Robin AI Documents API

Upload and manage legal documents

OpenAPI Specification

robin-ai-documents-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Robin Legal Intelligence Platform Documents API
  version: 0.2.0-dev
  description: 'Robin AI''s public REST API for legal contract intelligence. Exposes the

    Tables extraction engine, Documents store, reusable extraction Templates,

    typed Properties, and organizational Groups. Authenticate every request

    with an `X-API-Key` header. Lists support cursor pagination (`limit`,

    `starting_after`) and ISO 8601 date-range filters. Tables Results include

    clickable Citations linking every extracted answer back to the source

    span in the contract.

    '
  contact:
    name: Robin AI
    url: https://robinai.com/robin-api
  license:
    name: Proprietary
    url: https://robinai.com/terms
servers:
- url: https://api.robinai.com
  description: Production
security:
- ApiKeyAuth: []
tags:
- name: Documents
  description: Upload and manage legal documents
paths:
  /v1/documents:
    get:
      operationId: listDocuments
      summary: List Documents
      tags:
      - Documents
      parameters:
      - $ref: '#/components/parameters/Limit'
      - $ref: '#/components/parameters/StartingAfter'
      - $ref: '#/components/parameters/CreatedBefore'
      - $ref: '#/components/parameters/CreatedAfter'
      - $ref: '#/components/parameters/UpdatedBefore'
      - $ref: '#/components/parameters/UpdatedAfter'
      - name: name
        in: query
        schema:
          type: array
          items:
            type: string
      - name: id
        in: query
        schema:
          type: array
          items:
            type: string
      - name: type
        in: query
        schema:
          type: array
          items:
            type: string
      - name: group
        in: query
        schema:
          type: array
          items:
            type: string
      - name: status
        in: query
        schema:
          type: array
          items:
            type: string
            enum:
            - active
            - inactive
            - archived
            - deleted
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ListDocumentsRequestBody'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListDocumentsResponse'
    post:
      operationId: createDocument
      summary: Create Document
      tags:
      - Documents
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
              - file
              properties:
                file:
                  type: string
                  format: binary
                group_id:
                  type: string
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentRecord'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
  /v1/documents/{document_id}:
    get:
      operationId: getDocument
      summary: Get Document
      tags:
      - Documents
      parameters:
      - $ref: '#/components/parameters/DocumentId'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentRecord'
        '404':
          $ref: '#/components/responses/NotFound'
  /v1/documents/{document_id}/properties:
    post:
      operationId: addDocumentProperties
      summary: Add Document Properties
      tags:
      - Documents
      parameters:
      - $ref: '#/components/parameters/DocumentId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/PropertyInput'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentRecord'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
components:
  schemas:
    PropertyInput:
      type: object
      required:
      - definition_key
      - value
      properties:
        definition_key:
          type: string
        value:
          oneOf:
          - type: string
          - type: number
          - type: boolean
          - type: string
            format: date-time
    DocumentStatus:
      type: string
      enum:
      - active
      - inactive
      - archived
      - deleted
    Error:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
        code:
          type: string
    DocumentProperty:
      type: object
      properties:
        definition_key:
          type: string
        value:
          oneOf:
          - type: string
          - type: number
          - type: boolean
          - type: string
            format: date-time
    DocumentRecord:
      type: object
      properties:
        id:
          type: string
          example: doc_11abcd1234efgh6789
        name:
          type: string
        type:
          type: string
          nullable: true
        group:
          type: string
          nullable: true
        document_status:
          $ref: '#/components/schemas/DocumentStatus'
        processing_status:
          $ref: '#/components/schemas/ProcessingStatus'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        properties:
          type: array
          items:
            $ref: '#/components/schemas/DocumentProperty'
    ListDocumentsRequestBody:
      type: object
      properties:
        properties:
          type: array
          items:
            $ref: '#/components/schemas/PropertyFilter'
    ListDocumentsResponse:
      type: object
      properties:
        has_more:
          type: boolean
        documents:
          type: array
          items:
            $ref: '#/components/schemas/DocumentRecord'
    ProcessingStatus:
      type: string
      enum:
      - pending
      - processing
      - completed
      - failed
    PropertyFilter:
      type: object
      properties:
        definition_key:
          type: string
        operator:
          type: string
          enum:
          - eq
          - neq
          - gt
          - gte
          - lt
          - lte
          - contains
        value:
          oneOf:
          - type: string
          - type: number
          - type: boolean
  responses:
    PaymentRequired:
      description: Payment Required
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Not Found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    TooManyRequests:
      description: Too Many Requests
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    UnprocessableEntity:
      description: Unprocessable Entity
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  parameters:
    CreatedBefore:
      name: created_before
      in: query
      schema:
        type: string
        format: date-time
    UpdatedBefore:
      name: updated_before
      in: query
      schema:
        type: string
        format: date-time
    CreatedAfter:
      name: created_after
      in: query
      schema:
        type: string
        format: date-time
    UpdatedAfter:
      name: updated_after
      in: query
      schema:
        type: string
        format: date-time
    DocumentId:
      name: document_id
      in: path
      required: true
      schema:
        type: string
        example: doc_11abcd1234efgh6789
    StartingAfter:
      name: starting_after
      in: query
      schema:
        type: string
      description: Cursor for pagination; pass the ID of the last item from the previous page.
    Limit:
      name: limit
      in: query
      schema:
        type: integer
        minimum: 1
        maximum: 1000
        default: 100
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key