ampr docs

Webhooks

Event notification endpoints

GET /webhooks List webhooks

Parameters

Name In Type Required Description
page query integer
per_page query integer

Responses

200 Webhook list

PropertyTypeRequiredDescription
dataarray<Webhook>
PropertyTypeRequiredDescription
idstringrequired
urlstringformat: urirequired
eventsarray<WebhookEventType>required
secretstringnullableHMAC secret — only returned on creation
enabledbooleanrequired
created_atstringformat: date-timerequired
paginationPagination
PropertyTypeRequiredDescription
totalintegerrequired
pageintegerrequired
per_pageintegerrequired
has_morebooleanrequired

401 Missing or invalid API key application/problem+json

PropertyTypeRequiredDescription
typestringformat: urirequired
titlestringrequired
statusintegerrequired
detailstringnullable
instancestringnullable

Request example

curl -X GET "https://api.ampr.dev/v1/webhooks" \
  -H "Authorization: Bearer $AMPR_API_KEY"
Note
This endpoint requires an API key. Send it as a Bearer token in the Authorization header.

POST /webhooks Register a webhook endpoint

Request body

PropertyTypeRequiredDescription
urlstringformat: urirequired
eventsarray<WebhookEventType>required

Responses

201 Webhook created (secret shown only on creation)

PropertyTypeRequiredDescription
dataWebhook
PropertyTypeRequiredDescription
idstringrequired
urlstringformat: urirequired
eventsarray<WebhookEventType>required
secretstringnullableHMAC secret — only returned on creation
enabledbooleanrequired
created_atstringformat: date-timerequired

401 Missing or invalid API key application/problem+json

PropertyTypeRequiredDescription
typestringformat: urirequired
titlestringrequired
statusintegerrequired
detailstringnullable
instancestringnullable

422 Request understood but cannot be processed (e.g., invalid state) application/problem+json

PropertyTypeRequiredDescription
typestringformat: urirequired
titlestringrequired
statusintegerrequired
detailstringnullable
instancestringnullable

Request example

curl -X POST "https://api.ampr.dev/v1/webhooks" \
  -H "Authorization: Bearer $AMPR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "string",
    "events": [
      "charger.connected"
    ]
  }'
Note
This endpoint requires an API key. Send it as a Bearer token in the Authorization header.

GET /webhooks/{webhook_id} Get webhook detail

Parameters

Name In Type Required Description
webhook_id path string required

Responses

200 Webhook detail

PropertyTypeRequiredDescription
dataWebhook
PropertyTypeRequiredDescription
idstringrequired
urlstringformat: urirequired
eventsarray<WebhookEventType>required
secretstringnullableHMAC secret — only returned on creation
enabledbooleanrequired
created_atstringformat: date-timerequired

401 Missing or invalid API key application/problem+json

PropertyTypeRequiredDescription
typestringformat: urirequired
titlestringrequired
statusintegerrequired
detailstringnullable
instancestringnullable

404 Resource not found application/problem+json

PropertyTypeRequiredDescription
typestringformat: urirequired
titlestringrequired
statusintegerrequired
detailstringnullable
instancestringnullable

Request example

curl -X GET "https://api.ampr.dev/v1/webhooks/whk_example" \
  -H "Authorization: Bearer $AMPR_API_KEY"
Note
This endpoint requires an API key. Send it as a Bearer token in the Authorization header.

DELETE /webhooks/{webhook_id} Delete webhook

Parameters

Name In Type Required Description
webhook_id path string required

Responses

204 Webhook deleted

401 Missing or invalid API key application/problem+json

PropertyTypeRequiredDescription
typestringformat: urirequired
titlestringrequired
statusintegerrequired
detailstringnullable
instancestringnullable

404 Resource not found application/problem+json

PropertyTypeRequiredDescription
typestringformat: urirequired
titlestringrequired
statusintegerrequired
detailstringnullable
instancestringnullable

Request example

curl -X DELETE "https://api.ampr.dev/v1/webhooks/whk_example" \
  -H "Authorization: Bearer $AMPR_API_KEY"
Note
This endpoint requires an API key. Send it as a Bearer token in the Authorization header.

PATCH /webhooks/{webhook_id} Update webhook

Parameters

Name In Type Required Description
webhook_id path string required

Request body

PropertyTypeRequiredDescription
urlstringformat: uri
eventsarray<WebhookEventType>
enabledboolean

Responses

200 Webhook updated

PropertyTypeRequiredDescription
dataWebhook
PropertyTypeRequiredDescription
idstringrequired
urlstringformat: urirequired
eventsarray<WebhookEventType>required
secretstringnullableHMAC secret — only returned on creation
enabledbooleanrequired
created_atstringformat: date-timerequired

401 Missing or invalid API key application/problem+json

PropertyTypeRequiredDescription
typestringformat: urirequired
titlestringrequired
statusintegerrequired
detailstringnullable
instancestringnullable

404 Resource not found application/problem+json

PropertyTypeRequiredDescription
typestringformat: urirequired
titlestringrequired
statusintegerrequired
detailstringnullable
instancestringnullable

Request example

curl -X PATCH "https://api.ampr.dev/v1/webhooks/whk_example" \
  -H "Authorization: Bearer $AMPR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "string",
    "events": [
      "charger.connected"
    ],
    "enabled": true
  }'
Note
This endpoint requires an API key. Send it as a Bearer token in the Authorization header.