Skip to content

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.

GET /api/v1/webhooks

Scope: webhooks + game_owner

{
"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"
}
}

POST /api/v1/webhooks

Scope: webhooks + game_owner

FieldTypeRequiredDescription
urlstringYesHTTPS URL to receive webhook events
eventsstring[]YesEvents to subscribe to (or * for all)
Terminal window
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"]
}'

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.


PATCH /api/v1/webhooks/:id

Scope: webhooks + game_owner

FieldTypeDescription
urlstringNew webhook URL
eventsstring[]Replace event subscriptions
{
"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 /api/v1/webhooks/:id

Scope: webhooks + game_owner

Permanently deletes a webhook subscription.

{
"data": {
"message": "Webhook deleted"
},
"meta": {
"requestId": "req_abc123def456",
"timestamp": "2026-03-02T12:00:00.000Z"
}
}

GET /api/v1/webhooks/:id/deliveries

Scope: webhooks + game_owner

View delivery history for a webhook.

ParameterTypeDefaultDescription
limitinteger20Max 100
{
"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
}
}

POST /api/v1/webhooks/:id/test

Scope: webhooks + game_owner

Sends a test.ping event to the webhook URL to verify it’s working.

{
"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"
}
}

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.

{
"data": {
"message": "Webhook re-enabled",
"isActive": true
},
"meta": {
"requestId": "req_abc123def456",
"timestamp": "2026-03-02T12:00:00.000Z"
}
}

POST /api/v1/webhooks/:id/rotate-secret

Scope: webhooks + game_owner

Generate a new signing secret. The old secret is immediately invalidated.

{
"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"
}
}