---
title: "POST /server-provided-path-upload-documents-url"
method: POST
path: "/server-provided-path-upload-documents-url"
tags: ["Upload"]
---

# POST /server-provided-path-upload-documents-url

`POST /server-provided-path-upload-documents-url`

This endpoint returns the document upload information. The client retrieves this url via the callback url from the server after the user's completion of the upload metadata entry. The url of this endpoint is retrieved from the callback sent to the client in a query parameter named upload_documents_url. In case when the user cancels the upload on the CDE UI, this callback will still be called, but the upload_documents_url query parameter will not be present, instead the server will provide a query parameter called user_cancelled_upload=true.

## Request body

- UploadFileDetails — This object holds information about files to be uploaded. Each file in the array needs a file size so that the server can calculate the needed parts for a multipart upload. The session_file_id is used to identify the file.
  - `files` UploadFileDetail[], required
    - `size_in_bytes` integer, required
    - `session_file_id` string, required

## Response `200`

- DocumentsToUpload
  - `upload_context` string, nullable
  - `documents_to_upload` DocumentToUpload[], required
    - `session_file_id` string, required
    - `upload_file_parts` UploadFilePartInstruction[], required
      - `url` string, required
      - `http_method` 'POST' | 'PUT', required
      - `additional_headers` Headers
        - `values` HeaderValue[], required
          - `name` string, required
          - `value` string, required
      - `include_authorization` boolean — Whether or not to include the default authorization of the CDE in the file upload request
      - `multipart_form_data` MultipartFormData
        - `prefix` string, byte, required — This is a server provided value. Its value must be prefixed to the binary content body when uploading this part
        - `suffix` string, byte, required — This is a server provided value. Its value must be suffixed to the binary content body when uploading this part. Typically, this is the end boundary for a multipart/form-data request
      - `content_range_start` integer, required — The inclusive, zero index based start for this part
      - `content_range_end` integer, required — The inclusive, zero index based end for this part
    - `upload_completion` LinkData, required
      - `url` string, required
    - `upload_cancellation` LinkData, required
      - `url` string, required

## Other responses

- `400` — This error may be returned if the file size exceeds the maximum length supported by the server.

## Changes

- **2022-02-16** `30259031e29d` — 1 info
  - api tag `Upload` added
- **2022-02-14** `3eaa30d597fd` — 1 warning, 3 info
  - removed the optional property `server_context` from the response with the `200` status
  - api operation id `/server-provided-path-upload-documents-url` removed and replaced with ``
  - api tag `Upload` removed
  - added the optional property `upload_context` to the response with the `200` status

[Change history](https://skmtc.dev/buildingsmart/apis/opencde-documents-api/changes/server-provided-path-upload-documents-url/post.md)

---

[API](https://skmtc.dev/buildingsmart/apis/opencde-documents-api.md) · [All operations](https://skmtc.dev/buildingsmart/apis/opencde-documents-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/buildingsmart/opencde-documents-api/revisions/30259031e29d/schema)
