Relay Webhooks

Relay Webhooks are a way to instruct SparkPost to forward messages sent to an inbound domain to a target URL for your own consumption. Before you create a relay webhook, first create and configure an inbound domain. The Relay Webhooks API provides the means to create, list, retrieve, update, and delete a relay webhook.

Custom HTTP Headers

You can add up to 5 custom headers to your relay webhook. The custom_headers object may only be up to 3,000 bytes in size, and must be formatted as an object with keys as strings or numbers. Headers already used by SparkPost will not be allowed.

Match Object

The match object restricts which inbound messages will be relayed to the target:

  • protocol: The inbound messaging protocol (currently only SMTP is supported)

  • domain: The inbound domain associated with the relay webhook

Regional Endpoints

Please use the appropriate API endpoint based on your workspace region:

  • EU workspaces: https://email.eu-west-1.api.bird.com

  • US workspaces: https://email.us-west-1.api.bird.com

List all Relay Webhooks

get
/workspaces/{workspaceId}/reach/relay-webhooks

Returns a list of all your relay webhooks.

Authorizations
AuthorizationstringRequired

API key for authentication. Format: AccessKey <token> or Bearer <token>.

Path parameters
workspaceIdstring · uuidRequired

The ID of the workspace

Responses
chevron-right
200

Successfully retrieved relay webhooks list

application/json
get
/workspaces/{workspaceId}/reach/relay-webhooks
200

Successfully retrieved relay webhooks list

Create a Relay Webhook

post
/workspaces/{workspaceId}/reach/relay-webhooks

Create a relay webhook by providing a relay webhooks object as the POST request body. Before creating a relay webhook, first create and configure an inbound domain.

Authorizations
AuthorizationstringRequired

API key for authentication. Format: AccessKey <token> or Bearer <token>.

Path parameters
workspaceIdstring · uuidRequired

The ID of the workspace

Body
namestringOptional

Relay webhook name

targetstringRequired

URL of the target to which to POST relay batches. Only ports 80 for http and 443 for https can be set.

auth_typestring · enumOptional

Type of authentication to be used during POST requests to target

Default: nonePossible values:
auth_tokenstringOptional

Authentication token to present in the X-MessageSystems-Webhook-Token header of POST requests to target

custom_headersobjectOptional

Object of custom HTTP headers to be used during POST requests to target. Maximum of 5 custom headers, up to 3,000 bytes.

Responses
chevron-right
200

Relay webhook created successfully

application/json
post
/workspaces/{workspaceId}/reach/relay-webhooks

Retrieve a Relay Webhook

get
/workspaces/{workspaceId}/reach/relay-webhooks/{relayWebhookId}

Retrieve a specific relay webhook by specifying the webhook ID in the URI path.

Authorizations
AuthorizationstringRequired

API key for authentication. Format: AccessKey <token> or Bearer <token>.

Path parameters
workspaceIdstring · uuidRequired

The ID of the workspace

relayWebhookIdstringRequired

The ID of the relay webhook

Responses
chevron-right
200

Successfully retrieved relay webhook

application/json
get
/workspaces/{workspaceId}/reach/relay-webhooks/{relayWebhookId}

Update a Relay Webhook

put
/workspaces/{workspaceId}/reach/relay-webhooks/{relayWebhookId}

Update a relay webhook by specifying the webhook ID in the URI path.

Authorizations
AuthorizationstringRequired

API key for authentication. Format: AccessKey <token> or Bearer <token>.

Path parameters
workspaceIdstring · uuidRequired

The ID of the workspace

relayWebhookIdstringRequired

The ID of the relay webhook

Body
namestringOptional

Relay webhook name

targetstringOptional

URL of the target to which to POST relay batches. Only ports 80 for http and 443 for https can be set.

auth_typestring · enumOptional

Type of authentication to be used during POST requests to target

Possible values:
auth_request_detailsobjectOptional

Object containing details needed to request authorization token for OAuth 2.0. Required when auth_type is oauth2.

auth_tokenstringOptional

Authentication token to present in the X-MessageSystems-Webhook-Token header of POST requests to target

custom_headersobjectOptional

Object of custom HTTP headers to be used during POST requests to target

Responses
chevron-right
200

Relay webhook updated successfully

application/json
put
/workspaces/{workspaceId}/reach/relay-webhooks/{relayWebhookId}

Delete a Relay Webhook

delete
/workspaces/{workspaceId}/reach/relay-webhooks/{relayWebhookId}

Delete a specific relay webhook by specifying the webhook ID in the URI path.

Authorizations
AuthorizationstringRequired

API key for authentication. Format: AccessKey <token> or Bearer <token>.

Path parameters
workspaceIdstring · uuidRequired

The ID of the workspace

relayWebhookIdstringRequired

The ID of the relay webhook

Responses
chevron-right
200

Relay webhook deleted successfully

No content

delete
/workspaces/{workspaceId}/reach/relay-webhooks/{relayWebhookId}

No content

Validate a Relay Webhook

post
/workspaces/{workspaceId}/reach/relay-webhooks/{relayWebhookId}/validate

The validation request sends an example batch to the target URL, validates that the target responds with HTTP 200, and returns information on the response received from the target.

Authorizations
AuthorizationstringRequired

API key for authentication. Format: AccessKey <token> or Bearer <token>.

Path parameters
workspaceIdstring · uuidRequired

The ID of the workspace

relayWebhookIdstringRequired

The ID of the relay webhook

Responses
chevron-right
200

Relay webhook validation successful

application/json
post
/workspaces/{workspaceId}/reach/relay-webhooks/{relayWebhookId}/validate
200

Relay webhook validation successful

Last updated

Was this helpful?