WebhookSubscription
Webhook subscriptions, event catalog, test deliveries, and logs
List webhook subscriptions
GET /api/v1/webhooks
Nécessite une authentification (jeton Bearer) et l’en-tête X-Organization-Id.
Portée du jeton API : webhooks.view
Paramètres
| Nom | Emplacement | Type | Requis | Description |
|---|---|---|---|---|
event |
query | string | non | |
active |
query | string | non | |
page |
query | integer | non | |
per_page |
query | integer | non |
Réponses
| Statut | Description |
|---|---|
| 200 | For non-paginated data, return as before |
| 422 |
Exemple de requête
curl -X GET "https://kworia.com/api/v1/webhooks" \
-H "Authorization: Bearer {{access_token}}" \
-H "X-Organization-Id: {{organization_id}}" \
-H "Accept: application/json"
Create webhook subscription
POST /api/v1/webhooks
Nécessite une authentification (jeton Bearer) et l’en-tête X-Organization-Id.
Portée du jeton API : webhooks.manage
Corps de la requête
| Champ | Type | Requis | Description |
|---|---|---|---|
url |
string | oui | |
secret |
string | non | |
description |
string | non | |
events |
array | oui |
Réponses
| Statut | Description |
|---|---|
| 201 | For non-paginated data, return as before |
| 422 |
Exemple de requête
curl -X POST "https://kworia.com/api/v1/webhooks" \
-H "Authorization: Bearer {{access_token}}" \
-H "X-Organization-Id: {{organization_id}}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"url": "string",
"secret": "string",
"description": "string",
"events": []
}'
Get available webhook events
GET /api/v1/webhooks/events
Nécessite une authentification (jeton Bearer) et l’en-tête X-Organization-Id.
Portée du jeton API : webhooks.view
Réponses
| Statut | Description |
|---|---|
| 200 | For non-paginated data, return as before |
Exemple de requête
curl -X GET "https://kworia.com/api/v1/webhooks/events" \
-H "Authorization: Bearer {{access_token}}" \
-H "X-Organization-Id: {{organization_id}}" \
-H "Accept: application/json"
Get webhook subscription details
GET /api/v1/webhooks/{id}
Nécessite une authentification (jeton Bearer) et l’en-tête X-Organization-Id.
Portée du jeton API : webhooks.view
Paramètres
| Nom | Emplacement | Type | Requis | Description |
|---|---|---|---|---|
id |
path | integer | oui |
Réponses
| Statut | Description |
|---|---|
| 200 | For non-paginated data, return as before |
Exemple de requête
curl -X GET "https://kworia.com/api/v1/webhooks/{id}" \
-H "Authorization: Bearer {{access_token}}" \
-H "X-Organization-Id: {{organization_id}}" \
-H "Accept: application/json"
Update webhook subscription
PUT /api/v1/webhooks/{id}
Nécessite une authentification (jeton Bearer) et l’en-tête X-Organization-Id.
Portée du jeton API : webhooks.manage
Paramètres
| Nom | Emplacement | Type | Requis | Description |
|---|---|---|---|---|
id |
path | integer | oui |
Corps de la requête
| Champ | Type | Requis | Description |
|---|---|---|---|
url |
string | non | |
is_active |
boolean | non | |
description |
string | non | |
events |
array | non |
Réponses
| Statut | Description |
|---|---|
| 200 | For non-paginated data, return as before |
| 422 |
Exemple de requête
curl -X PUT "https://kworia.com/api/v1/webhooks/{id}" \
-H "Authorization: Bearer {{access_token}}" \
-H "X-Organization-Id: {{organization_id}}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"url": "string",
"is_active": true,
"description": "string",
"events": []
}'
Delete webhook subscription
DELETE /api/v1/webhooks/{id}
Nécessite une authentification (jeton Bearer) et l’en-tête X-Organization-Id.
Portée du jeton API : webhooks.manage
Paramètres
| Nom | Emplacement | Type | Requis | Description |
|---|---|---|---|---|
id |
path | integer | oui |
Réponses
| Statut | Description |
|---|---|
| 200 | For non-paginated data, return as before |
Exemple de requête
curl -X DELETE "https://kworia.com/api/v1/webhooks/{id}" \
-H "Authorization: Bearer {{access_token}}" \
-H "X-Organization-Id: {{organization_id}}" \
-H "Accept: application/json"
Get webhook delivery logs
GET /api/v1/webhooks/{id}/logs
Nécessite une authentification (jeton Bearer) et l’en-tête X-Organization-Id.
Portée du jeton API : webhooks.view
Paramètres
| Nom | Emplacement | Type | Requis | Description |
|---|---|---|---|---|
id |
path | integer | oui |
Réponses
| Statut | Description |
|---|---|
| 200 | For non-paginated data, return as before |
Exemple de requête
curl -X GET "https://kworia.com/api/v1/webhooks/{id}/logs" \
-H "Authorization: Bearer {{access_token}}" \
-H "X-Organization-Id: {{organization_id}}" \
-H "Accept: application/json"
Test webhook subscription
POST /api/v1/webhooks/{id}/test
Nécessite une authentification (jeton Bearer) et l’en-tête X-Organization-Id.
Portée du jeton API : webhooks.manage
Envoie un événement signé webhook.test à l'URL de l'abonnement et indique si le point de terminaison a répondu avec un statut 2xx. Le corps de la réponse du point de terminaison n'est jamais renvoyé.
Les URL de webhook doivent utiliser https et un nom d'hôte public. Les adresses IP, les noms internes et les hôtes qui résolvent vers des réseaux privés ou réservés sont refusés à la création ou à la modification de l'abonnement, puis vérifiés à nouveau à chaque envoi: une cible refusée renvoie 422 avec le motif, et un point de terminaison injoignable renvoie 502.
Paramètres
| Nom | Emplacement | Type | Requis | Description |
|---|---|---|---|---|
id |
path | integer | oui |
Réponses
| Statut | Description |
|---|---|
| 200 | For non-paginated data, return as before |
| 502 | |
| 422 |
Exemple de requête
curl -X POST "https://kworia.com/api/v1/webhooks/{id}/test" \
-H "Authorization: Bearer {{access_token}}" \
-H "X-Organization-Id: {{organization_id}}" \
-H "Accept: application/json"