Create a new webhook

Creates a new webhook, based on a given webhookEventTypeName or webhookEventTypeId.

SecurityCommonAuth
Request
Request Body schema: application/json

Body

One of:
accountId
string or null

The ID of the account to work with.

url
required
string <= 512 characters

The URL of the webhook endpoint.

authorizationHeader
string or null <= 512 characters

The authorization header content for the webhook.

sharedSecret
string or null <= 36 characters

When provided, this is used to sign the webhook payload and generate the x-em-signature header.

enabled
required
boolean

Webhook event type availability (whether the webhook is enabled or not).

webhookEventTypeName
required
string <= 256 characters

The name of the webhook event type to work with.

Responses
201

Created

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

405

Method Not Allowed

415

Unsupported Media Type

422

Unable to process the request

429

Too Many Requests

500

Internal Server Error

post/webhooks
Request samples
application/json
{
  • "accountId": "F50091",
  • "authorizationHeader": "Basic AXVubzpwQDU1dzByYM==",
  • "sharedSecret": "123e4567-e89b-12d3-a456-426614174000",
  • "enabled": true,
  • "webhookEventTypeId": "da91434a-4026-42ea-84b8-d0317b64af9c",
  • "webhookEventTypeName": "AccountCreated"
}
Response samples
application/json
{
  • "id": "da91434a-4026-42ea-84b8-d0317b64af9c",
  • "productId": "3ef24d53-6e22-4103-a16b-d268e4f7346d",
  • "webhookEventTypeId": "da91434a-4026-42ea-84b8-d0317b64af9c",
  • "webhookEventTypeName": "OrderCreated",
  • "accountId": "F50091",
  • "authorizationHeader": "Basic AXVubzpwQDU1dzByYM== ",
  • "enabled": true,
  • "sharedSecret": "123e4567-e89b-12d3-a456-426614174000",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}