CumulusDocs
Open Studio
On this page

Update a SIP trunk

Change a connected SIP trunk’s settings.

Operation ID: trunks.update.

Request

PATCH /api/v1/telephony/trunks/{trunk_id}

  • TypeScript SDK: client.trunks.update (path arguments use path).
  • MCP tool: sdk_client_call with operationId: "trunks.update" (path arguments use input.path). Legacy alias: trunks_update. Connect to your authenticated /mcp endpoint with an API key for the same environment.
  • Minimum API key role: admin.
  • Idempotency: No header required; the resource or revision identifies the change.

Read resource IDs from earlier responses and use a key for the same environment.

Request example

Use the trunk_id returned by trunks.create or trunks.list. Enable inbound only when LiveKit inbound provisioning is configured and the carrier’s inbound route is ready; inspect the trunk status afterward. Omitted fields retain their current values.

Set CUMULUS_BASE_URL to your workspace API URL and CUMULUS_API_KEY to a key for that environment. Example values are synthetic.

cURL

curl
curl --fail-with-body -sS -X PATCH "${CUMULUS_BASE_URL%/}/api/v1/telephony/trunks/${TRUNK_ID}" \
  -H "Authorization: Bearer $CUMULUS_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
  "name": "Service desk carrier — inbound enabled",
  "inbound": true
}'

TypeScript

typescript
import { Cumulus } from "@cumulus/sdk";

const baseUrl = process.env.CUMULUS_BASE_URL;
const apiKey = process.env.CUMULUS_API_KEY;
if (!baseUrl || !apiKey) throw new Error("Set CUMULUS_BASE_URL and CUMULUS_API_KEY");
const client = new Cumulus({ baseUrl, apiKey });

const response = await client.trunks.update({
  "path": {
    "trunk_id": "<trunk_id>"
  },
  "body": {
    "name": "Service desk carrier — inbound enabled",
    "inbound": true
  }
});

Input schema

Path, query and header parameters

trunk_id

path parameter · Required.

Type: string. minLength: 1. maxLength: 128.

JSON request body

FieldType or valuesRequiredDescription and limits
namestringOptionalminLength: 1. maxLength: 256.
termination_uristringOptionalminLength: 1. maxLength: 253. pattern: ^a-z0-9?$.
auth_usernamestringOptionalminLength: 1. maxLength: 256.
auth_secretobjectOptional—
auth_secret.idstringRequiredminLength: 1. maxLength: 128.
auth_secret.versionstringRequiredminLength: 1. maxLength: 128.
inboundbooleanOptional—
transfer_caller_id"from-transferee" · "from-transferor"OptionalDeclared Twilio trunk transfer caller ID. Configure the same mode in Twilio before saving; this API does not update Twilio. Transfer nodes must agree. Change only after draining voice calls.
Complete OpenAPI schema
OpenAPI JSON
{
  "parameters": [
    {
      "name": "trunk_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "minLength": 1,
        "maxLength": 128
      }
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/TrunksUpdateRequest"
        }
      }
    }
  }
}

Responses

HTTP 200

Update a BYOC SIP trunk

application/json

FieldType or valuesRequiredDescription and limits
trunk_idstringRequiredminLength: 1. maxLength: 128. pattern: ^[a-z0-9][a-z0-9_-]*$.
namestringRequiredminLength: 1. maxLength: 256.
provider"twilio_elastic_sip" · "generic_sip"Required—
termination_uristringRequiredminLength: 1. maxLength: 253. pattern: ^a-z0-9?$.
auth_usernamestring or nullRequiredminLength: 1. maxLength: 256.
auth_secretobject or nullRequired—
auth_secret.idstringRequired in a non-null parentminLength: 1. maxLength: 128.
auth_secret.versionstringRequired in a non-null parentminLength: 1. maxLength: 128.
inboundbooleanRequired—
transfer_caller_id"from-transferee" · "from-transferor"OptionalDeclared Twilio trunk transfer caller ID. Configure the same mode in Twilio before saving; this API does not update Twilio. Transfer nodes must agree. Change only after draining voice calls.
inbound_sip_uristring or nullOptionalmaxLength: 1024.
created_atstring (date-time)Requiredpattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:.\d+)?(?:Z))$.
updated_atstring (date-time)Requiredpattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:.\d+)?(?:Z))$.

