Scott Ai documents API

The documents API from Scott Ai — 9 operation(s) for documents.

OpenAPI Specification

scott-ai-documents-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: One-Shot access documents API
  version: 1.0.0
tags:
- name: documents
paths:
  /documents/:
    post:
      tags:
      - documents
      summary: Create Document
      description: Create a new document
      operationId: create_document_documents__post
      security:
      - HTTPBearer: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentCreate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    get:
      tags:
      - documents
      summary: List Documents
      description: List documents for the authenticated user
      operationId: list_documents_documents__get
      security:
      - HTTPBearer: []
      parameters:
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          maximum: 100
          minimum: 1
          default: 50
          title: Limit
      - name: offset
        in: query
        required: false
        schema:
          type: integer
          minimum: 0
          default: 0
          title: Offset
      - name: include_shared
        in: query
        required: false
        schema:
          type: boolean
          default: false
          title: Include Shared
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DocumentListResponse'
                title: Response List Documents Documents  Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /documents/{document_id}:
    get:
      tags:
      - documents
      summary: Get Document
      description: Get a specific document
      operationId: get_document_documents__document_id__get
      security:
      - HTTPBearer: []
      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/DocumentResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    patch:
      tags:
      - documents
      summary: Update Document
      description: Update a document
      operationId: update_document_documents__document_id__patch
      security:
      - HTTPBearer: []
      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/DocumentUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - documents
      summary: Delete Document
      description: Delete a document
      operationId: delete_document_documents__document_id__delete
      security:
      - HTTPBearer: []
      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'
  /documents/{document_id}/versions:
    post:
      tags:
      - documents
      summary: Create Document Version
      description: Create a new version of a document with revised content
      operationId: create_document_version_documents__document_id__versions_post
      security:
      - HTTPBearer: []
      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/DocumentVersionCreate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /documents/{document_id}/coordinator-context:
    get:
      tags:
      - documents
      summary: Get Document Coordinator Context
      description: Get coordinator context (API key + session ID) for document revision
      operationId: get_document_coordinator_context_documents__document_id__coordinator_context_get
      security:
      - HTTPBearer: []
      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/CoordinatorContextResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /documents/{document_id}/comments:
    get:
      tags:
      - documents
      summary: Get Document Comments
      description: Get all comment threads for a document
      operationId: get_document_comments_documents__document_id__comments_get
      security:
      - HTTPBearer: []
      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:
                type: array
                items:
                  $ref: '#/components/schemas/CommentThreadResponse'
                title: Response Get Document Comments Documents  Document Id  Comments Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
      - documents
      summary: Create Comment
      description: Create a new comment or reply
      operationId: create_comment_documents__document_id__comments_post
      security:
      - HTTPBearer: []
      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/CommentCreate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommentResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /documents/{document_id}/comments/{comment_id}:
    patch:
      tags:
      - documents
      summary: Update Comment
      description: Update a comment
      operationId: update_comment_documents__document_id__comments__comment_id__patch
      security:
      - HTTPBearer: []
      parameters:
      - name: document_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Document Id
      - name: comment_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Comment Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CommentUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommentResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - documents
      summary: Delete Comment
      description: Delete a comment and its replies
      operationId: delete_comment_documents__document_id__comments__comment_id__delete
      security:
      - HTTPBearer: []
      parameters:
      - name: document_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Document Id
      - name: comment_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Comment Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /documents/images:
    post:
      tags:
      - documents
      summary: Upload Document Image
      operationId: upload_document_image_documents_images_post
      security:
      - HTTPBearer: []
      parameters:
      - name: document_artifact_id
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Document Artifact Id
      - name: workspace_id
        in: query
        required: true
        schema:
          type: string
          title: Workspace Id
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Body_upload_document_image_documents_images_post'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentImageResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /documents/images/{file_id}:
    get:
      tags:
      - documents
      summary: Resolve Document Image
      operationId: resolve_document_image_documents_images__file_id__get
      security:
      - HTTPBearer: []
      parameters:
      - name: file_id
        in: path
        required: true
        schema:
          type: string
          title: File Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResolvedImageResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /workspaces/{workspace_id}/document-images:
    post:
      tags:
      - documents
      summary: Upload Agent Document Image
      operationId: upload_agent_document_image_workspaces__workspace_id__document_images_post
      parameters:
      - name: workspace_id
        in: path
        required: true
        schema:
          type: string
          title: Workspace Id
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Body_upload_agent_document_image_workspaces__workspace_id__document_images_post'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentImageResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    Body_upload_agent_document_image_workspaces__workspace_id__document_images_post:
      properties:
        file:
          type: string
          contentMediaType: application/octet-stream
          title: File
      type: object
      required:
      - file
      title: Body_upload_agent_document_image_workspaces__workspace_id__document_images_post
    CommentUpdate:
      properties:
        content:
          anyOf:
          - type: string
          - type: 'null'
          title: Content
        resolved:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Resolved
      type: object
      title: CommentUpdate
    DocumentListResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        title:
          type: string
          title: Title
        content:
          type: string
          title: Content
        conversation_id:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: Conversation Id
        parent_document_id:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: Parent Document Id
        child_document_id:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: Child Document Id
        version_number:
          type: integer
          title: Version Number
          default: 1
        coordinator_session_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Coordinator Session Id
        is_public:
          type: boolean
          title: Is Public
        shared_with:
          items:
            type: string
          type: array
          title: Shared With
        doc_metadata:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Doc Metadata
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        comment_count:
          type: integer
          title: Comment Count
          default: 0
      type: object
      required:
      - id
      - title
      - content
      - conversation_id
      - is_public
      - shared_with
      - doc_metadata
      - created_at
      - updated_at
      title: DocumentListResponse
    ResolvedImageResponse:
      properties:
        url:
          type: string
          title: Url
        expires_in:
          type: integer
          title: Expires In
      type: object
      required:
      - url
      - expires_in
      title: ResolvedImageResponse
    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
    CommentThreadResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        document_id:
          type: string
          format: uuid
          title: Document Id
        user_id:
          type: string
          title: User Id
        start_line:
          type: integer
          title: Start Line
        end_line:
          type: integer
          title: End Line
        content:
          type: string
          title: Content
        resolved:
          type: boolean
          title: Resolved
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        replies:
          items:
            $ref: '#/components/schemas/CommentResponse'
          type: array
          title: Replies
          default: []
      type: object
      required:
      - id
      - document_id
      - user_id
      - start_line
      - end_line
      - content
      - resolved
      - created_at
      - updated_at
      title: CommentThreadResponse
      description: Top-level comment with nested replies
    DocumentUpdate:
      properties:
        title:
          anyOf:
          - type: string
          - type: 'null'
          title: Title
        content:
          anyOf:
          - type: string
          - type: 'null'
          title: Content
        is_public:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Is Public
        shared_with:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Shared With
        doc_metadata:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Doc Metadata
        document_session_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Document Session Id
      type: object
      title: DocumentUpdate
    DocumentImageResponse:
      properties:
        file_id:
          type: string
          title: File Id
        url:
          type: string
          title: Url
      type: object
      required:
      - file_id
      - url
      title: DocumentImageResponse
    CoordinatorContextResponse:
      properties:
        anthropic_key:
          type: string
          title: Anthropic Key
        coordinator_session_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Coordinator Session Id
        conversation_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Conversation Id
      type: object
      required:
      - anthropic_key
      - coordinator_session_id
      - conversation_id
      title: CoordinatorContextResponse
      description: Context needed to resume coordinator for document revision
    Body_upload_document_image_documents_images_post:
      properties:
        file:
          type: string
          contentMediaType: application/octet-stream
          title: File
      type: object
      required:
      - file
      title: Body_upload_document_image_documents_images_post
    CommentCreate:
      properties:
        content:
          type: string
          title: Content
        parent_id:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: Parent Id
        start_line:
          anyOf:
          - type: integer
            minimum: 1.0
          - type: 'null'
          title: Start Line
        end_line:
          anyOf:
          - type: integer
            minimum: 1.0
          - type: 'null'
          title: End Line
      type: object
      required:
      - content
      title: CommentCreate
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    DocumentCreate:
      properties:
        title:
          type: string
          title: Title
        content:
          type: string
          title: Content
        conversation_id:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: Conversation Id
        parent_document_id:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: Parent Document Id
        child_document_id:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: Child Document Id
        version_number:
          type: integer
          title: Version Number
          default: 1
        coordinator_session_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Coordinator Session Id
        document_session_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Document Session Id
        is_public:
          type: boolean
          title: Is Public
          default: false
        shared_with:
          items:
            type: string
          type: array
          title: Shared With
          default: []
        doc_metadata:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Doc Metadata
      type: object
      required:
      - title
      - content
      title: DocumentCreate
    DocumentResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        user_id:
          type: string
          title: User Id
        title:
          type: string
          title: Title
        content:
          type: string
          title: Content
        conversation_id:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: Conversation Id
        parent_document_id:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: Parent Document Id
        child_document_id:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: Child Document Id
        version_number:
          type: integer
          title: Version Number
          default: 1
        coordinator_session_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Coordinator Session Id
        document_session_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Document Session Id
        is_public:
          type: boolean
          title: Is Public
        shared_with:
          items:
            type: string
          type: array
          title: Shared With
        doc_metadata:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Doc Metadata
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
      - id
      - user_id
      - title
      - content
      - conversation_id
      - is_public
      - shared_with
      - doc_metadata
      - created_at
      - updated_at
      title: DocumentResponse
    CommentResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        document_id:
          type: string
          format: uuid
          title: Document Id
        user_id:
          type: string
          title: User Id
        parent_id:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: Parent Id
        start_line:
          anyOf:
          - type: integer
          - type: 'null'
          title: Start Line
        end_line:
          anyOf:
          - type: integer
          - type: 'null'
          title: End Line
        content:
          type: string
          title: Content
        resolved:
          type: boolean
          title: Resolved
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
      - id
      - document_id
      - user_id
      - parent_id
      - start_line
      - end_line
      - content
      - resolved
      - created_at
      - updated_at
      title: CommentResponse
    DocumentVersionCreate:
      properties:
        content:
          type: string
          title: Content
      type: object
      required:
      - content
      title: DocumentVersionCreate
      description: Schema for creating a new document version
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer