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

> ## Agent Instructions
> Authenticate with the raw API key in the Authorization header. Never add a Bearer prefix.
> Use the sandbox base URL https://api.test.doola.com and a dk_test_ key in examples unless the user asks for production.
> Send an Idempotency-Key header on POST /v1/partner/customers, POST /v1/partner/companies, POST /v1/partner/companies/import, POST /v1/partner/companies/{companyId}/services and POST /v1/partner/companies/{companyId}/documents. No other endpoint takes one.
> Every response is wrapped as {payload, error}. Read fields from payload and branch on error.code, never on the message.
> Drive formation progress from webhooks plus a reconciliation sweep, never a polling loop.
> Embedded SDK (@doola/js): the dk_ key stays on the server and mints customer sessions; the browser gets only a pk_ key and the session. onFormed carries only companyId and can fire more than once. Before charging, read the company with the dk_ key, require formationSubmissionStatus AWAITING_PAYMENT, check the owner's email, and price on the server. Then POST payment-confirmed, which answers 200 with an empty body, and replace the SDK element with a new doola.create() (never append a second one).
> The doola Formation MCP server at https://mcp.doola.com is for founders forming their own company with their own doola account. Partners integrate the Partner API or the Embedded SDK. The /mcp endpoint on this docs site only searches these docs.
> For a full capability summary with the rules above, read https://docs.doola.com/skill.md.

# Upload a company document

> Adds one document to a company you own, sent as `multipart/form-data` with the file in `file` and its type in `documentType`. The file must be a PDF of at most 10MB, whatever the document type, with a name of at most 255 characters; a PDF is recognised from the file's contents, not from the declared content type. The stored document is returned and from then on appears in the list endpoint and can be downloaded by its `id`. Uploading a document has the same effect as doola receiving it: an `ArticlesOfOrganization` or `EinLetter` upload starts the work that document unlocks, and the matching `document_*_uploaded` webhook is sent for every type except `OTHER`. Idempotent on the `Idempotency-Key` header: retrying the same file with the same key returns the first upload instead of storing a second copy.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/partner/companies/{doolaCompanyId}/documents
openapi: 3.1.0
info:
  title: doola Partner API
  description: >-
    REST API for doola partners to create and manage customers and companies,
    retrieve formation documents, and look up reference data.


    Authenticate every request with a partner API key in the `Authorization`
    header. Generate keys and manage your webhook endpoint in the doola Partner
    Portal.
  contact:
    name: doola
    url: https://www.doola.com
  version: v1
servers:
  - url: https://api.test.doola.com
    description: Sandbox — use test keys (dk_test_…)
  - url: https://api.doola.com
    description: Production — use live keys (dk_live_…)
security:
  - PartnerApiKey: []
tags:
  - name: Playground (sandbox only)
    description: >-
      Sandbox-only helpers to drive a test company through the Formation and
      EinCreation milestones end to end.
  - name: Required Actions
    description: >-
      Actions doola needs you to take on a company, such as supplying new name
      options after a state rejection.
  - name: Customers
    description: Create and look up customers under your partner tenant.
  - name: Compliance
    description: Track a company's compliance obligations and their due dates.
  - name: Annual Report Filing
    description: >-
      File a company's annual report with its state: what to collect, what it
      costs, submission, confirmation and status.
  - name: Customer sessions
    description: Mint the token the doola SDK uses in your customer's browser.
  - name: Signatures
    description: Request embedded signing sessions for pending company documents.
  - name: Companies
    description: >-
      Create or import companies for your customers, then track formation
      status.
  - name: Documents
    description: List, download and upload a company's formation documents.
  - name: Companies
    description: Create companies for your customers, then track formation status.
  - name: SDK
    description: Keys for the doola Embedded SDK.
  - name: Reference data
    description: >-
      Static lookups for building company-creation requests: NAICS codes,
      states, countries, and state filing fees.
