Aller au contenu
TunVox

Retour aux 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.

Paramètres

Aucun paramètre

Réponse 200 Me

business_idobligatoirestring
featuresobligatoireobjectWhich parts of the API are on for this business
key_idobligatoirestring
limitsobligatoireLimits
modeobligatoire"live" | "test"`test`: this key never dials, texts or moves money
nameobligatoirestring
scopesobligatoirestring[]
time_zoneobligatoirestringIANA zone of the business; every time in the API is UTC

Erreurs: 401, 429, 503

GET /wallet

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

Paramètres

Aucun paramètre

Réponse 200 WalletView

available_millimesobligatoireinteger (64-bit)What can be spent now: paid and bonus credit minus holds
bonus_millimesobligatoireinteger (64-bit)
currencyobligatoirestring
held_millimesobligatoireinteger (64-bit)Held for calls in progress
month_spent_millimesobligatoireinteger (64-bit)Call debits of this business since the first of the month, in the business's time zone
paid_millimesobligatoireinteger (64-bit)

Erreurs: 401, 403, 429, 503

GET /call-requests

Calls asked for through the API, newest first.

Paramètres

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

Réponse 200 Page<CallRequest>

itemsobligatoireCallRequest[]
next_cursorobligatoirestring | null

Erreurs: 401, 403, 422, 429, 503

GET /call-requests/{request_id}

Paramètres

request_idobligatoirestring (path)

Réponse 200 CallRequest

call_idobligatoirestring | nullThe phone call, once it started
created_atobligatoirestring
ended_atobligatoirestring | null
idobligatoirestring
not_afterobligatoirestring | null
not_beforeobligatoirestring | null
outcomeobligatoire"completed" | "call_back" | "wrong_person" | "declined"
reasonobligatoirestring | nullWhy it was not called or how it ended, as a short code
referenceobligatoirestring | null
resultobligatoireobjectThe script's result fields the assistant filled
scriptobligatoirestring
stateobligatoire"accepted" | "not_called" | "calling" | "done" | "unreached" | "cancelled" | "expired"`accepted`: waiting its turn. `not_called`: this person cannot be called, see `reason`
testobligatoireboolean

Erreurs: 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.

Paramètres

request_idobligatoirestring (path)

Réponse 200 CallRequest

call_idobligatoirestring | nullThe phone call, once it started
created_atobligatoirestring
ended_atobligatoirestring | null
idobligatoirestring
not_afterobligatoirestring | null
not_beforeobligatoirestring | null
outcomeobligatoire"completed" | "call_back" | "wrong_person" | "declined"
reasonobligatoirestring | nullWhy it was not called or how it ended, as a short code
referenceobligatoirestring | null
resultobligatoireobjectThe script's result fields the assistant filled
scriptobligatoirestring
stateobligatoire"accepted" | "not_called" | "calling" | "done" | "unreached" | "cancelled" | "expired"`accepted`: waiting its turn. `not_called`: this person cannot be called, see `reason`
testobligatoireboolean

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

GET /call-scripts

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

Paramètres

Aucun paramètre

Réponse 200 CallScriptList

itemsobligatoireCallScript[]

Erreurs: 401, 403, 429, 503

GET /calls

Calls of the business, newest first.

Paramètres

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)

Réponse 200 Page<Call>

itemsobligatoireCall[]
next_cursorobligatoirestring | null

