Account Webhooks
Account Webhooks
Account-scoped webhook endpoint management for white-label subscription lifecycle events.
The Account Webhook object
Attributes
{
"id": "accwh_6595a27b5d35015c3ef0c3fd",
"account_id": "acc_6595a27b5d35015c3ef0c3fd",
"url": "https://example.com/account-webhooks",
"description": "Apollo billing lifecycle",
"secret": "whsec_****...****",
"events": [
"white_label_subscription.subscribed",
"white_label_subscription.cancelled"
],
"active": true,
"metadata": {},
"created_at": "2024-01-01T00:00:00.000Z",
"updated_at": "2024-01-01T00:00:00.000Z"
}Create a new account webhook
/account-webhooksCreate a new account webhook
Header parameters
Account Id on which the request is made. Optional if user is part of only one account.
Body parameters
The HTTPS URL to send account-scoped webhook events to.
Events that trigger this account webhook
curl -X POST "https://eu.spaceinvoices.com/account-webhooks" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "x-account-id: YOUR_ACCOUNT_ID" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/account-webhooks",
"events": [
"white_label_subscription.subscribed"
]
}'Returns
{
"id": "accwh_6595a27b5d35015c3ef0c3fd",
"account_id": "acc_6595a27b5d35015c3ef0c3fd",
"url": "https://example.com/account-webhooks",
"description": "Apollo billing lifecycle",
"secret": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"events": [
"white_label_subscription.subscribed",
"white_label_subscription.cancelled"
],
"active": true,
"metadata": {},
"created_at": "2024-01-01T00:00:00.000Z",
"updated_at": "2024-01-01T00:00:00.000Z"
}List all account webhooks
/account-webhooksList all account webhooks
Header parameters
Account Id on which the request is made. Optional if user is part of only one account.
Query parameters
Number of results per request.
Default: 10
Opaque cursor to fetch the next page of results. Reuse only with the same effective ordering. Use the value from pagination.next_cursor in the previous response.
Opaque cursor to fetch the previous page of results. Reuse only with the same effective ordering. Use the value from pagination.prev_cursor in the previous response.
Whether to include the total count of items in pagination.total.
Default is true.
When false, pagination.total returns -1 for better performance.
curl "https://eu.spaceinvoices.com/account-webhooks" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "x-account-id: YOUR_ACCOUNT_ID"Returns
{
"data": [
{
"id": "accwh_6595a27b5d35015c3ef0c3fd",
"account_id": "acc_6595a27b5d35015c3ef0c3fd",
"url": "https://example.com/account-webhooks",
"description": "Apollo billing lifecycle",
"secret": "whsec_****...****",
"events": [
"white_label_subscription.subscribed",
"white_label_subscription.cancelled"
],
"active": true,
"metadata": {},
"created_at": "2024-01-01T00:00:00.000Z",
"updated_at": "2024-01-01T00:00:00.000Z"
}
],
"pagination": {
"total": 1,
"next_cursor": null,
"prev_cursor": null,
"has_more": false
}
}Get an account webhook by ID
/account-webhooks/{id}Get an account webhook by ID
Header parameters
Account Id on which the request is made. Optional if user is part of only one account.
Path parameters
Unique resource identifier
curl "https://eu.spaceinvoices.com/account-webhooks/{id}" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "x-account-id: YOUR_ACCOUNT_ID"Returns
{
"id": "accwh_6595a27b5d35015c3ef0c3fd",
"account_id": "acc_6595a27b5d35015c3ef0c3fd",
"url": "https://example.com/account-webhooks",
"description": "Apollo billing lifecycle",
"secret": "whsec_****...****",
"events": [
"white_label_subscription.subscribed",
"white_label_subscription.cancelled"
],
"active": true,
"metadata": {},
"created_at": "2024-01-01T00:00:00.000Z",
"updated_at": "2024-01-01T00:00:00.000Z"
}Update an account webhook
/account-webhooks/{id}Update an account webhook
Header parameters
Account Id on which the request is made. Optional if user is part of only one account.
Path parameters
Unique resource identifier
Body parameters
curl -X PATCH "https://eu.spaceinvoices.com/account-webhooks/{id}" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "x-account-id: YOUR_ACCOUNT_ID" \
-H "Content-Type: application/json" \
-d '{
"events": [
"white_label_subscription.subscribed",
"white_label_subscription.renewed"
]
}'Returns
{
"id": "accwh_6595a27b5d35015c3ef0c3fd",
"account_id": "acc_6595a27b5d35015c3ef0c3fd",
"url": "https://example.com/account-webhooks",
"description": "Apollo billing lifecycle",
"secret": "whsec_****...****",
"events": [
"white_label_subscription.subscribed",
"white_label_subscription.cancelled"
],
"active": true,
"metadata": {},
"created_at": "2024-01-01T00:00:00.000Z",
"updated_at": "2024-01-01T00:00:00.000Z"
}Delete an account webhook
/account-webhooks/{id}Delete an account webhook
Header parameters
Account Id on which the request is made. Optional if user is part of only one account.
Path parameters
Unique resource identifier
curl -X DELETE "https://eu.spaceinvoices.com/account-webhooks/{id}" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "x-account-id: YOUR_ACCOUNT_ID"Returns
{
"success": true
}Test an account webhook
/account-webhooks/{id}/testTest an account webhook
Header parameters
Account Id on which the request is made. Optional if user is part of only one account.
Path parameters
Unique resource identifier
curl -X POST "https://eu.spaceinvoices.com/account-webhooks/{id}/test" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "x-account-id: YOUR_ACCOUNT_ID"Returns
{
"id": "accwhd_6595a27b5d35015c3ef0c3fd",
"account_webhook_id": "accwh_6595a27b5d35015c3ef0c3fd",
"account_id": "acc_6595a27b5d35015c3ef0c3fd",
"entity_id": "ent_6595a27b5d35015c3ef0c3fd",
"event_type": "account_webhook.test",
"status": "success",
"request_body": {
"event": "white_label_subscription.subscribed",
"data": {
"account_id": "acc_6595a27b5d35015c3ef0c3fd"
},
"timestamp": "2024-01-01T00:00:00.000Z"
},
"response_status": 200,
"response_body": "OK",
"error_message": null,
"attempt": 1,
"max_attempts": 5,
"next_retry_at": null,
"duration_ms": 120,
"created_at": "2024-01-01T00:00:00.000Z",
"completed_at": "2024-01-01T00:00:00.120Z"
}List account webhook deliveries
/account-webhooks/{id}/deliveriesList account webhook deliveries
Header parameters
Account Id on which the request is made. Optional if user is part of only one account.
Path parameters
Unique resource identifier
Query parameters
Number of results per request.
Default: 10
Opaque cursor to fetch the next page of results. Reuse only with the same effective ordering. Use the value from pagination.next_cursor in the previous response.
Opaque cursor to fetch the previous page of results. Reuse only with the same effective ordering. Use the value from pagination.prev_cursor in the previous response.
Whether to include the total count of items in pagination.total.
Default is true.
When false, pagination.total returns -1 for better performance.
curl "https://eu.spaceinvoices.com/account-webhooks/{id}/deliveries" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "x-account-id: YOUR_ACCOUNT_ID"Returns
{
"data": [
{
"id": "accwhd_6595a27b5d35015c3ef0c3fd",
"account_webhook_id": "accwh_6595a27b5d35015c3ef0c3fd",
"account_id": "acc_6595a27b5d35015c3ef0c3fd",
"entity_id": "ent_6595a27b5d35015c3ef0c3fd",
"event_type": "white_label_subscription.subscribed",
"status": "success",
"request_body": {
"event": "white_label_subscription.subscribed",
"data": {
"account_id": "acc_6595a27b5d35015c3ef0c3fd"
},
"timestamp": "2024-01-01T00:00:00.000Z"
},
"response_status": 200,
"response_body": "OK",
"error_message": null,
"attempt": 1,
"max_attempts": 5,
"next_retry_at": null,
"duration_ms": 120,
"created_at": "2024-01-01T00:00:00.000Z",
"completed_at": "2024-01-01T00:00:00.120Z"
}
],
"pagination": {
"total": 1,
"next_cursor": null,
"prev_cursor": null,
"has_more": false
}
}Rotate account webhook secret
/account-webhooks/{id}/rotate-secretRotate account webhook secret
Header parameters
Account Id on which the request is made. Optional if user is part of only one account.
Path parameters
Unique resource identifier
curl -X POST "https://eu.spaceinvoices.com/account-webhooks/{id}/rotate-secret" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "x-account-id: YOUR_ACCOUNT_ID"Returns
{
"id": "accwh_6595a27b5d35015c3ef0c3fd",
"account_id": "acc_6595a27b5d35015c3ef0c3fd",
"url": "https://example.com/account-webhooks",
"description": "Apollo billing lifecycle",
"secret": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"events": [
"white_label_subscription.subscribed",
"white_label_subscription.cancelled"
],
"active": true,
"metadata": {},
"created_at": "2024-01-01T00:00:00.000Z",
"updated_at": "2024-01-01T00:00:00.000Z"
}