paths:
  /v1/partner/companies/{doolaCompanyId}/documents:
    post:
      tags:
        - Documents
      summary: Upload a company document
      description: >-
        Adds one document to a company you own, sent as `multipart/form-data`
        with the file in `file` and its type in `documentType`. The file must be
        a PDF of at most 10MB, whatever the document type, with a name of at
        most 255 characters; a PDF is recognised from the file's contents, not
        from the declared content type. The stored document is returned and from
        then on appears in the list endpoint and can be downloaded by its `id`.
        Uploading a document has the same effect as doola receiving it: an
        `ArticlesOfOrganization` or `EinLetter` upload starts the work that
        document unlocks, and the matching `document_*_uploaded` webhook is sent
        for every type except `OTHER`. Idempotent on the `Idempotency-Key`
        header: retrying the same file with the same key returns the first
        upload instead of storing a second copy.
      operationId: uploadDocument
      parameters:
        - name: doolaCompanyId
          in: path
          description: doola company ID (KSUID).
          required: true
          schema:
            type: string
        - name: Idempotency-Key
          in: header
          description: >-
            Unique key that makes the upload safe to retry. Reuse the same value
            to retry; if the upload fails before it is stored, the key is
            released, so retry with the same value.
          required: true
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                documentType:
                  type: string
                  description: >-
                    What the document is. `ArticlesOfOrganization` is the
                    formation document for both entity types: the Articles of
                    Organization of an LLC, and the Articles or Certificate of
                    Incorporation of a C-Corp. `EinLetter` is the IRS CP 575 or
                    147C letter; `OTHER` is any other company document.
                  enum:
                    - ArticlesOfOrganization
                    - EinLetter
                    - OperatingAgreement
                    - CorporateBylaws
                    - OTHER
                file:
                  type: string
                  format: binary
                  description: 'The document: a PDF of at most 10MB.'
              required:
                - documentType
                - file
      responses:
        '201':
          description: Created
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/DocumentDto'
        '400':
          description: >-
            E_DOCUMENT_TYPE_INVALID: `documentType` is not one of the allowed
            values. E_DOCUMENT_FILE_INVALID: the file is not a PDF, or its name
            is missing or longer than 255 characters. E_FILE_TOO_LARGE: the file
            is larger than 10MB. E_REQUEST_BODY_INVALID: the `file` or
            `documentType` part is missing. E_IDEMPOTENCY_KEY_REQUIRED: the
            `Idempotency-Key` header is missing.
        '404':
          description: >-
            E_COMPANY_NOT_FOUND: no company with this ID for the authenticated
            partner.
        '409':
          description: >-
            E_IDEMPOTENCY_KEY_REUSED: the key was already used for a different
            upload. E_IDEMPOTENCY_IN_PROGRESS: an upload with the same key is
            still running.
components:
  schemas:
    DocumentDto:
      type: object
      description: Metadata for a company document.
      properties:
        id:
          type: string
          description: Document ID.
        companyId:
          type: string
          description: doola company ID (KSUID) the document belongs to.
        name:
          type: string
          description: File name.
          example: Articles-of-Organization.pdf
        contentType:
          type: string
          description: MIME content type.
          example: application/pdf
        documentType:
          type:
            - string
            - 'null'
          description: >-
            Document type — for example ArticlesOfOrganization, EinLetter, Mail,
            SignedSS4 or SignedForm8821. May be absent for a file whose source
            provides no type.
          example: ArticlesOfOrganization
        lastModified:
          type: string
          format: date-time
          description: Last modified timestamp (RFC 3339).
          example: '2026-07-06T21:11:56Z'
        createdAt:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            Creation timestamp (RFC 3339). May be null for files whose source
            provides no creation time.
          example: '2026-07-06T21:11:56Z'
  securitySchemes:
    PartnerApiKey:
      type: apiKey
      description: >-
        Partner API key. Send the raw key as the `Authorization` header value —
        e.g. `dk_test_…` in sandbox or `dk_live_…` in production. Generate and
        rotate keys in the doola Partner Portal.
      name: Authorization
      in: header

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.