Erreurs: 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}`.

Paramètres

Idempotency-Keystring | null (header)

Corps de la requête 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
scriptobligatoirestringThe id of an approved call script
test_outcome"answered" | "no_answer" | "refused"With a test key only: the outcome to simulate (default `answered`)
toobligatoirestringA Tunisian number, E.164 or local form
variablesobjectA value for each of the script's variables

Réponse 202 CallRequest

call_idobligatoirestring | nullThe phone call, once it started
created_atobligatoirestring
ended_atobligatoirestring | null
idobligatoirestring
not_afterobligatoirestring | null
not_beforeobligatoirestring | null
outcomeobligatoire"completed" | "call_back" | "wrong_person" | "declined"
reasonobligatoirestring | nullWhy it was not called or how it ended, as a short code
referenceobligatoirestring | null
resultobligatoireobjectThe script's result fields the assistant filled
scriptobligatoirestring
stateobligatoire"accepted" | "not_called" | "calling" | "done" | "unreached" | "cancelled" | "expired"`accepted`: waiting its turn. `not_called`: this person cannot be called, see `reason`
testobligatoireboolean

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

GET /calls/{call_id}

Paramètres

call_idobligatoirestring (path)

Réponse 200 Call

answered_atobligatoirestring | nullWhen the assistant started talking
channelobligatoire"dongle" | "cloud"
charged_millimesobligatoireinteger (64-bit) | nullThe call's one debit, in millimes (1 TND = 1000)
contact_idobligatoirestring | null
directionobligatoire"inbound" | "outbound"
duration_secondsobligatoireinteger | nullTime with the assistant; null until the call is finalized
ended_atobligatoirestring | null
exit_reasonobligatoirestring | null
external_stepsExternalStep[]
idobligatoirestring
numberobligatoirestring | nullThe other party's number in E.164; null when withheld
recapobligatoireCallRecap | null
referencestring | nullYour own id, for a call created through the API
started_atobligatoirestring
stateobligatoirestring
transcriptobligatoire"processing" | "ready" | "partial" | "failed" | "not_collected" | "deleted"

Erreurs: 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.

Paramètres

call_idobligatoirestring (path)

Réponse 200 CallTranscript

call_idobligatoirestring
linesobligatoireTranscriptLine[]
statusobligatoire"processing" | "ready" | "partial" | "failed"

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

GET /contacts

Active contacts, most recent activity first.

Paramètres

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

Réponse 200 Page<Contact>

itemsobligatoireContact[]
next_cursorobligatoirestring | null

Erreurs: 401, 403, 422, 429, 503

POST /contacts

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

Paramètres

Idempotency-Keystring | null (header)

Corps de la requête ContactCreate

namestring | null
notesstring | null
numbersstring[]

Réponse 201 Contact

created_atobligatoirestring
idobligatoirestring
languageobligatoirestring | null
last_activity_atobligatoirestring | null
nameobligatoirestring | null
notesobligatoirestring | null
numbersobligatoirestring[]
testbooleanTrue on the answer to a write made with a test key: nothing was saved
updated_atobligatoirestring

Erreurs: 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.

Paramètres

contact_idobligatoirestring (path)

Corps de la requête ContactUpdate

add_numbersstring[]
namestring | null
notesstring | null

Réponse 200 Contact

created_atobligatoirestring
idobligatoirestring
languageobligatoirestring | null
last_activity_atobligatoirestring | null
nameobligatoirestring | null
notesobligatoirestring | null
numbersobligatoirestring[]
testbooleanTrue on the answer to a write made with a test key: nothing was saved
updated_atobligatoirestring

Erreurs: 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.

Paramètres

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

Réponse 200 Page<Order>

itemsobligatoireOrder[]
next_cursorobligatoirestring | null

Erreurs: 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.

Paramètres

Idempotency-Keystring | null (header)

Corps de la requête OrderCreate

addressobligatoirestring
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
itemsobligatoirestring | OrderLine[]What was ordered: one line of text, or names and quantities
landmarkstring | null
namestring | null
numberobligatoirestringThe buyer's Tunisian number, E.164 or local form
payment"cod" | "prepaid"
shop_order_numberobligatoirestringYour 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

Réponse 201 OrderCreated

call_afterobligatoirestring | null
confirmation_callobligatoire"queued" | "not_called" | "none"
duplicateobligatoirebooleanTrue when this shop order number was already sent: nothing new was made
orderobligatoireOrder
reasonobligatoirestring | nullWhy the buyer will not be called, as a short code
testboolean

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

GET /orders/{order_id}

Paramètres

order_idobligatoirestring (path)

Réponse 200 Order

addressobligatoirestring | null
confirmationobligatoire"confirmed" | "changed" | "cancelled" | "no_answer"What the confirmation call found, once it happened
created_atobligatoirestring
delivery_dayobligatoirestring | null
delivery_fee_millimesobligatoireinteger (64-bit)
idobligatoirestring
itemsobligatoirestring
kindobligatoirestring
landmarkobligatoirestring | 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
nameobligatoirestring | null
numberobligatoirestring | null
paymentobligatoirestring | null
referenceobligatoirestringTunVox's short reference, the one a caller is told
shop_order_numberobligatoirestring | null
stateobligatoire"new" | "accepted" | "ready" | "on_the_way" | "done" | "cancelled" | "refused" | "no_show"
status_noteobligatoirestring | null
total_millimesobligatoireinteger (64-bit)
updated_atobligatoirestring

Erreurs: 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.

Paramètres

order_idobligatoirestring (path)

Corps de la requête 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

Réponse 200 Order

addressobligatoirestring | null
confirmationobligatoire"confirmed" | "changed" | "cancelled" | "no_answer"What the confirmation call found, once it happened
created_atobligatoirestring
delivery_dayobligatoirestring | null
delivery_fee_millimesobligatoireinteger (64-bit)
idobligatoirestring
itemsobligatoirestring
kindobligatoirestring
landmarkobligatoirestring | 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
nameobligatoirestring | null
numberobligatoirestring | null
paymentobligatoirestring | null
referenceobligatoirestringTunVox's short reference, the one a caller is told
shop_order_numberobligatoirestring | null
stateobligatoire"new" | "accepted" | "ready" | "on_the_way" | "done" | "cancelled" | "refused" | "no_show"
status_noteobligatoirestring | null
total_millimesobligatoireinteger (64-bit)
updated_atobligatoirestring

Erreurs: 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.

Paramètres

order_idobligatoirestring (path)

Corps de la requête ShopNumber

shop_order_numberobligatoirestring

Réponse 200 Order

addressobligatoirestring | null
confirmationobligatoire"confirmed" | "changed" | "cancelled" | "no_answer"What the confirmation call found, once it happened
created_atobligatoirestring
delivery_dayobligatoirestring | null
delivery_fee_millimesobligatoireinteger (64-bit)
idobligatoirestring
itemsobligatoirestring
kindobligatoirestring
landmarkobligatoirestring | 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
nameobligatoirestring | null
numberobligatoirestring | null
paymentobligatoirestring | null
referenceobligatoirestringTunVox's short reference, the one a caller is told
shop_order_numberobligatoirestring | null
stateobligatoire"new" | "accepted" | "ready" | "on_the_way" | "done" | "cancelled" | "refused" | "no_show"
status_noteobligatoirestring | null
total_millimesobligatoireinteger (64-bit)
updated_atobligatoirestring

Erreurs: 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.

Paramètres

Aucun paramètre

Corps de la requête CatalogUpsert

itemsobligatoireCatalogItemIn[]

Réponse 200 CatalogResult

createdobligatoireinteger
testboolean
unchangedobligatoireinteger
updatedobligatoireinteger

Erreurs: 401, 403, 422, 429, 503

GET /bookings

Bookings by start time, soonest first.

Paramètres

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

Réponse 200 Page<Booking>

itemsobligatoireBooking[]
next_cursorobligatoirestring | null

Erreurs: 401, 403, 422, 429, 503

GET /bookings/{booking_id}

Paramètres

booking_idobligatoirestring (path)

Réponse 200 Booking

call_idobligatoirestring | null
contact_idobligatoirestring | null
created_atobligatoirestring
detailsobligatoireobjectWhat the business asked to collect: name, party size, a note…
ends_atobligatoirestring
idobligatoirestring
party_sizeobligatoireinteger | null
referenceobligatoirestring | null
service_idobligatoirestring | null
sourceobligatoirestring
starts_atobligatoirestring
stateobligatoire"held" | "confirmed" | "completed" | "expired" | "cancelled" | "no_show"
time_zoneobligatoirestring
updated_atobligatoirestring

Erreurs: 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.

Paramètres

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

Réponse 200 EventList

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

Erreurs: 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.

Paramètres

request_idobligatoirestring (path)

Corps de la requête ActionLateResult

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

Réponse 200 ActionRequest

actionobligatoirestring
call_idobligatoirestring | null
idobligatoirestring
statusobligatoirestring

Erreurs: 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.

Paramètres

service_idobligatoirestring (path)

Corps de la requête 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
stateobligatoire"online" | "needs_sign_in"`needs_sign_in`: the session or the key on the outside system stopped working

Réponse 200 ServiceStatus

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

Erreurs: 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.

Paramètres

task_idobligatoirestring (path)

Corps de la requête AgentTaskUpdate

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

Réponse 200 AgentTaskState

idobligatoirestring
stateobligatoirestring

Erreurs: 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.

Paramètres

Aucun paramètre

Réponse 200 ConnectorMe

app_nameobligatoirestring
app_versionobligatoirestring
business_idobligatoirestring
device_idobligatoirestring
expires_atobligatoirestring (date-time)When this access token stops working
nameobligatoirestring
scopesobligatoirestring[]
service_idobligatoirestringThe first service this PC serves (the one it was paired with)
servicesobligatoireConnectorService[]CN4: every service this PC serves, the first one first
template_keyobligatoirestring

Erreurs: 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`.

