Create Conversations
This endpoint allows you to create conversations with AI agents.Dynamic Variables
Dynamic variables allow you to personalize your AI agent’s responses for each conversation. They’re a powerful way to make your conversations more relevant and context-aware. Here’s how you can use them:How It Works
-
When defining your AI agent, you can include a
dynamicVariablesin your prompts using the{{variableName}}placeholder. -
When creating a conversation, you can include those variables as a dictionary in the
dynamicVariablesfield in your request body. - Each key-value pair in this object represents a variable that can be used by your AI agent during the conversation.
- Your agent can then reference these variables to personalize its responses.
Example Usage
Here’s an example of how to include dynamic variables when creating a conversation:-
customerNamecould be used by the agent to greet the customer by name. -
productNamemight be referenced when discussing the customer’s current subscription.
Rate Limiting
The API has a rate limit of 20 concurrent calls per workspace. If you exceed this limit, the API will return a 429 error. The rate limit is enforced per workspace. If you need to increase the limit, please contact us. The endpoint throws a 429 error when the available slots are occupied byactive or dialing conversations.
Example Request
Here’s a simple example using cURL:Developer Recommendations
When you are trying to make multiple calls using this API endpoint. You can use the following strategy to ensure maximum utilisation of the available concurrency. There are two simple rules to follow:- Use Short Bursts: If you need to make a lot of calls, consider making them in short bursts.
- Listen to the Rate Limit Headers: Rather than sending a batch of arbitrary length, listen to the rate limit headers and adjust the length of calls to be made accordingly.
Example Strategy
In case you want to make 200 calls. Assuming your max concurrent calls is 20.- You can add 20 conversations in the first request.
- Then wait for few seconds and make another request with another 20 conversations. Check the rate limit headers and adjust the length of calls to be made accordingly.
- You can adjust the size of the batch based on the rate limit headers till you finish all the calls.
-
You can use the GET
/conversationsendpoint to check the status of the conversations.