> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.id.me/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.id.me/_mcp/server.

# Selfie Passback

> Retrieve the selfie captured during ID.me identity verification using the Document Passback API.

> **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](/apis/document-passback-api/overview) 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.

> **Note**
>
> 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

> **Info**
>
> 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

#### Get selfie tokens from the attributes endpoint

Call the attributes endpoint with a valid access token:

**`Example`**

```bash 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`**

```json Example
{
  "handle": "selfie_tokens",
  "name": "Tokens for Verified Selfies",
  "value": {
    "live_selfie": "5b0e2c7d94a14f0f9d6c1d3a8e7b4f21",
    "identity_document_selfie": "c41a9e03b7d84a5f8e2d6b19f0a3c577"
  }
}
```

| Key                        | Description                                                                                                       |
| -------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| `live_selfie`              | The selfie captured with ID.me's liveness check during verification                                               |
| `identity_document_selfie` | A 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.

> **Warning**
>
> 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.

#### Retrieve the selfie image

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

**`Example`**

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

**Example:**

**`Example`**

```bash 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.

| Behavior       | Rule                                                                                                         |
| -------------- | ------------------------------------------------------------------------------------------------------------ |
| Single use     | A token can be redeemed once. A second redemption fails with code `155`                                      |
| Expiry         | A token expires after the window configured on your consumer. An expired token fails with code `151`         |
| Reuse          | Repeat calls to the attributes endpoint can return a token you already hold, until it is redeemed or expires |
| Consumer-bound | A token can only be redeemed by the consumer it was issued to                                                |
| API token kind | A 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`**

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

**Example response:**

**`Example`**

```json 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.

> **Warning**
>
> 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`**

```bash 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  |
| ------- | ------ |
| Minimum | `100`  |
| Maximum | `1000` |

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 status | Code  | Message                                         | What to do                                                                                                                         |
| ----------- | ----- | ----------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| 401         | `110` | Access token is invalid or missing              | Check the `token` parameter. It must be your API token                                                                             |
| 403         | `111` | Access token has been revoked                   | Your API token has been revoked. Contact your ID.me account team for a new one                                                     |
| 403         | `112` | Access token has expired                        | Your API token has expired. This is not the selfie token, which returns `151`. Contact your ID.me account team for a new API token |
| 401         | `150` | Document token is missing or invalid            | Check the selfie token. It may be mistyped or not issued by ID.me                                                                  |
| 403         | `151` | Access token has expired                        | Call the attributes endpoint again for a new selfie token                                                                          |
| 403         | `152` | Document is missing                             | The selfie is no longer available. Use your fallback path                                                                          |
| 401         | `153` | Document token is missing or invalid            | The token was issued to a different consumer                                                                                       |
| 429         | `154` | Too many requests                               | Stop sending requests for 60 seconds, then retry. See [Rate limiting](#rate-limiting)                                              |
| 403         | `155` | Document token has already been redeemed        | Call the attributes endpoint again for a new token                                                                                 |
| 401         | `156` | API token is not valid for this document type   | Use the selfie API token for selfie tokens and the document API token for document tokens                                          |
| 401         | `132` | Requested image size is invalid or out of range | Use a `size` between `100` and `1000`                                                                                              |
| 500         | None  | Internal server error                           | Retry after a short delay. Contact your ID.me account team if it persists                                                          |

## Related

#### [Document Passback API Guide](/apis/document-passback-api/overview)

Retrieve identity document images using the same exchange.