POST
/
notifications
/
policies
curl --request POST \
  --url https://dev.seqhq.io/api/notifications/policies \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "Dev team integration webhooks",
  "notificationTypes": [
    "CUSTOMER_CREATED"
  ],
  "recipients": [
    "https://api.company.com/webhooks"
  ],
  "channel": "WEBHOOK",
  "webhookSecret": "whsec_UserSubmittedSecret1234567890abc"
}'
{
  "id": "75da306e-8e25-47ac-8079-b695c369e2ef",
  "createdAt": "2022-06-28T16:47:00Z",
  "sequenceAccountId": "c4602d51-0fb4-4b48-b689-6ba28f540d1e",
  "name": "Dev team integration webhooks",
  "notificationTypes": [
    "CUSTOMER_CREATED"
  ],
  "recipients": [
    "https://api.company.com/webhooks"
  ],
  "channel": "WEBHOOK",
  "webhookSecret": "whsec_AutoGeneratedSecret01234567890ab"
}

Headers

Authorization
string
required

Your API credentials. Eg. Basic {credentials}.

Body

application/json
name
string
required

Human-readable name

notificationTypes
enum<string>[]

Set of notification types that this policy matches. If not provided, then this policy will apply to all notification types.

Available options:
CUSTOMER_CREATED,
CUSTOMER_UPDATED,
CUSTOMER_DELETED,
NOTIFICATION_SENT,
INVOICE_CREATED,
INVOICE_ISSUED,
INVOICE_UPDATED,
INTEGRATION_SYNC_COMPLETED,
INTEGRATION_WEBHOOK_HANDLED,
MERCHANT_UPDATED,
MERCHANT_CUSTOM_FIELDS_CREATED,
MERCHANT_CUSTOM_FIELDS_UPDATED,
MERCHANT_CUSTOM_FIELDS_DELETED,
BILLING_SCHEDULE_CREATED,
BILLING_SCHEDULE_UPDATED,
BILLING_SCHEDULE_DELETED,
CREDIT_NOTE_CREATED,
CREDIT_NOTE_UPDATED,
CREDIT_NOTE_ISSUED,
QUOTE_PUBLISHED,
QUOTE_ACCEPTED,
QUOTE_ACCEPTED_BY_CUSTOMER
recipients
string[]
required

The webhook URLs or email addresses which will receive notifications, depending on the channel

channel
enum<string>
required

Notification channel

Available options:
WEBHOOK,
EMAIL
webhookSecret
string

Webhook secret used to generate a signature header that's sent with an outbound webhook.It can be used to verify the authenticity of received Sequence webhooks. Only available for webhook channel policies.

Response

201 - application/json
id
string
required

Unique ID

createdAt
string
required

Created at

sequenceAccountId
string
required

Sequence Account which this policy matches

name
string
required

Human-readable name

notificationTypes
enum<string>[]

Set of notification types that this policy matches. If not present this policy will cover all notification types.

Available options:
CUSTOMER_CREATED,
CUSTOMER_UPDATED,
CUSTOMER_DELETED,
NOTIFICATION_SENT,
INVOICE_CREATED,
INVOICE_ISSUED,
INVOICE_UPDATED,
INTEGRATION_SYNC_COMPLETED,
INTEGRATION_WEBHOOK_HANDLED,
MERCHANT_UPDATED,
MERCHANT_CUSTOM_FIELDS_CREATED,
MERCHANT_CUSTOM_FIELDS_UPDATED,
MERCHANT_CUSTOM_FIELDS_DELETED,
BILLING_SCHEDULE_CREATED,
BILLING_SCHEDULE_UPDATED,
BILLING_SCHEDULE_DELETED,
CREDIT_NOTE_CREATED,
CREDIT_NOTE_UPDATED,
CREDIT_NOTE_ISSUED,
QUOTE_PUBLISHED,
QUOTE_ACCEPTED,
QUOTE_ACCEPTED_BY_CUSTOMER
recipients
string[]
required

The webhook URLs or email addresses which will receive notifications, depending on the channel

channel
enum<string>
required

Notification channel

Available options:
WEBHOOK,
EMAIL