---
title: "Get a document"
method: GET
path: "/v2/documents/{documentId}"
---

# Get a document

`GET /v2/documents/{documentId}`

## Request

- Base URL: `https://api.slash.com`
- URL: `https://api.slash.com/v2/documents/{documentId}`
- Auth: API key in header `X-API-Key`

Get a document with a fresh `downloadUrl`, valid for about 15 minutes.

## Response `200`

The document.

- Document: A file stored on Slash, uploaded through the API or generated by Slash. Attach it by id where its `purpose` is accepted; the file itself is fetched through `downloadUrl`.
  - `id` string, required: Document id with the `st_` prefix.
  - `filename` string, required: The filename supplied at upload.
  - `purpose` 'bill_invoice' | 'accounting_receipt' | 'invoice_logo': What the document was uploaded for. Absent on files Slash generated.
  - `contentType` string, required: MIME type detected from the file's bytes.
  - `sizeBytes` integer, required: Size of the stored file in bytes, or `0` for files Slash generated.
  - `downloadUrl` string, uri, required: Presigned URL for the file. Valid for about 15 minutes; fetch the document again for a fresh one.
  - `createdAt` string, date-time, required: When the document was uploaded.

## Other responses

- `400`: - `invalid_request (request shape)` — The body, query, or headers failed validation, or a required header is missing. `details` has one entry per failing location, keyed by JSON pointer or header name.
- `401`: - `unauthorized` — API key authentication is missing or invalid.
- `403`: - `forbidden (legal entity)` — The credential is not permitted to act for the selected legal entity. - `not_available` — Public API v2 is not yet available. Use [Public API v1](https://docs.slash.com/introduction) in the meantime. - `user_api_key_required` — The API key is scoped to a legal entity rather than a user. Every v2 request needs a user API key, created under Settings → API keys in the Slash dashboard, together with the `x-legal-entity` header.
- `404`: - `not_found` — No resource matches the identifier. When the identifier is a field of the request, `details` names that `field` and the `id` it received.
- `429`: The request exceeded the applicable rate limit. The response body is plain text, not the error object; clients must not depend on its wording.
- `500`: - `internal` — Slash could not complete the request. Quote `referenceId` when contacting Slash support.

## Changes

- **2026-10-16** `8b5d371ffeea`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/slashfi/apis/slash-public-api/changes/v2/documents/:documentId/get.md)

---

[API](https://skmtc.dev/slashfi/apis/slash-public-api.md) - [All operations](https://skmtc.dev/slashfi/apis/slash-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/slashfi/apis/slash-public-api/revisions/eaed2d63c9e2?raw)
