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

# Sync extract

> Upload one file and wait for a single-document extract. Does not send webhooks. Prefer async upload for multi-document packs.



## OpenAPI

````yaml /openapi/external-v1.json post /api/v1/queues/{queueId}/extract
openapi: 3.1.0
info:
  title: Documate Partner API
  version: v1
  description: >-
    External partner API for uploading documents and reading extraction results.
    Authenticate with a business API key from the Documate app.
servers:
  - url: https://api2.documate.ai
    description: Production
security:
  - ApiKeyAuth: []
paths:
  /api/v1/queues/{queueId}/extract:
    post:
      summary: Sync extract
      description: >-
        Upload one file and wait for a single-document extract. Does not send
        webhooks. Prefer async upload for multi-document packs.
      operationId: syncExtract
      parameters:
        - name: queueId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  contentMediaType: application/octet-stream
                documentTypeKey:
                  type: string
                documentCount:
                  type: integer
                  description: Must be omitted or 1.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SyncExtractResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Channel not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: Multi-document conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SyncExtractResponse'
components:
  schemas:
    SyncExtractResponse:
      type: object
      properties:
        fileId:
          type: string
          format: uuid
        queueId:
          type: string
          format: uuid
        batchId:
          type: string
          format: uuid
          nullable: true
        fileStatus:
          type: string
          nullable: true
        timedOut:
          type: boolean
        fileIds:
          type: array
          items:
            type: string
            format: uuid
        documentIds:
          type: array
          items:
            type: string
            format: uuid
        documents:
          type: array
          items:
            $ref: '#/components/schemas/ExternalDocument'
        error:
          type: string
          nullable: true
    Error:
      type: object
      properties:
        error:
          type: string
    ExternalDocument:
      type: object
      properties:
        id:
          type: string
          format: uuid
        queueId:
          type: string
          format: uuid
        fileId:
          type: string
          format: uuid
        batchId:
          type: string
          format: uuid
          nullable: true
        documentTypeId:
          type: integer
          nullable: true
        documentTypeKey:
          type: string
          nullable: true
        agentId:
          type: string
          format: uuid
          nullable: true
        publicStatusKey:
          type: string
          nullable: true
        internalStageKey:
          type: string
          nullable: true
        errorCode:
          type: string
          nullable: true
        errorMessage:
          type: string
          nullable: true
        resultJson:
          nullable: true
        webhookStatusKey:
          type: string
          nullable: true
        webhookAttempts:
          type: integer
        webhookLastHttpStatus:
          type: integer
          nullable: true
        createdAt:
          type: string
          format: date-time
        completedAt:
          type: string
          format: date-time
          nullable: true
        downloadUrl:
          type: string
          nullable: true
        downloadUrlExpiresAt:
          type: string
          format: date-time
          nullable: true
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
      description: >-
        API key from the Documate app (Settings → API keys). You may also send
        `Authorization: ApiKey YOUR_API_KEY`.

````

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