Close Session

This endpoint closes an existing session and returns the session ID. A valid session ID must be provided to close the session.


Endpoint

POST /session/close


Parameters

Query Parameters

  • session_id (required):

    • Type: string

    • Description: Specify the session ID of the session to be closed. This field is mandatory.


Response

Response Parameters

  • session_id (required):

    • Type: string

    • Description: The unique identifier for the closed session.

  • error (optional):

    • Type: string

    • Description: Error message if something goes wrong during session closure.


Error Responses

  • 400 (Invalid Request):

    • Description: Returned when the session ID is not provided.

  • 500 (Internal Server Error):

    • Description: Returned when the server encounters an unexpected condition.


Authorizations

  • Authorization (required):

    • Type: string

    • Location: Header

    • Description: Access token received from the authorization server in the OAuth 2.0 flow.


Body

Content Type: application/json

  • session_id:

    • Type: string

    • Description: The ID of the session to be closed.


Example Request

curl --location \
--request POST 'https://api.notexai.pro/session/close' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer your-api-key' \
--data '{
    "session_id": "abcd1234-5678-90ef-ghij-klmnopqrstuv"
}'

Response Example

200 - application/json

{
    "session_id": "abcd1234-5678-90ef-ghij-klmnopqrstuv",
    "error": null
}

Status Options

  • active: Session is currently active.

  • closed: Session has been closed.

  • error: An error occurred during the session.

  • timed_out: Session timed out after exceeding the timeout period.


Important Notes

  • Ensure a valid session_id is provided when closing a session.

  • Closing a session ensures no additional billing for that session.

Last updated