VocalDocscontracts 1.65.0

Change the Organization's name or Call duration ceiling

PATCH /v1/organization

PropertyValue
Operationupdate_organization
GroupOrganization
Scopeorganization:write
Route classcontrol
IdempotencyNo Idempotency-Key
AuditAudited organization.update (mutation)
Released in1.21.0
Phase 0 hostServed (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 '{}'

Parameters

NameInTypeRequiredDescription
if-matchheaderstringyesThe revision the change was made against, quoted as the ETag returns it, or * to overwrite.

Request body

Content type application/json, required: OrganizationUpdateRequest.

FieldTypeRequiredDescription
dial_policyDialPolicyInputnoChanges 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_sintegernoThe 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.
namestringnoThe new display name of the Organization (1.21.0).
preview_providersbooleannoTurns 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_casesbooleannoWhether 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_allowlistTransferAllowlistInputnoReplaces 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

StatusContent typeShapeError codes
200application/jsonOrganization
400application/jsonErrorEnvelopeinvalid_request
401application/jsonErrorEnvelopeunauthenticated
403application/jsonErrorEnvelopeforbidden, org_suspended
412application/jsonErrorEnveloperevision_mismatch
422application/jsonErrorEnvelopevalidation_failed
428application/jsonErrorEnvelopeprecondition_required
429application/jsonErrorEnveloperate_limited
500application/jsonErrorEnvelopeinternal_error

Fields of the 200 answer

The shape is Organization.

FieldTypeRequiredDescription
created_atTimestampyes
dial_policyDialPolicynoWhat 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.
idOrganizationIdyes
max_call_duration_sintegernoThe 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.
namestringyes
object"organization"yes
phi_modebooleannoWhether 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_providersbooleannoWhether 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_casesbooleannoWhether 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.
revisionintegeryesCounts writes to the Organization (1.21.0); returned as the ETag and required in the If-Match of PATCH /v1/organization.
slugstringyesA URL-safe unique name.
spend_cap_microsSpendCapMicros or nullnoThe monthly spend cap; null means none. Added in 1.19.0: a reader treats its absence as null.
statusOrganizationStatusyes
transfer_allowlistTransferAllowlistnoThe 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.