Create Session
Path Parameters
The ID of your project
Request Headers
Bearer token authentication using your API key
Request Body
A unique identifier for the session. This can be any string you choose to identify the conversation session.
Optional initial session variables that can be used within the pathway. These variables can be referenced in your pathway configuration.
Optional provider specification for the session (e.g., “api”, “web”)
Response
The created session ID (same as the one provided in the request)
The pathway ID for this project
Example
Request
Response
Usage Notes
- Session ID: Choose a unique identifier for each conversation. This could be a UUID, user ID + timestamp, or any other unique string.
- Variables: Session variables can be used within your pathway logic. They persist throughout the session and can be referenced in conversation flows.
- Reusability: Once created, the session can be used in multiple completion requests by including the
session_id
parameter orX-Session-ID
header.
Error Responses
Status Code | Description |
---|---|
400 | Missing or invalid session_id |
401 | Invalid authentication |
500 | Internal server error |
Related APIs
- End Session - End an existing session when the conversation is complete