Skip to main content
POST
/
v1
/
domains
/
{domain}
/
routes
PHP
declare(strict_types=1);

require 'vendor/autoload.php';

use novu;
use novu\Models\Components;

$sdk = novu\Novu::builder()
    ->setSecurity(
        'YOUR_SECRET_KEY_HERE'
    )
    ->build();

$domainRouteDto = new Components\DomainRouteDto(
    address: '6581 Birch Road',
    type: Components\DomainRouteDtoType::Webhook,
);

$response = $sdk->domains->routes->create(
    domain: 'radiant-solvency.net',
    domainRouteDto: $domainRouteDto

);

if ($response->domainRouteResponseDto !== null) {
    // handle response
}
{
  "_id": "<string>",
  "_domainId": "<string>",
  "address": "<string>",
  "_environmentId": "<string>",
  "_organizationId": "<string>",
  "createdAt": "<string>",
  "updatedAt": "<string>",
  "agentId": "<string>",
  "data": {}
}

Authorizations

Authorization
string
header
required

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

Headers

idempotency-key
string

A header for idempotency purposes

Path Parameters

domain
string
required

Body

application/json
address
string
required

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

type
enum<string>
required
Available options:
agent,
webhook
agentId
string

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

data
object

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

Response

Created

_id
string
required
_domainId
string
required
address
string
required
type
enum<string>
required
Available options:
agent,
webhook
_environmentId
string
required
_organizationId
string
required
createdAt
string
required
updatedAt
string
required
agentId
string

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

data
object

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