CumulusDocs
Open Studio
On this page

Update a phone number

Rename a number or change its agent assignments. An incoming-call assignment pins the current publication; reassign after changing the live version.

Operation ID: numbers.update.

Request

PATCH /api/v1/telephony/numbers/{number_id}

  • TypeScript SDK: client.numbers.update (path arguments use path).
  • MCP tool: sdk_client_call with operationId: "numbers.update" (path arguments use input.path). Legacy alias: numbers_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 an imported number ID from numbers.list and the reviewed published phone agent ID. Assignments use the agent’s current head; confirm it before changing live inbound/outbound routing. Save the old assignments first and inspect every returned pin. It does not itself place a call.

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/numbers/${NUMBER_ID}" \
  -H "Authorization: Bearer $CUMULUS_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
  "nickname": "Service desk test line",
  "inbound_agent_id": "service-guide",
  "outbound_agent_id": "service-guide"
}'

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.numbers.update({
  "path": {
    "number_id": "<number_id>"
  },
  "body": {
    "nickname": "Service desk test line",
    "inbound_agent_id": "service-guide",
    "outbound_agent_id": "service-guide"
  }
});

Integration notes

Enable inbound on the Twilio trunk and configure its returned inbound_sip_uri in Twilio Origination first.

Setting inbound_agent_id pins the agent’s current publication and the assigning admin’s live authority to the number. Each signed SIP arrival admits an inbound run. Set the field to null to remove the assignment; reassign after publishing or promoting a new version.

Input schema

Path, query and header parameters

number_id

path parameter · Required.

Type: string (uuid). pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$.

JSON request body

FieldType or valuesRequiredDescription and limits
trunk_idstringOptionalminLength: 1. maxLength: 128. pattern: ^[a-z0-9][a-z0-9_-]*$.
nicknamestring or nullOptionalmaxLength: 256.
inbound_agent_idstring or nullOptionalminLength: 1. maxLength: 256. pattern: ^[A-Za-z0-9][A-Za-z0-9_.:-]*$.
outbound_agent_idstring or nullOptionalminLength: 1. maxLength: 256. pattern: ^[A-Za-z0-9][A-Za-z0-9_.:-]*$.
Complete OpenAPI schema
OpenAPI JSON
{
  "parameters": [
    {
      "name": "number_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "format": "uuid",
        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
      }
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/NumbersUpdateRequest"
        }
      }
    }
  }
}

Responses

HTTP 200

Assign agents or rename a phone number

application/json

FieldType or valuesRequiredDescription and limits
number_idstring (uuid)Requiredpattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$.
e164stringRequiredpattern: ^+[1-9][0-9]{6,14}$.
trunk_idstringRequiredminLength: 1. maxLength: 128. pattern: ^[a-z0-9][a-z0-9_-]*$.
nicknamestring or nullRequiredmaxLength: 256.
inbound_agent_idstring or nullRequiredminLength: 1. maxLength: 256. pattern: ^[A-Za-z0-9][A-Za-z0-9_.:-]*$.
outbound_agent_idstring or nullRequiredminLength: 1. maxLength: 256. pattern: ^[A-Za-z0-9][A-Za-z0-9_.:-]*$.
inbound_agent_versioninteger or nullRequiredStored inbound publication pin, including legacy version 0; null when unassigned. Publishing a newer head does not change it. At least 0. At most 9007199254740991.
outbound_agent_versioninteger or nullRequiredStored outbound publication version; null when unassigned. At least 0. At most 9007199254740991.
state"pending" · "ready"Required—
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))$.

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": "Assign agents or rename a phone number",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ByocNumber"
        }
      }
    }
  },
  "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": {
      "NumbersUpdateRequest": {
        "type": "object",
        "properties": {
          "trunk_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[a-z0-9][a-z0-9_-]*$"
          },
          "nickname": {
            "nullable": true,
            "type": "string",
            "maxLength": 256
          },
          "inbound_agent_id": {
            "nullable": true,
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]*$"
          },
          "outbound_agent_id": {
            "nullable": true,
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]*$"
          }
        },
        "additionalProperties": false
      },
      "ByocNumber": {
        "type": "object",
        "properties": {
          "number_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "e164": {
            "type": "string",
            "pattern": "^\\+[1-9][0-9]{6,14}$"
          },
          "trunk_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[a-z0-9][a-z0-9_-]*$"
          },
          "nickname": {
            "nullable": true,
            "type": "string",
            "maxLength": 256
          },
          "inbound_agent_id": {
            "nullable": true,
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]*$"
          },
          "outbound_agent_id": {
            "nullable": true,
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]*$"
          },
          "inbound_agent_version": {
            "nullable": true,
            "description": "Stored inbound publication pin, including legacy version 0; null when unassigned. Publishing a newer head does not change it.",
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "outbound_agent_version": {
            "nullable": true,
            "description": "Stored outbound publication version; null when unassigned.",
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "ready"
            ]
          },
          "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))$"
          }
        },
        "required": [
          "number_id",
          "e164",
          "trunk_id",
          "nickname",
          "inbound_agent_id",
          "outbound_agent_id",
          "inbound_agent_version",
          "outbound_agent_version",
          "state",
          "created_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 1f2dc096Customer SDKMarkdown source
Update a phone number · Cumulus developer docs