Chargers
Register and manage charge points
GET /chargers List chargers
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
page | query | integer | ||
per_page | query | integer | ||
status | query | ChargerStatus
| ||
location_id | query | string | ||
vendor | query | string |
Responses
200 Charger list
| Property | Type | Required | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data | array<Charger> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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/chargers" \
-H "Authorization: Bearer $AMPR_API_KEY" const res = await fetch('https://api.ampr.dev/v1/chargers', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.AMPR_API_KEY}`,
},
});
const data = await res.json(); POST /chargers Register a new charger
Request body
| Property | Type | Required | Description |
|---|---|---|---|
serial | string | required | |
vendor | string | required | |
model | string | required | |
location_id | stringnullable | ||
tariff_id | stringnullable | Optional charger-level tariff binding. Must belong to the same org. |
Responses
201 Charger created
| Property | Type | Required | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data | Charger | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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 |
409 Resource conflict (e.g., duplicate serial, active session) 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 POST "https://api.ampr.dev/v1/chargers" \
-H "Authorization: Bearer $AMPR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"serial": "string",
"vendor": "string",
"model": "string",
"location_id": "string",
"tariff_id": "trf_example"
}' const res = await fetch('https://api.ampr.dev/v1/chargers', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.AMPR_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"serial": "string",
"vendor": "string",
"model": "string",
"location_id": "string",
"tariff_id": "trf_example"
}),
});
const data = await res.json(); GET /chargers/stats Fleet stats rollup
Organization-scoped point-in-time fleet aggregate (chargers and sockets by status, active session count, and energy delivered today) for dashboard KPI tiles. Produced by a small fixed set of bounded grouped-COUNT/SUM queries — it does not paginate the fleet or read per-charger live state.
Responses
200 Fleet stats aggregate
| Property | Type | Required | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data | FleetStats | required | Point-in-time organization-scoped fleet aggregate for dashboard KPI tiles. Every known status key is always present (defaulting to 0) so the shape is stable regardless of which statuses currently have rows. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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/chargers/stats" \
-H "Authorization: Bearer $AMPR_API_KEY" const res = await fetch('https://api.ampr.dev/v1/chargers/stats', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.AMPR_API_KEY}`,
},
});
const data = await res.json(); GET /chargers/{charger_id} Get charger details with live state
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
charger_id | path | string | required |
Responses
200 Charger detail
| Property | Type | Required | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data | Charger | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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/chargers/chg_example" \
-H "Authorization: Bearer $AMPR_API_KEY" const res = await fetch('https://api.ampr.dev/v1/chargers/chg_example', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.AMPR_API_KEY}`,
},
});
const data = await res.json(); DELETE /chargers/{charger_id} Decommission a charger
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
charger_id | path | string | required |
Responses
204 Charger decommissioned
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 |
409 Resource conflict (e.g., duplicate serial, active session) 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/chargers/chg_example" \
-H "Authorization: Bearer $AMPR_API_KEY" const res = await fetch('https://api.ampr.dev/v1/chargers/chg_example', {
method: 'DELETE',
headers: {
Authorization: `Bearer ${process.env.AMPR_API_KEY}`,
},
});
const data = await res.json(); PATCH /chargers/{charger_id} Update charger metadata
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
charger_id | path | string | required |
Request body
| Property | Type | Required | Description |
|---|---|---|---|
label | string | ||
location_id | stringnullable | ||
tariff_id | stringnullable | Set to rebind the charger's tariff; `null` clears the binding (falls back to location/org tariff resolution). |
Responses
200 Charger updated
| Property | Type | Required | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data | Charger | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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 PATCH "https://api.ampr.dev/v1/chargers/chg_example" \
-H "Authorization: Bearer $AMPR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"label": "string",
"location_id": "string",
"tariff_id": "trf_example"
}' const res = await fetch('https://api.ampr.dev/v1/chargers/chg_example', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.AMPR_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"label": "string",
"location_id": "string",
"tariff_id": "trf_example"
}),
});
const data = await res.json();