DELETE/api/v2/ai/sessions/{session_id}
Close an AI session
Delete a session's history so the next conversation starts fresh, also after a handoff.
The session's history is deleted and the per-session answer count starts from zero, so the next message with the same session_id is answered by the AI again. Without agent_id, the sessions with this session_id at every agent this key may ask are closed too. The API history and the credits already used do not change.
Send an Idempotency-Key header (for example a new UUID per request). A repeat with the same key within 24 hours gets the first answer again, so nothing is sent twice.
Path parameters
session_idstringrequiredThe
session_idsent to Ask the AI for an answer.
Query parameters
agent_idintegerAgent id. Without it, the session is closed at every agent.
Possible errors
- 401
missing_keyAPI key not sent - 401
key_invalidUnknown API key - 401
key_revokedAPI key revoked - 401
key_expiredAPI key expired - 401
member_inactiveKey creator is no longer a member - 403
ip_not_allowedServer IP not in the key's list - 403
plan_no_apiPlan does not include the API for live keys - 403
tenant_blockedBusiness access suspended - 403
scope_missingKey lacks this permission - 403
permission_missingKey creator's role lacks this permission - 404
not_foundNot found - 422
invalid_requestInvalid field - 429
rate_limitedToo many requests per minute - 500
internal_errorProblem at Klik Flow
Try it
Try it with a test key
/api/v2/ai/sessions/{session_id}