Paramètres

Aucun paramètre

Corps de la requête PairingStart

app_nameobligatoirestringThe program, e.g. `tunvox_agent`
app_versionobligatoirestring
device_nameobligatoirestringThe PC's name, shown to the owner
platformobligatoirestring`windows`, `macos` or `linux`

Réponse 201 PairingStarted

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

Erreurs: 422, 429, 503

POST /connector/revoke

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

Paramètres

Aucun paramètre

Réponse 204

Erreurs: 401, 503

POST /connector/token

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

Paramètres

Aucun paramètre

Corps de la requête TokenRequest

device_codestring | null
grant_typeobligatoire"device_code" | "refresh_token"
refresh_tokenstring | null

Réponse 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
stateobligatoire"waiting" | "declined" | "expired" | "paired"`waiting`: poll again after `interval`; `declined`/`expired`: start a new pairing; `paired`: the tokens below are filled
token_typestring | null

Erreurs: 401, 422, 429, 503

Champs

ActionLateResult

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

ActionRequest

actionobligatoirestring
call_idobligatoirestring | null
idobligatoirestring
statusobligatoirestring

ActionStatus

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

AgentTaskState

idobligatoirestring
stateobligatoirestring

AgentTaskUpdate

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

Booking

call_idobligatoirestring | null
contact_idobligatoirestring | null
created_atobligatoirestring
detailsobligatoireobjectWhat the business asked to collect: name, party size, a note…
ends_atobligatoirestring
idobligatoirestring
party_sizeobligatoireinteger | null
referenceobligatoirestring | null
service_idobligatoirestring | null
sourceobligatoirestring
starts_atobligatoirestring
stateobligatoire"held" | "confirmed" | "completed" | "expired" | "cancelled" | "no_show"
time_zoneobligatoirestring
updated_atobligatoirestring

