Skip to content

Test an inbound route

Sends a synthetic inbound email through the same delivery path as production (outbound webhooks for webhook routes, signed HTTP to the agent for agent routes). Use dryRun: true to preview the payload without delivering.

POST
/v1/domains/{domain}/routes/{address}/test

Authorization

Authorization<token>

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

In: header

Request Body

application/jsonRequired
fromRequiredobject
subjectRequiredstring
textstring
htmlstring
dryRunboolean

When true, returns the payload that would be delivered without invoking outbound webhooks or the agent HTTP endpoint.

Path Parameters

domainRequiredstring
addressRequiredstring

Header Parameters

idempotency-keystring

A header for idempotency purposes

Response Body

OK

matchedRequiredboolean
dryRunRequiredboolean
domainStatusstring
Value in: "pending" | "verified"
mxRecordConfiguredboolean
typestring
Value in: "agent" | "webhook"
wouldDeliverTostring

Human-readable delivery target summary in dry-run mode.

payloadobject

The outbound payload (dry-run only).

webhookobject
agentobject
export interface Response {
  matched: boolean;
  dryRun: boolean;
  domainStatus?: "pending" | "verified";
  mxRecordConfigured?: boolean;
  type?: "agent" | "webhook";
  /**
   * Human-readable delivery target summary in dry-run mode.
   */
  wouldDeliverTo?: string;
  /**
   * The outbound payload (dry-run only).
   */
  payload?: {};
  webhook?: TestDomainRouteWebhookResultDto;
  agent?: TestDomainRouteAgentResultDto;
}
export interface TestDomainRouteWebhookResultDto {
  /**
   * True when outbound webhooks are disabled for this environment (nothing was emitted).
   */
  skipped?: boolean;
  latencyMs: number;
}
export interface TestDomainRouteAgentResultDto {
  agentId: string;
  httpStatus: number;
  /**
   * Parsed JSON body from the agent webhook response when JSON.
   */
  agentReply?: {};
  latencyMs: number;
}
 
curl -X POST "https://api.novu.co/v1/domains/string/routes/string/test" \
  -H "idempotency-key: string" \
  -H "Authorization: <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "from": {
      "address": "string",
      "name": "string"
    },
    "subject": "string",
    "text": "string",
    "html": "string",
    "dryRun": true
  }'
{
  "matched": true,
  "dryRun": true,
  "domainStatus": "pending",
  "mxRecordConfigured": true,
  "type": "agent",
  "wouldDeliverTo": "string",
  "payload": {},
  "webhook": {
    "skipped": true,
    "latencyMs": 0
  },
  "agent": {
    "agentId": "string",
    "httpStatus": 0,
    "agentReply": {},
    "latencyMs": 0
  }
}

On this page

No Headings
Edit this page on GitHub