For AI agents: this page in Markdown: https://www.pubnub.com/docs/admin-api/route-create.md. Documentation index: https://www.pubnub.com/llms-full.txt.
routeCreate
POST/v2/ena/routes
Create a connection between a router (action) and a route input (event listener) to set up the whole message (event) flow (input-to-output). In response, you'll obtain a unique string (route-id returned as data.id) representing the connection that's required to make a routerId call.
You can create a route between one router and one route input, but a single router or route input can be used in multiple routes (like one router with two route inputs or numerous routers connected to a single route input).
To create a route, at least one of its elements must already exist (router represented by routerId or route input represented by routeInputId), but the following combinations are allowed:
routeInputId+router— where you create a router (by providing its configuration) and join an existing route input to it (routeInputId)routeInputId+routerId— where you join an existing route input (routeInputId) with the existing router (routerId)routeInput+routerId— where you create a route input (by providing its configuration) and join an existing router to it (routerId)
Request
Example
{
"data": {
"id": "string",
"revisions": [
{
"id": "string",
"subscribeKey": "string",
"routeInput": {},
"router": {}
}
]
},
"meta": {},
"errors": [
{
"code": "string",
"message": "string",
"path": "string"
}
]
}