Locations
Group chargers by physical site
GET /locations List locations
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
page | query | integer | ||
per_page | query | integer |
Responses
200 Location list
| Property | Type | Required | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data | array<Location> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
pagination | Pagination | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
401 Missing or invalid API key application/problem+json
| Property | Type | Required | Description |
|---|---|---|---|
type | stringformat: uri | required | |
title | string | required | |
status | integer | required | |
detail | stringnullable | ||
instance | stringnullable |
Request example
curl -X GET "https://api.ampr.dev/v1/locations" \
-H "Authorization: Bearer $AMPR_API_KEY" const res = await fetch('https://api.ampr.dev/v1/locations', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.AMPR_API_KEY}`,
},
});
const data = await res.json(); POST /locations Create a location
Request body
| Property | Type | Required | Description |
|---|---|---|---|
name | string | required | |
address | string | ||
latitude | number | ||
longitude | number | ||
max_amperage | integer | ||
dlb_enabled | boolean | Enable Dynamic Load Balancing for this location. | |
tariff_id | stringnullable | ||
metering_regime | enum
| Metering compliance regime for CDR finalization at this location. Defaults to confirmed_register_ok. | |
idle_finalize_threshold | integernullable | Seconds of post-charge idle time before an abandoned session is force-finalized. Null falls back to the global default. |
Responses
201 Location created
| Property | Type | Required | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data | Location | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
401 Missing or invalid API key application/problem+json
| Property | Type | Required | Description |
|---|---|---|---|
type | stringformat: uri | required | |
title | string | required | |
status | integer | required | |
detail | stringnullable | ||
instance | stringnullable |
Request example
curl -X POST "https://api.ampr.dev/v1/locations" \
-H "Authorization: Bearer $AMPR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"address": "string",
"latitude": 0,
"longitude": 0,
"max_amperage": 0,
"dlb_enabled": true,
"tariff_id": "string",
"metering_regime": "confirmed_register_ok",
"idle_finalize_threshold": 0
}' const res = await fetch('https://api.ampr.dev/v1/locations', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.AMPR_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "string",
"address": "string",
"latitude": 0,
"longitude": 0,
"max_amperage": 0,
"dlb_enabled": true,
"tariff_id": "string",
"metering_regime": "confirmed_register_ok",
"idle_finalize_threshold": 0
}),
});
const data = await res.json(); GET /locations/{location_id} Get location detail
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
location_id | path | string | required |
Responses
200 Location detail
| Property | Type | Required | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data | Location | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
401 Missing or invalid API key application/problem+json
| Property | Type | Required | Description |
|---|---|---|---|
type | stringformat: uri | required | |
title | string | required | |
status | integer | required | |
detail | stringnullable | ||
instance | stringnullable |
404 Resource not found application/problem+json
| Property | Type | Required | Description |
|---|---|---|---|
type | stringformat: uri | required | |
title | string | required | |
status | integer | required | |
detail | stringnullable | ||
instance | stringnullable |
Request example
curl -X GET "https://api.ampr.dev/v1/locations/loc_example" \
-H "Authorization: Bearer $AMPR_API_KEY" const res = await fetch('https://api.ampr.dev/v1/locations/loc_example', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.AMPR_API_KEY}`,
},
});
const data = await res.json(); DELETE /locations/{location_id} Delete location (unassigns chargers)
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
location_id | path | string | required |
Responses
204 Location deleted
401 Missing or invalid API key application/problem+json
| Property | Type | Required | Description |
|---|---|---|---|
type | stringformat: uri | required | |
title | string | required | |
status | integer | required | |
detail | stringnullable | ||
instance | stringnullable |
404 Resource not found application/problem+json
| Property | Type | Required | Description |
|---|---|---|---|
type | stringformat: uri | required | |
title | string | required | |
status | integer | required | |
detail | stringnullable | ||
instance | stringnullable |
Request example
curl -X DELETE "https://api.ampr.dev/v1/locations/loc_example" \
-H "Authorization: Bearer $AMPR_API_KEY" const res = await fetch('https://api.ampr.dev/v1/locations/loc_example', {
method: 'DELETE',
headers: {
Authorization: `Bearer ${process.env.AMPR_API_KEY}`,
},
});
const data = await res.json(); PATCH /locations/{location_id} Update location
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
location_id | path | string | required |
Request body
| Property | Type | Required | Description |
|---|---|---|---|
name | string | ||
address | string | ||
latitude | number | ||
longitude | number | ||
max_amperage | integer | ||
dlb_enabled | boolean | Enable or disable Dynamic Load Balancing for this location. | |
tariff_id | stringnullable | ||
metering_regime | enum
| Metering compliance regime for CDR finalization at this location. | |
idle_finalize_threshold | integernullable | Seconds of post-charge idle time before an abandoned session is force-finalized. Null falls back to the global default. |
Responses
200 Location updated
| Property | Type | Required | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data | Location | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
401 Missing or invalid API key application/problem+json
| Property | Type | Required | Description |
|---|---|---|---|
type | stringformat: uri | required | |
title | string | required | |
status | integer | required | |
detail | stringnullable | ||
instance | stringnullable |
404 Resource not found application/problem+json
| Property | Type | Required | Description |
|---|---|---|---|
type | stringformat: uri | required | |
title | string | required | |
status | integer | required | |
detail | stringnullable | ||
instance | stringnullable |
422 Request understood but cannot be processed (e.g., invalid state) application/problem+json
| Property | Type | Required | Description |
|---|---|---|---|
type | stringformat: uri | required | |
title | string | required | |
status | integer | required | |
detail | stringnullable | ||
instance | stringnullable |
Request example
curl -X PATCH "https://api.ampr.dev/v1/locations/loc_example" \
-H "Authorization: Bearer $AMPR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"address": "string",
"latitude": 0,
"longitude": 0,
"max_amperage": 0,
"dlb_enabled": true,
"tariff_id": "string",
"metering_regime": "confirmed_register_ok",
"idle_finalize_threshold": 0
}' const res = await fetch('https://api.ampr.dev/v1/locations/loc_example', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.AMPR_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "string",
"address": "string",
"latitude": 0,
"longitude": 0,
"max_amperage": 0,
"dlb_enabled": true,
"tariff_id": "string",
"metering_regime": "confirmed_register_ok",
"idle_finalize_threshold": 0
}),
});
const data = await res.json(); GET /locations/{location_id}/load Get the location's live DLB load snapshot
Returns the location's current Dynamic Load Balancing state: the site capacity, the total in-force allocated current, per-session allocations (including any suspended sessions), and the capacity reserved for offline-but-active connectors.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
location_id | path | string | required |
Responses
200 DLB load snapshot
| Property | Type | Required | Description | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data | LoadSnapshot | required | Point-in-time Dynamic Load Balancing state for a location: the site cap, the total in-force allocated current, per-session allocations, and the capacity reserved for offline-but-active connectors. | ||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||
401 Missing or invalid API key application/problem+json
| Property | Type | Required | Description |
|---|---|---|---|
type | stringformat: uri | required | |
title | string | required | |
status | integer | required | |
detail | stringnullable | ||
instance | stringnullable |
404 Resource not found application/problem+json
| Property | Type | Required | Description |
|---|---|---|---|
type | stringformat: uri | required | |
title | string | required | |
status | integer | required | |
detail | stringnullable | ||
instance | stringnullable |
Request example
curl -X GET "https://api.ampr.dev/v1/locations/loc_example/load" \
-H "Authorization: Bearer $AMPR_API_KEY" const res = await fetch('https://api.ampr.dev/v1/locations/loc_example/load', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.AMPR_API_KEY}`,
},
});
const data = await res.json();