WebhookSubscriptions

Create webhook subscription

Creates a webhook subscription. A successful request returns the created Webhook Subscription resource. Requires an OAuth access token; API keys are not supported. The OAuth token must hold scopes appropriate for each subscribed event topic: order.create and order.update require website.orders or website.orders.read; contact.create, contact.update, contact.delete, address.create, address.update, and address.delete require website.contacts; extension.uninstall requires no event-specific scope.

post/1.0/webhook_subscriptions

Request

Headers

Authorizationstring required

API key or OAuth access token

User-Agentstring required

User Agent

Request body

endpointUrlstring required

HTTPS URL to POST webhook notifications.

topicsstring[]

List of event topics that trigger a webhook notification.

Example request

{
  "endpointUrl": "https://example-extension.com/uninstall",
  "topics": [
    "extension.uninstall"
  ]
}

Response

The created webhook subscription.

clientIdstring required

Third-party client id.

createdOnstring date-time required

ISO 8601 UTC date and time string; represents when the webhook subscription was created.

endpointUrlstring required

HTTPS URL to POST webhook notifications.

idstring required

Unique Webhook Subscription id.

secretstring required

Hexadecimal value used to generate a signature for a webhook notification; field is only returned when creating a new subscription or rotating a secret. Store the secret in a safe location to verify notifications from Squarespace. See the 'Verifying notifications' guide under Webhooks for details.

topicsstring[]

List of event topics that trigger a webhook notification.

updatedOnstring date-time required

ISO 8601 UTC date and time string; represents when the webhook subscription was last modified.

websiteIdstring required

Unique Webhook Subscription id.

Example response

{
  "clientId": "A125dfPqdKJDqPAcJQgLo3A5mwcKIq2G",
  "createdOn": "2020-04-22T22:18:00Z",
  "endpointUrl": "https://example-extension.com/uninstall",
  "id": "7aff04bb-90e0-4002-96c2-69d8162c8dae",
  "secret": "F3F9B981C78E7A6187E42853F6CE2804177E98206164779423B02DEC981ACD6B",
  "topics": [
    "extension.uninstall"
  ],
  "updatedOn": "2020-04-22T22:18:00Z",
  "websiteId": "7aff04bb-90e0-4002-96c2-69d8162c8dae"
}

Changes

No recorded changes to this operation across all 1 revision of this API.