Download Collection
Try the Dispatch API in Postman, Insomnia or Bruno with a ready-made collection of every endpoint.
Download the whole API as a collection and open it in your API client. It has every endpoint, with example bodies, and fills in the conversation and token for you as you go.
| File | Open it in |
|---|---|
| dispatch-api.postman_collection.json | Postman, Insomnia, Bruno, Hoppscotch and most other API clients. |
| openapi.yaml | Anything that reads OpenAPI 3.1, including code generators. |
Both are built from the same description as this reference, so they always match it.
Using the collection in Postman
Import it. In Postman, click Import and drop in dispatch-api.postman_collection.json.
Set your credentials. Open the Dispatch API collection, go to Variables, and set apiKey to your API key
and agent to your agent's ID. Then Save.
Start a conversation. Send Starting a conversation with an Agent. The collection saves the new conversation's
conversation and the visitor's participantToken.
Send messages. Send Sending a message to an Agent and Listing a conversation's messages. They use what the first request saved, so there is nothing to copy.
Variables
| Variable | What it holds | Set by |
|---|---|---|
baseUrl | https://api.rundispatch.ai/v1 | The collection |
apiKey | Your Dispatch API key | You |
agent | The ID of the agent to talk to | You |
conversation | The conversation's id | Starting or getting a conversation |
participantToken | The visitor's token | Starting or getting a conversation |
Sending a message to an Agent sends Accept: application/json, so the reply comes back as one JSON body. To watch
the reply stream in as Server-Sent Events, or get it as Markdown or
plain text, change its Accept header to one of the reply types.
The visitor's token lasts 90 days. From its last 7 days on, even once it has expired, send Getting a conversation to save a new one.