What you need
- Your API key and your assistant’s ID, both from the Console.
- The base URL:
https://api.unify.ai/v0 - A Bearer token header on every request:
Assistants running in a local deployment don’t
receive API messages — this channel is for assistants hosted by Unify.
Sending a message
POST /messages with the assistant’s ID and your message:
message_id straight away, before your assistant has done
anything with it:
Polling for the reply
Your assistant works on the message in the background — it might answer in a second, or go off and actually do the thing first. PollGET /messages/{message_id} until status flips from processing to
completed:
response can come back null on a completed message. That’s not an error —
your assistant decides whether a reply is warranted, the same way it does on
any other channel, and sometimes doing the task quietly is the right answer.
From Python
The SDK wraps both calls:Sending files
Upload each file first, then reference it in the message.1
Upload the file
2
Send the message with the attachment
response_attachments on the completed message, each with a
download URL.
Tags
Tags are arbitrary strings you can hang off a message. Your assistant treats them as opaque routing labels — it doesn’t read anything into them — and echoes them back on its reply asresponse_tags.