Skip to main content
POST
/
sessions
Create Chat Session
curl --request POST \
  --url https://api.callhq.ai/api/sessions \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "name": "<string>",
  "assistantId": "<string>"
}'
{
  "message": "<string>",
  "session": {
    "id": "<string>",
    "name": "<string>",
    "assistantId": "<string>",
    "status": "<string>",
    "messages": [
      {
        "role": "user",
        "content": "<string>"
      }
    ],
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z"
  }
}

Authorizations

x-api-key
string
header
required

Body

application/json
name
string
required

Name of the chat session

assistantId
string
required

ID of the assistant to use for this session

Response

Session created successfully

message
string

Response message

session
object