Skip to content

Account Webhooks

The Account Webhook object

object

Attributes

idstring
Other attributes
account_idstring
urlstring
descriptionstring
eventsarray of strings
activeboolean
metadataobject
created_atstring<date-time>
updated_atstring<date-time>
secretstring
Examplejson
{
  "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

POST/account-webhooks

Create a new account webhook

Header parameters

account_idstringoptional

Account Id on which the request is made. Optional if user is part of only one account.

Body parameters

urlstring<uri>required

The HTTPS URL to send account-scoped webhook events to.

eventsarray of stringsrequired

Events that trigger this account webhook

Other parameters
descriptionstringoptional
activebooleanoptional
metadataobjectoptional
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

idstring
Other parameters
account_idstring
urlstring
descriptionstring
secretstring
eventsarray of strings
activeboolean
metadataobject
created_atstring<date-time>
updated_atstring<date-time>
json
{
  "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

GET/account-webhooks

List all account webhooks

Header parameters

account_idstringoptional

Account Id on which the request is made. Optional if user is part of only one account.

Query parameters

limitintegeroptional

Number of results per request.

Default: 10

next_cursorstringoptional

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.

prev_cursorstringoptional

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.

include_total_countbooleanoptional

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

dataarray of objects
paginationobject

Pagination metadata including cursors and result counts

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

GET/account-webhooks/{id}

Get an account webhook by ID

Header parameters

account_idstringoptional

Account Id on which the request is made. Optional if user is part of only one account.

Path parameters

idstring<resource-id>required

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

idstring
Other parameters
account_idstring
urlstring
descriptionstring
eventsarray of strings
activeboolean
metadataobject
created_atstring<date-time>
updated_atstring<date-time>
secretstring
json
{
  "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

PATCH/account-webhooks/{id}

Update an account webhook

Header parameters

account_idstringoptional

Account Id on which the request is made. Optional if user is part of only one account.

Path parameters

idstring<resource-id>required

Unique resource identifier

Body parameters

urlstring<uri>optional
descriptionstringoptional
eventsarray of stringsoptional
activebooleanoptional
metadataobjectoptional
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

idstring
Other parameters
account_idstring
urlstring
descriptionstring
eventsarray of strings
activeboolean
metadataobject
created_atstring<date-time>
updated_atstring<date-time>
secretstring
json
{
  "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

DELETE/account-webhooks/{id}

Delete an account webhook

Header parameters

account_idstringoptional

Account Id on which the request is made. Optional if user is part of only one account.

Path parameters

idstring<resource-id>required

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

successboolean
json
{
  "success": true
}

Test an account webhook

POST/account-webhooks/{id}/test

Test an account webhook

Header parameters

account_idstringoptional

Account Id on which the request is made. Optional if user is part of only one account.

Path parameters

idstring<resource-id>required

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

idstring
Other parameters
account_webhook_idstring
account_idstring
entity_idstring
event_typestring
statusstring
request_bodyobject
response_statusinteger
response_bodystring
error_messagestring
attemptinteger
max_attemptsinteger
next_retry_atstring<date-time>
duration_msinteger
created_atstring<date-time>
completed_atstring<date-time>
json
{
  "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

GET/account-webhooks/{id}/deliveries

List account webhook deliveries

Header parameters

account_idstringoptional

Account Id on which the request is made. Optional if user is part of only one account.

Path parameters

idstring<resource-id>required

Unique resource identifier

Query parameters

limitintegeroptional

Number of results per request.

Default: 10

next_cursorstringoptional

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.

prev_cursorstringoptional

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.

include_total_countbooleanoptional

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

dataarray of objects
paginationobject

Pagination metadata including cursors and result counts

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

POST/account-webhooks/{id}/rotate-secret

Rotate account webhook secret

Header parameters

account_idstringoptional

Account Id on which the request is made. Optional if user is part of only one account.

Path parameters

idstring<resource-id>required

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

idstring
Other parameters
account_idstring
urlstring
descriptionstring
secretstring
eventsarray of strings
activeboolean
metadataobject
created_atstring<date-time>
updated_atstring<date-time>
json
{
  "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"
}