> 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/operations/get-file-keys.md).

# Get File Keys

Service that returns the assets stored in an operation, indexed by their context.

It is the recommended way to obtain the keys sent to validation services, instead of storing them in the client.

### Endpoint

```
GET /operation/{operationId}/file-keys
```

### Headers

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

### Path parameters

| Parameter     | Type   | Required | Description           |
| ------------- | ------ | -------- | --------------------- |
| `operationId` | string | **Yes**  | Operation identifier. |

### Responses

#### `200` Success

#### Response parameters

| Parameter           | Type   | Description                                                                                                                                                          |
| ------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `operationId`       | string | Operation identifier.                                                                                                                                                |
| `merchantReference` | string | The reference indicated when [creating the operation](/docs.facephi-en/rest-api/midapi-v2/operations/create-operation.md). It does not appear if none was indicated. |
| `fileKeys`          | object | Object indexed by context, where each value is the asset key for that context. Contexts without a stored asset do not appear.                                        |

#### Response example

```json
{
  "operationId": "0192a3f4-7b21-7c44-9e1a-3f5b8c2d1e04",
  "merchantReference": "ORD-4417",
  "fileKeys": {
    "TOKEN_FRONT_DOCUMENT": "0192a3f4-7b21-7c44-9e1a-3f5b8c2d1e04/TOKEN_FRONT_DOCUMENT",
    "TOKEN_BACK_DOCUMENT": "0192a3f4-7b21-7c44-9e1a-3f5b8c2d1e04/TOKEN_BACK_DOCUMENT",
    "TOKEN_BEST_IMAGE": "0192a3f4-7b21-7c44-9e1a-3f5b8c2d1e04/TOKEN_BEST_IMAGE"
  }
}
```

{% hint style="info" %}
`merchantReference` is returned to reconcile the operation with your own system. It is not a query criterion: this route is addressed by `operationId`.
{% endhint %}

#### Other responses

| Code  | Description                                                                                                                                                                               |
| ----- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `401` | Missing, invalid, or expired Token.                                                                                                                                                       |
| `403` | The consumer is not provisioned with the service `OPERATION`.                                                                                                                             |
| `404` | The operation does not exist or belongs to another consumer.                                                                                                                              |
| `410` | The operation declared in `operation-id` has expired.                                                                                                                                     |
| `429` | The consumer has exceeded its request rate limit. The response includes `Retry-After` with the wait seconds, and `X-RateLimit-Limit` and `X-RateLimit-Burst` with the current thresholds. |
| `503` | The service is temporarily unavailable.                                                                                                                                                   |

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