Skip to navigation

Selfie Passback

Preview

Selfie Passback is currently in preview and is not generally available. To request access, reach out to your solutions consultant.

Selfie Passback lets your organization retrieve the selfie a member took during ID.me identity verification. It uses the same two-token exchange as Document Passback and the same Document endpoint, so if you already retrieve document images you only need to read one additional attribute and use one additional API token.

Use a selfie when you need to see the member’s face as it looked at verification, rather than the photo printed on an identity document.

A selfie is a biometric image. Access is enabled per consumer by your ID.me account team, and your organization is responsible for how it stores and uses the image. Return only what you need, and do not log image data.

Environments

Sandbox

https://api.idmelabs.com/

Production

https://api.id.me/

Prerequisites

Before using Selfie Passback:

  • Selfie Passback must be enabled on your consumer by your ID.me account team, which adds the selfie_tokens attribute to your policy
  • You must have an API token with the selfie kind, provisioned by your ID.me account team. A document API token cannot retrieve a selfie
  • Your integration must already obtain an access token and call the attributes endpoint

If you already use Document Passback, you will hold a separate document API token. Keep both. Each token only works with its own kind of image.

How it works

Retrieving a selfie requires two values obtained from separate sources:

  • A selfie token, returned dynamically from the attributes endpoint for each verified session
  • A selfie API token, a static token provisioned for your consumer by your ID.me account team
1

Get selfie tokens from the attributes endpoint

Call the attributes endpoint with a valid access token:

Example
GET https://api.idmelabs.com/api/public/v3/attributes.json?access_token={ACCESS_TOKEN}

When selfie_tokens is enabled on your consumer and a selfie is available for the member, the response includes a token for each available selfie:

Example
{
"handle": "selfie_tokens",
"name": "Tokens for Verified Selfies",
"value": {
"live_selfie": "5b0e2c7d94a14f0f9d6c1d3a8e7b4f21",
"identity_document_selfie": "c41a9e03b7d84a5f8e2d6b19f0a3c577"
}
}
KeyDescription
live_selfieThe selfie captured with ID.me’s liveness check during verification
identity_document_selfieA static selfie captured when the member uploaded their identity document, rather than through the liveness check

Only the keys that are available for the member are returned. Your integration must not assume both are present.

Repeat calls to the attributes endpoint can return a token you already hold, including one created by a token refresh. Any token you receive stays valid until it is redeemed or expires.

2

Retrieve the selfie image

Make a POST request to the Document endpoint using the selfie token and your selfie API token:

Example
POST https://api.idmelabs.com/api/public/v3/documents/{SELFIE_TOKEN}?token={SELFIE_API_TOKEN}

Example:

Example
POST https://api.idmelabs.com/api/public/v3/documents/5b0e2c7d94a14f0f9d6c1d3a8e7b4f21?token=1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d

The response is the raw image file, for example image/jpeg. Check the Content-Type header rather than assuming a format.

When a selfie is available

ID.me returns a selfie token only when the member’s identity verification included a successful face match between the selfie and the identity document. If the member did not complete that step, or their selfie is no longer retained, the corresponding key is absent from selfie_tokens. If neither is available, selfie_tokens is returned with a null value.

Build your integration so that a missing selfie is a normal outcome, with a fallback path such as the identity document image or your own manual review.

Token behavior

Selfie tokens follow the same rules as document tokens.

BehaviorRule
Single useA token can be redeemed once. A second redemption fails with code 155
ExpiryA token expires after the window configured on your consumer. An expired token fails with code 151
ReuseRepeat calls to the attributes endpoint can return a token you already hold, until it is redeemed or expires
Consumer-boundA token can only be redeemed by the consumer it was issued to
API token kindA selfie token requires a selfie API token, and a document token requires a document API token

A token is not consumed when a request fails validation or when ID.me cannot produce the image, so you can retry the same token after correcting the request.

Token refresh

If you need the selfie again but have not made a new call to the attributes endpoint, use the Token Refresh endpoint to generate a new token without requiring a new user session.

Example
POST https://api.idmelabs.com/api/public/v3/documents/refresh/{SELFIE_TOKEN}?token={SELFIE_API_TOKEN}

Example response:

Example
{ "document_token": "8003c78ead9641bcbd284e97acac3f85" }

Use the returned token to call the Document endpoint as normal. The new token is for the same selfie as the one you refreshed. Refreshing does not invalidate the original token, which stays valid until it expires or is redeemed.

A token that has already been redeemed cannot be refreshed, and an expired token cannot be refreshed. Both return an error. To retrieve a selfie after that point, call the attributes endpoint again.

Dynamic image sizing

Pass a size parameter to resize the returned image:

Example
POST https://api.idmelabs.com/api/public/v3/documents/{SELFIE_TOKEN}?token={SELFIE_API_TOKEN}&size=300x300

If no size parameter is provided, the image is returned at its original resolution.

Aspect ratio

ID.me scales the image to fit within the requested width and height, preserving the original aspect ratio. For example, requesting 300x300 on a 480x640 image returns 225x300.

You can also pass a single integer, such as size=300. This sets the image width, and the height follows the original aspect ratio.

Size bounds

The larger of the two requested dimensions must fall within the bounds below.

Value
Minimum100
Maximum1000

A size that is not a single integer or in WIDTHxHEIGHT form, or whose larger value is outside these bounds, returns error code 132. ID.me does not fall back to the original image.

Image metadata

Images returned by the Document endpoint have embedded metadata (EXIF, IPTC and XMP), including any GPS location, removed. Both sized and unsized responses are processed this way, so the file you receive may differ in bytes and file size from the image originally captured.

Rate limiting

The Document endpoint is rate-limited to 2 requests per document. Once you reach the limit, requests are rejected until 60 seconds have passed since your last request, so a rejected request restarts the wait. The limit is counted per consumer and document, and is shared by every token issued for that document. Refreshing a token does not reset the limit, and refresh requests count toward it.

Errors

Errors, other than 500, are returned as JSON with a code and a message.

HTTP statusCodeMessageWhat to do
401110Access token is invalid or missingCheck the token parameter. It must be your API token
403111Access token has been revokedYour API token has been revoked. Contact your ID.me account team for a new one
403112Access token has expiredYour API token has expired. This is not the selfie token, which returns 151. Contact your ID.me account team for a new API token
401150Document token is missing or invalidCheck the selfie token. It may be mistyped or not issued by ID.me
403151Access token has expiredCall the attributes endpoint again for a new selfie token
403152Document is missingThe selfie is no longer available. Use your fallback path
401153Document token is missing or invalidThe token was issued to a different consumer
429154Too many requestsStop sending requests for 60 seconds, then retry. See Rate limiting
403155Document token has already been redeemedCall the attributes endpoint again for a new token
401156API token is not valid for this document typeUse the selfie API token for selfie tokens and the document API token for document tokens
401132Requested image size is invalid or out of rangeUse a size between 100 and 1000
500NoneInternal server errorRetry after a short delay. Contact your ID.me account team if it persists