Skip to main content

Read → patch → read back

Org configuration lives on one object per organization (the same record GET /api/v1/settings/general and GET /api/v1/settings/organization expose). Scopes — voice, sms, compliance, voice-clones, and the other slices the dashboard groups under Settings — are keys on that object, not separate resources. Every change follows one loop: read the current object, patch the scope you’re changing, then read again to see the merged result. Re-reading before you write is the safest way to learn what’s already set — sibling keys in the same scope are preserved verbatim, so you never have to resend them. Reads are available to any member. Writes are role-gated: most are owner/admin (PUT /api/v1/settings/general), and the stricter ones — consent, marketing, inbox-AI policy, and fraud caps (PATCH/PUT /api/v1/settings/compliance/*) — accept the owner role only. Call a write without the role and you get the standard 403 envelope. Configuration is server-side only here — no message is sent, no call is placed, and no routing changes because a scope changed. An outbound velocity or spend cap constrains your own org’s send path only; it never creates or reroutes an outbound path for another tenant.

1. Read the current object

GET /api/v1/settings/compliance/fraud-caps
Reads return the scope’s full current state — your org’s overrides plus the platform floor each override sits on. An override that was never set comes back null (the floor applies), so the response always carries the complete shape. Request
Only sms has overrides; whatsapp and voice ride the platform floor.

2. Patch one scope

PUT /api/v1/settings/compliance/fraud-caps
Send only the scope you’re changing. The write is a merge, not a replace — the sms override from step 1 and every untouched scope survive. A leaf value sets the override; a leaf null clears it back to the platform floor. The response tells you exactly which keys were written (set) and which were removed (cleared). Request

3. Read again — the merged result

GET /api/v1/settings/compliance/fraud-caps
The second read shows the scope you patched next to the overrides you never touched. sms still holds step 1’s values; voice is still at the floor. Nothing else moved. Request

Validation error envelope

Values outside the documented constraints fail validation — usually a cap below the platform floor or above the documented maximum — and return 422 with a VALIDATION_ERROR envelope before anything is written:
422
Nothing was stored — the write is accepted or rejected as a whole, so a scope you offend on never half-applies. Fix the offending value and retry the same request; read back to confirm the merge.

Channel, fallback and preference envelopes

The walk-through above is the compliance slice of Settings. The channel slice, the one the dashboard’s Settings → Channels page edits, follows the same read, write, read-back rhythm with its own field shapes. These are the calls you make when you pause one channel and let another pick up its traffic, so the envelopes below show the per-channel fields you branch on.

1. Read the channel bundle

GET /api/v1/settings/channels
The bundle is a map keyed by channel name. Each slot carries that channel’s stored configuration plus its connected flag, and only channels you have configured appear; a fresh org reads an empty data object. The two connected channels below show the per-channel fields: the WhatsApp slot holds the Meta Business identifiers, the SMS slot the sender identity.
Unconfigured channels are absent from the map rather than null, so iterate the keys you receive instead of probing a fixed list.

2. Write one channel slot

PUT /api/v1/settings/channels/{channel}
Writes on this surface use PUT. The body is merged into the named channel’s slot and every sibling slot is preserved, so send only the fields you change. The write needs the owner or admin role; the response returns the full bundle after the merge, which doubles as your read-back.
Reading the single slot back adds the addressing fields on top of the stored bundle:
GET /api/v1/settings/channels/{channel} answers configured: false for a channel you never saved, and INVALID_CHANNEL (400) for a channel name the platform does not recognise.

3. The cross-channel fallback map

GET /api/v1/settings/channels-fallback
Each key is a primary channel and each value the ordered cascade to try when the primary fails: the first entry is attempted first. An empty array, or a missing primary, means no fallback, and a primary failure then surfaces CHANNEL_UNAVAILABLE to the caller.
PUT /api/v1/settings/channels-fallback
Send the map you want; the stored map comes back. Entries are normalised on the way in: duplicate channels and self-references are dropped, so "rcs": ["sms", "sms", "rcs"] saves as ["sms"]. Owner or admin role required, and the change takes effect immediately on the send path.
With the map above, a WhatsApp send that fails at the provider retries over SMS; an SMS failure stops there because sms has no cascade.

4. Per-user preferences

GET /api/v1/settings/preferences
Preferences live on the calling user’s own record, not on the organization: this is the dashboard theme, locale and notification toggles the signed-in user saved. An empty object means nothing stored yet.
PUT /api/v1/settings/preferences
The write acts on behalf of the authenticated user only: it never touches the tenant’s settings row, and every role may save their own map. Send up to 50 keys and 16 kB serialized; keys you omit keep their stored value, and keys the server does not know are preserved so each dashboard surface can keep its own namespace. The saved map comes back, so no follow-up GET is needed.

Worked sequences

The catalogue above trims every operation past the fifteenth to cURL plus Node.js (TypeScript). The three flows below are the settings surface’s reach-for-first pipelines; each step renders in the full six-language group so the same calls are copy-paste complete from Go, Ruby, PHP, and Python. Request bodies and response envelopes are the ones the catalogue publishes for each operation.

Create a keyword rule, then verify it in the list

Keyword rules auto-reply, forward to agents, or drive opt-outs when an inbound message matches. Create one, then read the rule back through the paginated list. Create the rule — POST /api/v1/settings/keyword-rules
Read the rules back — GET /api/v1/settings/keyword-rules

Add an opt-out rule and audit the opt-out surface

Opt-out keywords (STOP, UNSUBSCRIBE) suppress sends for the contact that sent them. Register the rule, then confirm it on the management read. Create the opt-out rule — POST /api/v1/settings/opt-out-rules
Audit the rule list — GET /api/v1/settings/opt-out-rules

Register a sender ID and poll it to approval

Telephony senders start pending until moderation review; email senders auto-approve once their domain is DNS-verified. Register, then poll the inventory until the sender leaves pending. Register the sender — POST /api/v1/settings/sender-ids
Poll the inventory — GET /api/v1/settings/sender-ids