Create a reveal session

POST
/reveal-sessions

Creates a short-lived token for retrieving full card numbers and security codes. Send card requests with this token to the revealBaseUrl in the response, not to the API host. Your API key is never sent to that address.

The token works only for GET /cards and GET /cards/{cardId} sent to revealBaseUrl, and it expires five minutes after it is created. It covers each organization where your API key holds both cards:read and cards:reveal and card reveal is enabled. Create the session with an API key. The token is returned once: a retry with the same idempotencyKey returns the session without it.

Request body

idempotencyKey

string

required

Idempotency key for safe client retries

min length 1

max length 255

Responses

201

The created reveal session.

application/json
id

string (uuid)

required
token

string

Bearer token for card requests to revealBaseUrl. Returned only in the response that creates the session.

tokenType

string

required
Bearer
scope

string

required
cards:reveal
organizationIds

array of string (uuid)

required

The organizations whose cards the token can read.

expiresAt

string (date-time)

required
revealBaseUrl

string (uri)

required

Send card requests made with token to this base URL, not to the API host.

400

Bad Request

401

Unauthorized

403

The request was not made with an API key, or the key holds both cards:read and cards:reveal in no organization where card reveal is enabled.

409

The idempotencyKey was already used with a different request, or the session it created has expired.

429

Too Many Requests — the rate limit was exceeded. Carries a Retry-After header in whole seconds

Request template

curl -X POST 'https://api.flex.one/reveal-sessions' \
  -H "Authorization: Bearer $FLEX_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "idempotencyKey": "reveal-cards-001"
}'

Response 201

{
  "id": "f8e27a40-60ba-442d-a4b1-e068f454f384",
  "token": "<REVEAL_TOKEN>",
  "tokenType": "Bearer",
  "scope": "cards:reveal",
  "organizationIds": [
    "3f8bbfa2-9257-4a7e-86d3-df1797b8e143"
  ],
  "expiresAt": "2026-11-16T14:05:00.000Z",
  "revealBaseUrl": "https://example.secure.url.flex.one"
}