POST
/
api
/
chat
/
create-chat-session
Create a Chat Session
curl --request POST \
  --url https://stg-azure.hymalaia.net/api/chat/create-chat-session \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "persona_id": "0",
  "description": "<string>"
}'
{
  "chat_session_id": "<string>"
}
Create a Chat Session Endpoint for initializing a new chat session

Authorizations

Authorization

  • Type: Bearer Token
  • Description: Authentication header of the form Bearer <token>

Request Body

Parameters

Required

  • persona_id (string, default: “0”): ID of the persona for the chat session

Optional

  • description (string): Optional description for the chat session

Example Request

curl -X POST https://{{url_base}}/api/chat/create-chat-session \
  -H "Authorization: Bearer ${HYMALAIA_API_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
    "persona_id": "0",
    "description": "API test session"
  }'

Python Example

import requests

payload = {
    "persona_id": "0",
    "description": "API test session"
}

response = requests.post(
    f"https://{url_base}/api/chat/create-chat-session",
    headers={
        "Authorization": f"Bearer {HYMALAIA_API_TOKEN}",
        "Content-Type": "application/json"
    },
    json=payload
)

print(response.json())

Responses

200 OK

  • chat_session_id (string): Unique identifier for the created chat session

Error Responses

  • 400: Bad Request
  • 401: Unauthorized

Best Practices

  • Always specify a persona_id
  • Use descriptive session names when possible
  • Keep your API token confidential

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Chat session creation details

The body is of type object.

Response

200
application/json

Successfully created chat session

The response is of type object.