Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go
14.8 KB
Raw Blame
openapi: 3.1.0
info:
  title: Multica Public API
  version: v1
  description: >-
    Canonical v1 resource contract shared by Multica API surfaces. The Plugin
    API is the first deployed consumer and applies installation identity plus
    manifest scopes. Plugin-specific context and storage remain extensions.
servers:
  - url: https://plugin-api.multica.ai/v1
    description: Installed Plugin and invocation callback tokens
security:
  - pluginBearer: []
paths:
  /context:
    get:
      operationId: getPluginContext
      summary: Get the authorized Plugin invocation context
      x-multica-contract: plugin_extension
      responses:
        "200":
          description: Plugin context
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Context"
        default:
          $ref: "#/components/responses/Problem"
  /issues/{issue_ref}:
    parameters:
      - $ref: "#/components/parameters/IssueRef"
    get:
      operationId: getIssue
      summary: Get an issue
      x-multica-contract: shared_resource
      x-multica-scope: issues:read
      responses:
        "200":
          description: Issue
          headers:
            ETag:
              $ref: "#/components/headers/ETag"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Issue"
        default:
          $ref: "#/components/responses/Problem"
    patch:
      operationId: patchIssue
      summary: Update an issue title or description
      x-multica-contract: shared_resource
      x-multica-scope: issues:write
      parameters:
        - $ref: "#/components/parameters/IfMatch"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PatchIssueRequest"
      responses:
        "200":
          description: Updated issue
          headers:
            ETag:
              $ref: "#/components/headers/ETag"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Issue"
        default:
          $ref: "#/components/responses/Problem"
  /issues/{issue_ref}/comments:
    parameters:
      - $ref: "#/components/parameters/IssueRef"
    get:
      operationId: listIssueComments
      summary: List the newest 200 comments in chronological order
      x-multica-contract: shared_resource
      x-multica-scope: comments:read
      responses:
        "200":
          description: Comments
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CommentListResponse"
        default:
          $ref: "#/components/responses/Problem"
    post:
      operationId: createIssueComment
      summary: Create an issue comment without mention dispatch
      x-multica-contract: shared_resource
      x-multica-scope: comments:write
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateCommentRequest"
      responses:
        "201":
          description: Created comment
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Comment"
        default:
          $ref: "#/components/responses/Problem"
  /tasks/{task_id}/messages:
    parameters:
      - $ref: "#/components/parameters/TaskId"
    get:
      operationId: listTaskMessages
      summary: List the persisted run messages of one task in seq order
      description: >-
        The transcript companion to the task lifecycle events: plugins holding
        tasks:read can read what an agent actually did during a run (thinking,
        tool_use, tool_result, text, error) without a user PAT. ?since=<seq> returns
        only newer messages; ?include=thinking=false drops thinking messages.
        Private chat transcripts require a member credential for the session
        creator; plugin-only credentials cannot read them. Issue-scoped callbacks
        can read only tasks belonging to that issue. Missing or inaccessible
        tasks return 404; lookup failures return a retryable 500.
      x-multica-contract: shared_resource
      x-multica-scope: tasks:read
      parameters:
        - name: since
          in: query
          schema: { type: integer, minimum: 0 }
          description: Return only messages with seq greater than this value.
        - name: include
          in: query
          schema: { type: string, enum: [thinking, thinking=false] }
          description: >-
            thinking messages ship by default because memory plugins use them
            as distillation input; pass thinking=false to drop them.
      responses:
        "200":
          description: Task messages
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TaskMessageListResponse"
        default:
          $ref: "#/components/responses/Problem"
  /storage/{scope}:
    get:
      operationId: listPluginStorageKeys
      summary: List Plugin storage keys
      x-multica-contract: plugin_extension
      parameters:
        - $ref: "#/components/parameters/StorageScope"
      responses:
        "200":
          description: Storage keys
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StorageKeyListResponse"
        default:
          $ref: "#/components/responses/Problem"
  /storage/{scope}/{key}:
    parameters:
      - $ref: "#/components/parameters/StorageScope"
      - $ref: "#/components/parameters/StorageKey"
    get:
      operationId: getPluginStorageValue
      summary: Get a Plugin storage value
      x-multica-contract: plugin_extension
      responses:
        "200":
          description: Storage value
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StorageValueResponse"
        default:
          $ref: "#/components/responses/Problem"
    put:
      operationId: putPluginStorageValue
      summary: Put a Plugin storage value
      x-multica-contract: plugin_extension
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PutStorageValueRequest"
      responses:
        "204":
          description: Stored
        default:
          $ref: "#/components/responses/Problem"
    delete:
      operationId: deletePluginStorageValue
      summary: Delete a Plugin storage value
      x-multica-contract: plugin_extension
      responses:
        "204":
          description: Deleted
        default:
          $ref: "#/components/responses/Problem"
