> ## Documentation Index
> Fetch the complete documentation index at: https://api-docs.getmeadow.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Upload customer document

> POST /api/v1/documents/\{customerId\}/\{documentType\}

Upload a document to a customer profile. You will find the customer ID from the response of [create an order (POST /api/v1/orders)](/endpoints/orders/create-order) as `customer.id`.

Meadow supports two document types: `license` and `recommendation`. The `license` type is used for government identification such as a driver's license and `recommendation` is used for medical cannabis recommendations.

Documents are uploaded in the response body by turning them into a [Base64 encoded string](https://en.wikipedia.org/wiki/Base64). Please reach out if you have any questions about how to accomplish this.

When a document upload is successful, the status code will be `204` and there will be no response body returned.

The file size limit for documents is 2.5mb.


## OpenAPI

````yaml POST /api/v1/documents/{customerId}/{documentType}
openapi: 3.0.1
info:
  title: Meadow Open API
  description: The API to connect to the Meadow platform
  version: 1.0.0
servers:
  - url: https://api-staging.getmeadow.com
  - url: https://api.getmeadow.com
security:
  - meadowConsumer: []
    meadowClient: []
paths:
  /api/v1/documents/{customerId}/{documentType}:
    post:
      description: POST /api/v1/documents/\{customerId\}/\{documentType\}
      parameters:
        - name: customerId
          in: path
          description: ID of customer for this document
          required: true
          schema:
            type: integer
            format: int64
        - name: documentType
          in: path
          description: >-
            The type of document. Must be either `license` or `recommendation`.
            `license` is for government identification such as a Driver's
            License. `recommendation` is for medical cannabis doctor's
            recommendations.
          required: true
          schema:
            type: string
            enum:
              - license
              - recommendation
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - documentBase64
                - documentMime
              properties:
                documentBase64:
                  type: string
                  description: >-
                    The file encoded as a
                    [Base64](https://en.wikipedia.org/wiki/Base64) string.
                documentMime:
                  type: string
                  description: 'The mime of the document file. (Example: `image/jpeg`)'
            example:
              documentBase64: BASE_64_STRING_HERE
              documentMime: image/jpeg
      responses:
        '204':
          description: Empty response for successful upload
        4XX:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
components:
  schemas:
    APIError:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              example: A description of the error code
            code:
              type: string
              example: CODE_OF_ERROR_WILL_BE_HERE
  securitySchemes:
    meadowConsumer:
      type: apiKey
      name: X-Consumer-Key
      description: The key assigned to your company and provided via Meadow
      in: header
    meadowClient:
      type: apiKey
      name: X-Client-Key
      description: The key generated and provided by our mutual client
      in: header

````