Create a relay lease for a custom agent
create_relay_leaseCreate a one-time SIP name lease from the relay pool for an outbound call made by a custom (BYO) voice agent - to is the destination number, from is your own volai number the call should go out from (see get_sip_credentials). Configure the platform's outbound trunk with outboundTrunkAddress from get_sip_credentials, not server. Use the returned sipName (a bare name, not a URI) as to_number in your platform - ElevenLabs rejects a full SIP URI. sipUri is for a regular SIP client. A lease connects exactly one call: every new attempt, including a retry after a call that was not answered or failed, needs a new create_relay_lease - dialing the same sipName again is rejected, so turn off automatic redialing in your platform. The optional ttlSecs (15 to 300, default 120) is how many seconds the lease waits for the first call before an unused one expires and returns the SIP name to the shared pool - only use a longer value when you know your platform calls back late. With a monthly spending cap set by the customer (see get_spend_cap) and reached this month, this fails with spend_cap_reached (HTTP 402): nothing is charged and retrying will not help, so tell the customer, who can raise or remove the cap (set_spend_cap, clear_spend_cap) or wait for the next month. Same data as POST /v1/relay (response schema in /openapi.json).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"to": "<to>",
"from": "<from>"
},
"name": "create_relay_lease"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | Destination phone number for the call, in E.164 format with the country code, for example +420777123456. | |
| from | Yes | Your own volai number the call goes out from, in E.164 format with the country code, from list_numbers or get_sip_credentials. | |
| ttlSecs | No | How many seconds the lease waits for the first call before an unused one expires and returns the SIP name to the shared pool, 15 to 300. Defaults to 120. |