Maia-analytics notes API

The notes API from Maia-analytics — 2 operation(s) for notes.

OpenAPI Specification

maia-analytics-notes-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: MAIA Ah notes API
  description: API for MAIA application (migrated from Firebase)
  version: 0.1.0
tags:
- name: notes
paths:
  /api/v1/notes/{project_id}/{feature_id}:
    get:
      tags:
      - notes
      summary: Get Feature Notes
      description: Get all notes for a feature.
      operationId: get_feature_notes_api_v1_notes__project_id___feature_id__get
      security:
      - FirebaseAuthMiddleware: []
      parameters:
      - name: feature_id
        in: path
        required: true
        schema:
          type: string
          minLength: 1
          maxLength: 64
          title: Feature Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/FeatureNoteResponse'
                title: Response Get Feature Notes Api V1 Notes  Project Id   Feature Id  Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
      - notes
      summary: Create Feature Note
      description: Create a new note on a feature. One note per user per feature per source.
      operationId: create_feature_note_api_v1_notes__project_id___feature_id__post
      security:
      - FirebaseAuthMiddleware: []
      parameters:
      - name: feature_id
        in: path
        required: true
        schema:
          type: string
          minLength: 1
          maxLength: 64
          title: Feature Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FeatureNoteContentRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeatureNoteResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/notes/{project_id}/{note_id}:
    patch:
      tags:
      - notes
      summary: Update Feature Note
      description: Update a note's content. Only the author can update.
      operationId: update_feature_note_api_v1_notes__project_id___note_id__patch
      security:
      - FirebaseAuthMiddleware: []
      parameters:
      - name: note_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Note Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FeatureNoteContentRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeatureNoteResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - notes
      summary: Delete Feature Note
      description: Delete a note. Only the author can delete their own notes.
      operationId: delete_feature_note_api_v1_notes__project_id___note_id__delete
      security:
      - FirebaseAuthMiddleware: []
      parameters:
      - name: note_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Note Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: boolean
                title: Response Delete Feature Note Api V1 Notes  Project Id   Note Id  Delete
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    FeatureNoteResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        feature_id:
          type: string
          title: Feature Id
        project_id:
          type: string
          format: uuid
          title: Project Id
        user_id:
          type: string
          format: uuid
          title: User Id
        content:
          type: string
          title: Content
        source:
          type: string
          title: Source
        author_name:
          anyOf:
          - type: string
          - type: 'null'
          title: Author Name
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
      - id
      - feature_id
      - project_id
      - user_id
      - content
      - source
      - author_name
      - created_at
      - updated_at
      title: FeatureNoteResponse
      description: Response schema for a feature note.
    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
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    FeatureNoteContentRequest:
      properties:
        content:
          type: string
          maxLength: 5000
          minLength: 1
          title: Content
        source:
          anyOf:
          - type: string
            maxLength: 20
          - type: 'null'
          title: Source
      type: object
      required:
      - content
      title: FeatureNoteContentRequest
      description: Request schema for creating or updating a feature note.
  securitySchemes:
    FirebaseAuthMiddleware:
      type: http
      scheme: bearer