Skip to main content

Dynamic SIP Endpoint

A dynamic SIP webhook lets one agent reach a different SIP destination on every call. Instead of configuring a fixed SIP URI, you give Bluejay a webhook URL. Right before each call dials, Bluejay POSTs that URL and dials whatever sip_uri (or phone_number) it returns. Use this when each conversation needs its own room or endpoint — for example a fresh per-call SIP address minted by your platform — without creating a separate agent or simulation run per URI.
This is an alternative to a static SIP URI, not an addition. An agent has either a fixed sip_uri or a dynamic_sip_webhook_url, never both.

How It Works

  1. Fetch — at dial time, for each call, Bluejay POSTs your webhook URL.
  2. Resolve — your endpoint returns the SIP URI (or phone number) to dial for this specific call.
  3. Dial — Bluejay dials the returned destination and the simulation proceeds like any SIP call, including the injected X-Simulation-Result-Id header.
If the fetch fails after retries, the call is marked NO_CONNECTION with error code DYNAMIC_ENDPOINT_FAILED — Bluejay fails loudly rather than dialing a stale endpoint. There is no static fallback.

Setup

1

Host your webhook

Expose an HTTPS endpoint that Bluejay can reach from the public internet. It must accept a POST with a JSON body and return the destination for the call. See Webhook Contract below.
Let an AI build it for you. Paste the prompt below into any coding assistant (Claude, Cursor, Copilot, etc.) — it fully specifies the contract, so you just add your own logic for choosing the SIP URI.
Prompt: generate a Bluejay dynamic SIP webhook
2

Configure your agent

Set dynamic_sip_webhook_url on the agent. Providing it makes the agent a SIP agent automatically.
Open Agent Settings → Connection, choose SIP as the connection type, and paste your endpoint into Dynamic SIP Webhook URL. Leave the static SIP URI field blank.
3

Run a simulation

Create a simulation and queue runs as usual — see Simulations. Each call independently fetches its own destination from your webhook.

Webhook Contract

Request

Bluejay sends a POST with Content-Type: application/json:

Response

Return 200 OK with a JSON object containing sip_uri (or phone_number):
The endpoint must be idempotent on test_result_id. Bluejay retries with exponential backoff (3 attempts), so a given test_result_id must always resolve to the same destination — return the room you already minted rather than allocating a new one on a retry.

Security

Bluejay POSTs your endpoint from its own infrastructure, so treat it like any inbound webhook: restrict who can reach it. Where a shared signing secret is available for your agent, Bluejay signs the request body with HMAC-SHA256 and sends it in the X-Bluejay-Signature header — verify it the same way as other Bluejay webhooks. If no signing secret is configured, requests are sent unsigned; in that case gate access with an allowlist or a secret embedded in the URL path.

Troubleshooting