Mantic Documents API

The documents API from Mantic — 10 operation(s) for documents.

Operations 13

POST /webapp/documents/library Upload Document #
GET /webapp/documents/library List Library #
POST /webapp/documents/library/precheck Precheck Document #
GET /webapp/documents/library/quota Get Quota #
POST /webapp/documents/library/search Search Library #
GET /webapp/documents/library/{document_id} Get Document #
PATCH /webapp/documents/library/{document_id} Rename Document #
DELETE /webapp/documents/library/{document_id} Delete Document #
POST /webapp/documents/library/delete Delete Documents #
GET /webapp/documents/library/{document_id}/usages List Usages #
GET /webapp/documents/library/{document_id}/text Get Document Text #
GET /webapp/documents/library/{document_id}/content Get Document Content #
GET /webapp/documents/library/{document_id}/thumbnail Get Document Thumbnail #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/mantic:mantic-documents-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

mantic-documents-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Fast Documents API
  version: 0.1.0
tags:
- name: Documents
paths:
  /webapp/documents/library:
    post:
      tags:
      - Documents
      summary: Upload Document
      description: 'Store a file and start processing it. Returns before the text has been extracted.


        Deliberately not `async`: everything it does - the database, the upload to storage and the

        enqueue - is blocking, and on the event loop a slow upload would stall every other request.

        A plain handler runs in a worker thread instead.'
      operationId: upload_document_webapp_documents_library_post
      security:
      - OAuth2AuthorizationCodeBearer: []
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Body_upload_document_webapp_documents_library_post'
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentSummary'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    get:
      tags:
      - Documents
      summary: List Library
      operationId: list_library_webapp_documents_library_get
      security:
      - OAuth2AuthorizationCodeBearer: []
      parameters:
      - name: search
        in: query
        required: false
        schema:
          type: string
          maxLength: 2000
          default: ''
          title: Search
      - name: status
        in: query
        required: false
        schema:
          type: array
          items:
            type: string
          default: []
          title: Status
      - name: mime_type
        in: query
        required: false
        schema:
          type: array
          items:
            type: string
          default: []
          title: Mime Type
      - name: form
        in: query
        required: false
        schema:
          type: array
          items:
            type: string
          default: []
          title: Form
      - name: topic
        in: query
        required: false
        schema:
          type: array
          items:
            type: string
          default: []
          title: Topic
      - name: used
        in: query
        required: false
        schema:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Used
      - name: surface
        in: query
        required: false
        schema:
          type: array
          items:
            type: string
          default: []
          title: Surface
      - name: uploaded_after
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date
          - type: 'null'
          title: Uploaded After
      - name: uploaded_before
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date
          - type: 'null'
          title: Uploaded Before
      - name: sort
        in: query
        required: false
        schema:
          type: string
          pattern: ^(relevance|created_at|title|byte_size|file_name)$
          default: created_at
          title: Sort
      - name: order
        in: query
        required: false
        schema:
          type: string
          pattern: ^(asc|desc)$
          default: desc
          title: Order
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          maximum: 50
          minimum: 1
          default: 25
          title: Limit
      - name: offset
        in: query
        required: false
        schema:
          type: integer
          maximum: 10000
          minimum: 0
          default: 0
          title: Offset
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /webapp/documents/library/precheck:
    post:
      tags:
      - Documents
      summary: Precheck Document
      description: Whether these bytes are already stored, and whether they would fit.
      operationId: precheck_document_webapp_documents_library_precheck_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentPrecheckRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentPrecheckResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - OAuth2AuthorizationCodeBearer: []
  /webapp/documents/library/quota:
    get:
      tags:
      - Documents
      summary: Get Quota
      operationId: get_quota_webapp_documents_library_quota_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentQuotaResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - OAuth2AuthorizationCodeBearer: []
  /webapp/documents/library/search:
    post:
      tags:
      - Documents
      summary: Search Library
      description: Documents matching a query, each with the passages that matched.
      operationId: search_library_webapp_documents_library_search_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentLibrarySearchRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentLibrarySearchResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - OAuth2AuthorizationCodeBearer: []
  /webapp/documents/library/{document_id}:
    get:
      tags:
      - Documents
      summary: Get Document
      description: The document's metadata. A failed document answers 200 carrying why.
      operationId: get_document_webapp_documents_library__document_id__get
      security:
      - OAuth2AuthorizationCodeBearer: []
      parameters:
      - name: document_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Document Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentSummary'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    patch:
      tags:
      - Documents
      summary: Rename Document
      operationId: rename_document_webapp_documents_library__document_id__patch
      security:
      - OAuth2AuthorizationCodeBearer: []
      parameters:
      - name: document_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Document Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RenameDocumentRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentSummary'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - Documents
      summary: Delete Document
      operationId: delete_document_webapp_documents_library__document_id__delete
      security:
      - OAuth2AuthorizationCodeBearer: []
      parameters:
      - name: document_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Document Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /webapp/documents/library/delete:
    post:
      tags:
      - Documents
      summary: Delete Documents
      operationId: delete_documents_webapp_documents_library_delete_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeleteDocumentsRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteDocumentsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - OAuth2AuthorizationCodeBearer: []
  /webapp/documents/library/{document_id}/usages:
    get:
      tags:
      - Documents
      summary: List Usages
      operationId: list_usages_webapp_documents_library__document_id__usages_get
      security:
      - OAuth2AuthorizationCodeBearer: []
      parameters:
      - name: document_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Document Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentUsagesResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /webapp/documents/library/{document_id}/text:
    get:
      tags:
      - Documents
      summary: Get Document Text
      operationId: get_document_text_webapp_documents_library__document_id__text_get
      security:
      - OAuth2AuthorizationCodeBearer: []
      parameters:
      - name: document_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Document Id
      - name: max_chars
        in: query
        required: false
        schema:
          type: integer
          maximum: 100000
          minimum: 1
          default: 20000
          title: Max Chars
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentTextResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /webapp/documents/library/{document_id}/content:
    get:
      tags:
      - Documents
      summary: Get Document Content
      description: The original bytes, streamed. Only a PDF or an image may be served inline.
      operationId: get_document_content_webapp_documents_library__document_id__content_get
      security:
      - OAuth2AuthorizationCodeBearer: []
      parameters:
      - name: document_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Document Id
      - name: disposition
        in: query
        required: false
        schema:
          type: string
          pattern: ^(attachment|inline)$
          default: attachment
          title: Disposition
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /webapp/documents/library/{document_id}/thumbnail:
    get:
      tags:
      - Documents
      summary: Get Document Thumbnail
      operationId: get_document_thumbnail_webapp_documents_library__document_id__thumbnail_get
      security:
      - OAuth2AuthorizationCodeBearer: []
      parameters:
      - name: document_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Document Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    DocumentSearchHit:
      properties:
        document:
          $ref: '#/components/schemas/DocumentSummary'
        passages:
          items:
            $ref: '#/components/schemas/DocumentPassage'
          type: array
          title: Passages
      type: object
      required:
      - document
      - passages
      title: DocumentSearchHit
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    DocumentPrecheckResponse:
      properties:
        duplicate_of:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: Duplicate Of
        duplicate_title:
          anyOf:
          - type: string
          - type: 'null'
          title: Duplicate Title
        would_exceed_quota:
          type: boolean
          title: Would Exceed Quota
        quota:
          $ref: '#/components/schemas/DocumentQuotaResponse'
      type: object
      required:
      - duplicate_of
      - duplicate_title
      - would_exceed_quota
      - quota
      title: DocumentPrecheckResponse
    DocumentLibrarySearchRequest:
      properties:
        query:
          type: string
          maxLength: 2000
          minLength: 1
          title: Query
        limit:
          type: integer
          maximum: 20.0
          minimum: 1.0
          title: Limit
          default: 20
      additionalProperties: false
      type: object
      required:
      - query
      title: DocumentLibrarySearchRequest
    DocumentListResponse:
      properties:
        items:
          items:
            $ref: '#/components/schemas/DocumentSummary'
          type: array
          title: Items
        total:
          type: integer
          title: Total
        passages:
          additionalProperties:
            items:
              $ref: '#/components/schemas/DocumentPassage'
            type: array
          propertyNames:
            format: uuid
          type: object
          title: Passages
      type: object
      required:
      - items
      - total
      title: DocumentListResponse
    RenameDocumentRequest:
      properties:
        title:
          type: string
          maxLength: 120
          minLength: 1
          title: Title
      additionalProperties: false
      type: object
      required:
      - title
      title: RenameDocumentRequest
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    Body_upload_document_webapp_documents_library_post:
      properties:
        file:
          type: string
          contentMediaType: application/octet-stream
          title: File
        allow_duplicate:
          type: boolean
          title: Allow Duplicate
          default: false
      type: object
      required:
      - file
      title: Body_upload_document_webapp_documents_library_post
    DocumentPrecheckRequest:
      properties:
        sha256:
          type: string
          maxLength: 64
          minLength: 64
          title: Sha256
        byte_size:
          type: integer
          minimum: 0.0
          title: Byte Size
      additionalProperties: false
      type: object
      required:
      - sha256
      - byte_size
      title: DocumentPrecheckRequest
    DocumentPassage:
      properties:
        text:
          type: string
          title: Text
        marks:
          items:
            prefixItems:
            - type: integer
            - type: integer
            type: array
            maxItems: 2
            minItems: 2
          type: array
          title: Marks
        page_start:
          anyOf:
          - type: integer
          - type: 'null'
          title: Page Start
        page_end:
          anyOf:
          - type: integer
          - type: 'null'
          title: Page End
        heading_path:
          type: string
          title: Heading Path
      type: object
      required:
      - text
      - marks
      - page_start
      - page_end
      - heading_path
      title: DocumentPassage
      description: One matching passage, with the matched spans as offsets rather than markup.
    DeleteDocumentsRequest:
      properties:
        document_ids:
          items:
            type: string
            format: uuid
          type: array
          maxItems: 100
          minItems: 1
          title: Document Ids
      additionalProperties: false
      type: object
      required:
      - document_ids
      title: DeleteDocumentsRequest
    DocumentUsagesResponse:
      properties:
        items:
          items:
            $ref: '#/components/schemas/DocumentUsageEntry'
          type: array
          title: Items
      type: object
      required:
      - items
      title: DocumentUsagesResponse
    DocumentQuotaResponse:
      properties:
        document_count:
          type: integer
          title: Document Count
        used_bytes:
          type: integer
          title: Used Bytes
        max_documents:
          type: integer
          title: Max Documents
        max_bytes:
          type: integer
          title: Max Bytes
      type: object
      required:
      - document_count
      - used_bytes
      - max_documents
      - max_bytes
      title: DocumentQuotaResponse
    DocumentSummary:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        file_name:
          type: string
          title: File Name
        title:
          anyOf:
          - type: string
          - type: 'null'
          title: Title
        title_source:
          anyOf:
          - type: string
          - type: 'null'
          title: Title Source
        mime_type:
          type: string
          title: Mime Type
        extension:
          type: string
          title: Extension
        byte_size:
          type: integer
          title: Byte Size
        status:
          type: string
          title: Status
        scan_status:
          type: string
          title: Scan Status
        failure_code:
          anyOf:
          - type: string
          - type: 'null'
          title: Failure Code
        failure_detail:
          anyOf:
          - type: string
          - type: 'null'
          title: Failure Detail
        page_count:
          anyOf:
          - type: integer
          - type: 'null'
          title: Page Count
        char_count:
          type: integer
          title: Char Count
        document_form:
          anyOf:
          - type: string
            enum:
            - paper
            - article
            - book
            - report
            - memo
            - letter
            - presentation
            - contract
            - announcement
            - dataset
            - specification
            - other
          - type: 'null'
          title: Document Form
        document_topic:
          anyOf:
          - type: string
            enum:
            - finance
            - economics
            - business
            - legal
            - politics
            - technology
            - science
            - energy
            - sports
            - society
            - media
            - entertainment
            - personal
            - other
          - type: 'null'
          title: Document Topic
        primary_subject:
          anyOf:
          - type: string
          - type: 'null'
          title: Primary Subject
        source:
          type: string
          title: Source
        has_thumbnail:
          type: boolean
          title: Has Thumbnail
        usage_count:
          type: integer
          title: Usage Count
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
      - id
      - file_name
      - title
      - title_source
      - mime_type
      - extension
      - byte_size
      - status
      - scan_status
      - failure_code
      - failure_detail
      - page_count
      - char_count
      - document_form
      - document_topic
      - primary_subject
      - source
      - has_thumbnail
      - usage_count
      - created_at
      - updated_at
      title: DocumentSummary
      description: A stored document as the library lists it, without its body text.
    DocumentUsageEntry:
      properties:
        surface:
          type: string
          title: Surface
        target_kind:
          anyOf:
          - type: string
          - type: 'null'
          title: Target Kind
        target_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Target Id
        used_at:
          type: string
          format: date-time
          title: Used At
      type: object
      required:
      - surface
      - target_kind
      - target_id
      - used_at
      title: DocumentUsageEntry
    DocumentLibrarySearchResponse:
      properties:
        results:
          items:
            $ref: '#/components/schemas/DocumentSearchHit'
          type: array
          title: Results
      type: object
      required:
      - results
      title: DocumentLibrarySearchResponse
    DocumentTextResponse:
      properties:
        text:
          type: string
          title: Text
        character_count:
          type: integer
          title: Character Count
        was_truncated:
          type: boolean
          title: Was Truncated
      type: object
      required:
      - text
      - character_count
      - was_truncated
      title: DocumentTextResponse
      description: Extracted document text.
    DeleteDocumentsResponse:
      properties:
        deleted:
          type: integer
          title: Deleted
      type: object
      required:
      - deleted
      title: DeleteDocumentsResponse
  securitySchemes:
    OAuth2AuthorizationCodeBearer:
      type: oauth2
      flows:
        authorizationCode:
          scopes: {}
          authorizationUrl: https://app.mantic.com/auth/oauth2/authorize
          tokenUrl: https://app.mantic.com/auth/oauth2/token