Webhook Management Endpoints
Webhook endpoints require both the webhooks and game_owner scopes. For details on webhook events, payload format, and signature verification, see Webhooks.
List Webhooks
Section titled “List Webhooks”GET /api/v1/webhooks
Scope: webhooks + game_owner
Response
Section titled “Response”{ "data": { "webhooks": [ { "id": "wh-uuid", "url": "https://example.com/webhooks/wpg", "events": ["slot.submitted", "slot.accepted", "slot.rejected"], "isActive": true, "failureCount": 0, "lastFailureAt": null, "createdAt": "2026-02-01T10:00:00.000Z" } ] }, "meta": { "requestId": "req_abc123def456", "timestamp": "2026-03-02T12:00:00.000Z" }}Create Webhook
Section titled “Create Webhook”POST /api/v1/webhooks
Scope: webhooks + game_owner
Request Body
Section titled “Request Body”| Field | Type | Required | Description |
|---|---|---|---|
url | string | Yes | HTTPS URL to receive webhook events |
events | string[] | Yes | Events to subscribe to (or * for all) |
curl -X POST https://app.weplaytestgames.com/api/v1/webhooks \ -H "Authorization: Bearer wpg_sk_..." \ -H "Content-Type: application/json" \ -d '{ "url": "https://example.com/webhooks/wpg", "events": ["slot.submitted", "slot.accepted", "slot.rejected"] }'const response = await fetch('https://app.weplaytestgames.com/api/v1/webhooks', { method: 'POST', headers: { Authorization: `Bearer ${apiKey}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ url: 'https://example.com/webhooks/wpg', events: ['slot.submitted', 'slot.accepted', 'slot.rejected'], }),});Response
Section titled “Response”Returns 201 Created:
{ "data": { "webhook": { "id": "wh-uuid", "url": "https://example.com/webhooks/wpg", "events": ["slot.submitted", "slot.accepted", "slot.rejected"], "isActive": true, "createdAt": "2026-03-02T12:00:00.000Z" }, "secret": "whsec_a1b2c3d4e5f67890..." }, "meta": { "requestId": "req_abc123def456", "timestamp": "2026-03-02T12:00:00.000Z" }}The secret is shown once at creation. Store it securely — it’s used to verify webhook signatures.
Update Webhook
Section titled “Update Webhook”PATCH /api/v1/webhooks/:id
Scope: webhooks + game_owner
Request Body
Section titled “Request Body”| Field | Type | Description |
|---|---|---|
url | string | New webhook URL |
events | string[] | Replace event subscriptions |
Response
Section titled “Response”{ "data": { "webhook": { "id": "wh-uuid", "url": "https://example.com/webhooks/wpg-v2", "events": ["slot.submitted", "slot.accepted"], "isActive": true, "failureCount": 0, "createdAt": "2026-02-01T10:00:00.000Z" } }, "meta": { "requestId": "req_abc123def456", "timestamp": "2026-03-02T12:00:00.000Z" }}Delete Webhook
Section titled “Delete Webhook”DELETE /api/v1/webhooks/:id
Scope: webhooks + game_owner
Permanently deletes a webhook subscription.
Response
Section titled “Response”{ "data": { "message": "Webhook deleted" }, "meta": { "requestId": "req_abc123def456", "timestamp": "2026-03-02T12:00:00.000Z" }}List Deliveries
Section titled “List Deliveries”GET /api/v1/webhooks/:id/deliveries
Scope: webhooks + game_owner
View delivery history for a webhook.
Query Parameters
Section titled “Query Parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
limit | integer | 20 | Max 100 |
Response
Section titled “Response”{ "data": { "deliveries": [ { "id": "del-uuid", "event": "slot.submitted", "statusCode": 200, "attemptCount": 1, "deliveredAt": "2026-03-01T16:00:05.000Z", "nextRetryAt": null, "createdAt": "2026-03-01T16:00:00.000Z" } ] }, "meta": { "requestId": "req_abc123def456", "timestamp": "2026-03-02T12:00:00.000Z", "cursor": "eyJpZCI6ImFiYzEyMyJ9", "hasMore": false }}Test Webhook
Section titled “Test Webhook”POST /api/v1/webhooks/:id/test
Scope: webhooks + game_owner
Sends a test.ping event to the webhook URL to verify it’s working.
Response
Section titled “Response”{ "data": { "success": true, "delivery": { "id": "del-uuid", "statusCode": 200, "deliveredAt": "2026-03-02T12:00:01.000Z" } }, "meta": { "requestId": "req_abc123def456", "timestamp": "2026-03-02T12:00:00.000Z" }}Re-enable Webhook
Section titled “Re-enable Webhook”POST /api/v1/webhooks/:id/enable
Scope: webhooks + game_owner
Re-enable a webhook that was auto-disabled after 10 consecutive failures. Resets the failure count.
Response
Section titled “Response”{ "data": { "message": "Webhook re-enabled", "isActive": true }, "meta": { "requestId": "req_abc123def456", "timestamp": "2026-03-02T12:00:00.000Z" }}Rotate Secret
Section titled “Rotate Secret”POST /api/v1/webhooks/:id/rotate-secret
Scope: webhooks + game_owner
Generate a new signing secret. The old secret is immediately invalidated.
Response
Section titled “Response”{ "data": { "secret": "whsec_new_secret_value...", "message": "Secret rotated. Store this value securely — it will not be shown again." }, "meta": { "requestId": "req_abc123def456", "timestamp": "2026-03-02T12:00:00.000Z" }}