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

# Upload document

> Uploads an individual's identity document, or a company document for a business.

For an individual, uploading the photo ID auto-submits the applicant and moves the customer to `PENDING`. For a business, submission waits until the company documents **and** every owner's documents are in.

Content is sniffed rather than trusted by extension, so a renamed file is rejected.



## OpenAPI

````yaml api-reference/endl-onboarding-api.json POST /api/v0/customer/{userId}/documents
openapi: 3.1.0
info:
  title: Endl Partner Onboarding API
  version: '0'
  description: >-
    Onboard end customers for identity verification — individuals (KYC) and
    businesses (KYB) — through one uniform REST surface.


    Authentication is API-key only: every request carries a single `API-KEY`
    header. Unlike the Partner API, responses are **flat** — a successful body
    is the data object itself, with no `{ data, code, message, status }`
    envelope.
servers:
  - url: https://qa-api.endl.xyz
    description: QA
security:
  - apiKey: []
tags:
  - name: Customers
    description: Create, read, update and delete onboarding customers.
  - name: Documents
    description: Upload identity, company and beneficial-owner documents.
paths:
  /api/v0/customer/{userId}/documents:
    parameters:
      - name: userId
        in: path
        required: true
        schema:
          type: string
          format: uuid
    post:
      tags:
        - Documents
      summary: Upload document
      description: >-
        Uploads an individual's identity document, or a company document for a
        business.


        For an individual, uploading the photo ID auto-submits the applicant and
        moves the customer to `PENDING`. For a business, submission waits until
        the company documents **and** every owner's documents are in.


        Content is sniffed rather than trusted by extension, so a renamed file
        is rejected.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - document
                - idDocType
                - country
              properties:
                document:
                  type: string
                  format: binary
                  description: JPEG, PNG or PDF. Maximum 2 MB.
                idDocType:
                  type: string
                  description: >-
                    For an individual: `PASSPORT`, `ID_CARD`, `DRIVERS_LICENSE`,
                    `RESIDENCE_PERMIT` or `SELFIE` — validated. For a business
                    use `COMPANY_DOC`.
                country:
                  type: string
                  description: ISO 3166-1 alpha-3.
                idDocSubType:
                  type: string
                  description: >-
                    Which company document: `INCORPORATION_CERT`,
                    `INCORPORATION_ARTICLES` or `SHAREHOLDER_REGISTRY`. Not
                    needed for individual photo IDs.
                side:
                  type: string
                  description: >-
                    `FRONT` or `BACK`, meaningful only for two-sided documents.
                    Not validated — any value is passed through.
      responses:
        '200':
          description: Accepted. `missing` lists documents the provider still needs.
          content:
            application/json:
              example:
                accepted: true
                status: SUBMITTED
                missing:
                  - SELFIE
        '400':
          description: The file is not a valid JPEG, PNG or PDF, or a field is invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: '400'
                message: Document content is not a valid JPEG, PNG, or PDF
                name: PartnerOnboardingDocUpload failed to process
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '413':
          description: The file is larger than the 2 MB limit.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: '413'
                message: File too large
                name: File exceeds the maximum upload size of 2 MB
components:
  schemas:
    Error:
      type: object
      description: >-
        A single problem. `code` is the HTTP status, `message` the specific
        reason, and `name` the operation that failed.
      properties:
        code:
          type: string
        message:
          type: string
        name:
          type: string
  responses:
    Unauthorized:
      description: Missing or invalid `API-KEY`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: '401'
            message: Authentication Failed!
            name: PartnerOnboarding failed to process
    NotFound:
      description: Customer or owner not found. A deleted customer also returns 404.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: '404'
            message: Not found
            name: PartnerOnboardingGet failed to process
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: API-KEY
      description: Your partner API key. The key must carry the `onboarding` permission.

````