---
title: "Gets a file by ID"
method: GET
path: "/files/{id}"
tags: ["Files"]
---

# Gets a file by ID

`GET /files/{id}`

Retrieves the details of a file. You must supply the unique identifier of the file.

## Path parameters

- `id` string, required

## Response `200`

OK.

- FileObject
  - `id` string — The unique identifier of the file.
  - `createdTime` string, date-time — The time when the file was created.
  - `fileName` string — A filename for the file, suitable for saving to a filesystem.
  - `links` FileLink[] — An array of file links.
    - `id` string — Unique identifier for the file link.
    - `createdTime` string, date-time — Time when the file link was created.
    - `expired` boolean — Whether this link has already expired.
    - `expiresTime` string, date-time — Time at which the link expires.
    - `fileId` string — The file object this link points to.
    - `liveMode` boolean — Has the value true if the object exists in live mode or the value false if the object exists in test mode.
    - `metadata` Metadata — Key-value pairs used to store additional data. Value can be string, boolean or integer types.
    - `url` string — The publicly accessible URL to download the file.
  - `purpose` 'tax_document_customer_upload' | 'customer_invoice' | 'customer_credit_memo' — The purpose of the file.
  - `title` string — A user friendly title for the document.
  - `size` number — The size in bytes of the file object.
  - `type` string — The type of the file returned (e.g. pdf, jpg, or png).
  - `url` string — The URL from which the file can be downloaded. To download the file, use your live secret API key.
  - `liveMode` boolean — Has the value true if the object exists in live mode or the value false if the object exists in test mode.

## Other responses

- `400` — 400 Bad Request
- `401` — 401 Unauthorized
- `403` — 403 Forbidden
- `404` — 404 Not Found
- `405` — 405 Method Not Allowed
- `406` — 406 Not Acceptable
- `408` — 408 Request Timeout
- `429` — 429 Too Many Requests
- `500` — 500 Internal Server Error
- `502` — 502 Bad Gateway Error
- `503` — 503 Service Unavailable Error
- `504` — 504 Gateway Timeout Error

---

[API](https://skmtc.net/digitalriver/apis/digital-river-api-reference.md) · [All operations](https://skmtc.net/digitalriver/apis/digital-river-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/digitalriver/digital-river-api-reference/revisions/f21981db32be/schema)
