Create Chat
This endpoint allows you to create a new chat within an assistant session in TaskingAI.
Endpoint
- Method:
POST
- URL:
https://api.tasking.ai/v1/assistants/{assistant_id}/chats
Path Parameters
Parameter | Type | Description |
---|---|---|
assistant_id | string | The unique identifier for the assistant. |
Header Parameters
All TaskingAI API requests require the following headers:
Header | Type | Description |
---|---|---|
Content-Type | string | The content type of the request. Set to application/json . |
Authorization | string | API key for authorization in the format Bearer $TASKINGAI_API_KEY . The key can be obtained in the project settings in your TaskingAI console. |
Payload Parameters
Request Body (application/json)
Parameter | Type | Required | Default | Description | |
---|---|---|---|---|---|
name | string | No | "" | The name of the chat. Default is an empty string "" . | |
metadata | object | No | {} | Metadata for the chat. Can store up to 16 key-value pairs, each with key lengths < 64 and value lengths < 512. |
Request Example
{
"name": "New Chat",
"metadata": {
"key1": "value1"
}
}
Response Example
{
"status": "success",
"data": {
"object": "Chat",
"chat_id": "chat_1",
"assistant_id": "assistant_1",
"name": "New Chat",
"metadata": {"key1": "value1"},
"updated_timestamp": 1730210035453,
"created_timestamp": 1730210035453
}
}