---
title: "Uploads a document to the ePost archive of the authenticated tenant together with its metadata."
method: POST
path: "/epost/v2/archives/upload"
tags: ["ePost eArchive"]
---

# Uploads a document to the ePost archive of the authenticated tenant together with its metadata.

`POST /epost/v2/archives/upload`

## Request

- Base URL: `https://api.klara.ch`
- URL: `https://api.klara.ch/epost/v2/archives/upload`
- Auth: one of:
  - API key in header `X-API-KEY`
  - HTTP bearer

Uploads a document to the ePost archive of the authenticated tenant together with its metadata.

The request contains the binary file and document metadata. After a successful upload, the document is stored in the tenant's ePost archive and can be accessed through the archive.

## Response `201`

Document uploaded successfully.

- ArchiveUploadResponse: Response returned after a document is successfully archived.
  - `documentId` string: Identifier of the newly archived document.
  - `fileName` string: File name of the stored document (post sanitization).
  - `documentTitle` string: Display title of the archived document.
  - `documentReferenceDate` string: Reference date of the document (yyyy-MM-dd).
  - `description` string: Display description of the archived document.<br> Sourced from the BFF response field <code>documentDescription</code> and renamed here to <code>description</code> so the public API uses one consistent term across request and response.
  - `directoryIds` string[]: Directory ids the document is stored in, as resolved by the eArchive backend (after permission checks and root-directory normalization). Omitted when the document is stored at the root.<br> Sourced from the BFF response field <code>folderIds</code> and renamed here to <code>directoryIds</code> so the public API uses one consistent term across request and response.
  - `createdBy` string: User identifier (typically email) that created the document.
  - `createdDate` string: Creation timestamp in ISO-8601 format (UTC).
  - `updatedBy` string: User identifier (typically email) of the last update. Equal to <code>createdBy</code> on initial upload.
  - `updatedDate` string: Last update timestamp in ISO-8601 format (UTC). Equal to <code>createdDate</code> on initial upload.
  - `link` object: Resource link references for the archived document.
    - `self` string: Self link to the archived document, relative to the eArchive backend (<code>{tenantId}/documents/{documentId}</code>).
  - `versionNumber` integer: Monotonically increasing version number of the document. Starts at <code>1</code> on initial upload.

## Other responses

- `400`: Data invalid<br/><br/>Failures detected by a downstream service carry that service's own <code>code</code>, which this reference does not enumerate, so the <code>code</code> field may hold a value not documented here. Treat an unrecognised code as a generic failure of the status it arrives with, and do not branch on a code this reference does not list.
- `401`: No Authorization header found or invalid token<br/><br/>Failures detected by a downstream service carry that service's own <code>code</code>, which this reference does not enumerate, so the <code>code</code> field may hold a value not documented here. Treat an unrecognised code as a generic failure of the status it arrives with, and do not branch on a code this reference does not list.
- `403`: The current user is not allowed to access this company data<br/><br/>Failures detected by a downstream service carry that service's own <code>code</code>, which this reference does not enumerate, so the <code>code</code> field may hold a value not documented here. Treat an unrecognised code as a generic failure of the status it arrives with, and do not branch on a code this reference does not list.
- `411`: Length required — the request did not advertise a numeric, non-negative <code>Content-Length</code>. Chunked transfer encoding is not supported on this endpoint.<br/><br/>Failures detected by a downstream service carry that service's own <code>code</code>, which this reference does not enumerate, so the <code>code</code> field may hold a value not documented here. Treat an unrecognised code as a generic failure of the status it arrives with, and do not branch on a code this reference does not list.
- `413`: Request entity too large — payload exceeds the 1GB ceiling.<br/><br/>Failures detected by a downstream service carry that service's own <code>code</code>, which this reference does not enumerate, so the <code>code</code> field may hold a value not documented here. Treat an unrecognised code as a generic failure of the status it arrives with, and do not branch on a code this reference does not list.
- `415`: Unsupported Media Type<br/><br/>Failures detected by a downstream service carry that service's own <code>code</code>, which this reference does not enumerate, so the <code>code</code> field may hold a value not documented here. Treat an unrecognised code as a generic failure of the status it arrives with, and do not branch on a code this reference does not list.
- `429`: API rate limit exceeded<br/><br/>Failures detected by a downstream service carry that service's own <code>code</code>, which this reference does not enumerate, so the <code>code</code> field may hold a value not documented here. Treat an unrecognised code as a generic failure of the status it arrives with, and do not branch on a code this reference does not list.
- `500`: Something went wrong on our side while processing the request. Please kindly contact our support.<br/><br/>Failures detected by a downstream service carry that service's own <code>code</code>, which this reference does not enumerate, so the <code>code</code> field may hold a value not documented here. Treat an unrecognised code as a generic failure of the status it arrives with, and do not branch on a code this reference does not list.

---

[API](https://skmtc.dev/klara/apis/klara-public-api.md) · [All operations](https://skmtc.dev/klara/apis/klara-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/klara/apis/klara-public-api/revisions/490b1a879fc2?raw)
