Endpoint: POST /v1/sessions/
This endpoint creates a new session for a user. You need to provide the user_id
and optional metadata in the request body.
Parameters
The unique ID of the user for whom the session is created.
Additional metadata related to the session.
curl -X POST https://agent.api.lyzr.app/v1/sessions/ \
-H "x-api-key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"user_id": "string",
"metadata": {}
}'
import requests
url = "https://agent.api.lyzr.app/v1/sessions/"
headers = {
"x-api-key": "your_api_key_here",
"Content-Type": "application/json"
}
data = {
"user_id": "string",
"metadata": {}
}
response = requests.post(url, headers=headers, json=data)
{
"session_id": "66e2a2a6a64bxxxxxxx"
}
Response Parameters
The unique identifier for the newly created session.