Rename a Line or set its spend ceiling
PATCH /v1/lines/{id}
See https://ordan.io/docs/authentication and https://ordan.io/docs/errors for authority, scopes and retries. Paid usage reports customer charges; preview usage reports provider-cost allowance consumption. Money fields use the units specified in their schemas.
Operation ID: patch__v1_lines_id.
Authentication
Use one of these authentication alternatives. Schemes on the same line are required together:
sessionCookie(cookie: ordan_session)bearerAgent(bearer token)bearerKey(bearer token)
Organization roles, key scopes, grant capabilities, policy and spend limits still apply. See Authentication.
Request
Path parameters
| Parameter | Type | Required | Description / constraints |
|---|---|---|---|
id | string | Yes | — |
Body (required)
Content type: application/json
Type: object
Required means required within its containing object, when that object is present. Union/conditional constraints remain defined by the JSON Schema below.
| Field | Type | Presence | Description / constraints |
|---|---|---|---|
name | string | Optional | minLength: 1. maxLength: 120 |
spend_limit_cents | anyOf: integer; null | Optional | — |
voice | anyOf: string; null | Optional | One of ORDan voice's voices, by name; null: the default |
voice_language | anyOf: string; null | Optional | — |
voice_mode | none, ordan | Optional | ORDan voice on this Line's calls; an owner session or a project key only |
JSON Schema
json
{
"additionalProperties": true,
"properties": {
"name": {
"maxLength": 120,
"minLength": 1,
"type": "string"
},
"spend_limit_cents": {
"anyOf": [
{
"maximum": 100000000,
"minimum": 0,
"type": "integer"
},
{
"type": "null"
}
]
},
"voice": {
"anyOf": [
{
"examples": [
"default"
],
"type": "string"
},
{
"type": "null"
}
],
"description": "One of ORDan voice's voices, by name; null: the default"
},
"voice_language": {
"anyOf": [
{
"examples": [
"en-US"
],
"pattern": "^[a-z]{2,3}(-[A-Z]{2})?$",
"type": "string"
},
{
"type": "null"
}
]
},
"voice_mode": {
"description": "ORDan voice on this Line's calls; an owner session or a project key only",
"enum": [
"none",
"ordan"
],
"type": "string"
}
},
"type": "object"
}Request examples
These are request templates, not executed requests. Replace REPLACE_… and <…> placeholders, set the credential environment variables, and supply any conditional fields your action needs. JSON values are illustrative, not live records. Use a stable idempotency key per logical operation.
bash
curl --request PATCH --url 'https://api.ordan.io/v1/lines/REPLACE_id' \
--header "Authorization: Bearer $ORDAN_AGENT_TOKEN" \
--header "Content-Type: application/json" \
--data-raw '{}'js
const response = await fetch("https://api.ordan.io/v1/lines/REPLACE_id", {
method: "PATCH",
headers: {
"Authorization": "Bearer " + process.env.ORDAN_AGENT_TOKEN,
"Content-Type": "application/json",
},
body: JSON.stringify({}),
});
const text = await response.text();
if (!response.ok) throw new Error(`${response.status}: ${text}`);
const result = text ? JSON.parse(text) : null;python
import json
import os
from urllib.request import Request, urlopen
request = Request("https://api.ordan.io/v1/lines/REPLACE_id",
method="PATCH",
headers={
"Authorization": "Bearer " + os.environ["ORDAN_AGENT_TOKEN"],
"Content-Type": "application/json",
},
data="{}".encode("utf-8"),
)
with urlopen(request, timeout=30) as response:
text = response.read().decode("utf-8")
result = json.loads(text) if text else NoneResponses
| Status | Meaning |
|---|---|
400 | Invalid request; device token polling uses RFC 8628 string errors |
402 | spend_limit_exceeded: inspect details.scope (org/grant/line) and outstanding_micros |
403 | Missing authority, policy_violation, approval_required (details.approval_request), limit_reached, destination_not_supported or feature_disabled (details.feature) |
409 | Conflict, idempotency in progress, or a2p_registration_pending; retrieve state instead of duplicating work |
422 | validation_error: the request is not valid; details name each field |
429 | Rate limited; back off and retain the same idempotency key |
502 | provider_error: unknown routes need verified quotes; ambiguous operations retain resource references and cost holds |
2XX | Success (created objects use 201) |
default | Error |
Status ranges such as 2XX are retained exactly as declared. See Errors and recovery for retries and pending outcomes.
400 response
Content type: application/json
Type: Error
Required means required within its containing object, when that object is present. Union/conditional constraints remain defined by the JSON Schema below.
| Field | Type | Presence | Description / constraints |
|---|---|---|---|
error | object | Required | Additional properties allowed |
error.code | string | Required | — |
error.details | object | Optional | Additional properties allowed |
error.message | string | Required | — |
JSON Schema
json
{
"$ref": "#/components/schemas/Error"
}2XX response
Content type: application/json
Type: Line
Required means required within its containing object, when that object is present. Union/conditional constraints remain defined by the JSON Schema below.
| Field | Type | Presence | Description / constraints |
|---|---|---|---|
agent | anyOf: string; null | Optional | — |
capabilities | object | Optional | Additional properties allowed |
capabilities.a2p_outbound | string | Optional | — |
capabilities.sms | string | Optional | — |
capabilities.voice | string | Optional | — |
id | string | Required | Public line_… reference (not a UUID). pattern: ^line_[0-7][0-9A-HJKMNP-TV-Z]{25}$ |
number | anyOf: string; null | Optional | — |
org | string | Optional | Public org_… reference (not a UUID). pattern: ^org_[0-7][0-9A-HJKMNP-TV-Z]{25}$ |
phone_number | anyOf: string; null | Optional | — |
project | string | Optional | Public proj_… reference (not a UUID). pattern: ^proj_[0-7][0-9A-HJKMNP-TV-Z]{25}$ |
spend | object | Optional | Additional properties allowed |
spend.committed_micros | string | Optional | Integer USD micros as a decimal string; $1 = 1000000 micros. pattern: ^[0-9]+$ |
spend.limit_micros | anyOf: string; null | Optional | — |
spend.period | string | Optional | — |
spend.reserved_micros | string | Optional | Integer USD micros as a decimal string; $1 = 1000000 micros. pattern: ^[0-9]+$ |
spend_limit_cents | anyOf: integer; null | Optional | — |
status | provisioning, active, suspended, releasing, released | Required | — |
voice | anyOf: string; null | Optional | — |
voice_language | anyOf: string; null | Optional | — |
voice_mode | none, ordan | Optional | ordan: ORDan speaks the agent's text on the Line's calls and transcribes the other party (the owner's switch) |
JSON Schema
json
{
"$ref": "#/components/schemas/Line"
}Illustrative response template
Placeholder values show the shape, not a live response. Nullable costs remain null rather than implying zero usage.
json
{
"agent": null,
"capabilities": {
"a2p_outbound": "<a2p_outbound>",
"sms": "<sms>",
"voice": "<voice>"
},
"id": "<id>",
"number": null,
"org": "<org>",
"phone_number": null,
"project": "<project>",
"spend": {
"committed_micros": "<committed_micros>",
"limit_micros": null,
"period": "<period>",
"reserved_micros": "<reserved_micros>"
},
"spend_limit_cents": null,
"status": "provisioning",
"voice": null,
"voice_language": null,
"voice_mode": "none"
}default response
Content type: application/json
Type: Error
Required means required within its containing object, when that object is present. Union/conditional constraints remain defined by the JSON Schema below.
| Field | Type | Presence | Description / constraints |
|---|---|---|---|
error | object | Required | Additional properties allowed |
error.code | string | Required | — |
error.details | object | Optional | Additional properties allowed |
error.message | string | Required | — |
JSON Schema
json
{
"$ref": "#/components/schemas/Error"
}