---
title: "Upload a document"
method: POST
path: "/documents"
tags: ["Documents"]
---

# Upload a document

`POST /documents`

Upload a document.<br /><br />Uploaded files must be linked to a service within 30 minutes or they will be automatically deleted.

## Request body

- CreateDocServiceDocumentRequest
  - `url` string — If the file is already hosted publicly, you can provide a URL and have the documents service fetch it for you.
  - `file` string, byte — Alternatively, instead of the URL you can provide the Base64 encoded contents of the file you are uploading.
  - `filename` string — The filename of the document.
  - `customer_reference` string — A customer reference string for customer look ups.

## Response `200`

Successful response

- object
  - `data` DocServiceDocument
    - `id` string, uuid — Identifies the resource.
    - `record_type` string — Identifies the type of the resource.
    - `created_at` string — ISO 8601 formatted date-time indicating when the resource was created.
    - `updated_at` string — ISO 8601 formatted date-time indicating when the resource was updated.
    - `content_type` string — The document's content_type.
    - `size` object — Indicates the document's filesize
      - `unit` string — Identifies the unit
      - `amount` integer — The number of bytes
    - `status` 'pending' | 'verified' | 'denied' — Indicates the current document reviewing status
    - `sha256` string — The document's SHA256 hash provided for optional verification purposes.
    - `filename` string — The filename of the document.
    - `customer_reference` string — Optional reference string for customer tracking.
    - `av_scan_status` 'scanned' | 'infected' | 'pending_scan' | 'not_scanned' — The antivirus scan status of the document.

## Other responses

- `422` — Unprocessable entity. Check the 'detail' field in response for details.
- `default` — Unexpected error

---

[API](https://skmtc.net/team-telnyx/apis/telnyx-api-2.md) · [All operations](https://skmtc.net/team-telnyx/apis/telnyx-api-2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/team-telnyx/telnyx-api-2/versions/8f5f4e537994/schema)