Error responses

HTTPDescription
4XXTyped error (ApiError)
5XXTyped error (ApiError)

Errors use the shared error envelope. Inspect error.code, retryable, outcome and details before retrying.

Complete OpenAPI schema
OpenAPI JSON
{
  "200": {
    "description": "Update a BYOC SIP trunk",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ByocTrunk"
        }
      }
    }
  },
  "4XX": {
    "description": "Typed error (ApiError)",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ApiError"
        }
      }
    }
  },
  "5XX": {
    "description": "Typed error (ApiError)",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ApiError"
        }
      }
    }
  }
}

Referenced schemas

Expand the complete OpenAPI definitions for integrations that generate their own clients.

Complete OpenAPI schema
OpenAPI JSON
{
  "components": {
    "schemas": {
      "TrunksUpdateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "termination_uri": {
            "type": "string",
            "minLength": 1,
            "maxLength": 253,
            "pattern": "^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?$"
          },
          "auth_username": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "auth_secret": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "version": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              }
            },
            "required": [
              "id",
              "version"
            ],
            "additionalProperties": false
          },
          "inbound": {
            "type": "boolean"
          },
          "transfer_caller_id": {
            "type": "string",
            "enum": [
              "from-transferee",
              "from-transferor"
            ],
            "description": "Declared Twilio trunk transfer caller ID. Configure the same mode in Twilio before saving; this API does not update Twilio. Transfer nodes must agree. Change only after draining voice calls."
          }
        },
        "additionalProperties": false
      },
      "ByocTrunk": {
        "type": "object",
        "properties": {
          "trunk_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[a-z0-9][a-z0-9_-]*$"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "provider": {
            "type": "string",
            "enum": [
              "twilio_elastic_sip",
              "generic_sip"
            ]
          },
          "termination_uri": {
            "type": "string",
            "minLength": 1,
            "maxLength": 253,
            "pattern": "^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?$"
          },
          "auth_username": {
            "nullable": true,
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "auth_secret": {
            "nullable": true,
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "version": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              }
            },
            "required": [
              "id",
              "version"
            ],
            "additionalProperties": false
          },
          "inbound": {
            "type": "boolean"
          },
          "transfer_caller_id": {
            "type": "string",
            "enum": [
              "from-transferee",
              "from-transferor"
            ],
            "description": "Declared Twilio trunk transfer caller ID. Configure the same mode in Twilio before saving; this API does not update Twilio. Transfer nodes must agree. Change only after draining voice calls."
          },
          "inbound_sip_uri": {
            "nullable": true,
            "type": "string",
            "maxLength": 1024
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          }
        },
        "required": [
          "trunk_id",
          "name",
          "provider",
          "termination_uri",
          "auth_username",
          "auth_secret",
          "inbound",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "ApiError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "unauthenticated",
                  "forbidden",
                  "not_found",
                  "conflict",
                  "invalid_request",
                  "idempotency_conflict",
                  "policy_denied",
                  "capability_unavailable",
                  "provider_unavailable",
                  "knowledge_unavailable",
                  "publication_invalid",
                  "run_not_active",
                  "rate_limited",
                  "outcome_unknown",
                  "internal"
                ]
              },
              "message": {
                "type": "string"
              },
              "retryable": {
                "type": "boolean"
              },
              "outcome": {
                "type": "string",
                "enum": [
                  "none",
                  "unknown"
                ]
              },
              "details": {
                "type": "object",
                "additionalProperties": {}
              }
            },
            "required": [
              "code",
              "message",
              "retryable",
              "outcome"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false
      }
    }
  }
}

Errors and recovery

See API error handling and Troubleshooting.

Content version 8cd2702aCustomer SDKMarkdown source
Update a SIP trunk · Cumulus developer docs