Tokens
Driver authorization tokens (RFID / app / virtual idTags)
GET /tokens List tokens
Parameters
Responses
401 Missing or invalid API key application/problem+json
Request example
curl -X GET "https://api.ampr.dev/v1/tokens" \
-H "Authorization: Bearer $AMPR_API_KEY"
const res = await fetch('https://api.ampr.dev/v1/tokens', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.AMPR_API_KEY}`,
},
});
const data = await res.json();
This endpoint requires an API key. Send it as a Bearer token in the Authorization header.
POST /tokens Pre-register a driver token
Pre-register a driver token (fleet card) into the org allowlist before charger cutover. Strict insert — a duplicate (org, uid) returns 409.
Request body
Responses
400 Invalid request parameters application/problem+json
401 Missing or invalid API key application/problem+json
409 Resource conflict (e.g., duplicate serial, active session) application/problem+json
Request example
curl -X POST "https://api.ampr.dev/v1/tokens" \
-H "Authorization: Bearer $AMPR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"uid": "string",
"type": "rfid",
"valid": true,
"label": "string"
}'
const res = await fetch('https://api.ampr.dev/v1/tokens', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.AMPR_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"uid": "string",
"type": "rfid",
"valid": true,
"label": "string"
}),
});
const data = await res.json();
This endpoint requires an API key. Send it as a Bearer token in the Authorization header.
GET /tokens/{token_id} Get a token
Parameters
Responses
401 Missing or invalid API key application/problem+json
404 Resource not found application/problem+json
Request example
curl -X GET "https://api.ampr.dev/v1/tokens/trk_example" \
-H "Authorization: Bearer $AMPR_API_KEY"
const res = await fetch('https://api.ampr.dev/v1/tokens/trk_example', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.AMPR_API_KEY}`,
},
});
const data = await res.json();
This endpoint requires an API key. Send it as a Bearer token in the Authorization header.
PATCH /tokens/{token_id} Update a token
Toggle `valid` (e.g. block a lost card) or edit `label`.
Parameters
Request body
Responses
400 Invalid request parameters application/problem+json
401 Missing or invalid API key application/problem+json
404 Resource not found application/problem+json
Request example
curl -X PATCH "https://api.ampr.dev/v1/tokens/trk_example" \
-H "Authorization: Bearer $AMPR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"valid": true,
"label": "string"
}'
const res = await fetch('https://api.ampr.dev/v1/tokens/trk_example', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.AMPR_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"valid": true,
"label": "string"
}),
});
const data = await res.json();
This endpoint requires an API key. Send it as a Bearer token in the Authorization header.