---
title: "Uploads a new customer document."
url: "https://developer.tesma.com/apis/tesma-platform-api-v1/versions/333907fb-f0a7-4e20-b01e-c9915c73321a/paths/v1-documents/post"
---

> Full API specification: https://developer.tesma.com/apis/tesma-platform-api-v1/versions/333907fb-f0a7-4e20-b01e-c9915c73321a.md

# Uploads a new customer document.

`POST` `/v1/documents`

## Header parameters

- `CorporateGroup-Name` (string, optional) - Corporate group key that assigns the currently selected corporate group to the request.

## Request body

Content types: `multipart/form-data`

## Responses

- `200` - OK
- `400` - Bad Request
- `401` - Unauthorized
- `403` - Forbidden
- `415` - Unsupported Media Type

## OpenAPI definition

```yaml
openapi: 3.1.1
info:
  title: tesma
  version: v1
servers:
  - url: https://api.tesma.com
paths:
  /v1/documents:
    post:
      parameters:
        - description: Corporate group key that assigns the currently selected corporate
            group to the request.
          in: header
          name: CorporateGroup-Name
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            encoding:
              AssetId:
                style: form
              CustomerNumber:
                style: form
              DocumentCategory:
                style: form
              DocumentType:
                style: form
              LeaseCompany:
                style: form
              LeaseScheduleId:
                style: form
            schema:
              properties:
                AssetId:
                  format: int64
                  type: integer
                CustomerNumber:
                  format: int32
                  type: integer
                DocumentCategory:
                  $ref: "#/components/schemas/DocumentCategory"
                DocumentType:
                  maxLength: 128
                  minLength: 0
                  type: string
                LeaseCompany:
                  format: int32
                  type: integer
                LeaseScheduleId:
                  format: int32
                  type: integer
              required:
                - CustomerNumber
                - DocumentCategory
                - DocumentType
                - LeaseCompany
              type: object
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/DocumentCreateResponse"
                type: array
                x-is-public: true
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationProblemDetails"
          description: Bad Request
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
        "415":
          description: Unsupported Media Type
      summary: Uploads a new customer document.
      tags:
        - Documents
security:
  - PersonalAccessToken: []
components:
  schemas:
    DocumentCategory:
      enum:
        - masterLeaseAgreement
        - supplementalAgreement
        - leaseSchedule
        - carbonZeroCertificate
        - collection
        - erasureProtocol
        - invoice
        - credit
        - additionalDocument
        - report
        - ownDocument
        - scheduledExport
        - oneTimeExport
      type: string
    DocumentCreateResponse:
      additionalProperties: false
      properties:
        documentId:
          type:
            - "null"
            - string
      type: object
    ValidationProblemDetails:
      additionalProperties: {}
      properties:
        detail:
          type:
            - "null"
            - string
        errors:
          additionalProperties:
            items:
              type: string
            type: array
          type:
            - "null"
            - object
        instance:
          type:
            - "null"
            - string
        status:
          format: int32
          type:
            - "null"
            - integer
        title:
          type:
            - "null"
            - string
        type:
          type:
            - "null"
            - string
      type: object
  securitySchemes:
    PersonalAccessToken:
      description: Authentication using the Personal Access Token generated in tesma UI.
      in: header
      name: X-API-KEY
      type: apiKey
```
