- Flume opens a Flume account for the user, or links the one their email already has.
access_tokenis returned once and has no expiry. Store it as a secret, against the user.- Three wrong tries burn the code. After that, or after 10 minutes, send a new one.
- Confirming again issues a new token and stops the old one.
- Docs
- API reference
- Users
- Confirm a verification code
Confirm a verification code
Code samples show live values. Live is in early access and not yet open to new partners: see Environments.
https://sandbox-api.tryflume.ai/partner/v1/users/confirm-verificationConfirms the code a user typed and returns their user access token.
Guide: Verify a user
Request
Headers
| Header | Required | Description |
|---|---|---|
X-Flume-Partner-Key | Yes | Your partner key. See Authentication and keys. |
Body
Send application/json. A field the API does not list returns a 422 that names it.
The method used to send the code.
email_codeis the only method today.- Default
"email_code"
- Default
The address the code was sent to.
- Max 320 characters
- Pattern
^[^@\s]+@[^@\s]+\.[^@\s]+$
The 6 digits from the email.
- 6 digits
Your id for the user. Needed only when two of your users share one email.
- Max 128 characters
Returns
200 with these fields. Every field is always present. A field with no value is null.
external_refstringYour id for the user. Check that it is the user you expect before you store the token.
emailstringThe verified address.
access_tokenstringThe user access token. Returned once. Flume keeps only a hash of it.
token_typestringAlways
user_token.- Always
"user_token" - Default
"user_token"
- Always
verified_atstringWhen the user verified their email, in UTC.
accountenumCREATED: Flume opened a new Flume account with the details you sent.LINKED: the email already had a Flume account, and Flume linked it unchanged.
Errors
Every error uses one envelope. Branch on error.code.
| Status | Code | Meaning |
|---|---|---|
| 401 | EMBED_TOKEN_INVALID | You sent an Authorization header and no X-Flume-Partner-Key. Flume read the call as one from its own iframe. |
| 401 | PARTNER_KEY_INVALID | The partner key is missing, unknown, revoked, expired, or from the other environment. On live, also a platform Flume has not enabled yet. |
| 401 | USER_TOKEN_INVALID | The user access token is unknown, revoked, another partner's, or replaced by a later verification. A verification in the iframe replaces it too. |
| 404 | NOT_FOUND | The thing does not exist, or is not this user's. A search id that is not a UUID also returns this code. |
| 422 | USER_ACCOUNT_CLOSED | The user's email belongs to a Flume account that Flume has closed. |
| 422 | VALIDATION_FAILED | A field is missing, unknown or has an unusable value. field names it as a dotted path. Some refusals carry the detail in details and leave field empty. |
| 422 | VERIFICATION_CODE_EXPIRED | No code is valid: it is older than 10 minutes, already used, or was never sent. |
| 422 | VERIFICATION_CODE_INVALID | The code is wrong. The message says how many tries are left. |
| 422 | VERIFICATION_TRIES_EXHAUSTED | The code was wrong 3 times. It is burned. |
| 500 | INTERNAL | Something failed on Flume's side. |