Skip to main content

PATCH Update Trunk

Update an existing SIP trunk.

endpoint
PATCH https://api.telepathvoice.com/v1/trunks/{id}

Overview

Update the configuration of an existing SIP trunk. Only the fields you include in the request body will be changed — all other fields remain as-is. This follows standard PATCH semantics.

Request

Path Parameters

id string required The unique trunk identifier (e.g., conn_abc123xyz).

Body Parameters

All body parameters are optional. Include only the fields you want to update.

name string Update the friendly name for this trunk.
openai_api_key string Update the OpenAI API key (for openai trunks).
elevenlabs_api_key string Update the ElevenLabs API key (for elevenlabs trunks).
elevenlabs_agent_id string Update the ElevenLabs agent ID (for elevenlabs trunks).
custom_endpoint string Update the custom WebSocket endpoint URL (for custom trunks).
system_prompt string Update the system prompt sent to the AI agent at the start of each call.

Example Request

bash
curl -X PATCH https://api.telepathvoice.com/v1/trunks/conn_abc123xyz \
  -H "Authorization: Bearer sk_live_abc123def456..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Production OpenAI Agent v2",
    "system_prompt": "You are a knowledgeable support specialist."
  }'

Python Example

python
import requests

API_KEY = "sk_live_abc123def456..."
BASE_URL = "https://api.telepathvoice.com/v1"
TRUNK_ID = "conn_abc123xyz"

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

updates = {
    "name": "Production OpenAI Agent v2",
    "system_prompt": "You are a knowledgeable support specialist."
}

response = requests.patch(
    f"{BASE_URL}/trunks/{TRUNK_ID}",
    headers=headers,
    json=updates
)
response.raise_for_status()
trunk = response.json()
print(f"Updated trunk: {trunk['id']} at {trunk['updated_at']}")

Response

Response Fields

id string Unique trunk identifier.
name string Updated friendly name.
status string Current trunk status.
updated_at string ISO 8601 timestamp of this update.

Example Response

json
{
  "id": "conn_abc123xyz",
  "name": "Production OpenAI Agent v2",
  "status": "active",
  "updated_at": "2024-03-10T15:30:00Z"
}

Error Responses

Trunk Not Found (404)

json
{
  "error": {
    "code": "not_found",
    "message": "Trunk 'conn_abc123xyz' not found",
    "status": 404
  }
}

Invalid Credentials (401)

json
{
  "error": {
    "code": "unauthorized",
    "message": "Invalid or expired API key",
    "status": 401
  }
}

See Also