# Retrieve a file

`GET https://api.morevoice.ai/v1/files/{id}`

An uploaded file's facts (purpose, type, size, SHA-256, whether a request used it). The file itself is never returned.

Authenticate with a secret API key: `Authorization: Bearer $MOREVOICE_API_KEY`.

Operation ID: `files_retrieve`.

## Parameters

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | A file ID (`file_…`). |

### Headers

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `MoreVoice-Version` | `string` | no | The API version to use for this request. Defaults to the version the API key is pinned to. |

## Responses

### 200 OK

OK Returns `File`.

| Field | Type | Description |
| --- | --- | --- |
| `object` | `"file"` | — |
| `id` | `string` | A file ID (prefix `file_`). |
| `livemode` | `boolean` | `true` in live mode, `false` in test mode. |
| `purpose` | `"port_document"` | What the file is for: `port_document` (a port's signed LOA or latest invoice). |
| `filename` | `string` | — |
| `mime_type` | `string` | application/pdf, image/jpeg or image/png (read from the file itself). |
| `size_bytes` | `integer` | — |
| `sha256` | `string` | SHA-256 of the file's bytes (hex). |
| `used` | `boolean` | A request took it (a file is used once). |
| `expires_at` | `string \| null` | An unused file is deleted after this; null once used. |
| `created` | `string` | An ISO-8601 timestamp in UTC. |

Example:

```json
{
  "created": "2026-11-23T09:00:00.000Z",
  "expires_at": "2026-11-30T09:00:00.000Z",
  "filename": "loa-signed.pdf",
  "id": "file_3NcP7sQ2wLm9TzXb4RkVu",
  "livemode": true,
  "mime_type": "application/pdf",
  "object": "file",
  "purpose": "port_document",
  "sha256": "9f2c6b1e0d4a7c3b8e5f1a2d6c9b0e3f7a4d1c8b5e2f9a6d3c0b7e4f1a8d5c2b",
  "size_bytes": 184320,
  "used": false
}
```

### 400 Bad Request

The request is invalid: a parameter is missing, malformed or unknown, or the version header is unknown. Returns `ErrorEnvelope`.

### 401 Unauthorized

No valid API key was sent. Returns `ErrorEnvelope`.

### 403 Forbidden

The key may not do this (a missing scope, a plan limit, or a compliance block). Returns `ErrorEnvelope`.

### 404 Not Found

No object with this ID (in the path or the body) exists in this organisation and mode. Returns `ErrorEnvelope`.

### 429 Too Many Requests

Too many requests, or no call capacity right now. Retry after the Retry-After delay. Returns `ErrorEnvelope`.

### 500 Internal Server Error

Something went wrong on MoreVoice's side. Retry with the same Idempotency-Key. Returns `ErrorEnvelope`.

## Code samples

**TypeScript**

```ts
import MoreVoice from "@morevoice/sdk";

const mv = new MoreVoice(); // MOREVOICE_API_KEY from the environment

const file = await mv.files.retrieve("file_7Hk2Lm9Qp");
console.log(file);
```

**Python**

```python
from morevoice import MoreVoice

client = MoreVoice()  # MOREVOICE_API_KEY from the environment

file = client.files.retrieve("file_7Hk2Lm9Qp")
print(file)
```

**cURL**

```sh
curl https://api.morevoice.ai/v1/files/file_7Hk2Lm9Qp \
  -H "Authorization: Bearer $MOREVOICE_API_KEY"
```
