Skip to content

Confirm a verification code

POSThttps://sandbox-api.tryflume.ai/partner/v1/users/confirm-verification

Confirms the code a user typed and returns their user access token.

  • Flume opens a Flume account for the user, or links the one their email already has.
  • access_token is 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.

Guide: Verify a user

Request

Headers

HeaderRequiredDescription
X-Flume-Partner-KeyYesYour partner key. See Authentication and keys.

Body

Send application/json. A field the API does not list returns a 422 that names it.

  • methodenumOptional

    The method used to send the code. email_code is the only method today.

    • Default "email_code"
  • emailstringRequired

    The address the code was sent to.

    • Max 320 characters
    • Pattern ^[^@\s]+@[^@\s]+\.[^@\s]+$
  • codestringRequired

    The 6 digits from the email.

    • 6 digits
  • external_refstring or nullOptional

    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.

  • Your id for the user. Check that it is the user you expect before you store the token.

  • emailstring

    The verified address.

  • The user access token. Returned once. Flume keeps only a hash of it.

  • Always user_token.

    • Always "user_token"
    • Default "user_token"
  • When the user verified their email, in UTC.

  • CREATED: 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.

StatusCodeMeaning
401EMBED_TOKEN_INVALIDYou sent an Authorization header and no X-Flume-Partner-Key. Flume read the call as one from its own iframe.
401PARTNER_KEY_INVALIDThe partner key is missing, unknown, revoked, expired, or from the other environment. On live, also a platform Flume has not enabled yet.
401USER_TOKEN_INVALIDThe user access token is unknown, revoked, another partner's, or replaced by a later verification. A verification in the iframe replaces it too.
404NOT_FOUNDThe thing does not exist, or is not this user's. A search id that is not a UUID also returns this code.
422USER_ACCOUNT_CLOSEDThe user's email belongs to a Flume account that Flume has closed.
422VALIDATION_FAILEDA 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.
422VERIFICATION_CODE_EXPIREDNo code is valid: it is older than 10 minutes, already used, or was never sent.
422VERIFICATION_CODE_INVALIDThe code is wrong. The message says how many tries are left.
422VERIFICATION_TRIES_EXHAUSTEDThe code was wrong 3 times. It is burned.
500INTERNALSomething failed on Flume's side.