Maia-analytics skills API

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

OpenAPI Specification

maia-analytics-skills-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: MAIA Ah skills API
  description: API for MAIA application (migrated from Firebase)
  version: 0.1.0
tags:
- name: skills
paths:
  /api/v1/skills:
    get:
      tags:
      - skills
      summary: List Skills
      description: List the skills visible to the caller for a scope (user/workspace/system).
      operationId: list_skills_api_v1_skills_get
      security:
      - FirebaseAuthMiddleware: []
      parameters:
      - name: scope
        in: query
        required: true
        schema:
          $ref: '#/components/schemas/SkillScope'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SkillResponse'
                title: Response List Skills Api V1 Skills Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
      - skills
      summary: Create Skill
      description: Create a user- or workspace-scoped skill (system scope is read-only → 403).
      operationId: create_skill_api_v1_skills_post
      security:
      - FirebaseAuthMiddleware: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SkillCreateRequest'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SkillResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/skills/{skill_id}:
    get:
      tags:
      - skills
      summary: Get Skill
      description: Return a single skill (incl. body); 404 if not visible to the caller.
      operationId: get_skill_api_v1_skills__skill_id__get
      security:
      - FirebaseAuthMiddleware: []
      parameters:
      - name: skill_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Skill Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SkillResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    patch:
      tags:
      - skills
      summary: Update Skill
      description: Replace a skill's name + description + body (caller must be entitled).
      operationId: update_skill_api_v1_skills__skill_id__patch
      security:
      - FirebaseAuthMiddleware: []
      parameters:
      - name: skill_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Skill Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SkillUpdateRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SkillResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - skills
      summary: Delete Skill
      description: Delete a skill the caller is entitled to edit.
      operationId: delete_skill_api_v1_skills__skill_id__delete
      security:
      - FirebaseAuthMiddleware: []
      parameters:
      - name: skill_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Skill Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    SkillUpdateRequest:
      properties:
        name:
          type: string
          maxLength: 120
          minLength: 1
          title: Name
        description:
          type: string
          maxLength: 400
          minLength: 1
          title: Description
        body:
          type: string
          maxLength: 32000
          minLength: 1
          title: Body
      type: object
      required:
      - name
      - description
      - body
      title: SkillUpdateRequest
      description: Request body for replacing a skill's name + description + body.
    SkillResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        scope:
          $ref: '#/components/schemas/SkillScope'
        user_id:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: User Id
        workspace_id:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: Workspace Id
        name:
          type: string
          title: Name
        description:
          type: string
          title: Description
        body:
          type: string
          title: Body
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        is_starter:
          type: boolean
          title: Is Starter
          description: Whether this skill surfaces as a first-run starter in the new-project gallery. System (Ready-made by MAIA) and workspace-scoped skills may be starters; user-scoped skills are never starters.
          default: false
      type: object
      required:
      - id
      - scope
      - name
      - description
      - body
      - created_at
      - updated_at
      title: SkillResponse
      description: A skill as returned to clients (full record, including body).
    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
    SkillScope:
      type: string
      enum:
      - user
      - workspace
      - system
      title: SkillScope
      description: 'Tier a skill applies to.


        Unlike ``KnowledgeScope`` (user/workspace only), skills add a ``system``

        scope: globally-available skills that are read-only through the public

        service/API and writable only via the internal admin override,

        plus the in-code create-skill playbook registry. ``user`` skills are owned by

        a single user, ``workspace`` skills by a workspace, ``system`` skills by

        neither.'
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    SkillCreateRequest:
      properties:
        scope:
          $ref: '#/components/schemas/SkillScope'
        name:
          type: string
          maxLength: 120
          minLength: 1
          title: Name
        description:
          type: string
          maxLength: 400
          minLength: 1
          title: Description
        body:
          type: string
          maxLength: 32000
          minLength: 1
          title: Body
      type: object
      required:
      - scope
      - name
      - description
      - body
      title: SkillCreateRequest
      description: Request body for creating a user- or workspace-scoped skill.
  securitySchemes:
    FirebaseAuthMiddleware:
      type: http
      scheme: bearer