Skip to content
TunVox

Back to the guideshttps://api.tunvox.tn/v1 · v1.0.0-beta.1

GET /me

The business this key belongs to, what the key may do, and the limits that apply.

Parameters

No parameters

Response 200 Me

business_idrequiredstring
featuresrequiredobjectWhich parts of the API are on for this business
key_idrequiredstring
limitsrequiredLimits
moderequired"live" | "test"`test`: this key never dials, texts or moves money
namerequiredstring
scopesrequiredstring[]
time_zonerequiredstringIANA zone of the business; every time in the API is UTC

Errors: 401, 429, 503

GET /wallet

The owner's balance. One wallet serves every business of the same owner.

Parameters

No parameters

Response 200 WalletView

available_millimesrequiredinteger (64-bit)What can be spent now: paid and bonus credit minus holds
bonus_millimesrequiredinteger (64-bit)
currencyrequiredstring
held_millimesrequiredinteger (64-bit)Held for calls in progress
month_spent_millimesrequiredinteger (64-bit)Call debits of this business since the first of the month, in the business's time zone
paid_millimesrequiredinteger (64-bit)

Errors: 401, 403, 429, 503

GET /call-requests

Calls asked for through the API, newest first.

Parameters

limitinteger (query)
cursorstring | null (query)
referencestring | null (query)

Response 200 Page<CallRequest>

itemsrequiredCallRequest[]
next_cursorrequiredstring | null

Errors: 401, 403, 422, 429, 503

GET /call-requests/{request_id}

Parameters

request_idrequiredstring (path)

Response 200 CallRequest

call_idrequiredstring | nullThe phone call, once it started
created_atrequiredstring
ended_atrequiredstring | null
idrequiredstring
not_afterrequiredstring | null
not_beforerequiredstring | null
outcomerequired"completed" | "call_back" | "wrong_person" | "declined"
reasonrequiredstring | nullWhy it was not called or how it ended, as a short code
referencerequiredstring | null
resultrequiredobjectThe script's result fields the assistant filled
scriptrequiredstring
staterequired"accepted" | "not_called" | "calling" | "done" | "unreached" | "cancelled" | "expired"`accepted`: waiting its turn. `not_called`: this person cannot be called, see `reason`
testrequiredboolean

Errors: 401, 403, 404, 422, 429, 503

POST /call-requests/{request_id}/cancel

Cancel a call that has not started. A call already started or ended is returned unchanged.

Parameters

request_idrequiredstring (path)

Response 200 CallRequest

call_idrequiredstring | nullThe phone call, once it started
created_atrequiredstring
ended_atrequiredstring | null
idrequiredstring
not_afterrequiredstring | null
not_beforerequiredstring | null
outcomerequired"completed" | "call_back" | "wrong_person" | "declined"
reasonrequiredstring | nullWhy it was not called or how it ended, as a short code
referencerequiredstring | null
resultrequiredobjectThe script's result fields the assistant filled
scriptrequiredstring
staterequired"accepted" | "not_called" | "calling" | "done" | "unreached" | "cancelled" | "expired"`accepted`: waiting its turn. `not_called`: this person cannot be called, see `reason`
testrequiredboolean

Errors: 401, 403, 404, 422, 429, 503

GET /call-scripts

The business's call scripts. They are written and approved in the dashboard.

Parameters

No parameters

Response 200 CallScriptList

itemsrequiredCallScript[]

Errors: 401, 403, 429, 503

GET /calls

Calls of the business, newest first.

Parameters

limitinteger (query)
cursorstring | null (query)
direction"inbound" | "outbound" (query)
sincestring (date-time) | null (query)Only calls that started at or after this time
contact_idstring | null (query)

Response 200 Page<Call>

itemsrequiredCall[]
next_cursorrequiredstring | null

Errors: 401, 403, 422, 429, 503

POST /calls

Ask for one call from an approved script. The call waits its turn inside the business's call hours and limits; the result arrives as a `call.result` event and on `GET /call-requests/{id}`.

Parameters

Idempotency-Keystring | null (header)

Request body CallCreate

