Skip to content

Create a route

Creates a route on the domain that forwards inbound mail addressed to <address>@<domain> to either a webhook or an agent. Each address on a domain may only have a single route.

POST
/v1/domains/{domain}/routes

Authorization

Authorization<token>

API key authentication. Allowed headers-- "Authorization: ApiKey <novu_secret_key>".

In: header

Request Body

application/jsonRequired
addressRequiredstring

Inbox address local part (e.g. "support", "*")

agentIdstring

Agent identifier; required when type is agent, unused for webhook

typeRequiredstring
Value in: "agent" | "webhook"
dataobject

Optional string key-value metadata (max 10 keys, 500 characters total for keys+values).

Path Parameters

domainRequiredstring

Header Parameters

idempotency-keystring

A header for idempotency purposes

Response Body

Created

_idRequiredstring
_domainIdRequiredstring
addressRequiredstring
agentIdstring

Internal id of the destination agent. Only present for agent routes.

typeRequiredstring
Value in: "agent" | "webhook"
_environmentIdRequiredstring
_organizationIdRequiredstring
createdAtRequiredstring
updatedAtRequiredstring
dataobject

String key-value metadata (max 10 keys, 500 characters total when set via API).

export interface Response {
  _id: string;
  _domainId: string;
  address: string;
  /**
   * Internal id of the destination agent. Only present for agent routes.
   */
  agentId?: string;
  type: "agent" | "webhook";
  _environmentId: string;
  _organizationId: string;
  createdAt: string;
  updatedAt: string;
  /**
   * String key-value metadata (max 10 keys, 500 characters total when set via API).
   */
  data?: {
    [k: string]: string;
  };
}
 
curl -X POST "https://api.novu.co/v1/domains/string/routes" \
  -H "idempotency-key: string" \
  -H "Authorization: <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "address": "string",
    "agentId": "string",
    "type": "agent",
    "data": {
      "property1": "string",
      "property2": "string"
    }
  }'
{
  "_id": "string",
  "_domainId": "string",
  "address": "string",
  "agentId": "string",
  "type": "agent",
  "_environmentId": "string",
  "_organizationId": "string",
  "createdAt": "string",
  "updatedAt": "string",
  "data": {
    "property1": "string",
    "property2": "string"
  }
}

On this page

No Headings
Edit this page on GitHub