Reference API
Všechny adresy API složené přímo ze specifikace OpenAPI. Názvy polí a podrobné popisy jsou anglicky.
Základní adresa je https://api.ottoai.cz. Každý požadavek posílá Authorization: Bearer <klíč>. Strojově čitelná podoba je v openapi.json.
Account
/v1/me Oprávnění readKdo jsem: firma, plán, funkce a seznam událostí
Odpověď 200
tenantobjectidstring (uuid)namestring
planstringfeaturesobjectapibooleanwebhooksbooleanwhiteLabelbooleaninAppChatboolean
limitsobjectconversationsPerMonthinteger | null
eventsstring[]
Chyby: 401 403 429
/v1/stats Oprávnění readPočty a výsledky konverzací v čase
Without parameters: the last 30 days by day in Europe/Bratislava. The range is at most 400 days. resolvedByOtto + unanswered are the conversations Otto handled alone, which the panel shows as solved by Otto.
Parametry
sincequery · string (date-time) nepovinné Created at or after this time.untilquery · string (date-time) nepovinné Created before this time.intervalquery · day | week | month nepovinné Weeks start on Monday.timezonequery · string nepovinné IANA time zone for the series boundaries.
Odpověď 200
conversationsTotalintegerconversationsMonthintegerproductsintegerrangeobjectsincestring (date-time)untilstring (date-time)intervalday | week | monthtimezonestringtotalsobjectconversationsintegerresolvedByOttointegerunansweredintegerhandedOffintegermissedintegerratingUpintegerratingDownintegerleadsintegerreturnsinteger
seriesobject[]datestring (date) First day of the interval in the given time zone.conversationsintegerresolvedByOttointegerunansweredintegerhandedOffintegermissedintegerratingUpintegerratingDowninteger
Chyby: 400 401 403 429
/v1/usage Oprávnění readSpotřeba odpovědí v tomto měsíci
With a subscription the period runs from the day of payment to the same day next month, without one it is the calendar month. limit and remaining are null on an unlimited plan.
Odpověď 200
monthstringperiodStartstring (date-time)periodEndstring (date-time) When the limit resets.conversationsintegerlimitinteger | nullremaininginteger | null
Chyby: 401 403 429
Ask
/v1/ask Oprávnění askZeptat se Otta a počkat na odpověď
Call it from your server, the key does not belong in a mobile app or website code. Sends one customer message down the same path as the chat on your site: the same answer, the same checks before anything goes out, the same answer limit, message.created webhooks and encrypted storage. The conversation shows up in the panel's Inbox with the channel API. The call returns when the answer is ready, so set your client timeout to at least 60 seconds. Without conversationId a new conversation starts; send conversationId from the response to continue it. Only conversations started through the API can be continued, others return 409 conv_other_channel. Limit: 30 questions per minute per key and 60 per company, on top of the general API limit. A question that gets an answer counts as one answer of your plan. status tells you what happened: answered, handoff (Otto passes it to a colleague), with_operator (a colleague has the conversation, answer is null and the message is waiting for them) or stopped (the plan limit is reached or the service is paused; answer holds the same sentence the chat shows and the message stays in the Inbox). A colleague's reply reaches you through the message.created webhook or GET /v1/conversations/{id}.
Tělo požadavku
messagestring What the customer wrote.conversationIdstring (uuid) nepovinné From the previous response, to continue the conversation.idempotencyKeystring (uuid) nepovinné A new UUID for every question. Repeat it when you retry: you get the stored answer and no other answer is spent.languagesk | cs | en nepovinné The language of your page. Otto replies in the language the customer writes in and uses this for a short message whose language cannot be told.identitystring nepovinné The signed identity token of your signed-in customer, the same one the chat on your site uses.pageobject nepovinnéurlstring (uri) nepovinnétitlestring nepovinné
customerobject nepovinnénamestring nepovinnéemailstring nepovinnéphonestring nepovinné
Odpověď 200
conversationIdstring (uuid)messageIdstring | null Otto's message, the same id as in the message.created webhook. null when status is with_operator.statusanswered | handoff | with_operator | stoppedanswerstring | null The checked answer, the same text the chat on your site shows. It may contain **bold** and links. null when status is with_operator.followupstring | null A follow-up question for the customer, shown after the answer.suggestionsstring[] Short replies the customer can tap.productsobject[]titlestringurlstring | nullpricenumber | string | nullcurrencystring | nullimagestring | nullavailabilitystring | null
handoffboolean Otto wants to pass the conversation to a colleague.needsContactboolean Where the chat would show the contact form. Ask for an email or phone and send it to POST /v1/conversations/{id}/contact.contactBeforeHandoffboolean The handover waits for that contact.returnFormclaim | withdrawal | null Where the chat would show the complaint or return form. The API has no such form: show your own or send the customer to your complaints page.languagestring | nullcustomerVerifiedboolean The identity token was accepted.
Chyby: 400 401 403 404 409 429
/v1/chat Oprávnění askZeptat se Otta a sledovat stav přes SSE
The same request and the same result as POST /v1/ask, delivered as text/event-stream so your app can show that Otto is working. This is not token streaming: every answer is checked before it goes out, so its text arrives in one piece at the end. Events: status with { state: processing, elapsedMs } right away and then every 5 seconds; answer with the same object as POST /v1/ask, or error with { error, errcode, status, requestId }; done always comes last. A wrong key, permission, plan, parameter, limit or conversation returns an ordinary JSON error before the stream opens. When the connection drops, Otto still finishes, stores and counts the answer. Repeat the question with the same idempotencyKey to get that answer without spending another one.
Tělo požadavku
messagestring What the customer wrote.conversationIdstring (uuid) nepovinné From the previous response, to continue the conversation.idempotencyKeystring (uuid) nepovinné A new UUID for every question. Repeat it when you retry: you get the stored answer and no other answer is spent.languagesk | cs | en nepovinné The language of your page. Otto replies in the language the customer writes in and uses this for a short message whose language cannot be told.identitystring nepovinné The signed identity token of your signed-in customer, the same one the chat on your site uses.pageobject nepovinnéurlstring (uri) nepovinnétitlestring nepovinné
customerobject nepovinnénamestring nepovinnéemailstring nepovinnéphonestring nepovinné
Chyby: 400 401 403 404 409 429
/v1/conversations/{id}/contact Oprávnění askPředat kontakt na zákazníka
Does what the contact form in the chat does, when an answer says needsContact. Send at least an email or a phone number. When contactBeforeHandoff was true, the conversation goes to a colleague now and handedOff is true. Only for conversations started through the API.
Parametry
idpath · string (uuid)
Tělo požadavku
namestring nepovinnéemailstring nepovinnéphonestring nepovinnénotestring nepovinnéidentitystring nepovinné The identity token, needed when a verified customer owns the conversation.
Odpověď 200
oktruehandedOffboolean
Chyby: 400 401 403 404 409 429
Conversations
/v1/conversations Oprávnění readSeznam konverzací
Newest activity first. Returns no message text, use GET /v1/conversations/{id} for that.
Parametry
statusquery · bot | human | resolved nepovinnéoutcomequery · resolved_by_otto | unanswered | handed_off | missed nepovinnélangquery · string nepovinné Two-letter language code, for example sk, cs or en.qquery · string nepovinné Words to find in the message text or the colleague's name. Searches the newest 20,000 messages, searchTruncated is true when there were more. At most 20 searches per minute.tagquery · string nepovinné Only conversations with this tag: its name (any letter case) or id from GET /v1/tags. An unknown tag returns 400.sincequery · string (date-time) nepovinné Created at or after this time.untilquery · string (date-time) nepovinné Created before this time.updatedSincequery · string (date-time) nepovinné Changed at or after this time.beforequery · string nepovinné nextBefore from the previous page. Opaque, do not build it yourself.limitquery · integer nepovinné
Odpověď 200
conversationsConversation[]idstring (uuid)statusbot | human | resolvedoutcomeresolved_by_otto | unanswered | handed_off | missedlangstring | nullchannelweb | messenger | instagram | api Where the customer writes from.tagsstring[] Names of the tags in the order they were added. Changing them changes updatedAt.rating1 | -1 | nullcreatedAtstring (date-time)lastAtstring | null (date-time)updatedAtstring (date-time)customerIdstring | null Your customer ID from a verified identity token (sub), null for anonymous chats.
nextBeforestring | nullsearchTruncatedboolean nepovinné Only with q.
Chyby: 400 401 403 429
/v1/conversations/{id} Oprávnění readJedna konverzace i se zprávami
The only endpoint that returns message text. At most 500 messages, oldest first.
Parametry
idpath · string (uuid)
Odpověď 200
conversationConversationDetailidstring (uuid)statusbot | human | resolvedoutcomeresolved_by_otto | unanswered | handed_off | missedlangstring | nullchannelweb | messenger | instagram | api Where the customer writes from.tagsstring[] Names of the tags in the order they were added.rating1 | -1 | nullcreatedAtstring (date-time)lastAtstring | null (date-time)customerIdstring | nullcustomerCustomer The customer your site verified with a signed token, null for anonymous chats.idstringemailstring | nullnamestring | nullphonestring | nullverifiedAtstring | null (date-time)
messagesMessage[]roleuser | bot | operatorkindstring | nulltextstringatstring (date-time)deletedAtstring (date-time) nepovinné When the operator deleted the message. The customer no longer sees it, the text stays for you.
Chyby: 401 403 404 429
/v1/conversations/{id} Oprávnění writeVymazat konverzaci
Erases the conversation with its messages, notes, contacts, complaints and returns with their photos and unanswered questions, the same as deleting it in the panel. Use it when a customer asks you to erase their data. It cannot be undone.
Parametry
idpath · string (uuid)
Odpověď 200
oktrue
Chyby: 401 403 404 429
/v1/conversations/{id}/messages Oprávnění writeOdpovědět zákazníkovi
Sends a message as a colleague, exactly like replying in the panel. The conversation switches to human and Otto stays quiet in it. A customer who is not on the site gets the reply by email.
Parametry
idpath · string (uuid)
Tělo požadavku
textstringoperatorIdstring (uuid) nepovinné Team member from GET /v1/operators. Without it the author is shown as API.
Odpověď 200
oktruemessageobjectrole"operator"kind"text"textstringauthorstringatstring (date-time)
conversationobjectidstring (uuid)status"human"
Chyby: 400 401 403 404 429
/v1/conversations/{id}/notes Oprávnění writePřidat interní poznámku
The customer never sees notes.
Parametry
idpath · string (uuid)
Tělo požadavku
textstringoperatorIdstring (uuid) nepovinné Team member from GET /v1/operators. Without it the author is shown as API.
Odpověď 200
oktruenoteobjectidstringauthorstringtextstringatstring (date-time)
Chyby: 400 401 403 404 429
/v1/conversations/{id}/takeover Oprávnění writePřevzít konverzaci
Otto stops answering. Without operatorId the current assignee stays. Sends the conversation.operator_joined event.
Parametry
idpath · string (uuid)
Tělo požadavku
operatorIdstring (uuid) nepovinné Team member from GET /v1/operators. Without it the author is shown as API.
Odpověď 200
oktrueconversationobjectidstring (uuid)status"human"assigneestring | null (uuid)
Chyby: 400 401 403 404 409 429
/v1/conversations/{id}/release Oprávnění writeVrátit konverzaci Ottovi
Otto answers on its own again and nobody is assigned.
Parametry
idpath · string (uuid)
Odpověď 200
oktrueconversationobjectidstring (uuid)status"bot"assigneenull
Chyby: 401 403 404 409 429
/v1/conversations/{id}/resolve Oprávnění writeVyřešit konverzaci
Like Resolve in the panel. Contacts the customer left in this conversation are marked handled, each with the lead.updated event. Sends the conversation.resolved event.
Parametry
idpath · string (uuid)
Odpověď 200
oktrueconversationobjectidstring (uuid)status"resolved"
Chyby: 401 403 404 429
/v1/conversations/{id}/reopen Oprávnění writeOtevřít vyřešenou konverzaci
The conversation returns to human.
Parametry
idpath · string (uuid)
Odpověď 200
oktrueconversationobjectidstring (uuid)status"human"
Chyby: 401 403 404 429
Tags
/v1/conversations/{id}/tags Oprávnění writePřidat nebo odebrat štítky
Like tagging in the panel. add and remove take tag names (any letter case) or ids from GET /v1/tags; the tag must exist, create it with POST /v1/tags. Send at least one non-empty list; empty or whitespace-only names are rejected. Adding a tag the conversation has, or removing one it does not, changes nothing. A conversation carries at most 10 tags (errcode too_many_tags), an unknown tag returns 404 tag_not_found.
Parametry
idpath · string (uuid)
Tělo požadavku
addstring[] nepovinné Tag names or ids to add.removestring[] nepovinné Tag names or ids to remove.
Odpověď 200
oktrueconversationobjectidstring (uuid)tagsstring[]
Chyby: 400 401 403 404 409 429
/v1/tags Oprávnění readŠtítky konverzací
Alphabetical. conversations says how many conversations carry the tag.
Odpověď 200
tagsTag[]idstring (uuid)namestringcolorblue | green | yellow | orange | red | pink | purple | teal | grayconversationsinteger How many conversations carry the tag.
Chyby: 401 403 429
/v1/tags Oprávnění writeVytvořit štítek
At most 50 tags per company (errcode tag_limit). Names are unique regardless of letter case (errcode tag_exists). Without color the tag is blue.
Tělo požadavku
nameTagNamecolorblue | green | yellow | orange | red | pink | purple | teal | gray nepovinné
Odpověď 200
oktruetagTagidstring (uuid)namestringcolorblue | green | yellow | orange | red | pink | purple | teal | grayconversationsinteger How many conversations carry the tag.
Chyby: 400 401 403 409 429
/v1/tags/{id} Oprávnění writePřejmenovat štítek nebo změnit barvu
Conversations keep the tag under its new name. Renaming and deleting tags is limited to 30 changes per minute per company (errcode rate_limited).
Parametry
idpath · string (uuid)
Tělo požadavku
nameTagName nepovinnécolorblue | green | yellow | orange | red | pink | purple | teal | gray nepovinné
Odpověď 200
oktruetagTagidstring (uuid)namestringcolorblue | green | yellow | orange | red | pink | purple | teal | grayconversationsinteger How many conversations carry the tag.
Chyby: 400 401 403 404 409 429
/v1/tags/{id} Oprávnění writeSmazat štítek
The tag disappears from every conversation that carried it. It cannot be undone.
Parametry
idpath · string (uuid)
Odpověď 200
oktrue
Chyby: 401 403 404 429
Leads
/v1/leads Oprávnění readKontakty, které zákazníci nechali
Parametry
sincequery · string (date-time) nepovinné Created at or after this time.untilquery · string (date-time) nepovinné Created before this time.beforequery · string nepovinné nextBefore from the previous page. Opaque, do not build it yourself.limitquery · integer nepovinné
Odpověď 200
leadsLead[]idstring (uuid)conversationIdstring | null (uuid)namestringemailstringphonestringnotestringhandledbooleancreatedAtstring (date-time)
nextBeforestring | null
Chyby: 400 401 403 429
/v1/leads/{id} Oprávnění writeOznačit kontakt jako vyřízený
Sends the lead.updated event when the value changes.
Parametry
idpath · string (uuid)
Tělo požadavku
handledboolean
Odpověď 200
oktrueleadobjectidstring (uuid)handledboolean
Chyby: 400 401 403 404 429
/v1/leads/{id} Oprávnění writeVymazat kontakt
Erases one contact the customer left. The conversation stays, erase it with DELETE /v1/conversations/{id}. It cannot be undone.
Parametry
idpath · string (uuid)
Odpověď 200
oktrue
Chyby: 401 403 404 429
Returns
/v1/returns Oprávnění readReklamace a vrácení
Parametry
statusquery · new | approved | rejected | resolved nepovinnékindquery · claim | withdrawal nepovinnésincequery · string (date-time) nepovinné Created at or after this time.untilquery · string (date-time) nepovinné Created before this time.updatedSincequery · string (date-time) nepovinné Changed at or after this time.beforequery · string nepovinné nextBefore from the previous page. Opaque, do not build it yourself.limitquery · integer nepovinné
Odpověď 200
returnsReturn[]idstringkindclaim | withdrawalstatusnew | approved | rejected | resolvedorderIdstringissuestringwantstringnamestringemailstringconversationIdstring | null (uuid)createdAtstring (date-time)decidedAtstring | null (date-time)
nextBeforestring | null
Chyby: 400 401 403 429
/v1/returns/{id} Oprávnění writeRozhodnout o reklamaci nebo vrácení
Like the decision in the panel. notify: true emails the customer the decision and your note. Sends the return.updated event.
Parametry
idpath · string
Tělo požadavku
statusnew | approved | rejected | resolvednotestring nepovinnénotifyboolean nepovinné
Odpověď 200
oktruereturnobjectidstringstatusstring
Chyby: 400 401 403 404 429
Unanswered
/v1/unanswered Oprávnění readDotazy, na které chybí odpověď
Parametry
sincequery · string (date-time) nepovinné Created at or after this time.untilquery · string (date-time) nepovinné Created before this time.beforequery · string nepovinné nextBefore from the previous page. Opaque, do not build it yourself.limitquery · integer nepovinné
Odpověď 200
unansweredUnanswered[]idstringconversationIdstring | null (uuid)questionstringatstring (date-time)
nextBeforestring | null
Chyby: 400 401 403 429
/v1/unanswered/{id}/dismiss Oprávnění writeSkrýt otázku ze seznamu
Parametry
idpath · string
Odpověď 200
oktrue
Chyby: 401 403 404 429
Catalogue
/v1/products Oprávnění readProdukty, které Otto zná
Parametry
beforequery · string nepovinné nextBefore from the previous page. Opaque, do not build it yourself.limitquery · integer nepovinné
Odpověď 200
productsProduct[]idstringexternalIdstring | nulltitlestringurlstring | nullmetaobjectupdatedAtstring (date-time)
nextBeforestring | null
Chyby: 401 403 429
/v1/products Oprávnění cataloguePřidat nebo změnit produkty
Only what you send, nothing is deleted. At most 500 at once. Meant for price and stock changes.
Tělo požadavku
productsProductInput[]idstring Your product id. externalId works too.titlestring name works too.descriptionstring nepovinnéurlstring nepovinnéimagestring nepovinné imageUrl works too.pricenumber nepovinnécurrencystring nepovinnéavailabilitystring nepovinnécategorystring nepovinnémanufacturerstring nepovinnéparamsobject nepovinné
Odpověď 200
oktrueproductsinteger
Chyby: 400 401 403 429
/v1/products/snapshot Oprávnění catalogueNahradit celý katalog
Products missing from the snapshot are deleted. At most 5000 at once and 12 times per hour. If the snapshot would delete more products than it contains, the missing products are kept the first time and the response has warning, errcode prune_skipped and pendingRemoval. Send the same list again to delete them, otherwise they go with the first smaller snapshot you send after 24 hours. A snapshot with none of the ids we hold and at least 90% of their count (for example after switching to new ids) deletes the old products right away. Products read from your website are always replaced, so removed can be above 0 even with the warning. A snapshot with fewer than 5 products deletes nothing.
Tělo požadavku
productsProductInput[]idstring Your product id. externalId works too.titlestring name works too.descriptionstring nepovinnéurlstring nepovinnéimagestring nepovinné imageUrl works too.pricenumber nepovinnécurrencystring nepovinnéavailabilitystring nepovinnécategorystring nepovinnémanufacturerstring nepovinnéparamsobject nepovinné
Odpověď 200
oktrueproductsintegerremovedintegercurrencystring | null nepovinnéwarningstring nepovinnéerrcode"prune_skipped" nepovinnépendingRemovalinteger nepovinné
Chyby: 400 401 403 429
/v1/products/{id} Oprávnění catalogueSmazat jeden produkt
Parametry
idpath · string
Odpověď 200
oktrue
Chyby: 401 403 404 429
Knowledge
/v1/knowledge Oprávnění readZnalosti kromě produktů
source faq was added by you, page was read from your website. Only faq records can be deleted.
Parametry
beforequery · string nepovinné nextBefore from the previous page. Opaque, do not build it yourself.limitquery · integer nepovinné
Odpověď 200
knowledgeKnowledge[]idstringsourcefaq | pagetitlestringcontentstringurlstring | nullupdatedAtstring (date-time)deletableboolean
nextBeforestring | null
Chyby: 401 403 429
/v1/knowledge Oprávnění writePřidat znalost
Otto uses it right away. Content with an unfilled placeholder in square brackets, such as [delivery time] or [your e-mail], is refused with 400 and errcode kb_placeholder, and placeholders lists them. Markdown links and markers such as [1] are fine.
Tělo požadavku
titlestringcontentstring
Odpověď 200
oktrueidstring
Chyby: 400 401 403 429
/v1/knowledge/{id} Oprávnění writeSmazat vlastní znalost
Parametry
idpath · string
Odpověď 200
oktrue
Chyby: 401 403 404 429
Team
/v1/operators Oprávnění readVáš tým
Use id as operatorId in conversation actions.
Odpověď 200
operatorsOperator[]idstring (uuid)namestringemailstringroleowner | operator
Chyby: 401 403 429
Webhooks
/v1/webhooks Oprávnění webhooks_writeSeznam webhooků
Needs the webhooks_write permission. The address is shortened and the secret is never returned here, it comes only once when the webhook is created.
Odpověď 200
webhooksWebhook[]idstring (uuid)namestringurlstringformatjson | discord | slackeventsstring[]disabledbooleancreatedAtstring (date-time)
Chyby: 401 403 429
/v1/webhooks Oprávnění webhooks_writeZaložit webhook
Does what adding a webhook in the panel does: the same address check (only public https or http addresses, never your own Otto domains or an internal network), the same limit of 10 webhooks and the same e-mail to the account owner. Needs the webhooks_write permission. The secret, with which Otto signs the events, is returned only in this response, store it. The format follows the address: Discord and Slack addresses get a ready message, everything else gets the JSON envelope. Use it for REST hooks, for example from Zapier or Make: subscribe when the user switches the trigger on, delete when they switch it off.
Tělo požadavku
urlstringnamestring nepovinné Defaults to the host of the address.eventsconversation.started | conversation.handoff | conversation.operator_joined | conversation.resolved | conversation.rated | message.created | lead.created | lead.updated | return.created | return.updated | unanswered.created | catalog.synced | catalog.failed | usage.threshold[]
Odpověď 200
idstring (uuid)namestringurlstringformatjson | discord | slackeventsstring[]disabledbooleancreatedAtstring (date-time)secretstring Returned only here.
Chyby: 400 401 403 409 429
/v1/webhooks/{id} Oprávnění webhooks_writeSmazat webhook
Needs the webhooks_write permission. A webhook that does not exist or is not yours returns 404 webhook_nie_je.
Parametry
idpath · string (uuid)
Odpověď 200
oktrue
Chyby: 401 403 404 429
/v1/webhooks/deliveries Oprávnění webhooksDoručení webhooků
Parametry
statusquery · pending | delivered | failed | cancelled nepovinnéeventquery · string nepovinnéwebhookIdquery · string (uuid) nepovinné Only deliveries of one webhook.beforequery · string nepovinné nextBefore from the previous page. Opaque, do not build it yourself.limitquery · integer nepovinné
Odpověď 200
deliveriesDelivery[]idstring (uuid)webhookIdstring | null (uuid)eventstringstatuspending | delivered | failed | cancelledhttpStatusinteger | nullattemptsintegererrorstring | nullunconfirmedbooleantestbooleancreatedAtstring (date-time)lastAttemptAtstring | null (date-time)nextAttemptAtstring | null (date-time)canResendboolean
nextBeforestring | null
Chyby: 400 401 403 429
/v1/webhooks/deliveries/{id}/resend Oprávnění webhooksPoslat událost znovu
The body is kept 7 days after the last attempt; after that 410.
Parametry
idpath · string (uuid)
Odpověď 202
oktrueidstring (uuid)
Chyby: 401 403 404 409 410 429
/v1/webhooks/test Oprávnění webhooksPoslat zkušební událost
Delivers right away and tells you how your URL answered. When the company has more webhooks, send webhookId (errcode webhook_id_required otherwise).
Tělo požadavku
webhookIdstring (uuid) nepovinné
Odpověď 200
idstring (uuid)webhookIdstring (uuid)statuspending | delivered | failed | cancelledhttpStatusinteger | nullunconfirmedbooleanerrorstring | null
Chyby: 400 401 403 404 409 429