Call

answered_atobligatoirestring | nullWhen the assistant started talking
channelobligatoire"dongle" | "cloud"
charged_millimesobligatoireinteger (64-bit) | nullThe call's one debit, in millimes (1 TND = 1000)
contact_idobligatoirestring | null
directionobligatoire"inbound" | "outbound"
duration_secondsobligatoireinteger | nullTime with the assistant; null until the call is finalized
ended_atobligatoirestring | null
exit_reasonobligatoirestring | null
external_stepsExternalStep[]
idobligatoirestring
numberobligatoirestring | nullThe other party's number in E.164; null when withheld
recapobligatoireCallRecap | null
referencestring | nullYour own id, for a call created through the API
started_atobligatoirestring
stateobligatoirestring
transcriptobligatoire"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
scriptobligatoirestringThe id of an approved call script
test_outcome"answered" | "no_answer" | "refused"With a test key only: the outcome to simulate (default `answered`)
toobligatoirestringA Tunisian number, E.164 or local form
variablesobjectA value for each of the script's variables

CallRecap

languageobligatoirestring | null
outcomeobligatoirestring | null
restrictedobligatoireboolean
summaryobligatoirestring | nullA short neutral recap; null when the call's content is restricted

CallRequest

call_idobligatoirestring | nullThe phone call, once it started
created_atobligatoirestring
ended_atobligatoirestring | null
idobligatoirestring
not_afterobligatoirestring | null
not_beforeobligatoirestring | null
outcomeobligatoire"completed" | "call_back" | "wrong_person" | "declined"
reasonobligatoirestring | nullWhy it was not called or how it ended, as a short code
referenceobligatoirestring | null
resultobligatoireobjectThe script's result fields the assistant filled
scriptobligatoirestring
stateobligatoire"accepted" | "not_called" | "calling" | "done" | "unreached" | "cancelled" | "expired"`accepted`: waiting its turn. `not_called`: this person cannot be called, see `reason`
testobligatoireboolean

