> 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/identity-api/identity-api-reference/country-integrations/chile/previred/get-previred-token.md).

# Get Previred Token

Service that retrieves the TVI authentication Token and the PDF evidence document download URL generated during the verification process with Previred.

### Endpoint

```
GET /services/previred/{transactionId}
```

### Headers

| Name          | Type   | Required | Description                   |
| ------------- | ------ | -------- | ----------------------------- |
| **x-api-key** | string | **Yes**  | Access authorization API key. |

### Path parameters

| Parameter       | Type   | Required | Description                                                   |
| --------------- | ------ | -------- | ------------------------------------------------------------- |
| `transactionId` | string | **Yes**  | Transaction ID returned by the transaction creation endpoint. |

### Responses

#### `200` Success

#### Response parameters

| Parameter       | Type    | Description                                               |
| --------------- | ------- | --------------------------------------------------------- |
| `timestamp`     | integer | Unix timestamp of the response in seconds.                |
| `transactionId` | string  | Transaction ID linked to the evidence generation process. |
| `token`         | string  | TVI authentication Token.                                 |
| `url`           | string  | URL to download the verification PDF evidence document.   |

#### Response example

```json
{
  "timestamp": 1709708084,
  "transactionId": "0fec0e8d-3ef3-477f-ae9e-e350cda74b33",
  "token": "VI19:yCQAnOEPolfgPg5rSG8Px1Ism2DMKgyaWc1pqvYsz5vTx1E7nEAfh1oOrOa59...",
  "url": "https://api.identity-platform.io/services/custody/download?token=eyJhbG..."
}
```

#### `400` Bad Request

```json
{
  "status": 400,
  "title": "Bad Request",
  "detail": "Invalid request.",
  "type": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400",
  "errors": []
}
```

#### `401` Unauthorized

```json
{
  "message": "Unauthorized"
}
```

#### `403` Forbidden

```json
{
  "Message": "User is not authorized to access this resource with an explicit deny"
}
```

#### `404` Not Found

```json
{
  "status": 404,
  "title": "Not Found",
  "detail": "Transaction not found.",
  "type": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404"
}
```

#### `502` Bad Gateway

```json
{
  "status": 502,
  "title": "Bad Gateway",
  "detail": "Server got an invalid response.",
  "type": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/502"
}
```

#### `504` Gateway Timeout

```json
{
  "message": "Endpoint request timed out"
}
```
