Skip to main content

Endpoint

POST /v1/sessions/:id/revoke
EnvironmentFull URL
Sandboxhttps://sandbox.api.prava.space/v1/sessions/:id/revoke
Productionhttps://api.prava.space/v1/sessions/:id/revoke

Authentication

Bearer token using your secret key:
Authorization: Bearer sk_test_xxx

Path Parameters

id
string
required
The session_id of the session to revoke

Response (200)

success
boolean
Always true on successful revocation

Example

Swap the host for production: use https://api.prava.space instead of https://sandbox.api.prava.space.
curl -X POST https://sandbox.api.prava.space/v1/sessions/ses_a1b2c3d4/revoke \
  -H "Authorization: Bearer sk_test_xxx"
curl -X POST https://api.prava.space/v1/sessions/ses_a1b2c3d4/revoke \
  -H "Authorization: Bearer sk_live_xxx"
const BASE_URL = 'https://sandbox.api.prava.space'; // or https://api.prava.space

const result = await fetch(`${BASE_URL}/v1/sessions/ses_a1b2c3d4/revoke`, {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${SECRET_KEY}`,
  },
}).then(res => res.json());

Response

{
  "success": true
}

Error Responses

StatusCodeCause
401AUTH_1001Invalid API key
401AUTH_1002Missing or invalid Authorization header
404NOT_FOUNDSession not found or doesn’t belong to your merchant account

Error Response Format

{
  "error": {
    "code": "NOT_FOUND",
    "message": "Session not found"
  }
}

Notes

  • Once revoked, the session token can no longer be used for any SDK operations.
  • Any in-progress card collection or intent registration within the session will fail.
  • Revocation is immediate and irreversible.