components:
  securitySchemes:
    pluginBearer:
      type: http
      scheme: bearer
      bearerFormat: mpi_ or mpc_ token
  parameters:
    IssueRef:
      name: issue_ref
      in: path
      required: true
      description: Issue UUID or workspace identifier such as MUL-123
      schema:
        type: string
    TaskId:
      name: task_id
      in: path
      required: true
      schema: { type: string, format: uuid }
      description: The task (run) whose persisted messages to list.
    StorageScope:
      name: scope
      in: path
      required: true
      schema:
        type: string
        enum: [user, workspace]
    StorageKey:
      name: key
      in: path
      required: true
      schema:
        type: string
        maxLength: 1024
    IfMatch:
      name: If-Match
      in: header
      required: false
      description: Weak or strong ETag containing the expected positive revision
      schema:
        type: string
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: Reserved for durable retry deduplication as write endpoints adopt it
      schema:
        type: string
        maxLength: 255
  headers:
    ETag:
      description: Weak ETag derived from the resource revision
      schema:
        type: string
  responses:
    Problem:
      description: Stable API problem
      headers:
        X-Request-Id:
          description: Request correlation identifier
          schema:
            type: string
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/Problem"
  schemas:
    Problem:
      type: object
      required: [type, title, status, code, detail, request_id, error]
      properties:
        type: { type: string, format: uri }
        title: { type: string }
        status: { type: integer }
        code: { type: string }
        detail: { type: string }
        request_id: { type: string }
        error:
          type: string
          deprecated: true
          description: Compatibility alias for detail
        errors:
          type: array
          items:
            $ref: "#/components/schemas/FieldError"
    FieldError:
      type: object
      required: [field, code, message]
      properties:
        field: { type: string }
        code: { type: string }
        message: { type: string }
    Context:
      type: object
      required: [workspace, config, granted_net_domains, actor]
      properties:
        workspace:
          $ref: "#/components/schemas/ContextWorkspace"
        user:
          $ref: "#/components/schemas/ContextUser"
        issue:
          $ref: "#/components/schemas/ContextIssue"
        config:
          type: object
          additionalProperties: true
        granted_net_domains:
          type: array
          items: { type: string }
        actor:
          type: string
          enum: [member, plugin]
    ContextWorkspace:
      type: object
      required: [id, name, slug]
      properties:
        id: { type: string }
        name: { type: string }
        slug: { type: string }
    ContextUser:
      type: object
      required: [id, name]
      properties:
        id: { type: string }
        name: { type: string }
    ContextIssue:
      type: object
      required: [id, identifier, title]
      properties:
        id: { type: string }
        identifier: { type: string }
        title: { type: string }
    Issue:
      type: object
      required:
        - id
        - workspace_id
        - number
        - identifier
        - title
        - description
        - status
        - priority
        - assignee_type
        - assignee_id
        - creator_type
        - creator_id
        - parent_issue_id
        - project_id
        - position
        - stage
        - start_date
        - due_date
        - created_at
        - updated_at
        - revision
        - last_activity_at
        - metadata
        - properties
      properties:
        id: { type: string }
        workspace_id: { type: string }
        number: { type: integer, format: int32 }
        identifier: { type: string }
        title: { type: string }
        description: { type: [string, "null"] }
        status: { type: string }
        status_category: { type: string }
        priority: { type: string }
        assignee_type: { type: [string, "null"] }
        assignee_id: { type: [string, "null"] }
        creator_type: { type: string }
        creator_id: { type: string }
        parent_issue_id: { type: [string, "null"] }
        project_id: { type: [string, "null"] }
        position: { type: number }
        stage: { type: [integer, "null"], format: int32 }
        start_date: { type: [string, "null"], format: date }
        due_date: { type: [string, "null"], format: date }
        created_at: { type: string, format: date-time }
        updated_at: { type: string, format: date-time }
        revision: { type: integer, format: int64, minimum: 1 }
        last_activity_at: { type: [string, "null"], format: date-time }
        metadata: { type: object, additionalProperties: true }
        properties: { type: object, additionalProperties: true }
    PatchIssueRequest:
      type: object
      properties:
        expected_revision: { type: integer, format: int64, minimum: 1 }
        title: { type: string }
        description: { type: string }
      anyOf:
        - required: [title]
        - required: [description]
    Comment:
      type: object
      required: [id, author_type, author_id, content, type, created_at]
      properties:
        id: { type: string }
        author_type: { type: string, enum: [member, agent, plugin] }
        author_id: { type: string }
        content: { type: string }
        type: { type: string }
        parent_id: { type: string }
        created_at: { type: string, format: date-time }
        deleted_at:
          type: string
          format: date-time
          description: Set only on a deleted comment kept as an empty placeholder because it still has replies.
    CommentListResponse:
      type: object
      required: [comments]
      properties:
        comments:
          type: array
          items:
            $ref: "#/components/schemas/Comment"
    TaskMessage:
      type: object
      required: [task_id, seq, type, created_at]
      properties:
        task_id: { type: string }
        issue_id:
          type: string
          description: Empty for chat and autopilot tasks that carry no issue.
        seq: { type: integer }
        type: { type: string, enum: [thinking, tool_use, tool_result, text, error] }
        tool: { type: string }
        call_id: { type: string }
        content: { type: string }
        input: { type: object, additionalProperties: true }
        output: { type: string }
        output_truncated: { type: boolean }
        created_at: { type: string, format: date-time }
        details_hidden:
          type: boolean
          description: >-
            The agent restricts the inputs and outputs of its tool calls to its
            owner and workspace admins, so input, output and content were
            removed from this tool_use or tool_result.
    TaskMessageListResponse:
      type: object
      required: [messages]
      properties:
        messages:
          type: array
          items:
            $ref: "#/components/schemas/TaskMessage"
    CreateCommentRequest:
      type: object
      required: [content]
      properties:
        content: { type: string, maxLength: 65536 }
        parent_id: { type: string }
    StorageKey:
      type: object
      required: [key, size_bytes, updated_at]
      properties:
        key: { type: string }
        size_bytes: { type: integer, format: int64 }
        updated_at: { type: string, format: date-time }
    StorageKeyListResponse:
      type: object
      required: [keys]
      properties:
        keys:
          type: array
          items:
            $ref: "#/components/schemas/StorageKey"
    StorageValueResponse:
      type: object
      required: [value]
      properties:
        value: { type: string }
    PutStorageValueRequest:
      type: object
      required: [value]
      properties:
        value: { type: string, maxLength: 102400 }