language"aeb" | "ar" | "fr" | "en"
not_afterstring (date-time) | nullIf the call has not started by then, drop it
not_beforestring (date-time) | nullDo not call before this time
referencestring | nullYour own id for this call
scriptrequiredstringThe id of an approved call script
test_outcome"answered" | "no_answer" | "refused"With a test key only: the outcome to simulate (default `answered`)
torequiredstringA Tunisian number, E.164 or local form
variablesobjectA value for each of the script's variables

Response 202 CallRequest

call_idrequiredstring | nullThe phone call, once it started
created_atrequiredstring
ended_atrequiredstring | null
idrequiredstring
not_afterrequiredstring | null
not_beforerequiredstring | null
outcomerequired"completed" | "call_back" | "wrong_person" | "declined"
reasonrequiredstring | nullWhy it was not called or how it ended, as a short code
referencerequiredstring | null
resultrequiredobjectThe script's result fields the assistant filled
scriptrequiredstring
staterequired"accepted" | "not_called" | "calling" | "done" | "unreached" | "cancelled" | "expired"`accepted`: waiting its turn. `not_called`: this person cannot be called, see `reason`
testrequiredboolean

Errors: 400, 401, 403, 404, 409, 422, 429, 503

GET /calls/{call_id}

Parameters

call_idrequiredstring (path)

Response 200 Call

answered_atrequiredstring | nullWhen the assistant started talking
channelrequired"dongle" | "cloud"
charged_millimesrequiredinteger (64-bit) | nullThe call's one debit, in millimes (1 TND = 1000)
contact_idrequiredstring | null
directionrequired"inbound" | "outbound"
duration_secondsrequiredinteger | nullTime with the assistant; null until the call is finalized
ended_atrequiredstring | null
exit_reasonrequiredstring | null
external_stepsExternalStep[]
idrequiredstring
numberrequiredstring | nullThe other party's number in E.164; null when withheld
recaprequiredCallRecap | null
referencestring | nullYour own id, for a call created through the API
started_atrequiredstring
staterequiredstring
transcriptrequired"processing" | "ready" | "partial" | "failed" | "not_collected" | "deleted"

Errors: 401, 403, 404, 422, 429, 503

GET /calls/{call_id}/transcript

What was said. Needs `transcripts:read`. 404 when no transcript was collected or it was deleted.

Parameters

call_idrequiredstring (path)

Response 200 CallTranscript

call_idrequiredstring
linesrequiredTranscriptLine[]
statusrequired"processing" | "ready" | "partial" | "failed"

Errors: 401, 403, 404, 422, 429, 503

GET /contacts

Active contacts, most recent activity first.

Parameters

limitinteger (query)
cursorstring | null (query)
numberstring | null (query)Contacts holding exactly this number
qstring | null (query)Part of a name

Response 200 Page<Contact>

itemsrequiredContact[]
next_cursorrequiredstring | null

Errors: 401, 403, 422, 429, 503

POST /contacts

A new contact. `Idempotency-Key` is required: a repeated request returns the first answer.

Parameters

Idempotency-Keystring | null (header)

Request body ContactCreate

namestring | null
notesstring | null
numbersstring[]

Response 201 Contact

created_atrequiredstring
idrequiredstring
languagerequiredstring | null
last_activity_atrequiredstring | null
namerequiredstring | null
notesrequiredstring | null
numbersrequiredstring[]
testbooleanTrue on the answer to a write made with a test key: nothing was saved
updated_atrequiredstring

Errors: 400, 401, 403, 409, 422, 429, 503

PATCH /contacts/{contact_id}

Change the name or the notes, or add numbers. Fields left out are kept.

Parameters

contact_idrequiredstring (path)

Request body ContactUpdate

add_numbersstring[]
namestring | null
notesstring | null

Response 200 Contact

created_atrequiredstring
idrequiredstring
languagerequiredstring | null
last_activity_atrequiredstring | null
namerequiredstring | null
notesrequiredstring | null
numbersrequiredstring[]
testbooleanTrue on the answer to a write made with a test key: nothing was saved
updated_atrequiredstring

Errors: 401, 403, 404, 409, 422, 429, 503

GET /orders

Orders of the business, newest first: the ones callers placed and the ones your shop sent.

Parameters

