Affinda · Capability

Affinda Documents API — Documents

Affinda Documents API — Documents. Self-contained Naftiko capability for uploading documents, retrieving parsed data, and managing the document lifecycle (list, get, update, delete).

Affinda Documents API — Documents is a Naftiko capability published by Affinda, one of 8 capabilities the APIs.io network indexes for this provider. It bundles 2 operations across the POST and GET methods rooted at /v3/documents.

The capability includes 2 read-only operations and 1 state-changing operation. Lead operation: Upload a document to Affinda for parsing. Can be deployed as a REST endpoint, MCP tool, or Agent Skill via Naftiko.

Tagged areas include Affinda, Documents, and IDP.

Run with Naftiko AffindaDocumentsIDP

What You Can Do

POST
Createdocument — Upload a document for parsing.
/v3/documents
GET
Listdocuments — List parsed documents.
/v3/documents

MCP Tools

affinda-upload-document

Upload a document to Affinda for parsing.

affinda-get-document

Retrieve a parsed Affinda document.

read-only idempotent
affinda-list-documents

List parsed documents with filters.

read-only idempotent

Capability Spec

documents-documents.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Affinda Documents API — Documents
  description: Affinda Documents API — Documents. Self-contained Naftiko capability for uploading documents,
    retrieving parsed data, and managing the document lifecycle (list, get, update, delete).
  tags:
  - Affinda
  - Documents
  - IDP
  created: '2026-05-25'
  modified: '2026-05-25'
binds:
- namespace: env
  keys:
    AFFINDA_API_KEY: AFFINDA_API_KEY
    AFFINDA_REGION_BASE_URL: AFFINDA_REGION_BASE_URL
capability:
  consumes:
  - type: http
    namespace: documents
    baseUri: https://api.affinda.com
    description: Affinda v3 Documents resource — upload, list, get, update, delete documents and download
      redacted PDF.
    resources:
    - name: v3-documents
      path: /v3/documents
      operations:
      - name: createdocument
        method: POST
        description: Upload a document for parsing. Accepts multipart/form-data with `file`, `workspace`,
          and optional `documentType`, `wait`, `lowPriority`, `language`, `expiryTime`, `regionBias`,
          `compact`, `deleteAfterParse`, `customIdentifier`.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Multipart upload body.
          required: true
      - name: listdocuments
        method: GET
        description: List parsed documents with filters (workspace, document_type, state, tags, dateRange).
        outputRawFormat: json
        outputParameters:
        - name: results
          type: object
          value: $.results
        inputParameters:
        - name: offset
          in: query
          type: integer
        - name: limit
          in: query
          type: integer
        - name: workspace
          in: query
          type: string
        - name: documentType
          in: query
          type: string
    - name: v3-documents-identifier
      path: /v3/documents/{identifier}
      operations:
      - name: getdocument
        method: GET
        description: Retrieve a parsed document including extracted fields, raw text, and metadata.
        outputRawFormat: json
        outputParameters:
        - name: document
          type: object
          value: $.
        inputParameters:
        - name: identifier
          in: path
          type: string
          required: true
      - name: updatedocument
        method: PATCH
        description: Update a document's fields or state.
        outputRawFormat: json
        outputParameters:
        - name: document
          type: object
          value: $.
        inputParameters:
        - name: identifier
          in: path
          type: string
          required: true
        - name: body
          in: body
          type: object
          required: true
      - name: deletedocument
        method: DELETE
        description: Delete a document.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: identifier
          in: path
          type: string
          required: true
    authentication:
      type: apikey
      key: Authorization
      value: 'Bearer {{env.AFFINDA_API_KEY}}'
      placement: header
  exposes:
  - type: rest
    namespace: documents-rest
    port: 8080
    description: REST adapter for Affinda Documents — Spectral-compliant resource per consumed operation.
    resources:
    - path: /v3/documents
      name: v3-documents
      description: REST surface for uploading and listing parsed documents.
      operations:
      - method: POST
        name: createdocument
        description: Upload a document for parsing.
        call: documents.createdocument
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
      - method: GET
        name: listdocuments
        description: List parsed documents.
        call: documents.listdocuments
        with:
          offset: rest.query.offset
          limit: rest.query.limit
          workspace: rest.query.workspace
          documentType: rest.query.documentType
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: documents-mcp
    port: 9090
    transport: http
    description: MCP adapter for Affinda Documents.
    tools:
    - name: affinda-upload-document
      description: Upload a document to Affinda for parsing.
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: documents.createdocument
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: affinda-get-document
      description: Retrieve a parsed Affinda document.
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: documents.getdocument
      with:
        identifier: tools.identifier
      outputParameters:
      - type: object
        mapping: $.
    - name: affinda-list-documents
      description: List parsed documents with filters.
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: documents.listdocuments
      with:
        workspace: tools.workspace
        documentType: tools.documentType
        offset: tools.offset
        limit: tools.limit
      outputParameters:
      - type: object
        mapping: $.