Skip to content

Verify a user

Verify a user in two calls: send a code to their email, then confirm the code. The second call returns the user access token.

Steps 1 and 2: verify a user through the APIYou build the code screen. Two calls, with the partner key only. The second returns the user access token. The same content is listed as text under the diagram.UserYour pageYour backendFlume servers1email2POST /users/trigger-verification3email, 6 digits4types the code5code6POST /users/confirm-verification7access_token8store the tokenServer call (HTTPS)A person actsAny other step

Steps 1 and 2: verify a user through the API. You build the code screen. Two calls, with the partner key only. The second returns the user access token.

Read this diagram as text
  1. Your screen sends the user's email to your backend.
  2. Your backend calls POST /users/trigger-verification with external_ref and email.
  3. Flume emails the user a 6-digit code, valid for 10 minutes.
  4. The user types the code on your screen.
  5. Your screen sends the code to your backend.
  6. Your backend calls POST /users/confirm-verification with the email and the code.
  7. Flume returns the user access token, once.
  8. Your backend stores the token against that user and sends it on every call made for them.
curl -X POST "https://sandbox-api.tryflume.ai/partner/v1/users/trigger-verification" \
-H "X-Flume-Partner-Key: $FLUME_PARTNER_KEY" \
-H "Content-Type: application/json" \
-d '{
"external_ref": "u_8812",
"email": "sarah.chen@example.com",
"first_name": "Sarah",
"last_name": "Chen",
"org": {
"name": "NY Design Co"
}
}'
Response: 202
{
"external_ref": "u_8812",
"masked_email": "s···@example.com",
"expires_in_s": 600,
"resend_after_s": 30
}
  • Only external_ref and email are required.
  • Send the name, phone and firm if you have them. Flume puts them on the user's new Flume account.
  • phone must be a US number.
  • X-Flume-Client-IP is optional. Send the user's IP address in it and Flume also limits codes per IP address. See Users and verification.

Show the user a code box. Use masked_email to say where the code went.

curl -X POST "https://sandbox-api.tryflume.ai/partner/v1/users/confirm-verification" \
-H "X-Flume-Partner-Key: $FLUME_PARTNER_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "sarah.chen@example.com",
"code": "482913"
}'
Response: 200
{
"external_ref": "u_8812",
"email": "sarah.chen@example.com",
"access_token": "ut_dev_acme_example_token",
"token_type": "user_token",
"verified_at": "2026-10-16T09:02:11Z",
"account": "CREATED"
}
  • access_token is returned once. Store it encrypted, against the user.
  • A user has one working token at a time. This one replaces any earlier token.
  • account is CREATED for a new Flume account, or LINKED for an existing one.
  • Send external_ref in the body only if two of your users share one email.

Send it as X-Flume-User-Token, with your partner key, on every call made for the user.

curl "https://sandbox-api.tryflume.ai/partner/v1/products/7f3c2a91-4b0e-4c8d-9a21-1f6b2d5e7c30" \
-H "X-Flume-Partner-Key: $FLUME_PARTNER_KEY" \
-H "X-Flume-User-Token: $FLUME_USER_TOKEN"
You getDo this
422 VERIFICATION_CODE_INVALIDLet the user try again. The message says how many tries are left
422 VERIFICATION_TRIES_EXHAUSTEDSend a new code
422 VERIFICATION_CODE_EXPIREDSend a new code
429 VERIFICATION_RATE_LIMITEDWait Retry-After seconds, then resend
502 VERIFICATION_EMAIL_FAILEDRetry the send
404 NOT_FOUND on confirmCall trigger-verification first

Call POST /users/trigger-verification again after resend_after_s seconds. The new code replaces the old one.

Revoke when a user leaves or a token may have leaked.

curl -X DELETE "https://sandbox-api.tryflume.ai/partner/v1/users/u_8812/token" \
-H "X-Flume-Partner-Key: $FLUME_PARTNER_KEY"

Response: 204. No body.

To give the user a new token, verify them again.

The sandbox has no test code. Use an inbox you can read, and confirm with the code from the real email.