limitinteger (query)
cursorstring | null (query)
statestring | null (query)
shop_order_numberstring | null (query)

Response 200 Page<Order>

itemsrequiredOrder[]
next_cursorrequiredstring | null

Errors: 401, 403, 422, 429, 503

POST /orders

Send one order from your shop. A cash-on-delivery order is confirmed by a call to the buyer after the wait you choose, inside the business's call hours; the result arrives as `order.confirmed`, `order.changed`, `order.cancelled` or `order.unreached`. Tell your buyers about that call at checkout.

Parameters

Idempotency-Keystring | null (header)

Request body OrderCreate

addressrequiredstring
confirm_by_callbooleanCall the buyer to confirm a cash-on-delivery order
delay_minutesintegerHow long after the order the call may start
delivery_daystring | null
delivery_fee_millimesinteger (64-bit) | null
itemsrequiredstring | OrderLine[]What was ordered: one line of text, or names and quantities
landmarkstring | null
namestring | null
numberrequiredstringThe buyer's Tunisian number, E.164 or local form
payment"cod" | "prepaid"
shop_order_numberrequiredstringYour shop's own order number. The same number never makes a second order or a second call
totalstring | nullThe amount to collect, in dinars ("45.500"). Or send `total_millimes`
total_millimesinteger (64-bit) | null

Response 201 OrderCreated

call_afterrequiredstring | null
confirmation_callrequired"queued" | "not_called" | "none"
duplicaterequiredbooleanTrue when this shop order number was already sent: nothing new was made
orderrequiredOrder
reasonrequiredstring | nullWhy the buyer will not be called, as a short code
testboolean

Errors: 400, 401, 403, 409, 422, 429, 503

GET /orders/{order_id}

Parameters

order_idrequiredstring (path)

Response 200 Order

addressrequiredstring | null
confirmationrequired"confirmed" | "changed" | "cancelled" | "no_answer"What the confirmation call found, once it happened
created_atrequiredstring
delivery_dayrequiredstring | null
delivery_fee_millimesrequiredinteger (64-bit)
idrequiredstring
itemsrequiredstring
kindrequiredstring
landmarkrequiredstring | null
linesOrderLineView[] | nullThe order line by line; on `GET /v1/orders/{id}` only
make_in_shopboolean | nullOn `GET /v1/orders/{id}`, for a shop connection's key: the owner wants orders placed by phone made in the shop
namerequiredstring | null
numberrequiredstring | null
paymentrequiredstring | null
referencerequiredstringTunVox's short reference, the one a caller is told
shop_order_numberrequiredstring | null
staterequired"new" | "accepted" | "ready" | "on_the_way" | "done" | "cancelled" | "refused" | "no_show"
status_noterequiredstring | null
total_millimesrequiredinteger (64-bit)
updated_atrequiredstring

Errors: 401, 403, 404, 422, 429, 503

PATCH /orders/{order_id}

Move an order to its next state, or leave a note for the buyer who calls about it. A move the order's current state does not allow answers 409.

Parameters

order_idrequiredstring (path)

Request body OrderUpdate

ready_in_minutesinteger | null
state"accepted" | "refused" | "ready" | "on_the_way" | "done" | "cancelled" | "no_show"
status_notestring | nullA short note the assistant may tell the buyer who asks about the order

Response 200 Order

addressrequiredstring | null
confirmationrequired"confirmed" | "changed" | "cancelled" | "no_answer"What the confirmation call found, once it happened
created_atrequiredstring
delivery_dayrequiredstring | null
delivery_fee_millimesrequiredinteger (64-bit)
idrequiredstring
itemsrequiredstring
kindrequiredstring
landmarkrequiredstring | null
linesOrderLineView[] | nullThe order line by line; on `GET /v1/orders/{id}` only
make_in_shopboolean | nullOn `GET /v1/orders/{id}`, for a shop connection's key: the owner wants orders placed by phone made in the shop
namerequiredstring | null
numberrequiredstring | null
paymentrequiredstring | null
referencerequiredstringTunVox's short reference, the one a caller is told
shop_order_numberrequiredstring | null
staterequired"new" | "accepted" | "ready" | "on_the_way" | "done" | "cancelled" | "refused" | "no_show"
status_noterequiredstring | null
total_millimesrequiredinteger (64-bit)
updated_atrequiredstring

