Docs menuClose an AI session
API documentationBahasa Indonesia

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.

Key
kf_live_ / kf_test_… in the Authorization: Bearer header. Created in Settings › API & Webhook › Create key (Pengaturan › API & Webhook › Buat kunci).
Key scope
ai:reply
Plan feature
WhatsApp sending API, AI Agent (automatic replies)

Path parameters

  • session_idstringrequired

    The session_id sent to Ask the AI for an answer.

Query parameters

  • agent_idinteger

    Agent id. Without it, the session is closed at every agent.

Possible errors

Try it

Try it with a test key
Path parameters
Query parameters
/api/v2/ai/sessions/{session_id}

Send WhatsApp from your system with the Klik Flow API.

Mulai dengan paket Free. Ajak tim setelah ruang kerja siap.