Skip to main content
PATCH
/
trunks
/
{id}
Update Trunk
curl --request PATCH \
  --url https://api.example.com/trunks/{id} \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "openai_api_key": "<string>",
  "elevenlabs_api_key": "<string>",
  "elevenlabs_agent_id": "<string>",
  "custom_endpoint": "<string>",
  "system_prompt": "<string>"
}
'
{
  "id": "<string>",
  "name": "<string>",
  "status": "<string>",
  "updated_at": "<string>"
}

Overview

Update the configuration of an existing SIP trunk.

Request

id
string
required
The trunk ID (e.g., conn_abc123xyz)
name
string
Update the friendly name
openai_api_key
string
Update OpenAI API key
elevenlabs_api_key
string
Update ElevenLabs API key
elevenlabs_agent_id
string
Update ElevenLabs agent ID
custom_endpoint
string
Update custom WebSocket endpoint
system_prompt
string
Update system prompt

Example Request

curl -X PATCH https://api.telepathvoice.com/v1/trunks/conn_abc123xyz \
  -H "Authorization: Bearer sk_live_abc123def456..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated Support Bot",
    "system_prompt": "You are a helpful and friendly support agent."
  }'

Python Example

import requests

API_KEY = "sk_live_abc123def456..."
TRUNK_ID = "conn_abc123xyz"

headers = {
    "Authorization": f"Bearer {API_KEY}",
    "Content-Type": "application/json"
}

payload = {
    "name": "Updated Support Bot",
    "system_prompt": "You are a helpful and friendly support agent."
}

response = requests.patch(
    f"https://api.telepathvoice.com/v1/trunks/{TRUNK_ID}",
    headers=headers,
    json=payload
)

updated_trunk = response.json()

Response

id
string
Trunk identifier
name
string
Updated friendly name
status
string
Current status
updated_at
string
ISO 8601 update timestamp

Example Response

{
  "id": "conn_abc123xyz",
  "name": "Updated Support Bot",
  "status": "active",
  "updated_at": "2024-03-05T16:45:00Z"
}

Error Responses

Trunk Not Found

{
  "error": {
    "code": "TRUNK_NOT_FOUND",
    "message": "Trunk 'conn_abc123xyz' not found"
  }
}
Status Code: 404

Invalid Credentials

{
  "error": {
    "code": "INVALID_CREDENTIALS",
    "message": "The provided OpenAI API key is invalid"
  }
}
Status Code: 401

See Also