Skip to main content
POST
https://api.usedari.com
/
public
/
sessions
/
{session_id}
/
terminate
from dari import Dari

client = Dari(api_key="YOUR_API_KEY")

# Terminate a session when done
client.terminate_session("sess_a1b2c3d4e5f6")

print("Session terminated successfully")
{
  "detail": "Invalid API key"
}
Gracefully terminate an active browser session, cleaning up resources and marking it as terminated.

Headers

X-API-Key
string
required
Your API key for authentication

Path Parameters

session_id
string
required
The unique identifier of the session to terminate

Response

Returns 204 No Content on successful termination.
from dari import Dari

client = Dari(api_key="YOUR_API_KEY")

# Terminate a session when done
client.terminate_session("sess_a1b2c3d4e5f6")

print("Session terminated successfully")

Usage Notes

  • Terminated sessions cannot be reused
  • Terminating a session stops any in-progress browser actions
  • Resources are cleaned up immediately
  • For forceful deletion, use the Delete Session endpoint instead

Error Responses

{
  "detail": "Invalid API key"
}
{
  "detail": "Session not found"
}
{
  "detail": "Session is already terminated"
}