The REST surface the wetalk console and every customer integration share.
Generated from the API's own OpenAPI document at build time, so it cannot describe an endpoint the API does not have. Operations tagged operator are left out: they belong to wetalk's internal console, on a separate deployment no API key can reach.
Agents and versions
GET /v1/agents listVoiceAgents
Every VoiceAgent in this account, newest first.
Unpaginated, deliberately. Design §5.1 asks for cursors on the append-heavy collections — conversations, the ledger, the delivery log — and a workspace's VoiceAgents are none of those: the screen is a short list a person reads top to bottom, and the count above it ("N agents · M answering now") is a count of the whole set rather than of one page.
Every member role may read this, including Viewer: product decision Q10 makes a Viewer read-only over analytics and outcomes, and that is what this is. What a Viewer does not get is the caller's number on a conversation, which is enforced by the database view rather than by narrowing this list.
POST /v1/agents createVoiceAgent
Create a VoiceAgent and its first build job, which waits for the documents.
Four rows, in one transaction: voice_agent (state building), agent_version v1 (state building), build_job (state queued) and its six build_step rows. It does NOT enqueue build.start (plan-003, design §16.8): the build reads the version's documents, which exist only once the wizard has uploaded and confirmed each one (createAgentDocumentUpload, confirmAgentDocument). startVoiceAgentBuild then enqueues build.start, once, in its own transaction — the outbox contract lives there. The build job stays queued until then.
Three rules are checked against the platform catalogue, because that is the only place they are true: the template must be available, every language pack must be complete, and each language's voice must speak it — voice_by_language names one voice per language, voice_id one voice for every language (exactly one of the two; plan-015, 2026-10-09: a pair that fails is 400 validation_failed on voice_by_language.<language>, the language named). Version 1 stores the map and, as voice_id, the opening language's voice. A delivery agent (reference schema pizzabot-menu-md-v1) speaks one language for now, and is refused with more than one. Every refusal's message is written for the person in the wizard; its code and field say which rule it was.
Accepts Idempotency-Key. A wizard whose reply was lost must be able to retry without creating a second VoiceAgent.
"Start from a shared configuration" (plan-014): with resource_share_id, the new agent copies an agent configuration another workspace shared and this one accepted (listSharedVoiceAgentConfigurations). Its kind of agent, languages, voice, greeting, recording switch and concurrency fill whatever the request leaves out; the kind of agent cannot change. The copy is recorded as the share's provenance in the same transaction, once per workspace (409 conflict for a second copy); a revoked share is 409 share_revoked, a share this workspace cannot use 404 share_unavailable. The organization's agent limit applies as to every creation (409 resource_limit_reached). The copy also takes the pinned version's time zone, special dates and answering choices where the request leaves them out.
The answering answers (plan-015, 2026-10-09): the VoiceAgent's own time_zone (the workspace's when left out, written into the version), its special_date[], and what happens when it is closed or busy (after_hours_choice, busy_choice, longest_wait_minute, forward_to). A forward is checked before anything is written: 422 forward_unavailable while forwarding is not available, 400 forward_destination_refused for a number outside the reviewed countries, a premium-rate, emergency or short number, or one that answers through wetalk.
The information inputs (plan-018, 2026-10-13): field_value is checked against the template's field set. A website field's address must be an absolute http/https address with the default port, no user name or password and a public host name (never a numeric address), and is stored in one form (the fragment dropped); otherwise 400 website_address_refused with error.detail.reason (malformed, scheme, port, credentials, ip_literal, not_public_host, too_long). No DNS lookup is made here; the build screens the addresses when it reads the site. An upload field names its file; one with maxFileCount may name several, one per line, at most that many (400 validation_failed). Fields that share a required group are alternatives: at least one must be given, or 400 information_input_missing with error.detail.group and error.detail.field_code.
Takes a JSON request body.
- 201
- 400
- 401
- 403
- 404
- 409
- 422
- 429
GET /v1/agents/{voice_agent_id} getVoiceAgent
One VoiceAgent, with today's and this month's figures.
The VoiceAgent, with what its page draws (plan-015, 2026-10-09): the voice of each language, the live version's answering answers (its time zone, special dates, what happens when it is closed or busy, and the hold callers are really given), whether online payment is unavailable for a VoiceAgent that accepts only online payment, and whether forwarding to a phone is available with its ring and time limit.
PATCH /v1/agents/{voice_agent_id} updateVoiceAgent
Turn "Record calls" on or off, by publishing a new version (plan-003 RC-47).
Whether a VoiceAgent records is pinned in its versions, like everything else about how it answers: a version is immutable and a conversation keeps the version it was admitted onto. So this does not edit the live version. It copies it — the same validated configuration with recordingEnabled changed and the same measured prompt prefix — as a new ready version, and publishes that through the same compare-and-set, audit entry and outbox message as publishAgentVersion, in one transaction. A conversation already in progress keeps the setting it started with; the next one gets the new version.
recording_enabled is the only field this route changes. expected_live_version_seq is required, as on publish. Asking for the value the live version already has publishes nothing and answers changed: false. A VoiceAgent with no live version yet is 422 agent_version_not_ready: its first build uses the value it was created with.
With recording_enabled: false the runtime speaks no recording notice, captures no audio and leaves conversation.recording_consent at not_asked.
Takes a JSON request body.
- 200
- 400
- 401
- 403
- 404
- 409
- 422
- 429
GET /v1/agents/{voice_agent_id}/access getVoiceAgentAccess
Who may call this agent — whether its list is on, and how sure it must be of the caller.
The agent's access list setting with its revision (also the ETag) and how many people are on it. required is true for an agent made for your own team; open_warning is true while such an agent has no list that is on and holds at least one person — it will soon answer only the people on its list, so add them now. lock_state says whether such an agent is about to refuse every caller (pending) or already does (locked). Nothing is saved until someone saves it (revision 0, assurance_level null). available is false while choosing who may call is not available yet in this deploy.
PUT /v1/agents/{voice_agent_id}/access setVoiceAgentAccess
Switch the agent's list of who may call on or off.
voice_agent.write; an API key needs agent:write and a person who owns it. If-Match: "<revision>" is required. number_only can always be chosen; number_sms_code and number_passcode while confirming who's calling is available (number_sms_code also needs SMS codes and a code price); signed website visitors come later.
Refused, in this order: 400 validation_failed, 404 not_found, 422 access_list_unavailable, 422 assurance_level_unavailable, 422 confirmation_code_price_unset, 409 revision_stale. Each change is recorded in the audit log (voice_agent.access_changed); saving the values already stored changes nothing (changed: false).
Takes a JSON request body.
- 200
- 400
- 401
- 403
- 404
- 409
- 422
- 429
GET /v1/agents/{voice_agent_id}/access/entries listVoiceAgentAccessEntries
The people on the agent's list of who may call.
Every entry, oldest first (at most 500). A phone number is shown in full only to people who may change the agent (and API keys with agent:write); everyone else sees its last three digits.
POST /v1/agents/{voice_agent_id}/access/entries addVoiceAgentAccessEntry
Add a person to the agent's list of who may call.
voice_agent.write. A label and exactly one identity: a phone number (international form, or national with region), or a number on one of your SIP trunks as your phone system sends it (it matches only calls through that trunk). Signed website visitors come later (422 assurance_level_unavailable).
Refused, in this order: 400 validation_failed (the shape, or error.detail.code label_too_long, number_invalid, subject_too_long), 404 not_found (the agent, or sip_trunk_id), 422 access_list_unavailable, 422 assurance_level_unavailable, 409 access_entry_exists, 422 access_entry_limit_reached (500). Recorded in the audit log by label and last three digits.
Takes a JSON request body.
- 201
- 400
- 401
- 403
- 404
- 409
- 422
- 429
DELETE /v1/agents/{voice_agent_id}/access/entries/{party_access_entry_id} removeVoiceAgentAccessEntry
Remove a person from the list.
voice_agent.write. 404 not_found, 422 access_list_unavailable.
PATCH /v1/agents/{voice_agent_id}/access/entries/{party_access_entry_id} renameVoiceAgentAccessEntry
Give a person on the list a new label.
voice_agent.write. 400 validation_failed, 404 not_found, 422 access_list_unavailable.
Takes a JSON request body.
- 200
- 400
- 401
- 403
- 404
- 422
- 429
DELETE /v1/agents/{voice_agent_id}/access/entries/{party_access_entry_id}/passcode removeVoiceAgentAccessEntryPasscode
Remove a person's passcode.
voice_agent.write. Idempotent: removing a passcode that is not set changes nothing. Recorded in the audit log when one was removed (voice_agent.access_entry_passcode_removed).
PUT /v1/agents/{voice_agent_id}/access/entries/{party_access_entry_id}/passcode setVoiceAgentAccessEntryPasscode
Give a person on the list a passcode.
voice_agent.write. The person keys, types or says the passcode on the call when the agent asks for it (with the "number + passcode" level, or a passcode minimum). It is stored only as a keyed digest and is never shown again, returned or logged; setting it again replaces it. Recorded in the audit log by label and digit count (voice_agent.access_entry_passcode_set).
Refused, in this order: 400 validation_failed (4 to 8 digits), 404 not_found, 422 passcode_unavailable.
Takes a JSON request body.
- 204
- 400
- 401
- 403
- 404
- 422
- 429
GET /v1/agents/{voice_agent_id}/analytics getVoiceAgentAnalytics
Everything the Analytics tab draws, over one window, in one read.
Calls per day, the four headline figures, the outcome breakdown, language shares, the by-channel table, the busiest hours, a per-version comparison, and the ranked list of questions the agent could not answer.
Every breakdown is a count, never a percentage: the denominator ships once, in figure.conversation_count, and the screen divides. Two percentages rounded separately do not add to 100, and a percentage of a window the caller cannot see is not checkable.
Buckets are cut in the workspace's time zone, which the response names, so "busiest hours" means the hours the business was busy rather than the hours the server was. Only answered, non-test conversations are counted, and the response says so in counts_answered_only and excludes_test rather than leaving it to be inferred from a number that looks low.
since and until are optional and have no default: absent means unbounded on that side. An unparseable value is a 400, never a silently widened range.
GET /v1/agents/{voice_agent_id}/answering getVoiceAgentAnswering
When this VoiceAgent answers, and what it does when it cannot.
Read from the live agent_version's validated configuration document, which is immutable. There is deliberately no write counterpart: changing the weekly pattern, a closed date, the out-of-hours behaviour or the overflow behaviour means publishing a new agent_version, and a save button here would have to lie about which conversations it affected.
GET /v1/agents/{voice_agent_id}/answers getVoiceAgentAnswers
The answers a built version was made from, read back for the Edit form (customer-portal review
Read from the version's validated configuration document (the wizard's draft is replaced when a build succeeds): the opening hours as a week and as the sentence the build reads, the delivery fee and free-delivery threshold, how callers pay, the languages, voice, greeting and "Record calls", and the version's documents. A template text field the configuration does not carry is listed in unrecovered_field and must be answered again. The live version unless agent_version_id names another built one. edit_refusal says why an edit cannot be saved right now (a build is running). Owner or Admin.
- 200
- 401
- 403
- 404
- 409
- 422
- 429
POST /v1/agents/{voice_agent_id}/archive archiveVoiceAgent
Archive a VoiceAgent that no longer answers (customer-portal review
Sets archived_at, audited (voice_agent.archived): it leaves listVoiceAgents — the list, the sidebar count and every picker — while its conversations, orders and history are kept and getVoiceAgent still answers for it. Nothing is deleted.
Refused (409 voice_agent_archive_refused) while it is live (pause it first), while a number or endpoint still routes to it (numbers are held by wetalk: ask wetalk to move or release it), or while its build is running. A build still waiting for documents is closed with it. Archiving an archived VoiceAgent changes nothing (changed: false).
- 200
- 400
- 401
- 403
- 404
- 409
- 429
POST /v1/agents/{voice_agent_id}/browser-test-calls createBrowserTestCall
Talk to the agent's live version from the browser's microphone.
A real conversation on the live version over wetalk's browser voice relay, marked is_test and billed like any other minute from the moment it is answered (AC-38), for at most max_duration_second (15 minutes). The console asks for the microphone first and sends nothing when it is refused. Read the test with readTestCall ?conversation_id= and end it with endTestCall — the same two routes a phone test uses.
Checked in the phone test's order and words, without "has a number": the agent (404 voice_agent_not_found); its live version (422 agent_version_not_ready); the language (422 language_unavailable); the agent answers conversations (422 voice_agent_paused); the live balance and the workspace budget pay a second of it (402 trial_exhausted, credit_exhausted, hard_stop_reached, budget_exceeded); the model is running (503 model_pool_unavailable). Every refusal ends "Nothing was charged." and nothing is written.
One browser test per member per agent: starting one ends the one already running for you on this agent, and names it in replaced_conversation_id.
The answer carries webrtc — the relay's address, a join token (two minutes, this one conversation's room, microphone only), join_by, and the two participant identities — and the conversation's id, in state = connecting.
Takes a JSON request body.
- 201
- 400
- 401
- 402
- 403
- 404
- 422
- 429
- 503
POST /v1/agents/{voice_agent_id}/build startVoiceAgentBuild
Start building the VoiceAgent from its confirmed documents.
Queues the build of the VoiceAgent's building version, once. A second start is 409 build_already_started; a template built from documents with none confirmed is 422 build_no_document. Requires Idempotency-Key.
- 202
- 400
- 401
- 403
- 404
- 409
- 422
- 429
GET /v1/agents/{voice_agent_id}/caller-protection getVoiceAgentCallerProtection
This agent's caller protection — per-caller limits, withheld numbers, silent start and the longest conversation.
The VoiceAgent's caller protection with its revision (also the ETag). Every setting is off until someone who may change the agent saves one; an agent with nothing saved reads every setting off at revision 0. available is false while caller protection is not available yet in this deploy: the stored values are still shown, and nothing can be changed.
The settings live on the VoiceAgent beside its version: a saved change applies to the very next call, with no new version to publish.
PUT /v1/agents/{voice_agent_id}/caller-protection setVoiceAgentCallerProtection
Change this agent's caller protection.
voice_agent.write (Owner, Admin, Member, Developer); an API key needs agent:write and a person who owns it. If-Match: "<revision>" is required (0 when nothing was saved yet). Every field is stated; null is "off".
Refused, in this order:
1. 400 validation_failed — the body's shape, an absent If-Match, or a rule, named in error.detail.field and error.detail.code: per_hour_out_of_range (1–100), per_day_out_of_range (1–500), per_day_below_per_hour, silent_start_not_offered (10, 20, 30 or 60 seconds), longest_conversation_not_offered (5, 10, 15, 30, 60 or 120 minutes); 2. 404 not_found — no such agent in this workspace; 3. 422 caller_protection_unavailable — caller protection is not available yet; 4. 409 revision_stale — the settings changed since they were read.
Each change is recorded in the audit log (voice_agent.caller_protection_changed, before and after); saving the values already stored changes nothing, records nothing and answers changed: false.
Takes a JSON request body.
- 200
- 400
- 401
- 403
- 404
- 409
- 422
- 429
GET /v1/agents/{voice_agent_id}/channel-bindings listVoiceAgentChannelBindings
The endpoints that reach this VoiceAgent.
One row per channel_binding: which medium it carries, what it is addressed by, and how many conversations arrived on it in the last seven days.
GET /v1/agents/{voice_agent_id}/concurrency getVoiceAgentConcurrency
How many conversations this VoiceAgent is holding, and how many it may hold.
in_use counts conversations with no end time. channel_unit_ceiling is the effective ceiling admission holds new conversations to: the VoiceAgent's own channel_unit_limit when set, else the live agent_version's version_ceiling. It is null when nothing is published — a VoiceAgent with no live version admits nobody, which is not the same as a ceiling of zero. entitlement_ceiling is the organization's concurrent-conversation entitlement, the most channel_unit_limit may be set to.
PUT /v1/agents/{voice_agent_id}/concurrency setVoiceAgentChannelUnitLimit
Change how many conversations this VoiceAgent takes at once.
Sets the VoiceAgent's own line limit, channel_unit_limit, without publishing a new version. null returns it to the published version's own ceiling. Anyone who may change the agent (Owner, Admin, Member, Developer) may change it, up to the organization's concurrent-conversation entitlement; above it the answer is 422 channel_unit_limit_above_entitlement with error.detail.entitlement_ceiling, and the way up is "Request more lines" (POST /v1/quota-requests).
New conversations meet the limit within a few seconds. A lower limit never ends a conversation in progress: new callers meet the agent's busy behaviour until fewer are talking than the new limit. Each change is recorded in the audit log (voice_agent.channel_unit_limit_changed, old and new); setting the value it already has changes nothing and records nothing.
Takes a JSON request body.
- 200
- 400
- 401
- 403
- 404
- 409
- 422
- 429
GET /v1/agents/{voice_agent_id}/connection getVoiceAgentConnection
How calls reach this VoiceAgent, and what cannot be promised about it.
The number, the carrier, the SIP address with whose domain it is on, the events endpoint, the most recent registration observation — or null when there is none — and the inbound-failover verdict.
inbound_failover.possible is always false. A number is homed on one carrier and moving it is a porting operation measured in days; the alternative is named (byo_sip_dual_home) so the answer is never merely "no".
GET /v1/agents/{voice_agent_id}/documents listVoiceAgentLiveDocuments
The file names the agent's live version answers from (plan-015 TC1).
The documents the live version was built from, oldest upload first: those of the newest built version at or before the live one that has documents (an edit builds without uploading again). An agent with nothing live answers an empty list. Names only — the stored files are not reachable from here. The Test console's text hint names them ("The agent replies from …").
POST /v1/agents/{voice_agent_id}/documents createAgentDocumentUpload
A short-lived, write-only upload link for one document of the building version.
Answers a link the browser PUTs one file's bytes to, straight into storage, and a signed upload grant to confirm it with. Nothing is recorded yet: the document exists once it is confirmed.
Only while the VoiceAgent's build waits for documents (queued, not yet started): otherwise 409 build_already_started. At most the platform's per-version document count (422 document_count_exceeded). Requires Idempotency-Key.
Takes a JSON request body.
- 201
- 400
- 401
- 403
- 404
- 409
- 413
- 415
- 422
- 429
POST /v1/agents/{voice_agent_id}/documents/{agent_document_id}/confirm confirmAgentDocument
Record an uploaded document after checking its stored size and SHA-256.
Verifies the upload grant, reads the stored object back, and checks that its size, its content type and its SHA-256 are the declared ones. A mismatch discards the stored bytes and answers 422 document_mismatch. A match records the document and an audit entry.
Confirming the same document twice answers the same document. A grant that is forged, altered, or minted for another document or account is 400 upload_grant_invalid; one past its expiry is 410 upload_grant_expired.
Takes a JSON request body.
- 200
- 400
- 401
- 403
- 404
- 409
- 410
- 422
- 429
POST /v1/agents/{voice_agent_id}/edit editVoiceAgent
Open the next version from edited answers, and build it (customer-portal review
Inserts the next agent_version (state building, the edited answers as its draft), a queued build_job and its six steps. The live version keeps answering: a VoiceAgent that already has a live version is not published by its build (decision D14 (a)); the new version is tested on the Versions tab and published with publishAgentVersion, which keeps conversations in flight on the version they started on (design §7.5).
documents: "keep" copies the base version's documents to the new version and starts the build (202). documents: "replace" opens the version with no documents (201); upload them with createAgentDocumentUpload / confirmAgentDocument, then startVoiceAgentBuild.
Checked before anything is written with the same rules as createVoiceAgent and then the build's own reader, so unreadable hours or an unreadable fee are a 400 naming the field. 409 build_in_progress while a build runs (one only waiting for documents is closed and superseded); 409 live_version_seq_stale; 409 voice_agent_archived; 422 agent_version_not_ready with nothing built to edit from; 422 build_no_document for "keep" with no document; 422 edit_unchanged when nothing changed; 422 edit_needs_no_build when only recording_enabled changed — that switch publishes on its own through updateVoiceAgent, without a build. Owner or Admin; audited (voice_agent.edit_requested); requires Idempotency-Key.
The answering answers (plan-015, 2026-10-09) may be changed here, each one left out keeping the base version's; each change needs a build. A forward — stated or kept — is checked as on create: 422 forward_unavailable, 400 forward_destination_refused.
The information inputs (plan-018, 2026-10-13) are checked as on create (400 website_address_refused, 400 information_input_missing, each with error.detail); a kept upload counts as given when the base version has a document. A website field left out of field_value keeps the address the base version was built from (2026-10-14); sent empty, it removes it. A changed, added or removed website address is a change that needs a build. 422 build_no_document applies only to a template whose uploads are not alternatives of a required group.
Takes a JSON request body.
- 201
- 202
- 400
- 401
- 403
- 404
- 409
- 422
- 429
GET /v1/agents/{voice_agent_id}/flags listConversationFlags
Conversations somebody or something raised a concern about.
One table, two populations. A member flags a conversation from History, an operator from the staff console, the runtime automatically, a carrier by report — all four land in conversation_flag and are told apart by raised_by_kind. This list returns all four, because hiding the operator-raised ones would leave a customer looking at a list that does not match what wetalk can see.
state defaults to open, which is the unhandled ones.
POST /v1/agents/{voice_agent_id}/flags/{conversation_flag_id}/resolve resolveConversationFlag
Mark a raised concern dealt with.
Sets handled_at and records which population handled it, in the matching column. Resolving an already-resolved concern is not an error — two people can click at once — but the first resolver is the one recorded.
GET /v1/agents/{voice_agent_id}/gaps listGaps
Questions callers asked that the documents do not answer, grouped and counted.
Ranked by how many callers asked. state selects which of the four a gap is in and defaults to open; a value that is present but unknown is a 400 rather than a silently widened list.
POST /v1/agents/{voice_agent_id}/gaps/{gap_id}/answer answerGap
Queue an answer for the next draft.
Fills answer_text and leaves answered_into_agent_version_id null, which is what "queued" means. Nothing is published and nothing is built — publishAnswers saves the queued answers as a draft version, and the agent keeps saying what the live version says until somebody publishes that draft from Versions.
A gap already folded into a version — a draft included — is refused: that answer is part of an immutable agent_version, and a correction is answered on a new gap and goes into the next draft.
Takes a JSON request body.
POST /v1/agents/{voice_agent_id}/gaps/{gap_id}/dismiss dismissGap
Mark a gap not worth answering.
Sets dismissed_at. The row is kept rather than deleted: the cluster is evidence that callers asked, and deleting it would let the same question be rediscovered as new next month.
POST /v1/agents/{voice_agent_id}/gaps/publish publishAnswers
Save the queued answers as a draft version.
Creates a draft; publishes nothing (plan-015 DRF, ADR 0043). Folds every answer not yet live — each queued answer (a gap with answer_text and no answered_into_agent_version_id) and each answer already in a draft that was never published — into a new ready version built on the live one: the live version's configuration with its answers extended, its prompt prefix measured again. The draft has no published_at, its base_agent_version_id is the live version, and each folded gap names it from then on. A queued question equal to one already live replaces it.
There is no agent_version.published outbox message and the live version does not change: live_version_id and live_version_seq come back as they were, and every conversation keeps reaching the live version until somebody who may publish publishes the draft from Versions (publishAgentVersion, which refuses 409 draft_base_changed once another version went live meanwhile, unless acknowledged). The audit entry is agent_version.draft_created. Running this again after another version went live is the answers' "Recreate on the current version".
The operationId keeps its earlier name so generated clients do not break.
Takes a JSON request body.
- 200
- 400
- 401
- 403
- 404
- 409
- 422
- 429
GET /v1/agents/{voice_agent_id}/handoff getVoiceAgentHandoff
Whether this VoiceAgent puts callers through to a person, and where it can.
The VoiceAgent's handoff setting — on or off, the person's number and the language the person hears the summary in — with its revision (also the ETag), whether the agent's template offers a handoff at all (offered), and one availability row per kind of line the agent answers on, SIP trunks first:
- a number on your own SIP trunk: available, not_available_yet while the SIP handoff is not switched on for wetalk yet, or inbound_only_trunk when the trunk only receives calls and so cannot call the person; - a wetalk number: available, or not_available_yet while putting callers through from a wetalk number is not switched on for wetalk yet; - browser voice and the website chat: priority_message — a person cannot join those conversations live, so the agent takes a message for a person to reply to, whatever the setting says.
The setting lives on the VoiceAgent beside its version: a change applies from the next conversation, with no new version to publish.
PUT /v1/agents/{voice_agent_id}/handoff setVoiceAgentHandoff
Switch putting callers through to a person on or off, with the number and the person's language.
voice_agent.write (Owner, Admin, Member, Developer). If-Match: "<revision>" is required (400 validation_failed, field if-match, when absent; 409 revision_stale when the setting changed since it was read). Every field is stated; destination_e164 and language_code may be null only while the handoff is off, and a stored number and language may stay while it is off.
Switching on is refused, in this order:
1. 400 validation_failed — the body's shape (a number not in international form, an unknown field); 2. 422 handoff_not_offered — this kind of agent does not put callers through to a person; 3. 422 handoff_unavailable — no line the agent answers on can put a caller through now; error.detail.reason is switch_off (not available yet), inbound_only_trunk (every trunk it answers on receives calls only) or no_voice_binding (no number or trunk is connected); 4. 400 handoff_destination_refused — no available line may call that number, or it already answers through wetalk; error.detail.path_refusal gives each available line's reason; 5. 422 handoff_language_unavailable — not one of the agent's languages (not_configured), or the handoff is not offered in that language yet (framing_missing), in error.detail.reason.
Switching off checks only the shape and the revision. Each change is recorded in the audit log (voice_agent.handoff_changed, the number masked to its last four digits); saving the values already stored changes nothing and records nothing.
Takes a JSON request body.
- 200
- 400
- 401
- 403
- 404
- 409
- 422
- 429
PUT /v1/agents/{voice_agent_id}/name renameVoiceAgent
Rename a VoiceAgent — its name only, with no new version and no build (owner request 2026-10-28).
Changes voice_agent.name and nothing else, audited (voice_agent.renamed, the old and the new name) in the same db_transaction. The name is not part of a version, so no agent_version is made, nothing is rebuilt and the live version keeps answering; every list, History, campaign and notice shows the new name at once. The slug (the SIP user-part and webhook path segment) is kept, so nothing that reaches the agent changes.
The name is trimmed and must not be empty; at most 120 characters (400 validation_failed, field: name). Two agents of a workspace may share a name, as on creation. Asking for the name it already has changes nothing (changed: false). An archived VoiceAgent is not renamed (409 voice_agent_archived).
Takes a JSON request body.
- 200
- 400
- 401
- 403
- 404
- 409
- 429
GET /v1/agents/{voice_agent_id}/numbers listVoiceAgentNumbers
The numbers this VoiceAgent answers on.
Carrier numbers and your own SIP trunk's numbers alike. A trunk number has provider: sip_trunk, carrier: null, and names its trunk.
GET /v1/agents/{voice_agent_id}/optimisation-reviews listOptimisationReviews
This agent's optimisation reviews, newest first.
One page of the agent's reviews, newest first, each with its state, why it failed (failure_reason, set only when failed), how many findings it has and the draft its fixes were saved in. The findings themselves are on the review. The console restores the newest review from this list after a reload.
A cursor that names no review of this agent in the credential's workspace is 400 cursor_invalid. An agent in another workspace or account is a 404.
POST /v1/agents/{voice_agent_id}/optimisation-reviews createOptimisationReview
Start an optimisation review. It is recorded and queued for the factory; it does not run here.
Records the review with state = idle and its price (price_minor, currency = EUR), queues it on the optimisation_review.run outbox topic and writes the audit entry optimisation_review.requested, all in one database transaction. The review runs behind the frontier wall in the factory, never on the model pool; until the factory starts it the review is idle, and the response says so in queued.
The price is held from the start, and charged only when the review finishes with something to change. While the review waits or runs, its price is left out of the available credit. The charge is taken in the same transaction that marks it done, and only when it found at least one thing to change; a review that finds nothing, or fails, is never charged, and its hold ends with it.
An agent has at most one review waiting or running: a second start is 409 optimisation_review_already_open.
payer = customer charges the account and requires the live available credit to cover the price. payer = wetalk absorbs the cost and is a wetalk operator's decision only: it needs absorbed_reason, at least twelve characters. A wetalk operator acting as a member may not charge the account (403 impersonation_forbidden, and the refusal is written to the account's audit log); a person or an API key may not absorb (403 permission_denied).
Idempotency-Key is required: a repeated request returns the first review instead of queuing a second paid one.
Takes a JSON request body.
- 201
- 400
- 401
- 403
- 404
- 409
- 422
- 429
GET /v1/agents/{voice_agent_id}/optimisation-reviews/quote getOptimisationReviewQuote
What each depth of optimisation review would cost for a window, and whether it can run.
Counts the conversations a review would read — this VoiceAgent's, in the credential's workspace, ended and not test conversations, started inside the window (since_last_version is since the most recent publish) — and how many of them still have a recording under the retention policy. Recordings are visible to owners and admins only, so for a member recording_available_count is 0.
Each depth's price is the account's effective price book (review_standard_minor, review_ultra_minor), EUR in integer minor units. unavailable_reason is null when the depth can run, otherwise, in this order: not_available_yet — call reviews are not open to you yet (only a wetalk operator may start one, paid by wetalk), or the depth is ultra, which is not offered yet; not_offered — this agent's template is never reviewed; no_conversations_in_scope; insufficient_credit when the live available credit is below the price. The available credit already leaves out the price of every review still waiting or running, which is held from the moment it is started. Nothing is recorded or spent.
GET /v1/agents/{voice_agent_id}/party-confirmation getVoiceAgentPartyConfirmation
Confirm who's calling — what the agent protects, and how a caller confirms who they are.
The agent's caller confirmation with its revision (also the ETag): the capabilities it protects, the minimum way a caller must confirm who they are before the agent uses them, the capabilities this kind of agent can protect at all, and which ways of confirming are available now. confirmation_code_price is what one SMS code costs your organization (charged to your balance for each code sent), with the next change when one is scheduled; it is null while no price is set, and SMS codes are then not available. Nothing is saved until someone saves it (revision 0, minimum_method null). available is false while confirming who's calling is not available yet in this deploy.
PUT /v1/agents/{voice_agent_id}/party-confirmation setVoiceAgentPartyConfirmation
Choose what the agent protects and how a caller confirms who they are.
voice_agent.write; an API key needs agent:write and a person who owns it. If-Match: "<revision>" is required. An empty protected_capability turns caller confirmation off; that is always allowed.
Refused, in this order: 400 validation_failed, 404 not_found, 422 party_confirmation_unavailable, 422 capability_not_protectable (error.detail.capability), 422 method_unavailable (error.detail.reason: sms_code_off, signed_visitor_off or signed_visitor_voice_binding), 422 confirmation_code_price_unset, 409 revision_stale. Each change is recorded in the audit log (voice_agent.party_confirmation_changed); saving the values already stored changes nothing (changed: false).
Takes a JSON request body.
- 200
- 400
- 401
- 403
- 404
- 409
- 422
- 429
GET /v1/agents/{voice_agent_id}/pass-referrers listVoiceAgentPassReferrers
The agents of this workspace that pass conversations to this agent.
The other agents of this workspace whose published version (in: live), newest unpublished pass-target draft (in: draft), or both (in: both) list this agent, by name. Pausing or archiving this agent does not change their lists: they show this agent as not available and keep those conversations themselves until it is removed.
GET /v1/agents/{voice_agent_id}/pass-targets getVoiceAgentPassTargets
The agents this agent may pass a conversation to, in its published version and its newest draft.
The list of agents of this workspace this agent may pass a live conversation to — on the same call or chat, warm (it tells the caller and gives the next agent a short summary) or straight away (the next agent greets the caller) — as its published version carries it (live_version) and as its newest unpublished pass-target draft built on that version carries it (draft), with every other agent of the workspace it could add (candidate). ETag is the published version's sequence, which a save names in If-Match.
- availability is not_available_yet while passing between agents is not switched on for wetalk yet; the list can still be saved, and conversations stay with this agent until then. - offered is false for a kind of agent that never passes conversations (a survey); its list is then empty. - Each listed agent carries its state (live, not_live, paused, or unavailable when it was archived or deleted — remove it) and its warnings: pass_target_not_live, pass_target_no_shared_language (the languages of this agent it does not speak, in language_code) and pass_target_no_shared_medium (the kinds of conversation it does not answer, in medium). A warning never refuses a save. - A candidate with may_receive: false cannot be added; refusal says why (pass_target_cannot_receive, pass_target_audience_crossed).
PUT /v1/agents/{voice_agent_id}/pass-targets setVoiceAgentPassTargets
Save the agents this agent may pass a conversation to, as a draft to publish.
voice_agent.write (Owner, Admin, Member, Developer). If-Match: "<live_version_seq>" is required. The body is the whole list in display order (0 to 8 entries; an empty list removes every agent).
A save makes a draft built on the published version, which answers no conversation until it is published with POST /v1/agents/{voice_agent_id}/versions/{agent_version_id}/publish (409 draft_base_changed when another version was published meanwhile, unless acknowledged). Conversations in progress keep their version. Saving the list the published version already carries writes nothing and answers changed: false. Saving is allowed while passing is not available yet.
Each entry keeps the key it already had; a new entry takes the lowest free key, so removing or reordering an entry never renames another. The next agent's name is read from the workspace when the list is saved.
Refused, in this order:
1. 400 validation_failed — If-Match absent or malformed (field if-match); the body's shape, with error.detail.index for an entry: an unknown field, when not 1–240 characters on one line, note over 240 characters or not on one line, or a note on an entry passed straight away (send null). A newline, a control character, <| or |> is refused in when and note; 2. 404 voice_agent_not_found — the agent is not in this workspace; 3. 409 live_version_seq_stale — another version was published since the list was read; 4. 422 agent_version_not_ready — the agent has no published version yet; 5. 422 pass_source_cannot_pass — this kind of agent never passes conversations; 6. 422 pass_target_limit_exceeded — more than 8 entries (error.detail.limit); 7. per entry, the first failing entry first, each with error.detail.index: 422 pass_target_self (the agent itself), pass_target_duplicate (named twice), pass_target_not_found (not an agent of this workspace), pass_target_archived, pass_target_cannot_receive (a kind of agent that never receives a conversation), pass_target_audience_crossed (an agent that talks to your customers and an internal agent, either way).
Each change is recorded in the audit log (voice_agent.pass_targets_changed with the list before and after, and agent_version.draft_created).
Takes a JSON request body.
- 200
- 400
- 401
- 403
- 404
- 409
- 422
- 429
POST /v1/agents/{voice_agent_id}/pause pauseVoiceAgent
Stop a live VoiceAgent answering, until it is resumed (customer-portal review
live → paused, audited (voice_agent.paused). From the next conversation on, a caller hears the language pack's "we can't take your call right now, please try again later" and the conversation ends as voice_agent_paused — never silence. A conversation already in progress finishes. Only a live VoiceAgent can be paused (409 voice_agent_not_pausable); pausing a paused one changes nothing (changed: false).
- 200
- 400
- 401
- 403
- 404
- 409
- 429
GET /v1/agents/{voice_agent_id}/questionnaire-document getVoiceAgentQuestionnaireDocument
A survey agent's questions, as the question editor shows them.
The questions of one version of a survey agent — by default the version the editor edits: the newest unpublished draft of edited questions built on the published version, or else the published version (before anything is published, the newest finished version). agent_version_id shows another version, read-only. ETag is the shown version's id, which a check or a save names in If-Match.
- editable is false with not_editable_reason: editor_unavailable while editing questions is not switched on for wetalk yet (this read and the download still work); not_the_editable_version for another version; building or not_a_questionnaire when there are no questions to show; voice_agent_archived. - survey holds one questionnaire file per language exactly as stored. A questionnaire in the first format is shown in the current one, with the words wetalk added noted in warning (wording_added, format_converted): what the first save writes. - question_code_history lists every question code this agent has asked, with its type: a code keeps its type, and a new question takes a code not in it. - platform_line holds, per language, the lines wetalk says itself; pack_phrase the words wetalk adds for a new question (null where the language has none: type them yourself). - campaign_dialling lists the scheduled and running campaigns of this agent: people they call after a publish hear the new questions. - Any other kind of agent is 422 not_a_survey.
PUT /v1/agents/{voice_agent_id}/questionnaire-document setVoiceAgentQuestionnaireDocument
Save edited questions as a draft to publish.
voice_agent.write (Owner, Admin, Member, Developer). If-Match: "<agent_version_id>" is required: the version the questions were edited from, as the read's ETag names it. The body is every language's whole questionnaire file.
A save makes a draft built on the published version, which answers no conversation until it is published with POST /v1/agents/{voice_agent_id}/versions/{agent_version_id}/publish (409 draft_base_changed when another version was published meanwhile, unless acknowledged). The answer's ETag is the draft's id: the next save names it and continues the same draft. Saving questions equal to the edited version's writes nothing and answers changed: false. Results stay together under each question's code.
Refused, in this order:
1. 404 not_found — editing questions is not switched on for wetalk yet; 2. 400 validation_failed — If-Match absent or not a version id (field if-match); the body is not { survey, change_note? } with one object per language; 413 payload_too_large over 512 KiB; 3. 404 voice_agent_not_found; 422 not_a_survey; 409 voice_agent_archived; 4. 409 questionnaire_base_stale — If-Match is not the version the editor edits (someone saved or published meanwhile; error.detail.editable names the one it edits now); 5. 400 validation_failed (field survey) — a language this version lacks, or one it has missing; 6. 422 survey_rule_unavailable — the questions use rules, which are not available yet; 7. 422 questionnaire_invalid — every problem at once in error.detail.problem, each with its code and the path it is located at, beside error.detail.warning.
Each save is recorded in the audit log (voice_agent.questionnaire_changed with the question codes added, removed and reworded — never their wording — and agent_version.draft_created).
Takes a JSON request body.
- 200
- 400
- 401
- 403
- 404
- 409
- 413
- 422
- 429
POST /v1/agents/{voice_agent_id}/questionnaire-document/check checkVoiceAgentQuestionnaireDocument
Check edited questions without saving them.
The save's checks, without a write: every problem and warning, whether anything changed, the code a new question takes (free_code), and the files with the words wetalk added for a new question (survey), so the editor shows them before the save. If-Match: "<agent_version_id>" is required, as for the save. At most 60 checks a minute for one person (429 rate_limited).
Refused as the save is, up to and including 422 survey_rule_unavailable; the questions' own problems are answered 200 in problem. 404 not_found while editing questions is not switched on for wetalk yet.
Takes a JSON request body.
- 200
- 400
- 401
- 403
- 404
- 409
- 413
- 422
- 429
GET /v1/agents/{voice_agent_id}/questionnaire-document/file getVoiceAgentQuestionnaireFile
Download one version's questions as a file.
One version's questions as an attachment: json is the stored questionnaire file exactly (uploaded back through Edit, it is used as it is), md the same questions for a person to read. language_code is required only when the version has several languages. Works while editing questions is not switched on for wetalk yet. Each download is recorded in the audit log (voice_agent.questionnaire_exported).
- 200
- 400
- 401
- 403
- 404
- 422
- 429
POST /v1/agents/{voice_agent_id}/rebuild rebuildVoiceAgent
Try a failed build again, with the same documents or new ones (customer-portal review
For a VoiceAgent whose newest version failed. documents: "reuse" builds that version again from the documents already uploaded and starts at once (202). documents: "replace" opens a new version with the same answers and no documents (201); upload them with createAgentDocumentUpload / confirmAgentDocument, then startVoiceAgentBuild. Audited (voice_agent.rebuild_requested). Requires Idempotency-Key.
409 rebuild_refused when the newest version did not fail (it is building, waiting for documents, or built); 409 voice_agent_archived for an archived VoiceAgent; 422 build_no_document for "reuse" when the failed version has no document and the template needs one.
Takes a JSON request body.
- 201
- 202
- 400
- 401
- 403
- 404
- 409
- 422
- 429
POST /v1/agents/{voice_agent_id}/resume resumeVoiceAgent
Let a VoiceAgent its owner paused answer again (customer-portal review
paused → live, audited (voice_agent.resumed). A VoiceAgent wetalk paused is resumed only by wetalk (409 voice_agent_paused_by_operator); one that is not paused is 409 voice_agent_not_paused; resuming a live one changes nothing (changed: false).
- 200
- 400
- 401
- 403
- 404
- 409
- 429
POST /v1/agents/{voice_agent_id}/sandbox-turns createSandboxTurn
Type one line as a caller and get the live version's reply.
A text test against the agent, answered by the agent_runtime from the version's own prompt through the model pool — what a caller would hear, as text. Free (AC-38): no balance is judged and nothing is billed. turn is what this request produced, in order — the line as recorded, the reply, and a system line when the agent would have carried something out (a text test carries nothing out: no order is placed) — not the whole chat.
The chat is a conversation (medium = web_chat, is_test), so it shows in History as a test. Send the answered conversation_id back to continue it; the chat stays on the version its first turn used. Omit it to start a new chat on the live version, or send agent_version_id to start one on a built version that is not published yet (an edit, customer-portal review #75): 422 agent_version_not_ready unless that version is ready.
Checked in this order: text (non-empty, at most 2000 characters); the agent (404 voice_agent_not_found); its live version (422 agent_version_not_ready); the language (422 language_unavailable); the chat (404 conversation_not_found). A resting model is 503 model_pool_unavailable and a runtime that does not answer is 503 agent_runtime_unavailable — said before anything is written.
plan-015 TC2: a survey with two question groups needs survey_arm (A = group 1, B = group 2) on every turn of its chat; it is refused for one group or no survey (400 validation_failed, field survey_arm). opening: true on a new chat of an agent that makes calls answers turn 0 — its greeting, before the tester types anything — stored like every line and free.
Takes a JSON request body.
- 200
- 400
- 401
- 403
- 404
- 422
- 429
- 503
GET /v1/agents/{voice_agent_id}/signalling listVoiceAgentSignallingEvents
Recent SIP signalling for this VoiceAgent.
Rows wetalk synthesised rather than observed carry synthesised: true, because some carriers do not expose a REGISTER or a response code and a manufactured fact presented as an observed one is worse than a gap.
GET /v1/agents/{voice_agent_id}/sip getVoiceAgentSip
The bring-your-own-SIP address for this VoiceAgent (legacy).
Legacy (P10). The per-VoiceAgent SIP credential of the carrier era. It stays and answers as before, but it is not a customer SIP trunk and the portal no longer shows it: connect your own trunk with /v1/sip-trunks.
The address is on the carrier's domain, not wetalk's, and sip_address_owner says so. Telnyx's vanity SIP domains exist only on IP, FQDN and Teams-auth connections, and the credential connections that per-VoiceAgent usernames require cannot carry one.
POST /v1/agents/{voice_agent_id}/sip/rotation requestSipRotation
Request a new SIP password for this VoiceAgent (legacy).
Legacy (P10). Rotates the carrier-era per-VoiceAgent SIP credential; a customer trunk's password is replaced with PUT /v1/sip-trunks/{sip_trunk_id}/password.
Accepted, not applied. The worker issues the new secret at the carrier and writes it to the key store; until it does, the existing password keeps working. The SIP user-part does not change, so nothing needs re-pointing.
GET /v1/agents/{voice_agent_id}/test-calls readTestCall
How a voice test call — phone or browser — is going.
A phone test: after createTestCall, the console reads this with party_number and since until the tester's call has arrived and ended: state = idle while nothing has come in from party_number since since, then dialing, live and ended, with the conversation's id (for its live transcript stream) and, once ended, the billed seconds and amount.
A browser test (plan-004, since 2026-09-26): after createBrowserTestCall, read it with conversation_id instead. state = connecting until admission carries the conversation — before the browser has joined (no row yet) and while it has joined but is not yet answered — then live and ended, as for a phone test. An id this workspace did not start is 404.
Name the test one way: conversation_id, or party_number and since — both is 400.
POST /v1/agents/{voice_agent_id}/test-calls createTestCall
Place a voice test call on the agent's live version.
agent_calls_me rings party_number from the agent; i_call_the_agent answers state = idle and treats the next inbound conversation from party_number, within 120 seconds, as the test. Either way the conversation runs on the live version over the real connections, is marked is_test, and is billed like any other minute (AC-38).
Checked in this order: the body (party_number is required in both directions — dialling in, it is how the call is recognised as the test); the agent (404 voice_agent_not_found); its live version (422 agent_version_not_ready, in words that say whether the build failed or is still running); the language (422 language_unavailable).
Then, in both directions: the agent must answer calls (422 voice_agent_paused) and have a number (422 tenant_resolution_failed, "has no phone number yet" — the number to dial, or the number to call from); for agent_calls_me, party_number must not be on the account's do-not-call list for every agent or for this one (422 contact_suppressed); the live balance (402 trial_exhausted, credit_exhausted or hard_stop_reached) and the workspace's monthly budget (402 budget_exceeded) must pay a second of it.
i_call_the_agent: the agent_runtime arms the tester's number — 503 model_pool_unavailable when the model is resting, 503 agent_runtime_unavailable when the runtime does not answer — and the answer is 201 with state = idle, dial_number (the number to dial), waiting_since and waiting_until.
agent_calls_me (since 2026-09-25): the agent_runtime rings party_number from the agent's own number — dial_number in the answer, so the console can say which number will ring. Refused before anything rings with 503 model_pool_unavailable when the model is resting or when every free line is kept for inbound callers (inbound beats outbound), 503 agent_runtime_unavailable when the runtime does not answer or is restarting, 502 carrier_failed when the carrier refuses the call, 422 tenant_resolution_failed when the number no longer reaches the agent. The answer is 201 with state = dialing, dial_number, waiting_since and waiting_until (when the ringing stops). A phone that is not answered, or is busy or declines, ends the conversation with end_reason no_answer or busy, unbilled.
Read the call's progress with GET on this path. Nothing is written here: the runtime writes the conversation when the carrier reports the leg, marked is_test, and it is billed like any other minute from the moment it is answered.
A number on the account's own SIP trunk (plan-008, since 2026-09-30). The agent's number is its first enabled carrier number; when it has none, its enabled trunk number (a sip_trunk_number binding, one allowed as caller ID first). A carrier number keeps priority when the agent has both. A trunk number is reached through the trunk, by the same rules as createSipTrunkTestCall:
- agent_calls_me rings party_number through the trunk from the trunk number (origin: test_call, the trunk's default ring time). Before anything rings: a key also needs conversation:dial (403 scope_insufficient); the per-minute dial limits shared with startOutboundConversation (10 per account, 3 per key: 429 rate_limited, with Retry-After); the trunk is not disabled (422 sip_trunk_disabled); the number is allowed as caller ID (422 caller_id_not_bound); the destination rules (422 destination_refused); the do-not-call list (422 contact_suppressed); the balance (402). The runtime's own refusals: 429 daily_ceiling_reached, 422 sip_trunk_unverified, 503 all_lines_busy, 503 sip_edge_unavailable, 503 model_pool_unavailable, 503 agent_runtime_unavailable. The runtime opens the conversation before it answers, so the 201 carries its conversation_id with state = dialing, dial_number (the trunk number), waiting_since and waiting_until; GET on this path reads it as it reads a carrier test call, and endTestCall hangs it up through the trunk. A leg that could not reach the phone ends unreachable, unbilled. - i_call_the_agent needs wetalk to take calls through customer trunks: while the platform's SIP inbound is off it is 422 sip_trunk_inbound_off ("Calls into … come through your own phone system, and wetalk is not taking calls through phone systems yet."), before the balance is read. While it is on, the trunk number itself is armed (waiting_until is when the arm lapses), and a trunk not ready for inbound is 422 sip_trunk_inbound_off.
Takes a JSON request body.
- 201
- 400
- 401
- 402
- 403
- 404
- 422
- 429
- 503
POST /v1/agents/{voice_agent_id}/test-calls/arm/release releaseTestCallArm
Stop "My phone" waiting for the tester's call (plan-015 TC1).
Drops the arm when the test panel closes. A call from that phone afterwards is an ordinary conversation, not a test. Idempotent: 204 whether or not the number was armed. The tester's number is in the body, never in the URL.
Takes a JSON request body.
- 204
- 400
- 401
- 403
- 404
- 429
- 503
POST /v1/agents/{voice_agent_id}/test-calls/arm/renew renewTestCallArm
Keep "My phone" waiting for the tester's call (plan-015 TC1).
Moves the end of an armed "I call the agent" window by the platform's arm window again (ten minutes), keeping its start: the answer is waiting_since (unchanged) and the new waiting_until. The Test console renews at half the window while its panel is open. An arm that lapsed or that a call has already taken is not brought back: 404 test_call_arm_not_found, and the console arms afresh with createTestCall. The tester's number is in the body, never in the URL. Nothing is dialled or charged.
Takes a JSON request body.
- 200
- 400
- 401
- 403
- 404
- 429
- 503
GET /v1/agents/{voice_agent_id}/test-suites getVoiceAgentTestSuites
The test suites for this VoiceAgent, with each suite's most recent run.
Per-case pass and fail, with the result text and the transcript excerpt that shows the failure. A failing case does not block publishing (AC-15) — there is no constraint tying the live version to a passing run — so the run records which agent_version_id it was against and the failure stays retrievable against the version that was published anyway.
Reading a run is not running one. Placing a test conversation needs the runtime and belongs to the Test console (P11-09); this route reads what has already been run.
GET /v1/agents/{voice_agent_id}/versions listAgentVersions
Every version of this VoiceAgent, newest first.
The configuration document itself is not in the list projection: it holds the whole extracted catalogue, and the versions screen renders a label, a date, an author, a note and a what-changed list. Read one version to get its document.
GET /v1/agents/{voice_agent_id}/versions/{agent_version_id} getAgentVersion
One version, with the configuration document it was built into.
GET /v1/agents/{voice_agent_id}/versions/{agent_version_id}/documents listAgentVersionDocuments
The source documents this version was built from.
Documents are pinned per version, so what a live version answers from can always be downloaded exactly as it was uploaded.
POST /v1/agents/{voice_agent_id}/versions/{agent_version_id}/publish publishAgentVersion
Make this version the one new conversations resolve to.
One row update. Conversations already in flight hold the configuration they resolved at admission and finish on the outgoing version; the next new conversation gets this one. expected_live_version_seq is the sequence you last read — a mismatch is a 409 rather than a silent overwrite of somebody else's decision.
A DRAFT (plan-015, ADR 0043) — a version made from answers, a paid review's fixes or an edit, never published — records the version that was live when it was made. If that is no longer the live version, publishing it would replace what went live since, so it answers 409 draft_base_changed (with error.detail.base_agent_version_id, base_label, live_agent_version_id, live_label) unless the body says acknowledge_base_change: true. A stale expected_live_version_seq is judged first.
Takes a JSON request body.
- 200
- 400
- 401
- 403
- 404
- 409
- 429
POST /v1/agents/{voice_agent_id}/versions/{agent_version_id}/restore restoreAgentVersion
Go back to an earlier version. The same operation as publishing.
Identical to publish, with an older version id, and with the same guarantee for conversations already in flight. There is no separate rollback path.
Takes a JSON request body.
- 200
- 400
- 401
- 403
- 404
- 409
- 429
GET /v1/agents/{voice_agent_id}/website-reading getWebsiteReading
The website reading a version was built from — pages read, pages skipped and why.
The reading of the live version, or of ?agent_version_id=: the start address, when it ran, its outcome (read, partial, failed and the failure's code), the pages read (address, title, characters kept) and the pages skipped with their reason. One reading may serve several versions (a draft from answers shares its base version's). Never page text — see getWebsiteReadingPage.
404 website_reading_not_found when the version was built without a website; 404 not_found when the VoiceAgent has no such version, or no live version and none is named.
POST /v1/agents/{voice_agent_id}/website-reading readWebsiteAgain
Read the website again — build a draft of the live version with a fresh reading.
Builds the live version's inputs again with a fresh reading of its website address, producing a draft: the next version, built and not published (its base_agent_version_id is the live version), with the live version's answers and documents. The live version keeps answering until the draft is published from Versions. No body. Owner or Admin; audited (voice_agent.edit_requested); requires Idempotency-Key.
409 website_reading_in_progress while a build of this VoiceAgent runs (one only waiting for documents is closed and superseded); 409 voice_agent_archived; 422 website_address_missing when the live version was built without a website address; 422 agent_version_not_ready with no live version; 429 agent_build_limit_reached — a re-read counts against the organization's hourly build limit.
- 202
- 400
- 401
- 403
- 404
- 409
- 422
- 429
GET /v1/agents/{voice_agent_id}/website-reading/pages/{ordinal} getWebsiteReadingPage
One read page's text, as the build took it from the website.
The text kept from one page of the reading (headings, paragraphs, lists and table rows; the block repeated on most pages is kept once and is not on every page), from the reading's snapshot, which is pinned by its SHA-256. ordinal is the page's number in read_page. ?agent_version_id= as on getWebsiteReading.
404 website_page_not_found when the reading has no such page; 404 website_reading_not_found and 404 not_found as on getWebsiteReading.
GET /v1/blocked-numbers listBlockedNumbers
The numbers this workspace's agents refuse.
The workspace's active blocked numbers (not removed, not expired), newest first. voice_agent_id narrows the list to the numbers one agent refuses: its own and those blocked for every agent. A blocked number is shown by its last three digits and label only — the number itself is never stored. available is false while blocking numbers is not available yet in this deploy.
POST /v1/blocked-numbers addBlockedNumber
Block a number, for every agent of the workspace or for one.
voice_agent.write; an API key needs agent:write and a person who owns it. The number is read in international form, or as a national number of region (a country code such as GR); it is reduced to a digest and its last three digits and then discarded — it is never stored, returned or written to the audit log.
Refused, in this order: 400 validation_failed (the shape, or error.detail.code number_invalid, scope_voice_agent_mismatch, label_too_long, expiry_not_offered), 404 not_found (voice_agent_id), 422 caller_protection_unavailable, 422 blocked_number_limit_reached (5,000 active in the workspace). A number already blocked in that scope answers 200 with that entry and created: false, and records nothing.
Takes a JSON request body.
- 200
- 201
- 400
- 401
- 403
- 404
- 422
- 429
DELETE /v1/blocked-numbers/{party_block_entry_id} removeBlockedNumber
Unblock a number.
voice_agent.write. Recorded in the audit log by its last three digits and label. 404 not_found when no active blocked number has that id in this workspace; 422 caller_protection_unavailable while blocking numbers is not available yet.
GET /v1/builds/{build_job_id} getBuildJob
One build as it stands now — its steps, its progress, or why it failed (customer-portal review
What the Building screen reads on load and whenever its stream says something changed, so a reload, a second tab or a link opened later shows the real state. The failure carries the owner's sentence and the fault, never the operator's technical detail.
GET /v1/connections listConnections
The systems one version of a VoiceAgent may call, with their allowlists.
POST /v1/connections createConnection
Register a system the VoiceAgent may call, and the operations it may use.
The uploaded OpenAPI 3 or Swagger 2 document is parsed here, and operation_id must name operations that document declares. The resulting list is the allowlist: the runtime may call nothing else, and an attempt to call anything else is blocked and written to the conversation's own event timeline.
Takes a JSON request body.
GET /v1/connections/{connection_id} getConnection
One connection and its allowlist.
POST /v1/connections/read-spec readConnectionSpec
Read an uploaded specification and list the operations it offers.
Stores nothing. This is the wizard's "we read your file, here is what it offers" step, and it is what the customer picks the allowlist from.
Takes a JSON request body.
POST /v1/document-previews createDocumentPreviewUpload
Stage a menu for a preview — or answer the preview of the same file already read.
Names the template, the language the menu is written in and the file (its size and SHA-256). When this workspace already has a preview of the very same file for the same template and language — read, or being read — it is answered at once (200, upload: null): attaching the same file again costs nothing and never reads it again. Otherwise (201) the preview is uploading and upload is a short-lived, write-only link the browser PUTs the bytes to with exactly the headers given; then call confirmDocumentPreview.
Each new preview is a reading by the model: at most the platform's number per person per hour (429 rate_limited, with Retry-After). Only a template that reads a menu has previews (422 validation_failed on agent_template_code). A preview is kept for the platform's retention and then removed.
Takes a JSON request body.
- 200
- 201
- 400
- 401
- 403
- 413
- 415
- 422
- 429
GET /v1/document-previews/{document_preview_id} readDocumentPreview
One menu preview — poll it while it is being read.
POST /v1/document-previews/{document_preview_id}/confirm confirmDocumentPreview
Check the uploaded menu and start reading it.
Reads the stored file back and checks that its size, its content type and its SHA-256 are the declared ones; a mismatch discards it (422 document_mismatch). Then, when a preview of the same file was read already, this upload is folded into it and that preview is answered; otherwise the preview is queued and wetalk reads the menu in the background. Poll readDocumentPreview until it is done or failed. Confirming a preview that is no longer uploading answers it as it is.
- 200
- 400
- 401
- 403
- 404
- 422
- 429
GET /v1/messaging/conversations listMessagingConversations
Conversations on the workspace's website widgets, typed or spoken.
The Messaging page's conversation table (plan-004 WC-90, design §17.10.7): every conversation on a web_chat_widget channel binding — web_chat and widget voice — with the visitor (visitor_tag, never the key), the channel label, the last line said, the outcome and when. The console's own test chat has no binding and is not listed.
Read through the reader's lens: party_address comes back null for a Member and a Viewer — conversation_visible NULLs it in the database — and last_message is null for a Viewer, whose role does not include what was said (transcript_withheld).
GET /v1/messaging/media listMessagingMedia
The four media, and whether each can carry a conversation today.
GET /v1/messaging/media/{medium_code} getMessagingMedium
One medium in full — connected, coming soon or not connected.
Decodes against MessagingMediumDetail for all four media. For web_chat it also carries every website widget (widget, each with its snippet, CSP lines and state) and install (the script URL and the billing sentence); for the other media widget is empty and install is null.
POST /v1/messaging/media/{medium_code}/connection connectMessagingMedium
Bind a medium to a VoiceAgent.
Refused with 409 for a waitlisted medium, and for voice — a number, a trunk and a rotating SIP password are Numbers & SIP's surface, and binding a number in two places is how one of them ends up wrong. The refusal says which of the two it is.
For web_chat the body also needs site_origin — the address of the website the chat goes on (https://host[:port]; plain http only for localhost) — which becomes the widget's first allowed origin. A voice agent that already has a widget gets that widget back, re-enabled, with the address added (200); otherwise a new one is made (201). The widget key is the binding's id: a public identifier pasted into the customer's own page, carrying no scope and no secret.
An agent made for your own team answers only the people on its list: once such agents are locked to their lists, a new binding of such an agent whose list is not turned on is refused 422 access_list_required (error.detail.voice_agent_id); until then it is connected and the agent's access read warns (lock_state pending). Re-connecting an existing widget is never refused.
Takes a JSON request body.
- 200
- 201
- 400
- 401
- 403
- 404
- 409
- 422
- 429
POST /v1/messaging/media/{medium_code}/disconnection disconnectMessagingMedium
Stop answering on a medium, keeping its history.
Disables the workspace's bindings on this medium. Nothing is deleted: conversations reference the binding, and a delete would have to choose between breaking the foreign key and taking the transcripts with it. Each website widget it turns off is recorded in the audit log.
PATCH /v1/messaging/media/web_chat/widgets/{channel_binding_id} updateWebChatWidget
Turn a website widget on or off, and its voice on or off.
{ enabled?, voice_enabled? } — at least one. Turning either on needs at least one allowed origin (422 origin_list_empty). Turning the chat off stops it answering at once. Each change writes one audit entry; a request that changes nothing writes none. Owners and Admins only.
Takes a JSON request body.
- 200
- 400
- 401
- 403
- 404
- 422
- 429
POST /v1/messaging/media/web_chat/widgets/{channel_binding_id}/disconnection disconnectWebChatWidget
Disconnect a website widget, keeping its history.
Turns the widget off, turns its voice off and deletes its allowed origins; the page then shows it as not connected. Nothing is deleted from History, and connecting the same voice agent again brings back the same widget key. Owners and Admins only.
PUT /v1/messaging/media/web_chat/widgets/{channel_binding_id}/origins replaceWebChatWidgetOrigins
Replace the sites a website widget answers on.
{ allowed_origin: [...] } replaces the whole list. Each value is normalised to scheme://host[:port] (lower-case, default port dropped); https only, except http://localhost:<port>. At most 20 after removing duplicates. A value that is not a site address → 400 origin_invalid naming allowed_origin[<i>]; an empty list while the chat or its voice is on → 422 origin_list_empty. An origin check stops the widget being embedded on another site; it is not authentication. Owners and Admins only.
Takes a JSON request body.
- 200
- 400
- 401
- 403
- 404
- 422
- 429
GET /v1/numbers listNumbers
Every number in the workspace, bound or not.
The per-VoiceAgent list cannot serve this screen: a number with nothing bound to it has no VoiceAgent to be listed under, and that is exactly the row a customer opens Numbers & SIP to fix. Your own SIP trunk's numbers are listed beside carrier numbers, with provider: sip_trunk and the trunk's display name. meta.sip_trunk_count counts the workspace's customer SIP trunks (deleted ones excluded) — not the legacy per-VoiceAgent SIP credentials.
The kicker deliberately counts numbers and trunks and not a WebRTC endpoint: the browser media plane is unresolved (plan spike S8, risk R15), and a count of something that cannot carry audio would be a claim rather than a figure.
GET /v1/numbers/{phone_number_id}/activity getNumberActivity
One number's last conversation, this month's count and its five latest conversations.
What the Numbers & SIP screen shows when a number is opened: "Last call", "This month" and "Recent activity". A conversation counts when it came in — or, for an outbound leg through a SIP trunk, went out — through a voice binding of this number while the workspace held it (between the number's purchased_at and released_at), which is exactly what GET /v1/conversations?phone_number_id= lists ("See all calls on this number").
"This month" starts at the first instant of the current month in the workspace's own time zone. Test conversations count: they are conversations on this number. Read through the caller's own lens, so a Member and a Viewer get party_address as null, as in History.
GET /v1/numbers/availability getNumberAvailability
Whether wetalk can issue a number today.
Answers waitlisted. Which countries wetalk issues numbers in, and who bears the regulatory bundle, is an open product decision: a Greek +30 number needs proof of identity from an EU member state and takes days, a US number needs none. The detail names the two paths that exist: a number request wetalk fulfils, and "Connect a trunk" for numbers you already have with your own VoIP provider (/v1/sip-trunks).
GET /v1/numbers/region-latency getRegionLatency
Region and round-trip latency, measured by wetalk.
No carrier API reports this. Neither Telnyx nor Twilio exposes a per-region latency figure to a customer, so the design's us-west · 4 ms is a wetalk measurement or it is decoration. Samples come from region_latency_sample, the platform table design §4.7 created for them; when nothing has probed inside the window the response says measured: false and carries no figure. A plausible number with nothing behind it is the number a customer would quote back during an incident.
GET /v1/numbers/requests listNumberRequests
This workspace's number requests, newest first, with whether each has been met.
state is derived at read time: connected once the requested agent has a number bound to it at or after the request, pending until then.
POST /v1/numbers/requests requestPhoneNumber
Ask wetalk to set up a phone number for one of your agents.
Numbers are set up by wetalk for now. This records the request — the agent that should answer, the country, and anything wetalk should know (a number you already own, your own phone system) — as an entry in your audit log (voice_agent.number_requested); the entry's id is the request's. An operator reads it from the staff API and assigns the number; the request then reads state: connected.
Takes a JSON request body.
GET /v1/optimisation-reviews/{optimisation_review_id} getOptimisationReview
One optimisation review, with its findings and their decisions.
recording_available_count is recounted over the review's window as it stood when it was requested, against today's retention. next_agent_version_label is the label the draft would take. queued is set while the review waits for the factory. failure_reason says why a failed review stopped (nothing was charged); conversation_read_count is how many of the window's conversations it read.
Findings come in their position. Each names its category, its fix_kind (answer, config_patch or advice) and, for advice, where to make the change (advice_target). evidence_line shows the conversation lines the finding rests on, read from the transcripts when you ask: shown (with line) only to people who may read transcripts (an API key needs conversation:read), withheld otherwise, and gone once the conversations' words are no longer kept. A finding never stores a caller's words.
PUT /v1/optimisation-reviews/{optimisation_review_id}/findings/{optimisation_finding_id}/decision decideOptimisationFinding
Accept, reject or un-decide one finding.
Findings are decided one at a time and nothing is accepted by default. Allowed only while the review is done and its fixes are not yet in a draft (409 optimisation_review_state_conflict otherwise). Writes the audit entry optimisation_finding.decided.
A finding of the kind advice is a change you make yourself: it may be rejected or set back to pending, never accepted (422 optimisation_finding_not_applicable).
Takes a JSON request body.
- 200
- 400
- 401
- 403
- 404
- 409
- 422
- 429
POST /v1/optimisation-reviews/{optimisation_review_id}/publish publishOptimisationReview
Save the accepted fixes as a draft version — a compare-and-set on the live sequence.
Creates a draft; publishes nothing (plan-015 DRF, ADR 0043 — "Create draft vN with N fixes"). Applies the accepted findings, in their position, to the live version's configuration document: an answer is added to the agent's answers (one to a question the agent already answers replaces it); a config_patch may change only the greeting, the opening hours, the overflow and the after-hours behaviour — never the menu or questionnaire, transfers or a transfer number, connections, consent wording, languages, voice or concurrency. The result is validated, its prompt length measured again, and it is inserted as a ready version with no published_at and base_agent_version_id = the live version, provided live_version_seq still equals expected_live_version_seq. The review names the draft from then on.
The live version does not change: there is no agent_version.published outbox message, live_version_seq comes back as it was, and every conversation keeps reaching the live version until somebody who may publish publishes the draft from Versions (publishAgentVersion). Writes the audit entries agent_version.draft_created and optimisation_review.published. The charge is unchanged: the review was charged when it completed, and saving its fixes as a draft moves no money.
A review whose draft was never published and is no longer built on the live version (another version went live meanwhile) may run this again: the same accepted fixes are applied to the current live document and the review names the new draft ("Recreate on the current version"). A draft still built on the live version, or one already published, is 409 optimisation_review_state_conflict.
A live_version_seq that moved since you read it is 409 live_version_seq_stale with nothing saved: reload and decide again, never retry with the same number.
The operationId keeps its earlier name so generated clients do not break.
Takes a JSON request body.
- 200
- 400
- 401
- 403
- 404
- 409
- 422
- 429
POST /v1/public/widget-voice/{widget_key}/grants createWidgetVoiceGrant
Start a voice conversation from a website widget.
Unauthenticated. A real conversation with the widget's agent over wetalk's browser voice relay, billed to the site's owner like any other minute from the moment it is answered, for at most max_duration_second (10 minutes).
Checked in this order; each refusal writes nothing and creates no room: the request's Origin is wetalk's voice frame (403 origin_not_allowed); the body (400 validation_failed); the proof of work — genuine, unexpired, solved and not submitted before (400 proof_of_work_failed); at most ten grants from one network address per hour (429 rate_limited); the widget exists, is on and has voice switched on — one answer for all three (404 widget_voice_disabled); embedding_origin is one of the widget's allowed sites (403 origin_not_allowed); the agent can take the conversation now (503 widget_voice_unavailable — one answer whatever the reason, so a visitor never learns the owner's billing state); when the agent's owner set a limit on conversations per caller, this caller — counted by network address (an IPv6 address by its /64), together with the website chat — is within it (503 widget_voice_unavailable, the same answer; a grant counts as one conversation even if the visitor never connects, and is not counted when the voice could not be started or when it joins a chat already under way); every one of the agent's lines busy (503 all_lines_busy).
Joining the chat. When the visitor is already chatting, the frame sends the chat's single-use join_proof; the voice then joins that conversation instead of starting a new one, after every check above. The agent runtime judges the proof: one it refuses (expired, already used, another widget's or another visitor's) is 503 widget_voice_unavailable like any other reason. Without a proof the grant behaves exactly as before.
An allowed-sites check stops a widget being embedded on another site; it is not authentication. The proof of work, the per-address limit and the agent's own concurrency are the abuse bounds.
Takes a JSON request body.
- 201
- 400
- 403
- 404
- 429
- 502
- 503
GET /v1/public/widget-voice/challenge issueWidgetVoiceChallenge
A fresh proof-of-work challenge for the widget's voice frame.
Unauthenticated. An ALTCHA challenge — the same self-hosted check, key and cost as the public opt-out page (product decision A6) — signed by this API and valid for five minutes. The voice frame solves it and sends the solution as altcha in createWidgetVoiceGrant; each solved challenge is accepted once.
Counted per source address by the API's public limiter, so challenges cannot be stockpiled. Never cached. The body's data is ALTCHA's own challenge shape (camelCase field names — the solver reads exactly these).
GET /v1/sip listSipCredentials
The workspace's SIP credentials, one per VoiceAgent (legacy).
Legacy (P10). The carrier-era per-VoiceAgent SIP credentials. The route stays and answers as before; the Numbers & SIP screen no longer shows them (the customer trunk card, /v1/sip-trunks, replaced the credentials card), and they are not counted in listNumbers.meta.sip_trunk_count.
The password is not on this wire and never will be: secret_ref is a key-store secret NAME. Rotation is POST /v1/agents/{voice_agent_id}/sip/rotation, which is accepted and applied by the worker.
GET /v1/test-allowance getTestAllowance
What is left of today's free test minutes.
An organization that has never paid has a daily allowance of test time (voice tests and text test chats), which renews at midnight Greek time (Europe/Athens). A held organization has none. An organization that has paid tests without limit (unlimited: true). Past the allowance a new test answers 402 test_allowance_used.
POST /v1/test-calls/{conversation_id}/end endTestCall
Hang up a voice test call.
Only a voice test conversation (is_test, medium = voice) of the caller's workspace can be addressed; any other id — a customer's real conversation included — is 404 conversation_not_found. A test call that has already ended is answered with its stored facts (state = ended), so ending twice is harmless. An open one is hung up by the agent_runtime, which holds the carrier leg; the answer is the call as stored at that moment (usually still live — the carrier's hangup ends the row a moment later), so read it again with readTestCall. The API never marks a call ended that it did not end: when the runtime no longer carries the call, or does not answer, it is 503 agent_runtime_unavailable and the row is left as it is. billed_amount is what the billed seconds are worth at the account's rate; charged_amount is what billing charges once the free trial has covered what it covers (review #233); the invoice is the day close (design §7.9).
A browser test (plan-004, since 2026-09-26) is ended through the agent_runtime's WebRTC leg, not a carrier: an open conversation on the agent's browser binding, or — in the seconds before the runtime opens its row — a test the caller started a moment ago (state = ended, end_reason = caller_hangup, nothing billed). Another member's just-started browser test is 404, as an unknown id is.
A test call on a trunk number (plan-008, since 2026-09-30) is ended through the trunk's own end route, as endSipTrunkTestCall ends it. A call the tester placed into a trunk number has no end route: 422 validation_failed — hang up on the phone.
- 200
- 400
- 401
- 403
- 404
- 422
- 429
- 503
GET /v1/test-calls/availability readTestCallAvailability
What can be tested right now, and why not.
Read when the Test console or a Test tab opens, so a test that cannot run is said before anyone types or presses a button. model_running is false outside the model pool's scheduled windows; direction_available lists the voice test directions that can be placed (dialling in only: the platform places no outbound calls yet); message says why something cannot run, in words for a person. country_calling_code is the account's own (+30), for the phone field's example. browser_test_call_available (plan-004) says whether a browser test can start — the runtime answered, the model is running and wetalk's browser voice relay is reachable — with browser_test_call_message saying why not.
GET /v1/workspace/shared-agent-configurations listSharedVoiceAgentConfigurations
The shared agent configurations this workspace may start a new agent from.
plan-014 (B5's hand-off): every agent configuration another workspace of the organization shared, that this workspace accepted and has not copied yet, while the share stands and both workspaces are active — exactly what createVoiceAgent accepts as resource_share_id. Each carries the pinned version's kind of agent, languages, voice, greeting, recording switch and concurrency, which the wizard starts from. Calls, recordings, numbers and documents never travel with a configuration. Owner or Admin, like creating an agent.
Billing
GET /v1/billing-accounts/{billing_account_id}/postpaid getPostpaid
A balance's postpaid contract, what it owes and what is still available.
The credit limit wetalk approved, owed now (billed on unpaid monthly invoices plus usage not billed yet, open conversations included — nothing counted twice), still available (the live balance plus the credit limit and overage; new paid conversations stop at zero), the terms (invoice due 14 days after the month ends, card or bank transfer), the "if a payment fails" schedule (due date, +7, +14), each unpaid invoice with its collection steps, the last invoice settled and the collection state. A prepaid balance answers contract: null. Reading never advances anything. Needs account.finance.read over the balance.
POST /v1/billing-accounts/{billing_account_id}/postpaid/pay payPostpaid
Pay an unpaid postpaid invoice by card — open the processor's payment page.
Starts a statement_payment billing operation for the invoice's gross (frozen at the month's close) and answers with the hosted payment page to send the person to (next_action), or hands back the page an open payment of the same invoice already waits on. Never a second attempt (409 payment_pending); an invoice already paid or with nothing due is 409 operation_state_conflict; a contract paid by bank transfer only is 409 conflict. The outcome arrives from the processor; this answer reports nothing. Needs account.finance.manage.
- 202
- 400
- 401
- 403
- 404
- 409
- 429
POST /v1/billing-accounts/{billing_account_id}/refund-requests createRefundRequest
Ask for unused purchased credit back; a finance operator decides.
A draft refund operation awaiting an operator with finance rights (owner decision OD-13). Approved, the credit goes back to the original cards, newest purchase first, the remainder by bank transfer. One request may wait per balance (409 operation_conflict); more than is refundable is 422 refund_not_refundable.
- 200
- 202
- 400
- 401
- 403
- 404
- 409
- 422
- 429
GET /v1/billing-accounts/{billing_account_id}/refundable getRefundable
Unused purchased credit on a balance.
POST /v1/billing-operations/{billing_operation_id}/pay payOperation
Pay now — open (or re-open) the processor's payment page.
Confirms an automatic top-up waiting for a click (collection mode hosted_notification) or hands back the page an operation already waits on. Never a second attempt for an operation that has one (409 payment_pending).
GET /v1/billing-operations/{billing_operation_id}/payment getOperationPayment
What a billing operation is waiting on, and how to resume it.
Reads, never advances: a page the person returns to from the processor reads this. "Waiting on the bank" (an unknown outcome being looked up) and "paid, not applied" (resumed exactly once) are named.
POST /v1/billing-subscriptions/{billing_subscription_id}/card-replacement replaceSubscriptionCard
Replace the card a running plan is charged to.
plan-020 API-CARD (design §32.6.6; ED-23). The new card is charged once with the token of the form opened by POST /v1/billing/payment-methods/subscription-form (purpose: card_replacement), behind the person's agreement to the recurring terms (consent; 422 subscription_consent_missing unless agreed to the current words). While the renewal waits for the person, the charge is the renewal's payment (an open payment page is cancelled and confirmed first; one found paid pays the renewal and nothing is charged — 409 operation_state_conflict, open the form again). Otherwise the form's credit-pack quote is confirmed (billing_quote_id, amount_due_minor; 409 quote_mismatch when they are not the form's). On a captured charge the card is kept from the processor's own answer and the plan is charged to it from now on, in the same db_transaction; the old card's mandate is never charged again and is revoked at the processor. A declined card changes nothing. 409 subscription_renewal_unresolved while a renewal charge's outcome is being looked up; 409 operation_state_conflict for a plan that is no longer running.
`Idempotency-Key` is required. Needs account.finance.manage over the plan's balance, as a purchase. Signed-in people only. A cookie request carries X-WeTalk-Csrf.
Takes a JSON request body.
- 200
- 400
- 401
- 403
- 404
- 409
- 422
- 429
GET /v1/billing/auto-reload getAutoReloadPolicy
The automatic top-up rule.
An account with no policy is not a 404 — configured: false is a real state and the screen renders the switch as off.
PUT /v1/billing/auto-reload putAutoReloadPolicy
Set the automatic top-up rule.
A change to an existing policy names the revision it read in If-Match (400 validation_failed without it) and is refused 409 revision_stale when the policy changed since — two saves from one revision cannot both win (plan-014 review I-9, 2026-10-06). A first save needs none; if another first save got there first it is refused 409 revision_stale too. One policy per balance (migration 0114).
Takes a JSON request body.
GET /v1/billing/balance getBillingBalance
The balance, and what is actually left to spend.
Returns the settled balance and the live one. They answer different questions: the settled figure is what has been charged and paid, the live figure subtracts today's unbilled seconds and what open conversations have reserved, and it is the figure the hard stop is evaluated against.
AMENDED 2026-10-11 (plan-017): also the organization's talk rates in force (talk_rates, the figures GET /v1/talk-rates answers), every scheduled change with its start (upcoming_talk_rate_change) and the highest rate in force. talk_rate_minor_per_minute is deprecated: it is the rate for calls to a wetalk number.
GET /v1/billing/budget getBudget
The workspace's spend controls.
The monthly budget, the percentage that sends the warning, and the hard stop. An unconfigured workspace answers configured: false with a null budget rather than a 404: "no budget has been set" is a state the screen renders, not a missing resource.
PUT /v1/billing/budget putBudget
Set the monthly budget, the alert percentage and the hard stop.
The hard stop is an instruction, not a verdict. Writing it records that agents should stop answering rather than overspend; whether they have is decided on every admission by billingRefusalOf against design §7.9's live balance — the settled balance less today's unpriced seconds less what conversations in flight may still cost. Freezing that judgement at write time would use a number that is stale by the next call.
Takes a JSON request body.
GET /v1/billing/charge-attempts listChargeAttempts
Recent charge attempts, newest first.
What the declined banner is made of. It is a separate read from the balance on purpose: "your card was declined" and "you are out of credit" are different states with different remediations, and a funded account can be in the first without being in the second — state on the balance cannot express it, because a decline is a fact about a card rather than about the live balance.
requires_reauth and declined are distinct: one asks the cardholder to authenticate again, the other asks for a different card. ambiguous means the outcome is unknown and the reconciliation poller owns it — it never means "retry".
GET /v1/billing/funding getWorkspaceFunding
Which balance pays for the open workspace, since when, and what the person may do with it.
The balance in force for the open workspace (scope account is the organization's shared balance, workspace its own), the start of its unbroken run on that balance (since; null for a workspace not moved to effective-dated funding yet), and the workspaces the balance pays for — named only for someone who may read the organization's workspaces (funded_workspace_names_complete), otherwise the count and the open workspace alone.
finance_access is what the person may do with the balance: manage or read (organization Owner, Admin or Finance, or the delegate of a dedicated balance) or none — a workspace member without it sees the workspace's spend only, and the balance's payment methods, automatic top-up, charge attempts, invoices and ledger answer 403 capability_missing.
GET /v1/billing/invoices listInvoices
The issued invoices, newest period first.
blob_name is the stored reference, not a URL. Handing out a signed link is an access grant and belongs to the download route, not to a listing.
GET /v1/billing/ledger listLedgerEntries
Transactions — every money movement, newest first.
Cursor-paginated on sequence, which is monotonic per billing account. Never offset-paginated: the ledger is append-heavy, and an offset page recomputes its own start on every request, so a row inserted mid-paging produces a duplicate or a skip.
GET /v1/billing/payment-methods listBillingPaymentMethods
Saved cards — brand, expiry and the last four digits.
DELETE /v1/billing/payment-methods/{payment_method_id} deleteBillingPaymentMethod
Remove a saved card.
The row is stamped rather than deleted, so a historical payment still resolves to the card it was made against. Removing the default promotes the most recently added remaining card.
plan-020 API-CARD (design §32.6.6): the card a running plan (active, past_due, suspended) is charged to is never just removed — 409 payment_method_in_use_by_subscription with error.detail.billing_subscription_id, so the console can offer "Replace card" (POST /v1/billing-subscriptions/{billing_subscription_id}/card-replacement). A card an enabled automatic top-up charges needs replacement_payment_method_id (409 payment_method_in_use otherwise). A removed card's mandate is never charged again, and is revoked at the processor too.
POST /v1/billing/payment-methods/{payment_method_id}/default setBillingDefaultPaymentMethod
Make this card the default.
POST /v1/billing/payment-methods/card-purchase completeCardPurchase
Buy the credit pack with the form's token, and keep the card.
Charges the single-use token the processor's form produced for the amount of the quote the form was opened for (billing_quote_id: the pack's net + VAT, FIX-MONEY C1) — never an amount computed from the request; a form amount (amount_due_minor) that is not that quote's total is 409 quote_mismatch and nothing is charged — through the same charge-intent ledger every top-up uses. On success the account is credited and the card is stored from the processor's own answer: its stored-customer token, card token, mandate, brand, expiry, holder name and last four digits. Nothing card-shaped is ever accepted from the request; card_token must be the form's ctn_ token, and a stored customer or card token is refused.
Idempotency-Key is required. The reference is generated before the call and gives duplicate *rejection*, not idempotency: when the outcome is unknown the processor is asked what happened to that same reference, once, and if it still cannot say, the answer is pending_reconciliation — never a second charge.
Takes a JSON request body.
POST /v1/billing/payment-methods/hosted-form createHostedCardForm
What the payment form opens with, to add a card by buying credit.
A card is added by buying credit (product decision 2026-09-23). The processor documents no card-saving mode without a payment: its hosted Payform needs an amount, and the authorisation an automatic top-up charges later (the mandate) is issued only by a real first payment made from a form opened with frequency_type: recurring.
Name one of the credit packs; the answer carries the amount in integer minor units, the processor's public key, the processor's own script and the frequency type. The amount is the server's — there is no amount in the request. Nothing is charged: the browser mounts the processor's form with these values, the cardholder enters the card there (never into wetalk), and the form hands back a single-use token for completeCardPurchase.
AMENDED 2026-10-06 (FIX-MONEY C1): prices exclude VAT (OD-8), so the pack is NET credit and this route writes one row — a top_up quote of the pack's net + VAT (billing_quote_id, net_minor, tax_minor, the total). The form opens, and 3-D Secure authenticates, that total; the console shows net, VAT and total first. 409 terms_acceptance_required until an Owner or Finance member has accepted the purchase terms (PD-8); 422 legal_profile_required without the organization's legal details; 503 tax_rate_unset when no VAT rate is in force for the payer's treatment.
The free trial minutes need no card.
Takes a JSON request body.
POST /v1/billing/payment-methods/subscription-form createSubscriptionCardForm
What the payment form opens with, to pay a plan or replace a plan's card.
plan-020 API-CARD (design §32.6.1, §32.6.4, §32.6.6). A plan's card is always established by a new cardholder-initiated recurring charge: the console mounts the processor's Payform with these values (frequency_type: recurring; the form enables Pay only once a mobile number is entered, phone_required), the cardholder enters the card there — never into wetalk — and the form's single-use ctn_ token is sent with the confirm (card_token) or with the card replacement. The amount is the server's:
- { billing_quote_id }: a plan purchase, upgrade or reactivation quote with something due — its total (net + VAT). 410 quote_expired once the quote has expired; 400 for any other quote, or one with nothing due. - { purpose: card_replacement, billing_subscription_id } while the plan's renewal waits for the person: the renewal's amount due (the replacement charge pays the renewal, establishment: renewal_payment); 409 subscription_renewal_unresolved while a renewal charge is still being made or looked up. - the same with nothing due: a top_up quote of the smallest credit pack (net + VAT, establishment: credit_pack), credited to the balance as purchased credit — a mandate exists only after a captured charge.
Needs account.finance.manage over the balance, as a purchase. Signed-in people only (403 scope_insufficient to an API key). A cookie request carries X-WeTalk-Csrf.
Takes a JSON request body.
- 200
- 400
- 401
- 403
- 404
- 409
- 410
- 429
POST /v1/billing/top-ups createTopUp
Buy credit with a saved or newly entered card.
The body carries a token the hosted payment form produced — card data never reaches wetalk, which is what keeps PCI scope at SAQ A.
A reference is generated deterministically from the account and the attempt before the call and is reused on any retry. It gives duplicate *rejection*, not idempotency: an error outcome means the result is unknown and must be looked up, never that the charge can be tried again.
AMENDED 2026-10-06 (FIX-MONEY C1): amount_minor is the NET credit; the card is charged the net + VAT of the quote the card form was opened for (billing_quote_id, amount_due_minor — createHostedCardForm). A form amount that is not that quote's total is 409 quote_mismatch and nothing is charged.
Takes a JSON request body.
GET /v1/billing/usage listBillingUsage
Talk time, summed per VoiceAgent per day.
The roll-up FR-BIL-1 asks for. Seconds are summed per (voice_agent, day, medium, is_test) and priced once, at day close — which is what stops a hundred and forty-two separate roundings accumulating into a balance that does not reconcile.
AMENDED 2026-10-11 (plan-017): and per rate — each conversation is priced at the rate it was pinned at when it was admitted (a test: free), so a day with a rate change has one row per rate (talk_rate_minor_per_minute). Conversations before the talk rate change-over keep the price book rate.
POST /v1/billing/webhooks/everypay/new-payment receivePaymentWebhookNewPayment
The payment processor's "new payment" webhook.
The processor posts the bare payment object here when a payment is created on the billing merchant. The route is the event kind; nothing in the body is read to decide it.
Public: the credential is the signature. X-Signature-SHA256 is base64(hmac_sha256(raw body, secret)) and is verified against the raw bytes, constant-time, before any JSON parsing. A request from an address outside the processor's documented list is refused with 403 and nothing is written. Every other request is recorded with its raw bytes and its verdict, including a forged one, which is acknowledged with 200 and processed by nothing.
Nothing depends on this endpoint being reached. The processor's retry behaviour is undocumented, so a reconciliation poller closes every payment from wetalk's own side as well. A webhook is a trigger, never a fact.
Takes a JSON request body.
POST /v1/billing/webhooks/everypay/notification-expired receivePaymentWebhookNotificationExpired
The payment processor's "notification expired" webhook.
The processor posts the bare payment notification object here when one lapses unpaid. Verification, the address check and the acknowledgement are exactly those of the "new payment" route.
Takes a JSON request body.
POST /v1/billing/webhooks/everypay/notification-paid receivePaymentWebhookNotificationPaid
The payment processor's "notification paid" webhook.
The processor posts the bare payment notification object here when one is paid; its payment field names the payment as a token string. Verification, the address check and the acknowledgement are exactly those of the "new payment" route.
Takes a JSON request body.
POST /v1/billing/webhooks/everypay/refund receivePaymentWebhookRefund
The payment processor's "refund" webhook.
The processor posts here when a payment on the billing merchant is refunded. Its body is undocumented, so it is read as a trigger only: the worker re-reads the payment's refunds from the processor before it records anything. Verification, the address check and the acknowledgement are exactly those of the "new payment" route.
Takes a JSON request body.
GET /v1/online-payment/status readOnlinePaymentStatus
Whether callers are offered online payment now, and what is missing.
For the new-agent wizard's payment step and the voice agent's Payments setting. mode is the account's online-payment mode, which only wetalk sets (off until then). offered_to_callers is whether a phone caller in a real conversation would be offered online payment now; offered_in_web_chat the same for a website widget. missing lists, in the order someone has to act, what stands in the way: mode_off (wetalk has not enabled it), merchant_binding (wetalk's payment merchant is not yet in the mode this account needs), destination and destination_unverified (a payout destination, verified by wetalk, is required for pilot and live; a sandbox account needs none), general_live (real-money payments are not yet open to every account) and sms_unavailable (no SMS sender, so phone callers cannot get a link). Whether the shop accepts online payment and whether a language has the payment words are the voice agent's own settings and are not judged here.
GET /v1/payouts readPayoutStatement
The payable statement for one book and one period.
What wetalk owes the shop for its paid online orders, for the live book (or, marked "Sandbox" in the console, the sandbox book, which is never paid out). The period is whole days in Europe/Athens, the time zone every payout cut-off uses.
balance is the book now: held_minor is still inside the holding period (each held credit is listed with its release_at), available_minor is what a payout may take. On the live book holds says what holds the next payout and why, and next_payout is the next cut-off and the amount expected at it (0 while anything holds it). entries is the period's ledger in order; an order line reads gross · wetalk fee absorbed · commission 0 · net = gross. opening_balance_minor + entry_total_minor = closing_balance_minor, and the closing balance is the book's balance at the end of the period. More than 5000 entries in the period is 422 export_too_large; choose a shorter period.
Owners, Admins and Viewers read it; Members do not.
GET /v1/payouts/destination readPayoutDestination
Where payouts go, masked.
null until the Owner adds one. The IBAN is shown as its last four characters and the tax identifier as its last three; the full values are never returned. verified turns true once wetalk has checked the destination; a changed destination is unverified again, and payouts wait until hold_until. Owners and Admins, signed in; never an API key.
PUT /v1/payouts/destination setPayoutDestination
Change where payouts go (the Owner, with a fresh step-up).
Owner only, signed in, and within a few minutes of re-entering a password, an authenticator code or a passkey (POST /v1/session/step-up): otherwise 401 step_up_required. Refused 403 step_up_unavailable while wetalk support is acting as a member, and 403 for any other role or an API key. The IBAN must belong to a SEPA country and pass its check digits; a BIC is required only outside the EEA; a Greek tax identifier is the 9-digit ΑΦΜ. An invalid field is 422 payout_destination_invalid naming the field — the value is never echoed.
The IBAN is kept in wetalk's payout key store, never in the database: the answer carries its last four characters. The new destination is unverified until wetalk checks it, and payouts wait for the destination-change hold (hold_until). Audited as payout_destination.changed.
Takes a JSON request body.
- 200
- 400
- 401
- 403
- 422
- 429
- 502
GET /v1/payouts/export.csv exportPayoutStatement
The period's payable entries as a spreadsheet.
The same entries as GET /v1/payouts, one row each, built when asked and never stored: UTF-8 with a byte-order mark, CRLF records, amounts as signed decimals in euros. A text field beginning =, +, - or @ is prefixed with a single quote.
GET /v1/public/pricing getPublicPricing
The prices the website shows — pay as you go and the plans on sale.
Unauthenticated. Pay as you go (the standard talk rate of each kind and its calls at once), every plan on sale now with its fee, included talk time, calls at once, its own talk rates and its name and tagline in English and Greek, the free trial's talk time, the highest calls at once listed, and whether plans can be bought now (sale_open). Never an organization's own rate, and never a private or custom offer.
Computed at the request's instant, so a scheduled change never shows before it starts. Cached briefly: Cache-Control: public, max-age=60 at most, cut to the seconds left until the next change. Rate-limited per source address. The public site's origin may read it cross-origin, without credentials.
All or nothing: when any part is incomplete the answer is 503 configuration_missing, never a partial figure.
GET /v1/public/talk-rates getPublicTalkRates
The standard talk rates — what the website shows.
Unauthenticated. The standard talk rate of each kind of connection in force now — never an organization's own rate. all_equal is true while every kind costs the same, when the website shows one figure (the rate a minute and the same rate an hour); once they differ it shows one line per kind.
Computed at the request's instant, so a scheduled change never shows before it starts. Cached briefly: Cache-Control: public, max-age=60 at most, cut to the seconds left until a scheduled change starts, so a cached answer is not served past it. Rate-limited per source address. The public site's origin may read it cross-origin, without credentials.
GET /v1/quota-requests listQuotaRequests
This workspace's requests for more concurrent conversations, newest first.
POST /v1/quota-requests requestConcurrencyQuota
Ask wetalk for more concurrent conversations.
Records a quota_request (state: pending) and an audit entry (billing.quota_requested) in one db_transaction. An operator reads pending requests from the staff API and raises the account's ceiling; nothing changes until they do.
Takes a JSON request body.
GET /v1/talk-rates getTalkRates
The organization's talk rates, the upcoming changes and the highest rate.
What the organization pays for talk time, per kind of connection: calls to a wetalk number (carrier_leg_inbound), calls from a wetalk number (carrier_leg_outbound), calls on the organization's own SIP trunk (sip_trunk_inbound) and out over it (sip_trunk_outbound), website voice (browser) and web chat (text). Each rate is the organization's own when it has one (source: account), otherwise its plan's rate when its terms are a plan (source: offer, ADDED 2026-10-16, plan-020), otherwise the standard rate (source: standard). A kind with no price is absent, never defaulted. Tests are free and are not priced here.
upcoming_talk_rate_change lists every scheduled change with its start, earliest first; a change leaves the list when it starts. highest_talk_rate_minor_per_minute is the highest rate in force — the one "about N minutes of credit" and the low-balance line are counted at.
Readable by every member of the organization — an organization role or a workspace role of any kind — by a workspace API key, and by an organization key holding billing:read. The organization is the one the caller acts in; the path names none.
account
GET /v1/accounts listAccounts
The organizations the signed-in person may enter.
Plan-014 B1 (design §27.9.2). Every organization the person holds an organization role in, or a workspace membership in, with that role and the workspaces they may open (enterable is false for a workspace that is not active). Read through account_access_for_person (migration 0078); another person's organizations are never listed. An unscoped or account-only auth_session is the normal caller.
GET /v1/accounts/{account_id} getAccountProfile
The organization's profile.
Plan-014 B2. Name, state, country, default language, the billing timezone in force and any change waiting for its billing month, and the revision the next change must name (ETag carries it too) — with what the Overview shows beside it: every workspace's metadata (account.workspace_metadata.read; never its content), how many people have access and how many hold an organization role, and the number of balances (null unless the caller holds account.finance.read). Capability account.profile.read — every organization role. Refusals: 403 capability_missing (a workspace member with no organization role), 404 not_found, the 401s, 429 rate_limited.
PATCH /v1/accounts/{account_id} updateAccountProfile
Rename the organization or change its default language.
Plan-014 B2. If-Match: "<revision>" is required (409 revision_stale when the organization changed since it was read). Capability account.profile.write — Owner, Admin. The billing timezone is changed by scheduleAccountBillingTimezone, never here. Audited (account.profile_changed).
Takes a JSON request body.
- 200
- 400
- 401
- 403
- 404
- 409
- 429
POST /v1/accounts/{account_id}/allowed-networks createAccountAllowedNetwork
Allow console sign-in from a network range.
Plan-014 C2 (FR12-SEC-04/06). Console sign-in only: API keys carry their own network rules, and calls and webhooks are unaffected. A range written with host bits is normalised to its network. The change bumps the policy revision (every auth_session is judged again on its next request) and applies from the next request; one that would leave the address wetalk sees for this browser outside every range is refused 409 sign_in_policy_lockout; an active duplicate is 409 conflict. Capability account.sign_in_policy.write with a fresh step-up. Audited (allowed_network.added).
Takes a JSON request body.
- 201
- 400
- 401
- 403
- 404
- 409
- 429
DELETE /v1/accounts/{account_id}/allowed-networks/{account_allowed_network_id} deleteAccountAllowedNetwork
Remove an allowed network range.
Plan-014 C2. Bumps the policy revision. Refused 409 sign_in_policy_lockout when the ranges left would not contain the address wetalk sees for this browser. Capability account.sign_in_policy.write with a fresh step-up. Audited (allowed_network.removed).
GET /v1/accounts/{account_id}/audit-entries listAccountAuditEntries
The organization's audit log, newest first.
Plan-014 C4b (FR12-SEC-08). Every entry of the organization — each workspace's, the organization's own and its balances' — from the last retention_month calendar months, newest first, with the workspace log's filters plus scope and workspace_id. account.audit.read (Owner, Admin) reads every entry; account.audit.financial_read alone (Finance) reads only the entries the catalogue marks as financial, in the page, the count and the export alike, and the answer says so (finance_only). Served with the organization alone open. Never an API key.
POST /v1/accounts/{account_id}/audit-entries/exports exportAccountAuditEntries
- signed-in person only
- heavy
Export the organization's audit log as a CSV.
Plan-014 C4b. The organization log's export, bounded and audited exactly as the workspace log's: the count first (422 export_too_large over WETALK_API_EXPORT_MAX_ROW, naming it), then audit_entry.exported written before the rows are read, then the file and a short-lived link. Finance exports the financial entries only. Until the organization has a file location of its own the file is filed under the workspace the person has open, so a session with the organization alone open is refused 409 scope_required.
Takes a JSON request body.
- 201
- 400
- 401
- 403
- 404
- 409
- 422
- 429
POST /v1/accounts/{account_id}/billing-timezone scheduleAccountBillingTimezone
Change the billing timezone from the next billing month.
Plan-014 B2 (design §27.8.5; owner input 12). The change applies from the start of the next billing month in the zone in force now (effective_from) and never rewrites a period already open; naming the zone in force withdraws a pending change. If-Match: "<revision>" is required. Capability account.finance.manage — Owner, Admin, Finance. Refusals: 400 time_zone_invalid, 409 revision_stale, 403 capability_missing. Audited (account.billing_timezone_scheduled).
Takes a JSON request body.
- 200
- 400
- 401
- 403
- 404
- 409
- 429
GET /v1/accounts/{account_id}/closure-preflight getAccountClosurePreflight
What blocks closing the organization, what is refundable, and what is kept.
The Owner's read (account.close; a stale step-up is enough to read). blocker[] lists each thing that stops a closure now — a conversation in progress, an unpaid statement, a balance below zero, a payment still processing, a payout obligation — each with what to do about it. refundable[] is each balance's unused PURCHASED credit (trial and promotional credit are never refunded, and are used first). retention states the owner's figures: content is deleted content_purge_after_day days after access ends (the undo grace), financial records are kept financial_keep_year calendar years after closure. latest_closure is the most recent closure, whatever its state.
POST /v1/accounts/{account_id}/closures startAccountClosure
Start closing the organization (asynchronous).
The Owner only (account.close), with a fresh step-up (step_up_required otherwise) and never a wetalk operator acting as a member. Blockers are stored and answered 409 closure_blocked with error.detail.blocker[]. Otherwise the organization becomes closing — no new conversations or purchases — and the closure walks drain → refunds decided → plan and postpaid terms ended → access revoked → the grace → content purged → closed; follow status_url. refund_choice is refund (one refund request per balance, each approved by a finance operator), waive (with refund_waiver, the owner's own words) or none (when nothing purchased is unused). Closing this organization never removes the person's memberships in others.
Takes a JSON request body.
- 200
- 202
- 400
- 401
- 403
- 404
- 409
GET /v1/accounts/{account_id}/closures/{account_closure_operation_id} getAccountClosure
A closure's durable status.
POST /v1/accounts/{account_id}/closures/{account_closure_operation_id}/undo undoAccountClosure
Undo a closure during its grace (the former Owner).
An identity entry point: after access ended the former Owner holds no membership, so the auth_session cookie is presented to this route itself (with X-WeTalk-Csrf). Only the person who asked for the closure may undo it, only during the grace (409 operation_state_conflict otherwise); anyone else's closure is 404. The organization returns to its prior state with the former Owner as its Owner and as the Owner of the workspaces the closure archived; nobody else's access returns, and keys, numbers and campaigns stay off.
POST /v1/accounts/{account_id}/closures/{account_closure_operation_id}/withdraw withdrawAccountClosure
Withdraw a closure before access is being revoked.
Allowed while the closure is draining, refunding or ending the plan (409 operation_state_conflict after). The organization returns to the state it had; refund requests not yet decided are cancelled. Campaigns and automatic top-ups stay off until someone starts them again.
GET /v1/accounts/{account_id}/invitations listAccountInvitations
The organization's invitations, every state, newest first.
Plan-014 B2 (FR12-TEAM-05). Pending, expired, revoked, superseded and accepted invitations — the console shows them apart from the members. Capability account_membership.read.
POST /v1/accounts/{account_id}/invitations createAccountInvitation
Invite someone into the organization.
Plan-014 B2 (FR12-TEAM-01/02). Offers an organization role (Admin, Finance or Viewer — never Owner, 403 owner_change_forbidden), named workspace roles in live workspaces of this organization, or both; the offer is frozen — a workspace created later is never in it. Only an Owner of the organization may offer the workspace Owner role. The link lives for the configured lifetime (7 days). One pending invitation per address (409 conflict); someone who already holds an organization role is refused rather than invited twice. Capability account_membership.invite — Owner, Admin. delivery says whether the invitation was emailed or — while no email sender is bound — its invitation_path is returned ONCE for the inviter to pass on. Audited (account_invitation.sent).
Takes a JSON request body.
- 201
- 400
- 401
- 403
- 404
- 409
- 429
POST /v1/accounts/{account_id}/invitations/{account_invitation_id}/resend resendAccountInvitation
Resend an invitation with a fresh link; the old link stops working.
Plan-014 B2 (FR12-TEAM-03). A pending or expired invitation is superseded and a new one with the same frozen offer is issued in the same database transaction. An accepted, revoked or superseded one is 409 conflict. Capability account_membership.invite. Audited (account_invitation.resent).
POST /v1/accounts/{account_id}/invitations/{account_invitation_id}/revoke revokeAccountInvitation
Revoke a pending invitation.
Plan-014 B2 (FR12-TEAM-03). Only a pending invitation; anything else is 409 conflict. Capability account_membership.invite. Audited (account_invitation.revoked).
GET /v1/accounts/{account_id}/members listAccountMembers
Everyone with access to the organization, with their roles.
Plan-014 B2 (FR12-TEAM-01). One row per person holding an organization role, workspace roles, or both: the organization role and its revision, each workspace role with the workspace's name, how they sign in (which kinds exist — never a credential) and when they were last seen here. Capability account_membership.read — Owner, Admin.
DELETE /v1/accounts/{account_id}/members/{account_membership_id} removeAccountMember
Remove someone's organization role.
Plan-014 B2 (FR12-TEAM-04, FR12-AUTH-08). Ends the ORGANIZATION role — a state, never a deletion; the person and their workspace roles are untouched (the two memberships are independent). If-Match is required. Capability account_membership.remove: an Admin never removes an Owner (403 owner_change_forbidden); the last active Owner is never removed (409 last_owner_protected). Audited.
- 204
- 400
- 401
- 403
- 404
- 409
- 429
PATCH /v1/accounts/{account_id}/members/{account_membership_id} updateAccountMember
Change someone's organization role.
Plan-014 B2 (design §27.5.2; FR12-AUTH-08). If-Match: "<revision>" names the membership's revision. Capability account_membership.role_change. Nobody is changed TO Owner (ownership is transferred); an Admin changes non-owner members only and never raises their own role (403 owner_change_forbidden); the last active Owner is never demoted (409 last_owner_protected, judged under a lock on every active Owner row). The person's open pages re-read where they may go at their next request. Audited.
Takes a JSON request body.
- 200
- 400
- 401
- 403
- 404
- 409
- 429
POST /v1/accounts/{account_id}/ownership-transfers transferAccountOwnership
Transfer ownership of the organization.
Plan-014 B2 (FR12-AUTH-08). Capability account.ownership.transfer — Owner only — with a fresh step-up (401 step_up_required otherwise). The new Owner must already be an active member of the organization (400 validation_failed) with a verified email (403 invitation_identity_mismatch). In one database transaction, under a lock on every active Owner row, the target becomes Owner and the caller keeps former_owner_role: concurrent transfers end in exactly one Owner outcome and never in none. Accepts Idempotency-Key. Audited (account.ownership_transferred).
Takes a JSON request body.
- 200
- 400
- 401
- 403
- 404
- 409
- 429
GET /v1/accounts/{account_id}/resource-shares listAccountResourceShares
What is shared between this organization's workspaces, and what the caller could share.
Plan-014 B5. An Owner or Admin of the organization (account.resource_share.read) sees every share; a person without it who holds resource_share.publish or resource_share.accept in some workspace sees only the shares touching those workspaces (a sibling's use of an open offer stays the sibling's). Each share names its revision, from → to, its state and every acceptance with the VoiceAgent versions that use it. shareable lists what the caller could publish (the live agents and their documents in the workspaces where they may publish); do_not_call is the always-combined list's size.
GET /v1/accounts/{account_id}/security getAccountSecurity
The organization's sign-in policy, verified domains and allowed networks.
Plan-014 C2. The enforced policy and any draft, policy_revision (what the next change names in If-Match, 0 while nothing is enforced), every verified domain with the TXT record to publish, the active allowed ranges, the address wetalk sees for this browser (from its own proxy, never a header the browser wrote) and whether the ranges contain it, and the lockout preflight of each policy — who would be affected and whether an Owner keeps a tested way in. Capability account.security.read.
PUT /v1/accounts/{account_id}/sign-in-policy updateAccountSignInPolicy
Set how people sign in.
Plan-014 C2 (FR12-SEC-04/06). If-Match: "<policy_revision>" names the enforced revision the change was based on ("0" for none; 409 revision_stale when it moved). Enforcing supersedes the previous policy, draws the next revision and is judged on every auth_session's next request; a policy that would leave no Owner a tested way in is refused 409 sign_in_policy_lockout and nothing is saved. Single sign-on only while no domain is verified is saved as a DRAFT (state: draft, draft_reason: sign_in_policy_domain_unverified) and asks nothing of anyone. Saving the policy already enforced changes nothing (unchanged: true). Capability account.sign_in_policy.write with a fresh step-up. Audited (account.sign_in_policy_changed).
Takes a JSON request body.
- 200
- 400
- 401
- 403
- 404
- 409
- 422
- 429
POST /v1/accounts/{account_id}/sign-in-policy/preflight previewAccountSignInPolicy
Who a sign-in policy would affect, before anything is saved.
Plan-014 C2 (FR12-SEC-04). The lockout preflight for one choice: the people affected (asked to add an authenticator, out of recovery codes, or losing access because they cannot sign in with single sign-on on a verified domain) and whether at least one Owner keeps a tested way in. Saves nothing. Capability account.security.read.
Takes a JSON request body.
GET /v1/accounts/{account_id}/terms-acceptance readAccountTerms
The purchase terms in force for an organization, and whether it accepted them.
Plan-014 (E4's hand-off; design §27.8.15; PD-8). The purchase terms revision in force, its terms and privacy documents, whether the organization has accepted that revision, and whether the signed-in person may accept it (an Owner or a Finance member). The Plans page reads it before "Confirm and pay", which sends the revision as terms_revision. Any person who can enter the organization reads it. Refusals: 404 not_found (an organization the person cannot enter); the three 401s; 429 rate_limited.
POST /v1/accounts/{account_id}/terms-acceptance acceptAccountTerms
Accept the terms in force for an organization's purchases.
Plan-014 B1 (design §27.8.15; owner decision PD-8). An Owner or a Finance member of the organization accepts the terms revision in force; until one has, a purchase is refused 409 terms_acceptance_required. Recorded with the person and the time, and audited; accepting a revision the organization already accepted changes nothing.
Requires X-WeTalk-Csrf. Refusals: 409 terms_acceptance_required (the revision is not the one in force — reload); 403 capability_missing (no Owner or Finance role here); 404 not_found (an organization the person cannot enter); 400 validation_failed; 403 impersonation_forbidden; the three 401s; 429 rate_limited.
Takes a JSON request body.
- 204
- 400
- 401
- 403
- 404
- 409
- 429
POST /v1/accounts/{account_id}/verified-domains createAccountVerifiedDomain
Add a domain to verify.
Plan-014 C2 (FR12-SEC-05). The domain is added pending with a fresh challenge: publish txt_value as a TXT record at txt_name, then verify. 409 conflict when this organization already lists it. Capability account.sign_in_policy.write with a fresh step-up. Audited (verified_domain.added).
Takes a JSON request body.
- 201
- 400
- 401
- 403
- 404
- 409
- 429
DELETE /v1/accounts/{account_id}/verified-domains/{sso_domain_id} deleteAccountVerifiedDomain
Remove a domain.
Plan-014 C2. Refused 409 sign_in_policy_lockout for the last verified domain while single sign-on only is enforced, and 409 conflict for the last proven domain of an enforced single sign-on provider. Capability account.sign_in_policy.write with a fresh step-up. Audited (verified_domain.removed).
PUT /v1/accounts/{account_id}/verified-domains/{sso_domain_id}/auto-join updateAccountVerifiedDomainAutoJoin
Who may join without an invitation, and where.
Plan-014 C2 (FR12-SEC-05). People with an address on the domain may join while it is verified — always in a limited workspace role (viewer, member, developer, campaign_manager or billing; never owner or admin) and only in the active workspaces named. member_role: null turns it off. 422 validation_failed for another role or a workspace that is not an active workspace of this organization. Capability account.sign_in_policy.write with a fresh step-up. Audited (verified_domain.auto_join_changed).
Takes a JSON request body.
- 200
- 400
- 401
- 403
- 404
- 422
- 429
POST /v1/accounts/{account_id}/verified-domains/{sso_domain_id}/verify verifyAccountVerifiedDomain
- signed-in person only
- heavy
Verify now — check the domain's TXT record.
Plan-014 C2 (FR12-SEC-05, ED-3). One DNS check on wetalk's own resolver. outcome: found verifies the domain (from pending, or again from lapsed) and schedules its daily recheck; not_found_yet leaves it waiting ("DNS can take up to an hour"); a timeout, SERVFAIL or refused connection is 503 domain_check_unavailable — never "not found", and the domain's state never moves on it. 409 sso_domain_already_claimed when another organization verified the domain first. Only a person verifies (an operator never marks a domain verified). Rate class expensive. Capability account.sign_in_policy.write with a fresh step-up. Audited (verified_domain.verified).
- 200
- 401
- 403
- 404
- 409
- 429
- 503
POST /v1/accounts/{account_id}/workspace-access-grants grantAccountWorkspaceAccess
Give someone in the organization operational access to a workspace, with a reason.
Plan-014 B2 over A3's explicit grant (FR12-AUTH-07). An organization role never opens a workspace's content; this does, visibly — the membership records access_grant and the reason (at least ten characters), and the audit log records who gave it. The person must already be in the organization (404 not_found otherwise — invite a stranger instead). Only an Owner of the organization grants the workspace Owner role. Capability account.workspace_access.grant — Owner, Admin.
AMENDED 2026-10-06 (plan-014 review I-4 / I-5): a draining or archived workspace takes nobody new (422 workspace_draining / workspace_archived; a deleted one is 404), and the seats of the balance funding the workspace are checked after the row, in the same transaction (409 seat_limit_reached).
Takes a JSON request body.
- 201
- 400
- 401
- 403
- 404
- 409
- 422
- 429
GET /v1/me/account-closures listMyAccountClosures
The closures the signed-in person asked for that can still be undone.
An identity entry point (an unscoped auth_session is the normal caller once access ended). Each closure in its grace that this person started, with the organization's name, the grace's end and where to undo it.
GET /v1/me/onboarding-draft getOnboardingDraft
The signed-in person's resumable Create-an-organization draft.
Plan-014 B1 (FR12-ONB-01, FR12-ONB-05). The open draft — its schema revision, the steps completed (identity, organization, voice_agent) and the validated inputs — or an empty one, with what the screen shows beside it: whether the email is verified, the person's trial eligibility (one trial per verified person) and its length, the billing timezone a new organization gets, and the terms revision in force with its links. Kept server side; never a password, card data or a token.
PUT /v1/me/onboarding-draft saveOnboardingDraft
Save the Create-an-organization draft.
Plan-014 B1 (FR12-ONB-05). Replaces the open draft's inputs and the person's own step markers. Unknown fields are refused, so nothing but the three known inputs can be stored. identity needs a verified email (403 email_unverified); organization is marked only by creating the organization (POST /v1/accounts) and is refused here; voice_agent needs the organization first. Once the organization exists its inputs are the record's and are not changed by a save. The draft completes when every step is marked; the next draft starts empty.
Requires X-WeTalk-Csrf. Refusals: 400 validation_failed; 422 country_unsupported; 403 email_unverified; 403 impersonation_forbidden; the three 401s; 429 rate_limited.
Takes a JSON request body.
GET /v1/organization-hold getOrganizationHold
Whether the signed-in organization is held for checking.
An organization created from a hosting network or during a sign-up wave is held for checking until a wetalk operator approves it. While it is held, its people sign in, set up agents and edit drafts; tests, builds and publishing, website reading, document previews, API keys, invitations, campaigns, outbound conversations and number requests answer 422 organization_held. The reasons are not shown.
POST /v1/resource-shares/{resource_share_id}/accept acceptResourceShare
Accept something shared with a workspace.
Plan-014 B5 (FR12-SHR-02). The consumer is consumer_workspace_id, else the share's destination, else the workspace the person has open. A document is accepted by reference (mode: reference), a configuration as a copy (mode: copy); mode may be left out. Accepting again answers outcome: already_accepted. Capability resource_share.accept in the consumer workspace (workspace Owner, Admin).
- 200
- 400
- 401
- 403
- 404
- 409
- 422
- 429
POST /v1/resource-shares/{resource_share_id}/attach attachResourceShare
Add an accepted shared document to one of this workspace's agent builds.
Plan-014 B5 (FR12-SHR-03). Copies the accepted, fixed revision into the agent's build that waits for documents (an edit that replaces documents, or a new agent before its build starts), through the share gate: accepted by the agent's workspace, not revoked, both workspaces active. A build that already carries the same bytes answers created: false. Capability agent_document.write on the agent.
Takes a JSON request body.
- 200
- 400
- 401
- 403
- 404
- 409
- 422
- 429
POST /v1/resource-shares/{resource_share_id}/revoke revokeResourceShare
Revoke a share — nothing new can use it; what is already built keeps it.
Plan-014 B5 (FR12-SHR-03). Final. Blocks new acceptance, new use, new copies and new builds; live agent versions and conversations in progress keep the revision they use. The answer lists each acceptance with the agent versions that use the revision, so the person is told who keeps it. Revoking again answers outcome: already_revoked. Capability resource_share.publish in the source workspace, or account.workspace.manage in the organization.
POST /v1/workspaces/{workspace_id}/resource-shares createResourceShare
Share a document revision or an agent's configuration from this workspace.
Plan-014 B5 (FR12-SHR-02). The source workspace publishes the revision it holds NOW — the document row itself, or the agent's live version — to one other workspace, or to every other workspace when destination_workspace_id is left out. Publishing the same revision to the same destination again answers 200 with outcome: already_published and writes nothing. Capability resource_share.publish in the source workspace (workspace Owner, Admin).
Takes a JSON request body.
- 200
- 201
- 400
- 401
- 403
- 404
- 409
- 422
- 429
identity
POST /v1/accounts createAccount
Create an organization for the signed-in person (plan-014 B1), or finish a sign-up.
Two bodies, told apart by `terms_revision` (a compatibility window of one release):
* with `terms_revision` — plan-014 B1's Create an organization (FR12-ONB-01 step 2): { account_name, country, first_workspace_name, terms_revision, time_zone? }. The person's email must be verified (403 email_unverified), and terms_revision must be the terms revision in force (409 terms_acceptance_required — reload and accept the current terms). The billing timezone is the platform's configured one for new organizations and is never taken from the request; without time_zone the first workspace takes it too. The Idempotency-Key is 16–128 characters. * without it — design §15.4.2's recovery body { account_name, country, time_zone }, which the console's "Finish setting up your business" sends. Since 2026-10-17 (ADR 0071) a sign-up creates no organization, so this is how a self-serve person sets up their first one; the person's email must be verified (403 email_unverified). No terms acceptance is recorded.
Either way ONE committed unit creates the organization (state trial), its shared balance, the first workspace, the person's Owner role in the organization AND the workspace, the workspace's funding under the pay-as-you-go terms, the person's one trial when they are verified and have not had one (trial_granted), the terms acceptance (B1 body) and the audit entries — then rotates the auth_session onto the new organization and workspace and sets a new cookie.
`Idempotency-Key` is required, stored durably against the *person* and the key. The same key with the same facts re-scopes to the organization the first request created — however long ago, and when several arrive at once — rather than creating another; with other facts it is 409 idempotency_key_reused_with_different_body.
Requires X-WeTalk-Csrf matching this auth_session's token (401 csrf_token_invalid otherwise), checked before anything is looked up. Refusals: 400 validation_failed (a missing or unknown field, the name's length, a missing or malformed Idempotency-Key); 422 country_unsupported; 400 time_zone_invalid; 403 email_unverified; 409 terms_acceptance_required; 403 impersonation_forbidden; 401 authentication_required, auth_session_expired or auth_session_revoked; 429 rate_limited, per source address; 429 signup_limit_reached, platform-wide.
Takes a JSON request body.
- 201
- 400
- 401
- 403
- 409
- 422
- 429
- 500
POST /v1/auth/app-auth-session/end endAppAuthSession
End the wetalk app's sign-in (the app's sign-out).
Presents the app bearer (Authorization: Bearer wtk_app_…) and revokes that sign-in. 204 for every well-formed app bearer, idempotently: one already ended, expired or unknown has nothing to end. 401 authentication_required without an app bearer, or with a session cookie beside it. Works whether or not the app sign-in is switched on.
DELETE /v1/auth/app-auth-session/push-registration deleteAppPushRegistration
Stop pushes to this phone.
Removes this app sign-in's push registration — the app calls it when the phone's notification permission is withdrawn. Idempotent: 204 when there was nothing to remove. Allowed whether or not notifications from the wetalk app are available. The wetalk app's sign-in only, as putAppPushRegistration. Not audited.
PUT /v1/auth/app-auth-session/push-registration putAppPushRegistration
Register this phone's push token for the wetalk app's sign-in.
Registers (or refreshes) the push token of the phone this app sign-in is on, so the person's pushes reach it. The wetalk app's sign-in only (Authorization: Bearer wtk_app_…): no credential, a session cookie — alone or beside the bearer — an API key or any other bearer is 401 authentication_required; an app sign-in that is no longer live is 401 auth_session_expired. No X-WeTalk-Csrf.
One sign-in has one registration: a new token, or a new display_language, updates it. The phone's platform is the sign-in's own, never the body's. When the same token is registered by another sign-in (a shared phone, signed in as someone else), it moves to this one and the other registration is removed — a phone never receives two people's pushes. The registration ends with the sign-in (signing out, revocation, a password change).
The token's shape is the platform's: on iOS a hex device token of 32 to 400 characters (stored lower-case); on Android 32 to 4096 characters of letters, digits, _, : and -. push_environment is production or sandbox on iOS and must be null on Android. 400 validation_failed names the field.
422 app_push_unavailable while notifications from the wetalk app are not available (judged after the sign-in): nothing is registered. Not audited.
Takes a JSON request body.
POST /v1/auth/app-auth-sessions exchangeAppAuthorizationCode
Trade an app authorization code and its PKCE verifier for the wetalk app's own sign-in.
Called by the wetalk app with no credential: the code and the verifier are the proof. The code is spent by the first attempt whatever its outcome. The browser sign-in the code came from is judged again now — still live, not an operator acting as the person, the person active, the organization's sign-in policy met, and this request's address inside its allowed networks — and a NEW app-bound auth_session is issued in its scope and with its assurance; the browser sign-in is ended when the mint asked. The answer has no absolute expiry: an app sign-in ends when it is revoked or after idle_expires_at unused. 400 app_authorization_code_invalid — one answer for an unknown, expired, spent or replayed code, a verifier or platform that does not match, or a browser sign-in that has ended; a second redemption of a code also ends the sign-in the first one produced. 403 app_sign_in_refused with field operator_actor, person_not_active or assurance_unmet; 403 network_not_allowed; 400 validation_failed for the body's shape; 422 app_sign_in_unavailable while switched off; 429 rate_limited; 502/504 when the shared cache cannot be reached. Answers carry Cache-Control: no-store.
Takes a JSON request body.
- 200
- 400
- 403
- 422
- 429
- 502
- 504
POST /v1/auth/app-authorization-codes createAppAuthorizationCode
Mint a single-use code the wetalk app trades for its own sign-in.
Called by the portal's consent page (/app-sign-in) with the browser's cookie and X-WeTalk-Csrf, after the person chose "Continue". Holds a 43-character code for WETALK_API_APP_AUTHORIZATION_CODE_LIFETIME_SECOND (60 in production), bound to the S256 challenge, the person, this browser auth_session, the platform and the ends_browser_auth_session choice, and answers the configured return address for the platform — the page never builds one from its own address. No code is held on any refusal. 422 app_sign_in_unavailable while the app sign-in is switched off; 401 authentication_required / auth_session_expired / auth_session_revoked without a live cookie, 401 csrf_token_invalid without its token; 403 app_sign_in_refused (field: operator_actor) for a wetalk operator acting as the person; 400 validation_failed for a challenge that is not 43 base64url characters, any method but S256, an unknown platform or a missing boolean; 401 assurance_required when the organization's sign-in policy or the person's own authenticator asks for a step first (the challenge is on GET /v1/session); 403 network_not_allowed outside the organization's allowed networks; 429 rate_limited past the per-network budget; 502/504 when the shared cache cannot be reached (nothing is minted). Answers carry Cache-Control: no-store.
Takes a JSON request body.
- 201
- 400
- 401
- 403
- 422
- 429
- 502
- 504
GET /v1/auth/challenge createIdentityChallenge
A fresh proof-of-work challenge for the sign-in and sign-up card.
Unauthenticated. An ALTCHA challenge, valid for five minutes, that the card solves and sends as altcha with discovery, log-in and sign-up (ADR 0071). Each solved challenge is accepted once. Never cached.
POST /v1/auth/discover discoverIdentity
Home-realm discovery — should this address see a password field at all?
Identifier-first login (design §8.3). A work address on a verified, SSO-governed domain answers microsoft with a start_url; show_password is false when the organisation enforces SSO and the person holds no live break-glass grant.
Enumeration-safe. An unknown domain, a known domain with no SSO, and a malformed address all answer { "method": "password", "start_url": null, "show_password": true }. Only whether a *domain* is SSO-governed is ever disclosed — never whether a person or an account exists. Answers are padded to a configured floor so the governed and ungoverned branches take comparable time, and the route is limited per source address.
Asks the identity challenge first (altcha, from GET /v1/auth/challenge) while it is on.
Takes a JSON request body.
POST /v1/auth/email-verification verifyPersonEmail
Confirm a person's email address with the token from the verification link.
The token the verification mail carries in its link's fragment (plan-014 MAIL; owner answer 41). Public: the link may be opened in a browser where nobody is signed in. The token is single-use and expires with WETALK_API_EMAIL_VERIFICATION_TTL_MS (24 hours in production); a used, expired or forged token is one answer, 404 not_found. A verified address is what lets the person's first organization take the trial (one trial per verified person). Counted against the per-source sign-up window (429 rate_limited).
Takes a JSON request body.
POST /v1/auth/email-verification/resend resendPersonEmailVerification
Send the signed-in person a new email verification link.
Replaces the person's live verification link (the old one stops working) and queues a new verification mail (plan-014 MAIL). Requires X-WeTalk-Csrf matching this auth_session's token (401 csrf_token_invalid otherwise). 202 sent; 200 already_verified when the address is verified already (nothing is sent); 404 not_found while wetalk sends no email (mail.binding = none); 403 impersonation_forbidden when a wetalk operator is acting as the person; 429 rate_limited past the person's window.
GET /v1/auth/google/callback finishGoogleSignIn
Google's return — always a redirect into the console.
Unauthenticated; the redirect URI registered with Google. Consumes the single-use request named by state (a replay is refused), checks the browser binding, exchanges the code, verifies the ID token (signature, issuer, audience, nonce, lifetime) and admits the arrival (design §39.5): signed in → 302 to the return path with the auth_session cookie (amr: google, never a second factor); an address Google is not authoritative for → a six-digit code is mailed and 302 to /log-in?confirm=provider; otherwise 302 to /log-in?problem=<code>, naming nothing about a person.
GET /v1/auth/google/start startGoogleSignIn
Start "Continue with Google" — a redirect to Google.
Unauthenticated. Stores a single-use authorisation request (state, nonce, PKCE S256) bound to this browser by the __Host-wetalk_oidc cookie, then answers 302 to Google's account chooser (openid email profile). A switched-off provider answers 302 to /log-in?problem=not_available. return is a path on this origin, checked; anything else becomes the default.
POST /v1/auth/google/start beginGoogleSignIn
Start "Continue with Google" from the entry card or the join page — the start URL in the body.
Unauthenticated. As the GET, for a page that must send something it may not put in a URL. While sign-up protection is on, every start — the join page's too — carries a solved identity challenge (altcha) and the out-of-sight field (entry_marker, empty); otherwise 403 identity_challenge_invalid. The join page's invitation token travels in the body and is checked to name an open invitation; the sign-up the arrival makes is the invitation's (not counted in the hourly sign-up limit) only when the provider's address is the invited address, and any other address is a self-serve sign-up. Answers the provider's URL and sets the binding cookie. 404 not_found while switched off; an unusable invitation answers as the join page does.
Takes a JSON request body.
POST /v1/auth/impersonation-handoff redeemImpersonationHandoff
Redeem a wetalk support hand-off and receive the impersonated auth_session.
The customer half of the impersonation hand-off (design §15.7.8, ADR 0017 §7). When a wetalk operator starts acting as a member, the operator console opens <this console's origin>/impersonation/<impersonation_grant_id>#<handoff_token>. The console removes the fragment at once and posts both values here.
The token is accepted only if it names a live auth_session issued for exactly that grant, carrying the operator as actor, that has never been presented, whose person is active and still holds the membership the grant is for. It is then rotated at once: the hand-off token stops working on first use, and a new token is set as the __Host-wetalk_session cookie. The session can never outlive the grant (at most thirty minutes), and an unredeemed hand-off expires after the operator deployment's hand-off window.
No cookie is required, and one the browser already holds is ignored. Every refusal — unknown, already used, expired, mismatched, revoked or malformed — is the same 401 impersonation_handoff_invalid, so the route is not an oracle. 400 validation_failed only for a body that is not the documented shape.
The body is the auth_session, including the banner fields (actor.operator_display_name, actor.reason) read from the account's own audit log.
Takes a JSON request body.
POST /v1/auth/invitation/accept acceptInvitation
Join a workspace from an invitation link, setting a password if new.
Design §16.37. A browser with a live session joins as that person (and must carry x-wetalk-csrf); the invitation's address must be theirs, or 403 permission_denied. Otherwise a person is created for the invitation's own address with display_name and password (sign-up's rules: 400 password_too_short; 409 email_taken when the address already has a sign-in — sign in, then open the link again). They do not found an account of their own. The invitation is single use; the session is rotated onto the account and workspace joined, and the cookie set.
AMENDED 2026-11-03: a new person may send code instead of password — the code POST /v1/auth/sign-in-code with invitation_token mailed to the invitation's address, from the browser holding its challenge cookie. They are created with no password and their address verified. A code for another address, or a used, expired or wrong one, is 401 sign_in_code_invalid and creates nobody; an address on a domain with enforced single sign-on is 401 sso_required_for_domain; password with code is 400 validation_failed. The answer's context.assurance says what the organization's sign-in policy and the person's own authenticator still ask: an emailed code is never the second step.
Takes a JSON request body.
- 200
- 400
- 401
- 403
- 404
- 409
- 429
POST /v1/auth/invitation/inspect inspectInvitation
What an invitation link joins, before anyone signs in.
The join page's first read (design §16.37). The token is the capability; it travels in the body so it stays out of access logs. 404 not_found for a link that was used, expired, was withdrawn or never existed — one answer for all four.
Takes a JSON request body.
POST /v1/auth/login logInPerson
Sign in with an email address and a password.
Sets the __Host-wetalk_session cookie for valid credentials and answers 401 otherwise.
Every failure that is a fact about a person — unknown address, wrong password, locked, disabled, or a person who only signs in with Google — is the same `401 credential_invalid`, with the same message, no `field`, and the same cost: each one pays for a full memory-hard password derivation before it answers. Lockout is never announced; the recovery path is the ordinary password reset.
401 sso_required_for_domain is the one distinct refusal, because it is a fact about a *domain* that discovery already discloses. A person who belongs to exactly one account is scoped to it; a person with none or several gets an unscoped auth_session and the list of account_choice.
Takes a JSON request body.
POST /v1/auth/logout logOutPerson
End this auth_session.
Revokes the auth_session the cookie names and clears the cookie. Requires X-WeTalk-Csrf matching this auth_session's token (401 csrf_token_invalid otherwise), checked before anything is looked up. Idempotent: an auth_session that has already expired is answered 204 and its cookie cleared all the same.
GET /v1/auth/microsoft/callback finishMicrosoftSignIn
Microsoft's return — always a redirect into the console.
Unauthenticated; the redirect URI registered with Microsoft, one for both flows. As Google's callback. A public token's issuer must be its OWN directory's (https://login.microsoftonline.com/{tid}/v2.0); the identity is the directory and the object id, never the address. A token from an organization's SSO directory is that organization's single sign-on. Microsoft's address is trusted only with xms_edov or on the organization's verified domain; otherwise a code is mailed first.
GET /v1/auth/microsoft/start startMicrosoftSignIn
Start "Continue with Microsoft" — a redirect to Microsoft.
Unauthenticated. Without d: the public flow (/common — a personal Microsoft account or a work account in any directory). With d (discovery's start_url for an SSO-governed domain): that organization's single sign-on, pinned to its directory. Otherwise as GET /v1/auth/google/start.
POST /v1/auth/microsoft/start beginMicrosoftSignIn
Start "Continue with Microsoft" from the entry card or the join page — the start URL in the body.
As POST /v1/auth/google/start, for Microsoft's public flow.
Takes a JSON request body.
POST /v1/auth/password-reset requestPasswordReset
Email a single-use password reset link (one answer for every address).
Answers 202 { state: "accepted" } the same way, after the same minimum time (personSecurity.passwordResetResponseFloorMs), for every address: whether a person exists is never said. A link is emailed only to an active person who has a password, on a domain whose organization does not enforce single sign-on (that address is sent nothing — the log-in page already sends it to its provider), at most personSecurity.passwordResetMaximumPerHour links per address an hour (past it nothing is sent and the answer is unchanged). The link opens https://app.wetalk.io/reset-password#<token> — the token in the fragment — works once and expires after personSecurity.passwordResetExpirySecond; a new request replaces the previous link. 404 not_found while wetalk sends no email from the environment (for every address); 429 rate_limited past the per-network window; 403 impersonation_forbidden when the request carries an auth_session a wetalk operator is acting through.
Takes a JSON request body.
POST /v1/auth/password-reset/confirm confirmPasswordReset
Set a new password with the token from the reset link.
The token is the capability (single use, short-lived); no cookie is needed, and nobody is signed in by this call — the person logs in afterwards with the new password, and with their authenticator if they have one. The new password is held to the sign-up rules (400 password_too_short, 400 validation_failed) BEFORE the link is spent, so a refused password leaves the link usable. On success every auth_session of the person is revoked (API keys are not: they are the organization's integration credentials), every other reset link stops working, the address counts as verified, each organization of the person records person_security.password_reset in its activity, and the person is emailed that their password changed. 404 not_found for a used, expired, replaced or forged link, or one whose person can no longer reset a password (one answer); 429 rate_limited past the per-network window; 403 impersonation_forbidden when the request carries an auth_session a wetalk operator is acting through.
Takes a JSON request body.
POST /v1/auth/provider/confirm confirmProviderSignIn
The six-digit code a held Google or Microsoft sign-in was mailed.
Unauthenticated; bound to the browser by the `__Host-wetalk_oidc_pending` cookie. A right code admits the held arrival with its address confirmed and sets the auth_session cookie; the answer names where to go next. A wrong code is 401 provider_code_invalid (the hold burns after its attempt cap); a hold that is gone is 409 provider_sign_in_expired; any other end is 409 provider_sign_in_refused.
Takes a JSON request body.
POST /v1/auth/provider/confirm/resend resendProviderSignInCode
A new code for a held Google or Microsoft sign-in.
Unauthenticated; bound by the pending cookie. Mails a new code (the old one stops working), at most a few times per sign-in: then 409 provider_code_limit. 409 provider_sign_in_expired when the hold is gone.
GET /v1/auth/providers getSignInProviders
Which of "Continue with Google" and "Continue with Microsoft" work.
Unauthenticated. Each provider's sign-in is behind its own switch (WETALK_API_GOOGLE_SIGN_IN, WETALK_API_MICROSOFT_SIGN_IN), shipped off; the entry card enables a button only when its provider answers true here. Cached privately for a minute.
GET /v1/auth/sign-in-code readSignInCodeAvailability
Can a sign-in code be emailed in this environment?
Whether POST /v1/auth/sign-in-code can send a code at all. false while wetalk has no email sender; the log-in page then offers no emailed code. Says nothing about any address.
POST /v1/auth/sign-in-code requestSignInCode
Email a single-use sign-in code (uniform answer).
FR12-SEC-02. Answers 202 the same way for a known and an unknown address, and sets the HttpOnly challenge cookie __Host-wetalk_sign_in_code the code must be entered with (the browser binding). A code is mailed only to a person who exists. A new request while a code is open is a resend: the old code stops working. At most personSecurity.signInCodeResendMaximumPerHour resends per address per hour (429 rate_limited). An address on a domain with enforced single sign-on is 401 sso_required_for_domain. 404 not_found when no email sender exists (see readSignInCodeAvailability). An emailed code never counts as a second factor.
AMENDED 2026-11-03: the invitation page sends invitation_token instead of email. The token must name an open invitation (404 not_found otherwise) and the code goes to that invitation's address: a person who exists gets their ordinary sign-in code; an address nobody signs in with yet gets a code it can only join with (POST /v1/auth/invitation/accept with code). The same answer, cookie, ceilings and SSO refusal. Sending both is 400 validation_failed. AMENDED 2026-11-03 (later the same day): the token may be a workspace invitation's (/join) or a pending organization invitation's (/invitation); a new address's code then joins with POST /v1/auth/signup (invitation_token and code).
Takes a JSON request body.
POST /v1/auth/sign-in-code/verify verifySignInCode
Sign in with the emailed code.
Needs the challenge cookie set by requestSignInCode. Single use, expires after personSecurity.signInCodeExpirySecond, at most personSecurity.signInCodeAttemptMaximum attempts (the last burns the code); a wrong code counts against the person lock-out. Every failure is the one 401 sign_in_code_invalid. On success the auth_session cookie is set exactly as at password sign-in; the auth_session's mfa_verified_at is never set by an emailed code.
Takes a JSON request body.
POST /v1/auth/signup signUpPerson
Create a person with a password; their business is set up once their email is verified.
Verification-first since 2026-10-17 (ADR 0071). The person and their password are created with the email unverified, the business name and country are kept in the person's onboarding draft, and the verification mail is sent. Nobody is signed in and nothing else is created: the answer is 202 with state: verification_sent and no cookie. The person opens the link, logs in and sets up the business with POST /v1/accounts (createAccount), which refuses an unverified person 403 email_unverified.
Everything is judged before the person is created: the fields, the country (a closed list; 422 country_unsupported) and the time zone (an IANA name; 400 time_zone_invalid). The time zone is confirmed again when the business is set up.
With invitation_token (plan-014 B3) the answer is 201: the person and an unscoped auth_session with the __Host-wetalk_session cookie, no organization of their own. AMENDED 2026-11-03: with invitation_token a person may send code instead of password — the code POST /v1/auth/sign-in-code mailed to the invited address — and is created with no password, the address verified.
Refusals: 400 password_too_short (fewer than 10 characters) or validation_failed naming the field; 401 sso_required_for_domain when the address's organisation enforces Microsoft sign-in (design §8.3 — a password account there would be a land grab); 409 email_taken when the address already has a person. That last one is an acknowledged enumeration oracle, which is why this route is limited per source.
Takes a JSON request body.
- 201
- 202
- 400
- 401
- 403
- 409
- 410
- 422
- 429
POST /v1/invitations/accept acceptAccountInvitation
Accept an organization invitation.
Plan-014 B2 (FR12-TEAM-03, FR12-ONB-04). The signed-in person whose email is the invited one (403 invitation_identity_mismatch otherwise). Owner answer 45: accepting with the invited address VERIFIES that address when it was not yet verified (the emailed token proves the mailbox) — no second verification email; another address is never verified. The inviter's current authority is asked again (an inviter removed or demoted since makes the link unusable); the organization role is granted or the existing one reused; each workspace role is created or the existing membership reused, in one database transaction. A token works once; a second acceptance by the same person — concurrent or later — returns the same result (replayed: true). It creates no organization, workspace, subscription or trial. The console then switches into account_id and goes to landing. Requires X-WeTalk-Csrf; an operator acting as the person is refused.
Takes a JSON request body.
POST /v1/invitations/inspect inspectAccountInvitation
What an organization invitation offers.
Plan-014 B2 (FR12-ONB-04). The token is the proof; nobody needs to be signed in. Answers the organization, exactly the offered memberships (a workspace archived since is available: false and will not be granted), whether the invited address already signs in to wetalk, the organization's policy, and — when a live session cookie is presented — whether the signed-in person is the invited one. An invitation the viewer already accepted answers state: accepted with where to go. Every unusable token is one answer: 410 invitation_unavailable.
Takes a JSON request body.
GET /v1/me/auth-sessions listMyAuthSessions
Where I am signed in.
Own identity only: the auth_session cookie, any organization or none selected. An operator acting as the person is refused 403 impersonation_forbidden (design §27.5.5).
DELETE /v1/me/auth-sessions/{auth_session_id} revokeMyAuthSession
Sign out one of my other devices.
Own identity only: the auth_session cookie, any organization or none selected. An operator acting as the person is refused 403 impersonation_forbidden (design §27.5.5). A write carries x-wetalk-csrf. 400 for the device making the request (log out instead); 404 not_found for anything that is not one of the person's own live auth_sessions.
Security review CR-1 (2026-10-06): when the person holds an active authenticator, this write needs an auth_session that has passed it (mfa_verified_at), else 401 assurance_required — answer POST /v1/me/mfa/challenge (the authenticator code or one recovery code), then retry. A password step-up does not stand in for it.
POST /v1/me/auth-sessions/sign-out-others signOutMyOtherAuthSessions
Sign out everywhere else.
Own identity only: the auth_session cookie, any organization or none selected. An operator acting as the person is refused 403 impersonation_forbidden (design §27.5.5). A write carries x-wetalk-csrf.
Security review CR-1 (2026-10-06): when the person holds an active authenticator, this write needs an auth_session that has passed it (mfa_verified_at), else 401 assurance_required — answer POST /v1/me/mfa/challenge (the authenticator code or one recovery code), then retry. A password step-up does not stand in for it.
ADR 0101 (2026-11-07): every OTHER remembered browser is forgotten too (forgotten_browser); this browser's remembering, if any, stays.
GET /v1/me/domain-join-offers listDomainJoinOffers
My offers to join an organization through my verified email domain.
Owner answer 47. One offer per organization and verified domain: the organization, the domain, and the workspaces the person would join with their role (never Owner or Admin). Only a VERIFIED address, a domain in state verified with auto-join on, an organization that is not closed, and a person who holds no account or workspace membership there in any state (someone an Owner removed is not re-offered — they can still be invited). An unverified address has none. Dismissing an offer is the console's; nothing is stored for it.
POST /v1/me/domain-join-offers/{offer_id}/accept acceptDomainJoinOffer
Accept an offer to join an organization through my verified email domain.
Owner answer 47. The organization's sign-in policy is judged first (plan-014 C2, FR12-SEC-06): a stricter policy is 401 assurance_required, a network outside its ranges 403 network_not_allowed; nothing joins either way. Then, in one database transaction in the organization, every condition of the listing is checked again and a workspace membership is created in each named active workspace with the constrained role (provenance domain_join; never an organization role), audited membership.domain_joined. An offer that no longer stands — for any reason — is 410 domain_join_offer_unavailable. The console then switches into account_id and goes to landing. Requires X-WeTalk-Csrf.
POST /v1/me/email-changes requestMyEmailChange
Change my email: a confirmation link goes to the new address.
Own identity only: the auth_session cookie, any organization or none selected. An operator acting as the person is refused 403 impersonation_forbidden (design §27.5.5). A write carries x-wetalk-csrf. A security change: needs a confirmation within WETALK_API_STEP_UP_MAX_AGE_S (POST /v1/session/step-up or POST /v1/me/mfa/challenge), else 401 step_up_required. 409 email_taken when another sign-in holds the address; 404 not_found when no email sender exists. The change is made only when the link is opened (confirmMyEmailChange); the previous address is then told.
Security review CR-1 (2026-10-06): when the person holds an active authenticator, this write needs an auth_session that has passed it (mfa_verified_at), else 401 assurance_required — answer POST /v1/me/mfa/challenge (the authenticator code or one recovery code), then retry. A password step-up does not stand in for it.
Takes a JSON request body.
POST /v1/me/email-changes/confirm confirmMyEmailChange
Confirm an email change with the link's token.
The token is the capability (single use, expires after WETALK_API_EMAIL_VERIFICATION_TTL_MS); no cookie is needed. 404 not_found for a used, expired or unknown token. The previous address is told, and the change is written to the audit log of every organization the person belongs to.
Takes a JSON request body.
POST /v1/me/mfa/challenge answerMyMfaChallenge
Prove my second step (authenticator code or recovery code).
Own identity only: the auth_session cookie, any organization or none selected. An operator acting as the person is refused 403 impersonation_forbidden (design §27.5.5). A write carries x-wetalk-csrf. Stamps this auth_session's mfa_verified_at and its confirmation. A TOTP code works once (replay refused by time step); a recovery code works once and its use is audited. 401 mfa_factor_invalid / 401 recovery_code_invalid; rate-limited (429) and counted against the lock-out.
ADR 0101 (2026-11-07): with remember_browser: true, a code that passes also remembers this browser for WETALK_API_REMEMBERED_BROWSER_DAY days (30): the answer sets __Host-wetalk_remembered_browser (HttpOnly, Secure, SameSite=Strict) and names remembered_until. The browser's earlier remembering, if any, is replaced. Audited (person_security.browser_remembered).
Takes a JSON request body.
POST /v1/me/mfa/recovery-codes regenerateMyRecoveryCodes
Make new recovery codes; the old ones stop working.
Own identity only: the auth_session cookie, any organization or none selected. An operator acting as the person is refused 403 impersonation_forbidden (design §27.5.5). A write carries x-wetalk-csrf. A security change: needs a confirmation within WETALK_API_STEP_UP_MAX_AGE_S (POST /v1/session/step-up or POST /v1/me/mfa/challenge), else 401 step_up_required. 403 mfa_enrolment_required without an authenticator. The codes are answered once and stored only as keyed digests.
Security review CR-1 (2026-10-06): when the person holds an active authenticator, this write needs an auth_session that has passed it (mfa_verified_at), else 401 assurance_required — answer POST /v1/me/mfa/challenge (the authenticator code or one recovery code), then retry. A password step-up does not stand in for it.
POST /v1/me/mfa/remembered-browser useMyRememberedBrowser
Pass my sign-in second step with this remembered browser.
ADR 0101 (design §50, 2026-11-07). Own identity only: the auth_session cookie, any organization or none selected. An operator acting as the person is refused 403 impersonation_forbidden. A write carries x-wetalk-csrf. No body: the browser sends its HttpOnly __Host-wetalk_remembered_browser cookie.
When this browser holds a remembering of THIS person that still counts — unexpired (30 days), not forgotten, made with the authenticator that is still active, and no password set or removed since — it stamps this auth_session's mfa_verified_at (the sign-in second step, which an organization asking for an authenticator also accepts) and NOT its confirmation (stepped_up_at): a security change still asks for the authenticator. Else 401 remembered_browser_invalid, and the portal asks for the code. A locked or disabled person is answered the same.
POST /v1/me/mfa/totp startMyTotpEnrolment
Start (or replace) my authenticator app.
Own identity only: the auth_session cookie, any organization or none selected. An operator acting as the person is refused 403 impersonation_forbidden (design §27.5.5). A write carries x-wetalk-csrf. A security change: needs a confirmation within WETALK_API_STEP_UP_MAX_AGE_S (POST /v1/session/step-up or POST /v1/me/mfa/challenge), else 401 step_up_required. Answers the otpauth:// URI once (the console renders the QR code; the seed is never returned again and is stored only in the person-MFA vault). Confirm within personSecurity.totpEnrolmentExpirySecond; a new start replaces an unfinished one.
Security review CR-1 (2026-10-06): when the person holds an active authenticator, this write needs an auth_session that has passed it (mfa_verified_at), else 401 assurance_required — answer POST /v1/me/mfa/challenge (the authenticator code or one recovery code), then retry. A password step-up does not stand in for it.
POST /v1/me/mfa/totp/confirm confirmMyTotpEnrolment
Confirm the authenticator with a 6-digit code.
Own identity only: the auth_session cookie, any organization or none selected. An operator acting as the person is refused 403 impersonation_forbidden (design §27.5.5). A write carries x-wetalk-csrf. 401 mfa_factor_invalid for a wrong code (it counts against the lock-out). The first authenticator answers its recovery codes once (recovery_code, personSecurity.recoveryCodeCount of them); a replacement keeps the existing codes and answers null.
Security review CR-1 (2026-10-06): when the person holds an active authenticator, this write needs an auth_session that has passed it (mfa_verified_at), else 401 assurance_required — answer POST /v1/me/mfa/challenge (the authenticator code or one recovery code), then retry. A password step-up does not stand in for it.
Takes a JSON request body.
POST /v1/me/password changeMyPassword
Change (or set) my password; my other devices are signed out.
Own identity only: the auth_session cookie, any organization or none selected. An operator acting as the person is refused 403 impersonation_forbidden (design §27.5.5). A write carries x-wetalk-csrf. A security change: needs a confirmation within WETALK_API_STEP_UP_MAX_AGE_S (POST /v1/session/step-up or POST /v1/me/mfa/challenge), else 401 step_up_required. Sign-up's rules apply (400 password_too_short). Every other auth_session of the person is revoked.
Security review CR-1 (2026-10-06): when the person holds an active authenticator, this write needs an auth_session that has passed it (mfa_verified_at), else 401 assurance_required — answer POST /v1/me/mfa/challenge (the authenticator code or one recovery code), then retry. A password step-up does not stand in for it.
Takes a JSON request body.
GET /v1/me/profile readMyProfile
My profile — the same in every organization.
Own identity only: the auth_session cookie, any organization or none selected. An operator acting as the person is refused 403 impersonation_forbidden (design §27.5.5).
The wetalk app reads it too, with its own sign-in (Authorization: Bearer wtk_app_…), for the person's display language. An app sign-in that has ended or is unknown is 401 auth_session_expired; a bearer sent beside a cookie is 401 authentication_required. Every other /v1/me/** operation answers the app 403 mobile_surface_refused.
PATCH /v1/me/profile updateMyProfile
Change my display name, locale or time zone.
Own identity only: the auth_session cookie, any organization or none selected. An operator acting as the person is refused 403 impersonation_forbidden (design §27.5.5). A write carries x-wetalk-csrf. time_zone must be an IANA zone (400 time_zone_invalid); null clears locale or time zone.
Security review CR-1 (2026-10-06): when the person holds an active authenticator, this write needs an auth_session that has passed it (mfa_verified_at), else 401 assurance_required — answer POST /v1/me/mfa/challenge (the authenticator code or one recovery code), then retry. A password step-up does not stand in for it.
Takes a JSON request body.
DELETE /v1/me/remembered-browsers forgetMyRememberedBrowsers
Forget every browser I asked to remember.
ADR 0101 (2026-11-07). Own identity only: the auth_session cookie, any organization or none selected. An operator acting as the person is refused 403 impersonation_forbidden. A write carries x-wetalk-csrf. Protective, like signing a device out: no fresh confirmation; but when the person holds an active authenticator, an auth_session that has passed it (401 assurance_required otherwise). Every remembered browser — this one included — asks for the authenticator code at its next sign-in; this browser's cookie is removed. Audited when one was forgotten (person_security.remembered_browsers_forgotten).
GET /v1/me/sign-in-methods listMySignInMethods
My ways to sign in and my second step.
Own identity only: the auth_session cookie, any organization or none selected. An operator acting as the person is refused 403 impersonation_forbidden (design §27.5.5). linkable is false while wetalk serves no Google or Microsoft sign-in.
DELETE /v1/me/sign-in-methods/{provider} unlinkMySignInMethod
Remove a way to sign in — never the last one.
Own identity only: the auth_session cookie, any organization or none selected. An operator acting as the person is refused 403 impersonation_forbidden (design §27.5.5). A write carries x-wetalk-csrf. A security change: needs a confirmation within WETALK_API_STEP_UP_MAX_AGE_S (POST /v1/session/step-up or POST /v1/me/mfa/challenge), else 401 step_up_required. 409 last_sign_in_method when it is the last usable way to sign in; 404 not_found when it is not set up.
Security review CR-1 (2026-10-06): when the person holds an active authenticator, this write needs an auth_session that has passed it (mfa_verified_at), else 401 assurance_required — answer POST /v1/me/mfa/challenge (the authenticator code or one recovery code), then retry. A password step-up does not stand in for it.
POST /v1/me/sign-in-methods/{provider}/link linkMySignInMethod
Link Google or Microsoft to the signed-in person.
Own identity only: the auth_session cookie, any organization or none selected. An operator acting as the person is refused 403 impersonation_forbidden (design §27.5.5). A write carries x-wetalk-csrf. A security change: needs a confirmation within WETALK_API_STEP_UP_MAX_AGE_S (POST /v1/session/step-up or POST /v1/me/mfa/challenge), else 401 step_up_required.
AMENDED 2026-10-25 (plan-028 §39.8, ADR 0080): answers the provider's start_url and sets the browser-binding cookie (__Host-wetalk_oidc); the console navigates there. The provider's callback links the identity to THIS person whatever its address, returns to My security, and refuses an identity another person already holds. 404 not_found for password (set with POST /v1/me/password) and for a provider whose sign-in is switched off. Identities are never merged on an unverified email.
Security review CR-1 (2026-10-06): when the person holds an active authenticator, this write needs an auth_session that has passed it (mfa_verified_at), else 401 assurance_required — answer POST /v1/me/mfa/challenge (the authenticator code or one recovery code), then retry. A password step-up does not stand in for it.
POST /v1/operator-action-confirmations/confirm confirmOperatorAction
Confirm a change wetalk support prepared, with the link's token.
awaiting_approval: a second wetalk operator decides next (within 7 days). approved: an operator applies it. The confirmation is written to the organization's audit log, the person as the actor.
Takes a JSON request body.
POST /v1/operator-action-confirmations/inspect inspectOperatorActionConfirmation
What a confirmation link asks the person to confirm — read only.
Takes a JSON request body.
GET /v1/session getCurrentAuthSession
Who is signed in, scoped to which account, and on whose behalf.
The console's source of truth for the signed-in person, the account scope, the member role and the impersonation banner (design §5.2, §8.7). Answers an unscoped auth_session too (account_id: null, with account_choice).
401 authentication_required when there is no cookie; 401 auth_session_expired — with the cookie cleared — when there is one that is expired, revoked or unknown. Which of those applied is deliberately not said.
AMENDED 2026-10-07 (plan-014 ACT, design §27.6.3): one scoped to a workspace or organization the person no longer belongs to is NOT signed out. It is rotated (a new cookie, a new scope generation) to the next allowed destination — another enterable workspace of the organization, else the organization alone for someone with an organization role there, else the picker — and the body carries notice: { code: "membership_revoked" }. An operator's impersonated auth_session keeps the old answer (its scope is fixed), a 401 auth_session_expired.
AMENDED 2026-10-07 (plan-014 FIX2): the tabs of a browser share the cookie, so a second tab's read that left before that move's answer came back carries the token just rotated away. For 30 seconds after such a move that token is answered 409 auth_session_superseded with the cookie left alone (never cleared): read the session again, with the cookie the browser now holds. Nothing is described to it.
The body carries the auth_session's csrf_token, the value every cookie-authenticated non-GET request must send as X-WeTalk-Csrf.
Plan-014 A2 (design §27.6.1), additive: context is the three-state authentication context (selection_required, account_only, workspace_selected) with its scope_generation, organization, workspace, capability listing and assurance facts; landing is where the console lands it; each account_choice entry also carries the organization's own fields. The flat account_id / account_name / workspace_id / member_role fields and each choice's account_name / member_role keep their meanings for one release (the compatibility window). Every cookie request to a scoped route must send X-WeTalk-Scope-Generation with context.scope_generation; a stale or absent one is 409 scope_changed.
Plan-034 (design §45.7.4): the wetalk app reads it with its own sign-in (Authorization: Bearer wtk_app_…). The body is the same with csrf_token: null and absolute_expires_at: null, and it never sets a cookie. A scope the person no longer holds is moved IN PLACE — the same sign-in, a new scope_generation, the same notice — never rotated. An app sign-in that has ended or is unknown is 401 auth_session_expired; the bearer sent beside a cookie is 401 authentication_required.
POST /v1/session/account switchAuthSessionAccount
Re-scope this auth_session to another organization, one of its workspaces, or the organization alone.
Design §15.4.4, §27.6.2. The organization must be one the person can enter (an account membership, workspace memberships, or both); the workspace is the one named. With scope_generation (the new contract) workspace_id: null means the organization ALONE — it needs an account role there (403 capability_missing otherwise) — and the generation must be the auth_session's current one (409 scope_changed otherwise, nothing rotated). Without it (the legacy contract, one release) workspace_id: null means the organization's first workspace membership, or the organization alone for a person with an account role and no workspace there. An unscoped auth_session (a person with several organizations who has not chosen) is a normal caller.
A re-scope is a privilege change, so the auth_session is rotated: a new token and a new cookie, and the old token stops working at once (design §8.1).
Requires X-WeTalk-Csrf matching this auth_session's token (401 csrf_token_invalid otherwise), checked before anything is looked up. 404 not_found for an account or workspace the person does not belong to — the same answer as for one that does not exist. 403 impersonation_scope_fixed when a wetalk operator is acting as this person: a re-scope would leave the account the grant covers. 401 authentication_required without a cookie; 401 auth_session_expired or auth_session_revoked, with the cookie cleared, for one that no longer works.
AMENDED 2026-10-06 (plan-014 C2, FR12-SEC-06): the destination organization's sign-in policy is judged first — 401 assurance_required when it asks for an authenticator or single sign-on this auth_session has not proven (answer the challenge, then switch again), 403 network_not_allowed from outside its allowed networks; nothing is rotated either way.
Plan-034 (design §45.7.4): the wetalk app switches with its own sign-in (Authorization: Bearer wtk_app_…) and no X-WeTalk-Csrf. From the app scope_generation is required (400 validation_failed without it; 409 scope_changed when stale), and the sign-in is re-scoped IN PLACE — the same bearer, a new scope_generation — with no Set-Cookie. An app sign-in that has ended or is unknown is 401 auth_session_expired.
Takes a JSON request body.
- 200
- 400
- 401
- 403
- 404
- 409
- 429
POST /v1/session/step-up stepUpAuthSession
Confirm it is you — re-verify a factor so a sensitive change is allowed for a few minutes.
The person proves a factor they already hold, and this auth_session records the moment (stepped_up_at). Routes that change money details — the payout destination (PUT /v1/payouts/destination) — answer 401 step_up_required when that moment is missing or older than WETALK_API_STEP_UP_MAX_AGE_S (300 seconds in production); the console asks for the factor here and retries once.
factor is password, totp, recovery_code, single_sign_on or passkey. AMENDED 2026-10-06 (plan-014 C2): the authenticator confirms too — totp with its code, or one recovery_code (used once; a replayed code is 401 credential_invalid; the person lock-out is shared with sign-in) — which also records the sign-in's second step; a person without one gets 400 validation_failed naming factor. single_sign_on (a fresh Google or Microsoft sign-in) answers 403 step_up_unavailable until those sign-ins are connected. passkey answers 400 validation_failed. An auth_session with its organization alone open (no workspace) steps up too, audited at the organization. An auth_session in no organization answers 403 step_up_unavailable — except (plan-014 review I-18, 2026-10-06) a person in NO organization who holds NO authenticator, confirming their password so they can add their first one (POST /v1/me/mfa/totp), as the invitee of an organization that requires an authenticator must before accepting; recorded on the auth_session only (no organization's log exists).
Not a rotation: 204 with no cookie, and the CSRF token is unchanged. A later rotation (switching account, a role or password change) starts the new auth_session with no step-up.
Requires X-WeTalk-Csrf matching this auth_session's token (401 csrf_token_invalid otherwise), checked before anything is looked up. Refusals: 401 credential_invalid for a wrong password — the same answer while the person is locked out, as at sign-in, and each failure counts toward that lockout; 403 step_up_unavailable when a wetalk operator is acting as this person (only the person can confirm it is them), when the auth_session has no organization yet, or when the person signs in only with Google or Microsoft and holds no password; 429 rate_limited when this person's attempts exceed the sign-in window; 401 authentication_required without a cookie; 401 auth_session_expired or auth_session_revoked, with the cookie cleared, for one that no longer works. Each success writes auth_session.stepped_up to the account's audit log, naming the factor's kind.
AMENDED 2026-10-06 (security review CR-1): password is refused 401 assurance_required while the person holds an active authenticator this auth_session has not passed — the password never stands in for the authenticator; confirm with totp or recovery_code, which records both the second step and the step-up.
AMENDED 2026-11-03: email_code with its code confirms a person whose only way in is their mailbox — no password, no authenticator, no Google or Microsoft (someone who joined from an invitation with a code): ask for the code with POST /v1/auth/sign-in-code, then send it from the same browser. It records the step-up, never the second step. Anyone else is 403 step_up_unavailable; a wrong, used or expired code is 401 credential_invalid.
Takes a JSON request body.
POST /v1/session/step-up/provider beginProviderStepUp
Confirm it is you with Google or Microsoft — the start URL in the body.
Signed in; CSRF-checked. For a person who holds NO password and NO authenticator app (anyone holding one confirms with it through POST /v1/session/step-up, answered 403 step_up_unavailable here), and who has this provider as a way to sign in. Stores a single-use step_up request naming this person AND this auth_session, bound to this browser, counts one attempt in the person's step-up window (429 when spent), and answers the provider's URL with the binding cookie. Microsoft is asked for the credentials again (prompt=login); Google for auth_time. The callback (the provider's usual redirect URI) never signs anyone in: it confirms only when the browser presents the same auth_session, the token names an identity already linked to this person, its auth_time is inside the step-up window, and the person still holds no other factor — then stepped_up_at is stamped and audited (factor: single_sign_on) — and redirects to return_path with ?step_up=confirmed, cancelled or failed. A confirmation is freshness only, never a second factor (ADR 0080 amendment 2026-10-25, design §39.15). Never for an operator acting as the person. 404 not_found while the provider is switched off.
Takes a JSON request body.