Skip to content

Update a route

Updates the destination of the route bound to <address>@<domain>. The address itself is the resource identity and cannot be changed; delete and recreate the route to rename it.

PATCH
/v1/domains/{domain}/routes/{address}

Authorization

Authorization<token>

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

In: header

Request Body

application/jsonRequired
agentIdstring

Agent identifier; required when type is agent, ignored when type is webhook.

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

Replaces route metadata when provided (max 10 keys, 500 characters total for keys+values).

Path Parameters

domainRequiredstring
addressRequiredstring

Header Parameters

idempotency-keystring

A header for idempotency purposes

Response Body

OK

_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 PATCH "https://api.novu.co/v1/domains/string/routes/string" \
  -H "idempotency-key: string" \
  -H "Authorization: <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "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