CallScript

idobligatoirestring
labelobligatoirestring
languageobligatoirestring
purposeobligatoire"order_confirmation" | "delivery_slot" | "reminder" | "survey" | "information"
result_fieldsobligatoireScriptField[]
stateobligatoire"draft" | "active" | "paused"Only an `active` script can be used
variablesobligatoirestring[]The names a call may fill

CallScriptList

itemsobligatoireCallScript[]

CallTranscript

call_idobligatoirestring
linesobligatoireTranscriptLine[]
statusobligatoire"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
nameobligatoirestring
price_millimesinteger (64-bit) | nullNull removes the price
stock_notestring | nullFor today, e.g. "2 left"

CatalogResult

createdobligatoireinteger
testboolean
unchangedobligatoireinteger
updatedobligatoireinteger

CatalogUpsert

itemsobligatoireCatalogItemIn[]

ConnectorChannel

app_versionstring | null
connectedobligatoirebooleanWhether 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_nameobligatoirestring
app_versionobligatoirestring
business_idobligatoirestring
device_idobligatoirestring
expires_atobligatoirestring (date-time)When this access token stops working
nameobligatoirestring
scopesobligatoirestring[]
service_idobligatoirestringThe first service this PC serves (the one it was paired with)
servicesobligatoireConnectorService[]CN4: every service this PC serves, the first one first
template_keyobligatoirestring

ConnectorService

idobligatoirestring
template_keyobligatoirestring

Contact

created_atobligatoirestring
idobligatoirestring
languageobligatoirestring | null
last_activity_atobligatoirestring | null
nameobligatoirestring | null
notesobligatoirestring | null
numbersobligatoirestring[]
testbooleanTrue on the answer to a write made with a test key: nothing was saved
updated_atobligatoirestring

ContactCreate

namestring | null
notesstring | null
numbersstring[]

ContactUpdate

add_numbersstring[]
namestring | null
notesstring | null

Event

business_idobligatoirestring
dataobligatoireobjectIds, codes and times only. Fetch content with the matching GET
idobligatoirestring
occurred_atobligatoirestring
testobligatoireboolean
typeobligatoirestring

EventList

itemsobligatoireEvent[]Oldest first
last_idobligatoirestring | 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).

actionobligatoirestring
atobligatoirestring
duration_msobligatoireinteger | null
idobligatoirestring
statusobligatoirestring

