Sessions

Close a session

POST https://api.129.212.147.181.sslip.io/v1/sessions/{session}/close

The session takes no more messages. Its history and answers stay readable until it is deleted or expires, and documents can still be made from a ready session.

Path parameters

session string required

Headers

Authorization string required
Bearer dg_test_… or Bearer dg_live_…
Docgen-Session-Secret string required
The session_secret returned when the session started. For a document, the secret of the session it was made from. Send it from your server only.
Idempotency-Key string optional
Retrying with the same key and body returns the original response. Kept 24 hours.

Returns

200 OK: a Session object. The closed session.

Errors

StatusCodeWhat to do
401session_secret_missingSend Docgen-Session-Secret: the session_secret returned when the session started.
404session_not_foundCheck the ID, and that Docgen-Session-Secret is the secret returned when the session started.
410session_deletedThe session was deleted with its conversation and answers. Start a new one.

Any endpoint can also return the common errors (bad key, rate limit, idempotency).