Ending a Session

To ensure that token consumption is calculated for the precise time the items have been in use, the client application should be configured to close a session it is using when it stops running.

The client application ends the session using a DELETE call to the /api/v1.0/sessions/{sessionID} endpoint. After a session has been deleted, it cannot be used again. Subsequent activity requires the creation of a new session, resulting in a new session ID.

Elastic Access automatically ends a session in the following scenarios:

The software fails to send a heartbeat in the required time (see Sending a Heartbeat).
Insufficient tokens are available to make the automatic charge.

A deleted or ended session is placed in a TERMINATED state.