Texa AI in your product
Voice notes, photos and documents
Send customers' voice notes, photos, PDFs and videos to Texa AI, and get voice-note replies back.
Customers send more than text. Texa AI understands voice notes, photos, documents and videos: it transcribes, reads and describes them, then answers as if they had typed.
Send a file
Upload the file, then send a message that carries it:
curl https://api.texadesk.com/v1/media \
-H "Authorization: Bearer $TEXA_API_KEY" \
-F conversation_id=cnv_8a7f0c... \
-F file=@voice-note.ogg
{"media_id": "med_31c...", "kind": "audio", "status": "processing", "size": 48213,
"sha256": "9f2c..."}
curl https://api.texadesk.com/v1/conversations/cnv_8a7f0c.../messages \
-H "Authorization: Bearer $TEXA_API_KEY" -H "Content-Type: application/json" \
-d '{"message_id": "wamid.HBg...", "attachments": [{"media_id": "med_31c..."}]}'
The turn waits for the file to be understood. A long recording can take longer than your request,
so Texa AI's reply may arrive later, as a conversation.reply webhook and
on the event feed. Texa sends media.understood (or media.failed) when it's done.
- A location goes as an attachment too:
{"type": "location", "latitude": 6.45, "longitude": 3.39}. GET /v1/media/{media_id}gives what was understood (the transcript, the description);GET /v1/media/{media_id}/contentgives the bytes back.- Uploads are at most 64 MB through the API; the widget takes files of up to 10 MB.
Replies as voice notes
Customers who speak often want to hear the answer. Open the conversation with "reply_audio": true
(or send it on a message to switch from then on), and each reply also carries audio_media_id: an
OGG/Opus voice note of the reply, ready for WhatsApp. Fetch it from /v1/media/{id}/content.
Counted
Each file understood counts as a media_items, and audio and video by the second
(media_seconds). See usage and credits.