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

# Attach a company document

> Confirm a company document you already PUT to a presigned URL. Routes
through the shared deposit core, so the document runs the same triage
and kind-match gating and drives the same KYB completion recompute as an
officer upload — ownership, size and file type are re-checked
server-side. Requires `documents:write`.


Step 2 of the company-document upload: confirm a document you already `PUT` to a
[presigned URL](/api-reference/entities/document-upload-url). It routes through
the shared deposit core, so the document runs the **same triage and kind-match
gating** and drives the **same KYB completion recompute** as an officer upload —
ownership, size and file type are all re-checked server-side (the presigned URL
only says where you may write).

`outcome: reading` means it was accepted and queued for extraction;
`wrong-document` means the initial check judged it not to be the expected
document — replace it and confirm again. Requires the `documents:write` scope.


## OpenAPI

````yaml POST /entities/{id}/documents
openapi: 3.1.0
info:
  title: Instant Compliance API
  version: 1.0.0
  summary: External integration API for Instant Compliance.
  description: |
    The Instant Compliance v1 API lets your systems push customers into
    Instant Compliance and pull their verification / AML status back out.
    Designed for server-to-server use (CRMs, Zapier, internal back-office
    tools).

    **Base URL:** `https://app.instantcompliance.ai/api/v1`

    **Authentication:** Bearer API key — `Authorization: Bearer ic_live_…`
    Issue keys from **Settings → Developers** in your Instant Compliance
    organisation.

    **Scope:** individual customers (`INDIVIDUAL` and `SOLE_TRADER`, KYC)
    live on `/customers`; entity customers (companies, trusts,
    partnerships, SMSFs — KYB) live on `/entities`.
  contact:
    name: Instant Compliance Support
    email: support@instantcompliance.ai
    url: https://instantcompliance.ai
  license:
    name: Proprietary
servers:
  - url: https://app.instantcompliance.ai/api/v1
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Customers
    description: |
      Create, read, and update individual customer records ingested through
      the external API.
  - name: Entities
    description: |
      Create, read, and update entity customer records (companies, trusts,
      partnerships, SMSFs). Entities verify via KYB instead of KYC; the API
      ingests the record and reports status — verification is started by
      your back-office team in-app.
  - name: Designated services
    description: |
      Read-only catalog of the designated-service codes accepted when
      creating customers.
  - name: Groups
    description: |
      Create group workspaces (multi-party deals/matters — e.g. one per
      property for real-estate integrators) and discover the group
      templates available to your organisation. Requires the Groups
      feature to be enabled for your organisation.
paths:
  /entities/{id}/documents:
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
        description: Entity identifier (UUID or your `external_id`).
    post:
      tags:
        - Entities
      summary: Confirm / attach a company document
      description: |
        Confirm a company document you already PUT to a presigned URL. Routes
        through the shared deposit core, so the document runs the same triage
        and kind-match gating and drives the same KYB completion recompute as an
        officer upload — ownership, size and file type are re-checked
        server-side. Requires `documents:write`.
      operationId: attachEntityDocument
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CompanyDocumentConfirmRequest'
            example:
              s3Key: check-documents/org-…/entity-…/…_asic-extract.pdf
              file:
                fileName: asic-extract.pdf
                fileSize: 482913
                contentType: application/pdf
      responses:
        '201':
          description: The stored file / extraction-job ids and the triage outcome.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompanyDocumentResult'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/ForbiddenScope'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/ValidationFailed'
        '429':
          $ref: '#/components/responses/RateLimited'
      security:
        - bearerAuth: []
components:
  schemas:
    CompanyDocumentConfirmRequest:
      type: object
      required:
        - s3Key
        - file
      additionalProperties: false
      properties:
        s3Key:
          type: string
          minLength: 1
          maxLength: 1024
        file:
          type: object
          required:
            - fileName
            - fileSize
            - contentType
          additionalProperties: false
          properties:
            fileName:
              type: string
              minLength: 1
              maxLength: 512
            fileSize:
              type: integer
              minimum: 1
            contentType:
              type: string
              minLength: 1
              maxLength: 255
        note:
          type: string
          maxLength: 2000
    CompanyDocumentResult:
      type: object
      properties:
        file_id:
          type: string
          format: uuid
        job_id:
          type: string
          format: uuid
        outcome:
          type: string
          enum:
            - reading
            - wrong-document
          description: |
            `reading` — accepted and queued for extraction. `wrong-document` —
            the initial check judged it not to be the expected document; replace
            it and confirm again.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              enum:
                - unauthorized
                - forbidden_scope
                - not_found
                - validation_failed
                - conflict
                - insufficient_credits
                - rate_limited
                - idempotency_conflict
                - feature_disabled
                - internal
            message:
              type: string
            details:
              type: object
              additionalProperties: true
  responses:
    Unauthorized:
      description: Missing, invalid, expired, or revoked API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: unauthorized
              message: Invalid or revoked API key.
    ForbiddenScope:
      description: API key lacks the required scope.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: forbidden_scope
              message: This API key does not have the required scope. customers:write
              details:
                required_scope: customers:write
    NotFound:
      description: No customer matching the supplied id in this organisation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: not_found
              message: Customer not found.
    ValidationFailed:
      description: Request payload failed schema validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: validation_failed
              message: Invalid customer payload.
              details:
                issues:
                  email:
                    - Must be a valid email address.
    RateLimited:
      description: Burst or daily rate limit exceeded for this API key.
      headers:
        Retry-After:
          schema:
            type: integer
          description: Seconds to wait before retrying.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: rate_limited
              message: Rate limit exceeded. Slow down and retry shortly.
              details:
                limit: 60
                window_seconds: 60
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: |
        Bearer API key issued from **Settings → Developers** in your
        Instant Compliance organisation. Format: `ic_live_…`.

````