Errors: 401, 403, 404, 409, 422, 429, 503

PUT /orders/{order_id}/shop-number

An order a caller placed by phone now exists in your shop: tell TunVox its number there. From then on it is found by that number, and the same order sent with `POST /v1/orders` is recognised instead of doubled. An order that already has a number keeps it.

Parameters

order_idrequiredstring (path)

Request body ShopNumber

shop_order_numberrequiredstring

Response 200 Order

addressrequiredstring | null
confirmationrequired"confirmed" | "changed" | "cancelled" | "no_answer"What the confirmation call found, once it happened
created_atrequiredstring
delivery_dayrequiredstring | null
delivery_fee_millimesrequiredinteger (64-bit)
idrequiredstring
itemsrequiredstring
kindrequiredstring
landmarkrequiredstring | null
linesOrderLineView[] | nullThe order line by line; on `GET /v1/orders/{id}` only
make_in_shopboolean | nullOn `GET /v1/orders/{id}`, for a shop connection's key: the owner wants orders placed by phone made in the shop
namerequiredstring | null
numberrequiredstring | null
paymentrequiredstring | null
referencerequiredstringTunVox's short reference, the one a caller is told
shop_order_numberrequiredstring | null
staterequired"new" | "accepted" | "ready" | "on_the_way" | "done" | "cancelled" | "refused" | "no_show"
status_noterequiredstring | null
total_millimesrequiredinteger (64-bit)
updated_atrequiredstring

Errors: 401, 403, 404, 422, 429, 503

PUT /catalog/items

Create or update menu, product or price-list items by name. Only the fields you send are changed; items you do not send are left as they are.

Parameters

No parameters

Request body CatalogUpsert

itemsrequiredCatalogItemIn[]

Response 200 CatalogResult

createdrequiredinteger
testboolean
unchangedrequiredinteger
updatedrequiredinteger

Errors: 401, 403, 422, 429, 503

GET /bookings

Bookings by start time, soonest first.

Parameters

limitinteger (query)
cursorstring | null (query)
starts_afterstring (date-time) | null (query)Default: now
state"confirmed" | "cancelled" | "completed" | "no_show" (query)

Response 200 Page<Booking>

itemsrequiredBooking[]
next_cursorrequiredstring | null

Errors: 401, 403, 422, 429, 503

GET /bookings/{booking_id}

Parameters

booking_idrequiredstring (path)

Response 200 Booking

call_idrequiredstring | null
contact_idrequiredstring | null
created_atrequiredstring
detailsrequiredobjectWhat the business asked to collect: name, party size, a note…
ends_atrequiredstring
idrequiredstring
party_sizerequiredinteger | null
referencerequiredstring | null
service_idrequiredstring | null
sourcerequiredstring
starts_atrequiredstring
staterequired"held" | "confirmed" | "completed" | "expired" | "cancelled" | "no_show"
time_zonerequiredstring
updated_atrequiredstring

Errors: 401, 403, 404, 422, 429, 503

GET /events

The business's events of the last 7 days, oldest first: for polling, or to catch up after your endpoint was down. The same bodies are sent to your endpoints.

Parameters

limitinteger (query)
afterstring | null (query)The last event id you handled
typestring | null (query)

Response 200 EventList

itemsrequiredEvent[]Oldest first
last_idrequiredstring | nullPass it back as `after` to get what came next; null when `items` is empty (keep your previous value)

Errors: 401, 422, 429, 503

POST /action-requests/{request_id}/result

The answer to an action request your service answered `pending`. The owner gets it as a task: the caller was told they would hear back.

Parameters

request_idrequiredstring (path)

Request body ActionLateResult

reason"not_found" | "not_allowed" | "closed" | "other"
resultobject | null
saystring | null
statusrequired"ok" | "refused"

Response 200 ActionRequest

actionrequiredstring
call_idrequiredstring | null
idrequiredstring
statusrequiredstring

Errors: 401, 403, 404, 409, 422, 429, 503

PUT /services/{service_id}/status

