---
title: "Upload Document"
url: "https://developer.pexa.co.uk/apis/lodgement-v1-v1/versions/4cf5cbcd-2fac-43d1-a87a-4c2ddc00ef30/operations/uploadFile"
---

> Full API specification: https://developer.pexa.co.uk/apis/lodgement-v1-v1/versions/4cf5cbcd-2fac-43d1-a87a-4c2ddc00ef30.md

# Upload Document

`POST` `/partner/api/platformconnect/v1/workspaces/{workspace_id}/files`

Operation ID: `uploadFile`

This API is used to upload documents to workspace such as offer document as well as upload & attach a document to the lodgement application associated to the workspace, such as a mortgage deed. <br><br> ***Note:*** In the event of eDeed please update mortgageDeedReference and mortgageDeedReferenceType using Update Lodgement Application Attribute before uploading

## Path parameters

- `workspace_id` (string, uuid, required) - Workspace id

## Header parameters

- `X-Request-Correlation-Id` (string, optional)

## Request body (required)

Content types: `multipart/form-data`

## Responses

- `202` - ACCEPTED
- `400` - BAD REQUEST
- `500` - INTERNAL SERVER ERROR
- `503` - SERVICE UNAVAILABLE

## OpenAPI definition

```yaml
openapi: 3.0.1
info:
  title: Lodgement
  version: v1.1.0
servers:
  - url: https://api.pexa.co.uk
    description: API Gateway URL
paths:
  /partner/api/platformconnect/v1/workspaces/{workspace_id}/files:
    post:
      tags:
        - LodgementDocument
      summary: Upload Document
      description: "This API is used to upload documents to workspace such as offer
        document as well as upload & attach a document to the lodgement
        application associated to the workspace, such as a mortgage deed.
        <br><br> ***Note:*** In the event of eDeed please update
        mortgageDeedReference and mortgageDeedReferenceType using Update
        Lodgement Application Attribute before uploading "
      operationId: uploadFile
      security:
        - oauth2:
            - x-api:create:attachments
            - x-api:add:workspace_files
            - add:lodgement_files
            - view:lodgement_documents
      parameters:
        - in: header
          name: X-Request-Correlation-Id
          schema:
            type: string
            description: The unique identifier for the request
        - name: workspace_id
          in: path
          description: Workspace id
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          multipart/form-data:
            schema:
              required:
                - file
                - documentType
                - documentCategory
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  example: sample_document.pdf
                  description: |
                    Allowed format: [`PDF`]
                documentType:
                  type: string
                  example: MORTGAGE_DEED
                  description: |
                    Allowed values: [`MORTGAGE_DEED`,
                     `TR1`,
                     `RX3`,
                     `BIRTH_CERTIFICATE`,
                     `CORRESPONDENCE`,
                     `EVIDENCE`,
                     `IDENTITY_EVIDENCE`,
                     `IDENTITY_FORM`,
                     `MARRIAGE_CERTIFICATE`,
                     `STATEMENT_OF_TRUTH`,
                     `STATUTORY_DECLARATION`,
                     `MORTGAGE_OFFER`,
                     `REDEMPTION_STATEMENT`,
                     `PG82_CERTIFICATE`,
                     `COMPANIES_HOUSE_CERTIFICATE`,
                     `COMPANIES_HOUSE_EVIDENCE`,
                     `LAND_TRANSACTION_TAX`,
                     `STAMP_DUTY_LAND_TAX`]
                applicationId:
                  type: string
                  format: uuid
                  example: 123e4567-e89b-12d3-a456-426614174000
                  description: To attach the uploaded document to a specific application, the
                    corresponding Application ID must be provided. This value is
                    not required when uploading a document to Workspace without
                    having to attach to an application.
                documentCategory:
                  type: string
                  example: APPLICATION_DOCUMENT
                  description: |
                    Allowed values: [`APPLICATION_DOCUMENT`,
                     `SUPPORTING_DOCUMENT`,
                     `WORKSPACE_SUPPORTING_DOCUMENT`]
                certificationType:
                  type: string
                  pattern: (CERTIFIED|ORIGINAL|SCANNED)
                  example: CERTIFIED
                  description: |
                    Allowed values: [`CERTIFIED`, `ORIGINAL`, `SCANNED`]
        required: true
      responses:
        "202":
          description: ACCEPTED
          headers:
            X-API-Version:
              schema:
                type: string
                description: The API version that was used to process the request.
            X-Request-Correlation-Id:
              schema:
                type: string
                description: The unique identifier for the request
          content:
            application/json:
              schema:
                required:
                  - fileId
                properties:
                  fileId:
                    type: string
                    format: uuid
        "400":
          description: BAD REQUEST
          headers:
            X-API-Version:
              schema:
                type: string
                description: The API version that was used to process the request.
            X-Request-Correlation-Id:
              schema:
                type: string
                description: The unique identifier for the request
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                          description: Field
                        message:
                          type: string
                          description: Error message
              example:
                errors:
                  - message: Bad Request
        "500":
          description: INTERNAL SERVER ERROR
          headers:
            X-API-Version:
              schema:
                type: string
                description: The API version that was used to process the request.
            X-Request-Correlation-Id:
              schema:
                type: string
                description: The unique identifier for the request
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                          description: Field
                        message:
                          type: string
                          description: Error message
              example:
                errors:
                  - message: Internal Server Error
        "503":
          description: SERVICE UNAVAILABLE
          headers:
            X-API-Version:
              schema:
                type: string
                description: The API version that was used to process the request.
            X-Request-Correlation-Id:
              schema:
                type: string
                description: The unique identifier for the request
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                          description: Field
                        message:
                          type: string
                          description: Error message
              example:
                errors:
                  - message: Service under maintenance
security:
  - oauth2:
      - x-api:create:attachments
      - x-api:add:workspace_files
      - add:lodgement_files
      - view:lodgement_documents
components:
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://login.pexauk.co.uk/oauth/token
          scopes:
            x-api:create:attachments: Create access to the attachments
            x-api:add:workspace_files: Add access to the workspace files
            view:title_documents: View access to the title documents
            x-api:view:documents: View access to the documents
            x-api:approve:lodgement_applications: Approve access to lodgement applications
            x-api:unapprove:lodgement_applications: Unapprove access to lodgement applications
            x-api:submit:lodgement_applications: Submit access to lodgement applications
            x-api:add:lodgement_titles: Add titles to lodgementCase
            view:lodgement_cases: View lodgement cases
            view:lodgement_documents: View lodgement documents
            add:lodgement_files: Add access to the lodgement files
            view:lodgement_files: View access to the lodgement files
            submit:lodgement_applications: Submit access to the lodgement applications
            view:workspaces: View access to the workspaces
```
