Source: https://docs.cumuluslabs.io/reference/numbers.update
Content version: ff995f58

# numbers.update

Assign agents or rename a phone number

## Request {#request}

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

- MCP: `numbers_update`
- SDK: `client.numbers.update` (SDK path arguments use `path`; MCP uses `params`).
- Minimum API key role: **admin**.
- Idempotency: **natural**.

inbound_agent_id pins a published phone agent and the assigning admin's live authority to this number. Enable inbound on its Twilio trunk first and configure the returned inbound_sip_uri in Twilio Origination. Each signed SIP arrival admits one inbound Run; null removes the assignment. Reassign after publishing a new agent version.

## Input schema {#input-schema}

```json
{
  "parameters": [
    {
      "name": "number_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "format": "uuid"
      }
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/NumbersUpdateRequest"
        }
      }
    }
  }
}
```

## Responses {#responses}

```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 {#schemas}

```json
{
  "components": {
    "schemas": {
      "NumbersUpdateRequest": {
        "type": "object",
        "properties": {
          "trunk_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[a-z0-9][a-z0-9_-]*$"
          },
          "nickname": {
            "type": "string",
            "maxLength": 256,
            "nullable": true
          },
          "inbound_agent_id": {
            "allOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 256,
                "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]*$"
              }
            ],
            "nullable": true
          },
          "outbound_agent_id": {
            "allOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 256,
                "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]*$"
              }
            ],
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ByocNumber": {
        "type": "object",
        "properties": {
          "number_id": {
            "type": "string",
            "format": "uuid"
          },
          "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": {
            "type": "string",
            "maxLength": 256,
            "nullable": true
          },
          "inbound_agent_id": {
            "allOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 256,
                "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]*$"
              }
            ],
            "nullable": true
          },
          "outbound_agent_id": {
            "allOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 256,
                "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]*$"
              }
            ],
            "nullable": true
          },
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "ready"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "number_id",
          "e164",
          "trunk_id",
          "nickname",
          "inbound_agent_id",
          "outbound_agent_id",
          "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 {#errors}

See [API error handling](https://docs.cumuluslabs.io/api#errors) and [Troubleshooting](https://docs.cumuluslabs.io/troubleshooting).

## Related guides {#related-guides}

- [Phone](https://docs.cumuluslabs.io/phone)
- [Troubleshooting](https://docs.cumuluslabs.io/troubleshooting)