A hosted service says what it can do right now. Send it at start, on every change, and every 5 minutes: a service that stops reporting is shown offline and its actions are left out of new calls. Only the key made for the service may report for it.

Parameters

service_idrequiredstring (path)

Request body ServiceStatusReport

accountstring | nullADR 0287: what the owner connected, as the platform names it (for example a Page's name), shown to the owner on the connection. Never a person's name, a number or an address
actionsobjectPer action name; an action left out follows `state`
connectorConnectorChannel | nullADR 0228, sent by TunVox's hub for a service run by a program on the owner's PC: a closed channel shows the service offline at once
operationsstring[]Every action name the service can carry out at all
staterequired"online" | "needs_sign_in"`needs_sign_in`: the session or the key on the outside system stopped working

Response 200 ServiceStatus

catalogbooleanThe owner switched phone orders on: send the shop's products with `PUT /v1/catalog/items`, and again when they change
idrequiredstring
presencerequired"online" | "needs_sign_in" | "offline" | "paused" | "direct"
report_again_within_srequiredintegerWithout a report for this long the service is shown offline
reported_atrequiredstring (date-time)

Errors: 401, 403, 404, 422, 429, 503

POST /agent-tasks/{task_id}/updates

TunVox Agent's word on a task the owner sent it (TunVox's hub sends it with the service's key). A repeat or a word after the task ended changes nothing.

Parameters

task_idrequiredstring (path)

Request body AgentTaskUpdate

messagestring | nullShown to the owner in the chat as written
staterequired"accepted" | "needs_confirmation" | "question" | "done" | "failed" | "cancelled"
summarystring | null`needs_confirmation`: exactly what will be changed, for the owner's card

Response 200 AgentTaskState

idrequiredstring
staterequiredstring

Errors: 401, 403, 404, 422, 429, 503

GET /connector/me

Who this access token is: the PC, its service and its business. TunVox's hub asks this before it opens a channel and again every few minutes while it stays open.

Parameters

No parameters

Response 200 ConnectorMe

app_namerequiredstring
app_versionrequiredstring
business_idrequiredstring
device_idrequiredstring
expires_atrequiredstring (date-time)When this access token stops working
namerequiredstring
scopesrequiredstring[]
service_idrequiredstringThe first service this PC serves (the one it was paired with)
servicesrequiredConnectorService[]CN4: every service this PC serves, the first one first
template_keyrequiredstring

Errors: 401, 503

POST /connector/pairings

A program on the owner's PC asks to be paired. Show `code` to the owner, then poll with `device_code`.

Parameters

No parameters

Request body PairingStart

app_namerequiredstringThe program, e.g. `tunvox_agent`
app_versionrequiredstring
device_namerequiredstringThe PC's name, shown to the owner
platformrequiredstring`windows`, `macos` or `linux`

Response 201 PairingStarted

coderequiredstringShow it to the owner (`ABCD-EFGH`); they type it in TunVox › Settings › Services
device_coderequiredstringKeep it secret; poll `POST /connector/token` with it
expires_inrequiredintegerSeconds until the code stops working
intervalrequiredintegerSeconds to wait between two polls

Errors: 422, 429, 503

POST /connector/revoke

The PC unpairs itself ("Disconnect" in TunVox Agent). Its tokens stop working at once.

Parameters

No parameters

Response 204

Errors: 401, 503

POST /connector/token

Poll a pairing with its device code, or renew the tokens with the refresh token.

Parameters

No parameters

Request body TokenRequest

device_codestring | null
grant_typerequired"device_code" | "refresh_token"
refresh_tokenstring | null

Response 200 TokenReply

access_tokenstring | null
business_idstring | null
business_namestring | null
device_idstring | null
expires_ininteger | nullSeconds the access token lasts
hub_urlstring | nullWhere to open the channel (`wss://…/v1/connector`)
intervalinteger | null
protocolinteger | nullThe channel's message version
refresh_tokenstring | nullStore it in the OS credential store. Each use returns a new one; never present an old one again
service_idstring | null
staterequired"waiting" | "declined" | "expired" | "paired"`waiting`: poll again after `interval`; `declined`/`expired`: start a new pairing; `paired`: the tokens below are filled
token_typestring | null

Errors: 401, 422, 429, 503

Fields

ActionLateResult

reason"not_found" | "not_allowed" | "closed" | "other"
resultobject | null
saystring | null
statusrequired"ok" | "refused"

ActionRequest

actionrequiredstring
call_idrequiredstring | null
idrequiredstring
statusrequiredstring

ActionStatus

availableboolean
slowbooleanUsually answers `pending`: the assistant promises a follow-up

AgentTaskState

idrequiredstring
staterequiredstring

AgentTaskUpdate

messagestring | nullShown to the owner in the chat as written
staterequired"accepted" | "needs_confirmation" | "question" | "done" | "failed" | "cancelled"
summarystring | null`needs_confirmation`: exactly what will be changed, for the owner's card

Booking

call_idrequiredstring | null
contact_idrequiredstring | null
created_atrequiredstring
detailsrequiredobjectWhat the business asked to collect: name, party size, a note…
ends_atrequiredstring
idrequiredstring
party_sizerequiredinteger | null
referencerequiredstring | null
service_idrequiredstring | null
sourcerequiredstring
starts_atrequiredstring
staterequired"held" | "confirmed" | "completed" | "expired" | "cancelled" | "no_show"
time_zonerequiredstring
updated_atrequiredstring

Call

answered_atrequiredstring | nullWhen the assistant started talking
channelrequired"dongle" | "cloud"
charged_millimesrequiredinteger (64-bit) | nullThe call's one debit, in millimes (1 TND = 1000)
contact_idrequiredstring | null
directionrequired"inbound" | "outbound"
duration_secondsrequiredinteger | nullTime with the assistant; null until the call is finalized
ended_atrequiredstring | null
exit_reasonrequiredstring | null
external_stepsExternalStep[]
idrequiredstring
numberrequiredstring | nullThe other party's number in E.164; null when withheld
recaprequiredCallRecap | null
referencestring | nullYour own id, for a call created through the API
started_atrequiredstring
staterequiredstring
transcriptrequired"processing" | "ready" | "partial" | "failed" | "not_collected" | "deleted"

CallCreate

language"aeb" | "ar" | "fr" | "en"
not_afterstring (date-time) | nullIf the call has not started by then, drop it
not_beforestring (date-time) | nullDo not call before this time
referencestring | nullYour own id for this call
scriptrequiredstringThe id of an approved call script
test_outcome"answered" | "no_answer" | "refused"With a test key only: the outcome to simulate (default `answered`)
torequiredstringA Tunisian number, E.164 or local form
variablesobjectA value for each of the script's variables

CallRecap

languagerequiredstring | null
outcomerequiredstring | null
restrictedrequiredboolean
summaryrequiredstring | nullA short neutral recap; null when the call's content is restricted

CallRequest

call_idrequiredstring | nullThe phone call, once it started
created_atrequiredstring
ended_atrequiredstring | null
idrequiredstring
not_afterrequiredstring | null
not_beforerequiredstring | null
outcomerequired"completed" | "call_back" | "wrong_person" | "declined"
reasonrequiredstring | nullWhy it was not called or how it ended, as a short code
referencerequiredstring | null
resultrequiredobjectThe script's result fields the assistant filled
scriptrequiredstring
staterequired"accepted" | "not_called" | "calling" | "done" | "unreached" | "cancelled" | "expired"`accepted`: waiting its turn. `not_called`: this person cannot be called, see `reason`
testrequiredboolean

CallScript

idrequiredstring
labelrequiredstring
languagerequiredstring
purposerequired"order_confirmation" | "delivery_slot" | "reminder" | "survey" | "information"
result_fieldsrequiredScriptField[]
staterequired"draft" | "active" | "paused"Only an `active` script can be used
variablesrequiredstring[]The names a call may fill

CallScriptList

itemsrequiredCallScript[]

CallTranscript

call_idrequiredstring
linesrequiredTranscriptLine[]
statusrequired"processing" | "ready" | "partial" | "failed"

CatalogItemIn

aliasesstring[] | nullOther names callers use
availableboolean | nullFalse: not available today
categorystring | null
external_idstring | nullYour own id for the item (a product or a variant). Never told to a caller
image_urlstring | nullThe item's own picture, by its public https link (png or jpeg). The assistant may send it to a customer who writes on Messenger or Instagram. TunVox does not fetch or store the picture. Null removes it
namerequiredstring
price_millimesinteger (64-bit) | nullNull removes the price
stock_notestring | nullFor today, e.g. "2 left"

CatalogResult

createdrequiredinteger
testboolean
unchangedrequiredinteger
updatedrequiredinteger

CatalogUpsert

itemsrequiredCatalogItemIn[]

ConnectorChannel

app_versionstring | null
connectedrequiredbooleanWhether the PC's channel to the hub is open now
device_idstring | nullThe paired PC (`pcd_…`)
sincestring | nullWhen the channel opened or closed (ISO 8601)

ConnectorMe

app_namerequiredstring
app_versionrequiredstring
business_idrequiredstring
device_idrequiredstring
expires_atrequiredstring (date-time)When this access token stops working
namerequiredstring
scopesrequiredstring[]
service_idrequiredstringThe first service this PC serves (the one it was paired with)
servicesrequiredConnectorService[]CN4: every service this PC serves, the first one first
template_keyrequiredstring

ConnectorService

idrequiredstring
template_keyrequiredstring

Contact

created_atrequiredstring
idrequiredstring
languagerequiredstring | null
last_activity_atrequiredstring | null
namerequiredstring | null
notesrequiredstring | null
numbersrequiredstring[]
testbooleanTrue on the answer to a write made with a test key: nothing was saved
updated_atrequiredstring

ContactCreate

namestring | null
notesstring | null
numbersstring[]

ContactUpdate

add_numbersstring[]
namestring | null
notesstring | null

Event

business_idrequiredstring
datarequiredobjectIds, codes and times only. Fetch content with the matching GET
idrequiredstring
occurred_atrequiredstring
testrequiredboolean
typerequiredstring

EventList

itemsrequiredEvent[]Oldest first
last_idrequiredstring | nullPass it back as `after` to get what came next; null when `items` is empty (keep your previous value)

ExternalStep

A request the assistant sent to a service during the call (PA4).

actionrequiredstring
atrequiredstring
duration_msrequiredinteger | null
idrequiredstring
statusrequiredstring

Limits

business_requests_per_minuterequiredinteger
page_sizerequiredinteger
requests_per_minuterequiredinteger

Me

business_idrequiredstring
featuresrequiredobjectWhich parts of the API are on for this business
key_idrequiredstring
limitsrequiredLimits
moderequired"live" | "test"`test`: this key never dials, texts or moves money
namerequiredstring
scopesrequiredstring[]
time_zonerequiredstringIANA zone of the business; every time in the API is UTC

Order

addressrequiredstring | null
confirmationrequired"confirmed" | "changed" | "cancelled" | "no_answer"What the confirmation call found, once it happened
created_atrequiredstring
delivery_dayrequiredstring | null
delivery_fee_millimesrequiredinteger (64-bit)
idrequiredstring
itemsrequiredstring
kindrequiredstring
landmarkrequiredstring | null
linesOrderLineView[] | nullThe order line by line; on `GET /v1/orders/{id}` only
make_in_shopboolean | nullOn `GET /v1/orders/{id}`, for a shop connection's key: the owner wants orders placed by phone made in the shop
namerequiredstring | null
numberrequiredstring | null
paymentrequiredstring | null
referencerequiredstringTunVox's short reference, the one a caller is told
shop_order_numberrequiredstring | null
staterequired"new" | "accepted" | "ready" | "on_the_way" | "done" | "cancelled" | "refused" | "no_show"
status_noterequiredstring | null
total_millimesrequiredinteger (64-bit)
updated_atrequiredstring

OrderCreate

addressrequiredstring
confirm_by_callbooleanCall the buyer to confirm a cash-on-delivery order
delay_minutesintegerHow long after the order the call may start
delivery_daystring | null
delivery_fee_millimesinteger (64-bit) | null
itemsrequiredstring | OrderLine[]What was ordered: one line of text, or names and quantities
landmarkstring | null
namestring | null
numberrequiredstringThe buyer's Tunisian number, E.164 or local form
payment"cod" | "prepaid"
shop_order_numberrequiredstringYour shop's own order number. The same number never makes a second order or a second call
totalstring | nullThe amount to collect, in dinars ("45.500"). Or send `total_millimes`
total_millimesinteger (64-bit) | null

OrderCreated

call_afterrequiredstring | null
confirmation_callrequired"queued" | "not_called" | "none"
duplicaterequiredbooleanTrue when this shop order number was already sent: nothing new was made
orderrequiredOrder
reasonrequiredstring | nullWhy the buyer will not be called, as a short code
testboolean

OrderLine

namerequiredstring
quantityinteger

OrderLineView

external_idrequiredstring | nullYour id of the item, when it came from `PUT /v1/catalog/items`
namerequiredstring
notesrequiredstring | null
optionsrequiredstring | nullWhat the caller chose: a size, a colour
quantityrequiredinteger
unit_millimesrequiredinteger (64-bit) | null

OrderUpdate

ready_in_minutesinteger | null
state"accepted" | "refused" | "ready" | "on_the_way" | "done" | "cancelled" | "no_show"
status_notestring | nullA short note the assistant may tell the buyer who asks about the order

PairingStart

app_namerequiredstringThe program, e.g. `tunvox_agent`
app_versionrequiredstring
device_namerequiredstringThe PC's name, shown to the owner
platformrequiredstring`windows`, `macos` or `linux`

PairingStarted

coderequiredstringShow it to the owner (`ABCD-EFGH`); they type it in TunVox › Settings › Services
device_coderequiredstringKeep it secret; poll `POST /connector/token` with it
expires_inrequiredintegerSeconds until the code stops working
intervalrequiredintegerSeconds to wait between two polls

ScriptField

keyrequiredstring
labelrequiredstring
optionsstring[] | null
typerequired"yes_no" | "text" | "date" | "choice" | "number"

ServiceStatus

catalogbooleanThe owner switched phone orders on: send the shop's products with `PUT /v1/catalog/items`, and again when they change
idrequiredstring
presencerequired"online" | "needs_sign_in" | "offline" | "paused" | "direct"
report_again_within_srequiredintegerWithout a report for this long the service is shown offline
reported_atrequiredstring (date-time)

ServiceStatusReport

accountstring | nullADR 0287: what the owner connected, as the platform names it (for example a Page's name), shown to the owner on the connection. Never a person's name, a number or an address
actionsobjectPer action name; an action left out follows `state`
connectorConnectorChannel | nullADR 0228, sent by TunVox's hub for a service run by a program on the owner's PC: a closed channel shows the service offline at once
operationsstring[]Every action name the service can carry out at all
staterequired"online" | "needs_sign_in"`needs_sign_in`: the session or the key on the outside system stopped working

ShopNumber

shop_order_numberrequiredstring

TokenReply

access_tokenstring | null
business_idstring | null
business_namestring | null
device_idstring | null
expires_ininteger | nullSeconds the access token lasts
hub_urlstring | nullWhere to open the channel (`wss://…/v1/connector`)
intervalinteger | null
protocolinteger | nullThe channel's message version
refresh_tokenstring | nullStore it in the OS credential store. Each use returns a new one; never present an old one again
service_idstring | null
staterequired"waiting" | "declined" | "expired" | "paired"`waiting`: poll again after `interval`; `declined`/`expired`: start a new pairing; `paired`: the tokens below are filled
token_typestring | null

TokenRequest

device_codestring | null
grant_typerequired"device_code" | "refresh_token"
refresh_tokenstring | null

TranscriptLine

end_msrequiredinteger | null
languagerequiredstring | null
speakerrequiredstring`caller`, `assistant` or `owner`
start_msrequiredinteger
textrequiredstring | nullNull when the line was redacted

WalletView

available_millimesrequiredinteger (64-bit)What can be spent now: paid and bonus credit minus holds
bonus_millimesrequiredinteger (64-bit)
currencyrequiredstring
held_millimesrequiredinteger (64-bit)Held for calls in progress
month_spent_millimesrequiredinteger (64-bit)Call debits of this business since the first of the month, in the business's time zone
paid_millimesrequiredinteger (64-bit)