Limits

business_requests_per_minuteobligatoireinteger
page_sizeobligatoireinteger
requests_per_minuteobligatoireinteger

Me

business_idobligatoirestring
featuresobligatoireobjectWhich parts of the API are on for this business
key_idobligatoirestring
limitsobligatoireLimits
modeobligatoire"live" | "test"`test`: this key never dials, texts or moves money
nameobligatoirestring
scopesobligatoirestring[]
time_zoneobligatoirestringIANA zone of the business; every time in the API is UTC

Order

addressobligatoirestring | null
confirmationobligatoire"confirmed" | "changed" | "cancelled" | "no_answer"What the confirmation call found, once it happened
created_atobligatoirestring
delivery_dayobligatoirestring | null
delivery_fee_millimesobligatoireinteger (64-bit)
idobligatoirestring
itemsobligatoirestring
kindobligatoirestring
landmarkobligatoirestring | 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
nameobligatoirestring | null
numberobligatoirestring | null
paymentobligatoirestring | null
referenceobligatoirestringTunVox's short reference, the one a caller is told
shop_order_numberobligatoirestring | null
stateobligatoire"new" | "accepted" | "ready" | "on_the_way" | "done" | "cancelled" | "refused" | "no_show"
status_noteobligatoirestring | null
total_millimesobligatoireinteger (64-bit)
updated_atobligatoirestring

OrderCreate

addressobligatoirestring
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
itemsobligatoirestring | OrderLine[]What was ordered: one line of text, or names and quantities
landmarkstring | null
namestring | null
numberobligatoirestringThe buyer's Tunisian number, E.164 or local form
payment"cod" | "prepaid"
shop_order_numberobligatoirestringYour 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_afterobligatoirestring | null
confirmation_callobligatoire"queued" | "not_called" | "none"
duplicateobligatoirebooleanTrue when this shop order number was already sent: nothing new was made
orderobligatoireOrder
reasonobligatoirestring | nullWhy the buyer will not be called, as a short code
testboolean

OrderLine

nameobligatoirestring
quantityinteger

OrderLineView

external_idobligatoirestring | nullYour id of the item, when it came from `PUT /v1/catalog/items`
nameobligatoirestring
notesobligatoirestring | null
optionsobligatoirestring | nullWhat the caller chose: a size, a colour
quantityobligatoireinteger
unit_millimesobligatoireinteger (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_nameobligatoirestringThe program, e.g. `tunvox_agent`
app_versionobligatoirestring
device_nameobligatoirestringThe PC's name, shown to the owner
platformobligatoirestring`windows`, `macos` or `linux`

PairingStarted

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

ScriptField

keyobligatoirestring
labelobligatoirestring
optionsstring[] | null
typeobligatoire"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
idobligatoirestring
presenceobligatoire"online" | "needs_sign_in" | "offline" | "paused" | "direct"
report_again_within_sobligatoireintegerWithout a report for this long the service is shown offline
reported_atobligatoirestring (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
stateobligatoire"online" | "needs_sign_in"`needs_sign_in`: the session or the key on the outside system stopped working

ShopNumber

shop_order_numberobligatoirestring

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
stateobligatoire"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_typeobligatoire"device_code" | "refresh_token"
refresh_tokenstring | null

TranscriptLine

end_msobligatoireinteger | null
languageobligatoirestring | null
speakerobligatoirestring`caller`, `assistant` or `owner`
start_msobligatoireinteger
textobligatoirestring | nullNull when the line was redacted

WalletView

available_millimesobligatoireinteger (64-bit)What can be spent now: paid and bonus credit minus holds
bonus_millimesobligatoireinteger (64-bit)
currencyobligatoirestring
held_millimesobligatoireinteger (64-bit)Held for calls in progress
month_spent_millimesobligatoireinteger (64-bit)Call debits of this business since the first of the month, in the business's time zone
paid_millimesobligatoireinteger (64-bit)