Change the Organization's name or Call duration ceiling
PATCH /v1/organization
| Property | Value |
|---|---|
| Operation | update_organization |
| Group | Organization |
| Scope | organization:write |
| Route class | control |
| Idempotency | No Idempotency-Key |
| Audit | Audited organization.update (mutation) |
| Released in | 1.21.0 |
| Phase 0 host | Served (the hosted api pins 1.65.0) |
Applies the named fields at the revision If-Match names and writes the Audit event organization.update (1.21.0, FR-calls-15). Only the owner holds organization:write. Phase 0 accepts it from a Member ID token only, as for members:write, and refuses the route to every API key. Lowering the ceiling never changes a Call in progress; a Call admitted later takes the lower of its Agent version maximum and the new ceiling. From 1.22.0 the update also changes the dial policy (FR-telephony-5), which only the owner may widen as it alone holds this permission; the Audit event then records the number of allowed countries before and after, and the premium-rate switch and the outbound cap before and after, never a phone number. From 1.34.0 the description lists 422 validation_failed (register row H-25): a new name is rendered into the stored disclosure scripts and recording announcements, and one that would push a rendered line past 300 characters is refused with the issue template_invalid at path /name, so the name stays as it was. From 1.59.0 the update also turns the opt-in to production decision cases (production_decision_cases) on or off.
Request
Set VOCAL_API to the base URL of your API and VOCAL_API_KEY to an API key with the organization:write scope (Authentication and keys). Replace each placeholder, such as agt_... or <name>, with your own value.
curl -X PATCH "$VOCAL_API/v1/organization" \
-H "Authorization: Bearer $VOCAL_API_KEY" \
-H 'If-Match: "1"' \
-H "Content-Type: application/json" \
-d '{}'const response = await fetch(`${process.env.VOCAL_API}/v1/organization`, {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.VOCAL_API_KEY}`,
'If-Match': '"1"',
'Content-Type': 'application/json',
},
body: JSON.stringify({}),
});
console.log(response.status, await response.text());import os
import requests
response = requests.patch(
f"{os.environ['VOCAL_API']}/v1/organization",
headers={
"Authorization": f"Bearer {os.environ['VOCAL_API_KEY']}",
"If-Match": '"1"',
},
json={},
)
print(response.status_code, response.text)Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
if-match | header | string | yes | The revision the change was made against, quoted as the ETag returns it, or * to overwrite. |
Request body
Content type application/json, required: OrganizationUpdateRequest.
| Field | Type | Required | Description |
|---|---|---|---|
dial_policy | DialPolicyInput | no | Changes the dial policy (1.22.0, FR-telephony-5): each field given replaces its value. A Call in progress is never changed; the next start is checked against the new policy. The Audit event records the number of allowed countries before and after, and the premium-rate switch and the outbound cap before and after, never a phone number. |
max_call_duration_s | integer | no | The new Call duration ceiling in seconds, from 60 to 7,200 (1.21.0). Lowering it never changes a Call in progress, which keeps the maximum fixed at its admission, and changes no saved draft or published Agent version. Admission takes the lower of the limits.max_duration_s of the pinned version and the ceiling in force, so a Call on an earlier version is held to the new ceiling. A draft saved or published later with a maximum above the ceiling is refused with 422 validation_failed and the existing issue max_duration_above_organization_ceiling. |
name | string | no | The new display name of the Organization (1.21.0). |
preview_providers | boolean | no | Turns the opt-in to preview Providers on or off (1.60.0). A Call in progress keeps the chains it was admitted with; the Audit event records the value before and after. |
production_decision_cases | boolean | no | Whether the Organization labels its own production Turns for decision corpora (1.59.0; decision-models.md section 9): when true, a production decision case copies the redacted caller text of a Turn of one of its Calls; when false, every production case is refused with decision_case_production_not_allowed. The owner turns it on only where the Organization's terms with its callers allow it. Turning it off keeps the cases already copied. The Audit event records the value before and after. |
transfer_allowlist | TransferAllowlistInput | no | Replaces the transfer allowlist (1.50.0, FR-telephony-6). A number the dial policy refuses at the time of the change is the issue transfer_destination_not_dialable with the DialRefusalReason in reason, at /transfer_allowlist/<i>/number. A Call in progress keeps the destinations it was admitted with. Removing a key that a published Agent version names is allowed: a transfer to it is then refused with destination_not_allowed, and the next publish of that Agent refuses the key. The Audit event records the number of entries before and after, never an address. |
Responses
| Status | Content type | Shape | Error codes |
|---|---|---|---|
200 | application/json | Organization | |
400 | application/json | ErrorEnvelope | invalid_request |
401 | application/json | ErrorEnvelope | unauthenticated |
403 | application/json | ErrorEnvelope | forbidden, org_suspended |
412 | application/json | ErrorEnvelope | revision_mismatch |
422 | application/json | ErrorEnvelope | validation_failed |
428 | application/json | ErrorEnvelope | precondition_required |
429 | application/json | ErrorEnvelope | rate_limited |
500 | application/json | ErrorEnvelope | internal_error |
Fields of the 200 answer
The shape is Organization.
| Field | Type | Required | Description |
|---|---|---|---|
created_at | Timestamp | yes | |
dial_policy | DialPolicy | no | What outbound phone Calls the Organization may place (1.22.0, FR-telephony-5). The api from 1.22.0 always sends it; an api before 1.22.0 omits it. |
id | OrganizationId | yes | |
max_call_duration_s | integer | no | The Organization's Call duration ceiling in seconds, from 60 to 7,200 (FR-calls-15). It is the platform ceiling, 7,200 seconds or 120 minutes, until the owner lowers it. Added in 1.21.0: a reader treats its absence as the platform ceiling. |
name | string | yes | |
object | "organization" | yes | |
phi_mode | boolean | no | Whether the Organization runs in PHI mode (1.65.0): what a Webhook subscription's selection, a payload's projection and an include are checked against, readable by every Member before a request. PHI mode is planned for slices 3.3 to 3.5 and not built, so the api answers false until it is; absent from an older api, which a reader treats as false. |
preview_providers | boolean | no | Whether the Organization opts in to preview Providers (1.60.0): when false, a preview Provider runs only for test keys and is dropped from every live chain with the reason preview_not_opted_in; when true, it runs in both. The owner turns it on. The api from 1.60.0 always sends it, false until the owner turns it on; a reader treats its absence as false. |
production_decision_cases | boolean | no | Whether the Organization labels its own production Turns for decision corpora (1.59.0; decision-models.md section 9): when true, a production decision case copies the redacted caller text of a Turn of one of its Calls; when false, every production case is refused with decision_case_production_not_allowed. The owner turns it on only where the Organization's terms with its callers allow it. Turning it off keeps the cases already copied. The api from 1.59.0 always sends it, false until the owner turns it on; a reader treats its absence as false. |
revision | integer | yes | Counts writes to the Organization (1.21.0); returned as the ETag and required in the If-Match of PATCH /v1/organization. |
slug | string | yes | A URL-safe unique name. |
spend_cap_micros | SpendCapMicros or null | no | The monthly spend cap; null means none. Added in 1.19.0: a reader treats its absence as null. |
status | OrganizationStatus | yes | |
transfer_allowlist | TransferAllowlist | no | The only destinations a transfer may reach (1.50.0, FR-telephony-6), by key, each with its number or SIP URI. The api from 1.50.0 always sends it, empty until the owner adds one; an api before 1.50.0 omits it. |