cURL
custom_id
curl --request POST \ --url https://ninjachat.ai/api/v1/sessions \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "session_id": "user-alice-session-1" } '
{ "session_id": "<string>", "message_count": 123, "created_at": "2023-11-07T05:31:56Z" }
Create a persistent conversation session. Use the returned session_id with the chat endpoint to maintain context across messages.
API key starting with nj_sk_
Optional stable identifier for this session (e.g. user-123-session-1). If omitted, a session_id is auto-generated.
Optional metadata to associate with the session.
Session created.