> For the complete documentation index, see [llms.txt](https://docs.facephi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.facephi.com/docs.facephi-en/rest-api/midapi-v2/biometric-services/detokenize-image.md).

# Detokenize Image

Service that returns the open image corresponding to a best-image token generated by the capture SDK.

Operates on the token it receives rather than on a stored asset, so it does not support a reference or header `operation-id`.

### Endpoint

```
POST /biometric/face/detokenize
```

### Headers

| Name              | Type   | Required | Description                                                                                                                                        |
| ----------------- | ------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Authorization** | string | **Yes**  | Consumer token in the format `Bearer <token>`. See [Authentication](https://docs.facephi.com/docs.facephi-en/rest-api/midapi-v2/autenticacion.md). |
| **consumer-id**   | string | **Yes**  | Consumer identifier.                                                                                                                               |

### Request body

**Content-Type:** `application/json`

#### Parameters

| Parameter        | Type   | Required | Description                        |
| ---------------- | ------ | -------- | ---------------------------------- |
| `bestImageToken` | string | **Yes**  | Best-image token from the capture. |

#### Example Request

```json
{
  "bestImageToken": "BAMBAQLNHJoWGPjfeuDIzDXdZuP..."
}
```

### Responses

#### `200` Success

#### Response Parameters

| Parameter       | Type   | Description                                                |
| --------------- | ------ | ---------------------------------------------------------- |
| `consumerId`    | string | Identifier of the consumer that made the call.             |
| `transactionId` | string | Transaction identifier.                                    |
| `timestamp`     | string | Response timestamp in **ISO 8601**.                        |
| `message`       | string | Descriptive field for the result of the service execution. |
| `imageBuffer`   | string | Resulting image, in Base64.                                |

#### Other responses

| Code  | Description                                                    |
| ----- | -------------------------------------------------------------- |
| `400` | The token is invalid or cannot be detokenized.                 |
| `401` | Token is missing, invalid, or expired.                         |
| `403` | The consumer is not provisioned with the service `DETOKENIZE`. |

The body of an error response has the form described in [Middleware API v2](https://docs.facephi.com/docs.facephi-en/rest-api/midapi-v2.md#respuestas-de-error).
