Add a New Site

Request

POST https://backend.net0.com/v1/sites

This endpoint allows you to add a new site (location) to your Net0 account.

curl --location --request POST 'https://backend.net0.com/v1/sites' \
--header 'x-api-key: <API_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "address": {
        "address": "New Providence Garden, Lekki, Lagos",
        "coordinates": {
            "lat": "6.457828405855804",
            "lng": "3.553892929988102"
        }
    },
    "avatarUrl": "https://picsum.photos/200/300",
    "possessionType": "Owned",
    "name": "New Providence Site",
    "area": 75,
    "unit": "M2",
    "countryId": 39,
    "gridRegionId": 28
}'

Request Body

{
  "address": {
    "address": "Address",
    "coordinates": {
      "lat": "lat",
      "lng": "lng"
    }
  },
  "avatarUrl": "string",
  "possessionType": "Owned",
  "name": "string",
  "area": 0,
  "unit": "M2",
  "countryId": 0,
  "gridRegionId": 0
}

Field Parameters

AttributeTypeDescriptionRequired
addressObjectAn object containing the address and coordinates in latitude and longitude of the site.true
avatarUrlStringThe image url of the site.false
possessionTypeStringDefault value of "owned".true
nameStringThe name of the site.true
areaNumberThe area of the site measured in square meter(sq/m)true
unitStringThe unit of the site.true
countryIdNumberThe id of the country where the site is located.true
gridRegionIdNumberThe id of the grid region in which the site is locatedfalse

Response

The response is the created site.

{
    "address": {
        "address": "New Providence Garden, Lekki, Lagos",
        "coordinates": {
            "lat": "6.457828405855804",
            "lng": "3.553892929988102"
        }
    },
    "avatarUrl": "https://picsum.photos/200/300",
    "possessionType": "Owned",
    "name": "New Providence Site",
    "area": 75,
    "unit": "M2",
    "countryId": 39,
    "gridRegionId": 28,
    "companyId": 2,
    "id": "d7f67e75-ca96-4374-8702-fab50dd43b43",
    "totalEmission": 0,
    "createdAt": "2021-11-25T21:41:06.085Z",
    "updatedAt": "2021-11-25T21:41:06.085Z"
}