Defend

Sessions API

Inspect or delete server-side session state for debugging and privacy workflows.

GET /v1/sessions/{session_id}

Returns session state when found.

Examples

Get session
curl -s "http://localhost:8000/v1/sessions/def-abc12345"
httpx client
import httpx

r = httpx.get("http://localhost:8000/v1/sessions/def-abc12345")
print(r.status_code, r.json())

Success body

Prop

Type

Errors

  • 404 - Session not found

DELETE /v1/sessions/{session_id}

Deletes session state. Returns 204 No Content on success.

Delete session
curl -s -i -X DELETE "http://localhost:8000/v1/sessions/def-abc12345"

Expect 204 No Content on success.

httpx client
import httpx

r = httpx.delete("http://localhost:8000/v1/sessions/def-abc12345")
print(r.status_code)

See also

Sessions concept