# ProjectFlow REST API v1. Published at https://getprojectflow.com/docs/api/openapi.yaml
# Route list must match PROJECTFLOW_SUPPORTED_ENDPOINTS in functions/src/projectflow-api.ts (checked by functions/scripts/unit/openapi-spec.test.js).
openapi: 3.1.0
info:
  title: ProjectFlow REST API
  version: 1.0.0
  summary: Projects, tasks, files, forms and webhooks of a ProjectFlow workspace.
  description: >-
    Public REST API v1 of ProjectFlow. Authenticate with a workspace API token (`pfat_...`, Settings > API) as `Authorization: Bearer
    <token>`.


    Responses of successful calls keep their resource keys (e.g. `{ success, projects }`) and add `requestId`. Errors use one envelope (`{
    success: false, error: { code, message, status, details? }, requestId }`).

    `GET` list endpoints that return one array accept `limit` (1-200, default 100) and `cursor` and add `nextCursor` and `total`.

    Every response carries `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`; 429 adds `Retry-After`.


    OAuth / personal tokens may send `X-ProjectFlow-Workspace: <workspaceId>` (or `tenantId`). Account-wide OAuth
    connections need it unless they have a default workspace (otherwise 400); a workspace-bound token answers 403
    when it names another workspace.

    Plan limits (request rate, daily writes, webhooks) are subject to change.

    Each operation lists the token scope (`x-required-scope`) and fine-grained permission (`x-permission`) it needs.
  contact:
    name: ProjectFlow
    email: hello@getprojectflow.com
    url: https://getprojectflow.com/docs/api
servers:
  - url: https://api.getprojectflow.com/v1
    description: Production
  - url: https://app.getprojectflow.com/api/v1
    description: Production (alias on the app host; same API)
security:
  - bearerAuth: []
tags:
  - name: Projects
  - name: Tasks
  - name: Subtasks
  - name: Initiatives
  - name: Milestones
  - name: Sprints
  - name: Categories
  - name: Project groups
  - name: Comments
  - name: Activities
  - name: Search
    description: Search and "my day".
  - name: Members
    description: People in the workspace (for assignments).
  - name: Wiki
    description: Workspace and project wiki pages (Markdown in and out).
  - name: Notebooks
    description: Notebook lists (rated dishes, books, checklists); fields by label, private notebooks stay private.
  - name: Feedback ingest
    description: >-
      Test-phase feedback from your own apps (`pff_...` app feedback key, Settings > API > App feedback keys). A key can only
      create feedback tasks in its one project. Guide: brain/operations/feedback-ingest.md.
  - name: Files
  - name: Forms
  - name: Agent personas
    description: >-
      "My team": agent personas label writes of AI clients (header `X-ProjectFlow-Persona`, MCP argument `persona`). Management routes need the
      Firebase ID token of the human. Guide: brain/reference/api/integrations.md section 0f.
  - name: Webhooks
    description: Manage webhook endpoints (scope `webhooks:manage`).
  - name: Codex
    description: Coding-agent session tracking.
  - name: Webhook events
    description: Outgoing events (see `webhooks`).
paths:
  /projects/{projectId}/project-binding:
    get:
      tags:
        - Agent time
      operationId: resolveProjectBinding
      summary: Resolve validated local project metadata and tracking policy
      x-permission: projects:read
      x-required-scope: read
      parameters:
        - $ref: '#/components/parameters/ProjectId'
      responses:
        '200':
          description: Success. See the agent-time API contract for response fields.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: Tracking disabled; retain local entries for explicit review.
        '429':
          $ref: '#/components/responses/RateLimited'
  /projects/{projectId}/agent-time-settings:
    get:
      tags:
        - Agent time
      operationId: getAgentTimeSettings
      summary: Read tracking policy
      x-permission: projects:read
      x-required-scope: read
      parameters:
        - $ref: '#/components/parameters/ProjectId'
      responses:
        '200':
          description: Success. See the agent-time API contract for response fields.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: Tracking disabled; retain local entries for explicit review.
        '429':
          $ref: '#/components/responses/RateLimited'
    patch:
      tags:
        - Agent time
      operationId: setAgentTimeSettings
      summary: Enable or disable tracking (project owner or workspace administrator)
      x-permission: projects:write
      x-required-scope: projects:write
      parameters:
        - $ref: '#/components/parameters/ProjectId'
      responses:
        '200':
          description: Success. See the agent-time API contract for response fields.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: Tracking disabled; retain local entries for explicit review.
        '429':
          $ref: '#/components/responses/RateLimited'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - enabled
              properties:
                enabled:
                  type: boolean
  /projects/{projectId}/agent-time:
    get:
      tags:
        - Agent time
      operationId: getAgentTimeReport
      summary: Read own times or project report; elapsed times are not billable time
      x-permission: agent-time:read
      x-required-scope: read
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - name: from
          in: query
          schema:
            type: string
            format: date-time
          description: 'UTC instant. Default: last 30 days; any period, at most 1,000 entries per response (otherwise truncated).'
        - name: to
          in: query
          schema:
            type: string
            format: date-time
          description: 'UTC instant. Default: last 30 days; any period, at most 1,000 entries per response (otherwise truncated).'
      responses:
        '200':
          description: Success. See the agent-time API contract for response fields.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: Tracking disabled; retain local entries for explicit review.
        '429':
          $ref: '#/components/responses/RateLimited'
    post:
      tags:
        - Agent time
      operationId: syncAgentTime
      summary: Import immutable, idempotent intervals (maximum 100 per batch; 5000 new intervals per project/UTC day)
      x-permission: agent-time:write
      x-required-scope: tasks:write
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/PersonaHeader'
      responses:
        '200':
          description: Success. See the agent-time API contract for response fields.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: Tracking disabled; retain local entries for explicit review.
        '429':
          $ref: '#/components/responses/RateLimited'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - entries
              properties:
                entries:
                  type: array
                  minItems: 1
                  maxItems: 100
                  items:
                    $schema: https://json-schema.org/draft/2020-12/schema
                    type: object
                    properties:
                      entryId:
                        type: string
                        minLength: 1
                        maxLength: 160
                        pattern: ^[a-zA-Z0-9_.:-]+$
                      deviceId:
                        type: string
                        minLength: 1
                        maxLength: 160
                        pattern: ^[a-zA-Z0-9_.:-]+$
                      runId:
                        type: string
                        minLength: 1
                        maxLength: 160
                        pattern: ^[a-zA-Z0-9_.:-]+$
                      sessionId:
                        type: string
                        minLength: 1
                        maxLength: 160
                        pattern: ^[a-zA-Z0-9_.:-]+$
                      agent:
                        type: string
                        enum:
                          - codex
                          - claude
                          - other
                      startedAt:
                        type: string
                        format: date-time
                        pattern: >-
                          ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
                      endedAt:
                        type: string
                        format: date-time
                        pattern: >-
                          ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
                      durationMs:
                        type: integer
                        minimum: 0
                        maximum: 86400000
                      captureMethod:
                        type: string
                        enum:
                          - hooks
                          - agent
                      quality:
                        type: string
                        enum:
                          - elapsed
                          - incomplete
                          - clock-anomaly
                      outcome:
                        type: string
                        enum:
                          - completed
                          - interrupted
                          - incomplete
                      taskId:
                        type: string
                        minLength: 1
                        maxLength: 160
                        pattern: ^[a-zA-Z0-9_.:-]+$
                      description:
                        type: string
                        maxLength: 240
                      tokens:
                        type: object
                        additionalProperties: false
                        description: Token usage of this interval; input excludes cache reads and writes.
                        required: [input, output, cacheRead, cacheWrite]
                        properties:
                          input:
                            type: integer
                            minimum: 0
                            maximum: 1000000000
                          output:
                            type: integer
                            minimum: 0
                            maximum: 1000000000
                          cacheRead:
                            type: integer
                            minimum: 0
                            maximum: 1000000000
                          cacheWrite:
                            type: integer
                            minimum: 0
                            maximum: 1000000000
                          model:
                            type: string
                            maxLength: 80
                    required:
                      - entryId
                      - deviceId
                      - runId
                      - sessionId
                      - agent
                      - startedAt
                      - endedAt
                      - durationMs
                      - captureMethod
                      - quality
                      - outcome
                    additionalProperties: false
  /projects/{projectId}/agent-time-import:
    post:
      tags:
        - Agent time
      operationId: importAgentTime
      summary: Backfill or import historical time entries (maximum 400 rows; all-or-nothing, idempotent per row)
      description: >-
        Send either `entries` or `csv` (header row; columns start/end, date + start/end times, or start +
        minutes/hours/duration, plus optional agent, description, task, id). Local times without offset use
        `timeZone` (IANA, default UTC). `dryRun: true` validates and returns row errors without saving.
        Rejected imports return 400 with `errors: [{row, message}]`. Stored entries carry
        `captureMethod: manual` (source manual) or `import`.
      x-permission: agent-time:write
      x-required-scope: tasks:write
      parameters:
        - $ref: '#/components/parameters/ProjectId'
      responses:
        '200':
          description: Success. Preview (dryRun) or results with accepted, duplicates and conflicts counts.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: Tracking disabled for this project.
        '429':
          $ref: '#/components/responses/RateLimited'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                source:
                  type: string
                  enum: [manual, import]
                  default: import
                timeZone:
                  type: string
                dryRun:
                  type: boolean
                csv:
                  type: string
                  maxLength: 500000
                entries:
                  type: array
                  minItems: 1
                  maxItems: 400
                  items:
                    type: object
                    additionalProperties: false
                    required:
                      - startedAt
                    properties:
                      startedAt:
                        type: string
                        description: ISO instant with offset, or local "YYYY-MM-DD HH:MM" / "DD.MM.YYYY HH:MM".
                      endedAt:
                        type: string
                      durationMinutes:
                        type: number
                        exclusiveMinimum: 0
                        maximum: 1440
                      agent:
                        type: string
                        enum: [codex, claude, other]
                      taskId:
                        type: string
                      description:
                        type: string
                        maxLength: 240
                      externalId:
                        type: string
                      tokens:
                        type: object
                        additionalProperties: false
                        description: Token usage of this interval; input excludes cache reads and writes.
                        required: [input, output, cacheRead, cacheWrite]
                        properties:
                          input:
                            type: integer
                            minimum: 0
                            maximum: 1000000000
                          output:
                            type: integer
                            minimum: 0
                            maximum: 1000000000
                          cacheRead:
                            type: integer
                            minimum: 0
                            maximum: 1000000000
                          cacheWrite:
                            type: integer
                            minimum: 0
                            maximum: 1000000000
                          model:
                            type: string
                            maxLength: 80
  /finance/receipts/commands:
    post:
      operationId: financeReceiptCommand
      x-internal: true
      summary: Private finance pilot — list or capture incoming receipts
      description: >-
        Experimental, not deployed or publicly released. Requires the caller's explicit finance pilot
        grant in addition to token scopes. Project-scoped tokens are denied. listReceipts needs
        finance:read; saveReceipt and uploadReceiptOriginal need finance:write. Existing read/project
        scopes and legacy tokens never acquire finance access automatically. Original upload currently
        works only in the isolated demo sandbox. No payment, booking or tax approval occurs.
        Supply stable operationId for writes; retry the identical command after an uncertain response.
        Lists use afterId and return data.records/data.nextCursor. Storage paths are omitted.
      x-required-scope: finance:write
      x-permission: finance:write
      x-action-permissions:
        listReceipts: finance:read
        saveReceipt: finance:write
        uploadReceiptOriginal: finance:write
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [action, environment]
              properties:
                action:
                  enum: [listReceipts, saveReceipt, uploadReceiptOriginal]
                environment:
                  enum: [sandbox, live]
                afterId:
                  type: string
                id:
                  type: string
                expectedRevision:
                  type: integer
                  minimum: 0
                revision:
                  type: integer
                  minimum: 1
                operationId:
                  type: string
                data:
                  type: object
                  description: Receipt draft fields per functions/src/finance/receipts.ts; exact integer cent strings, EUR, versioned supplier/costCenter/paymentAccount references. No paymentState or originalDocument fields.
                filename:
                  type: string
                mimeType:
                  enum: [application/pdf, image/png, image/jpeg, application/xml]
                base64:
                  type: string
                  description: Canonical base64, maximum 5 MiB decoded. Original remains quarantined until a successful generation-bound scan. Upload acknowledgement is immutable; list receipts for current scan state.
              description: Each action strictly validates its own fields. saveReceipt requires id/expectedRevision/operationId/data; upload requires id/revision/operationId/filename/mimeType/base64. Do not supply actor or resource overrides.
      responses:
        '200':
          description: Command result in data, success true
        '400':
          description: Invalid command
        '401':
          description: Authentication required
        '403':
          description: Token scope, project scope or private finance grant denied
        '409':
          description: Revision or idempotency conflict
        '412':
          description: Original archive or profile precondition failed
        '429':
          description: Rate or daily quota exceeded
  /projects:
    get:
      tags:
        - Projects
      operationId: listProjects
      summary: List projects
      description: >-
        Projects the credential can see. With `externalSource` the list is filtered by external reference and pages itself (`limit` 1-100,
        default 50, `nextCursor`, no `total`). Without it the standard pagination applies.
      parameters:
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/Cursor'
        - name: externalSource
          in: query
          schema:
            type: string
          description: Source key of the external reference (e.g. `manager`). Enables the filter.
        - name: externalCustomerId
          in: query
          schema:
            type: string
          description: Match `external.<source>.customerId`. Not together with `externalRef`.
        - name: externalRef
          in: query
          schema:
            type: string
          description: Match `external.<source>.ref`. Not together with `externalCustomerId`.
        - name: status
          in: query
          schema:
            type: string
            enum:
              - active
              - archived
          description: '`archived` = status Completed or Canceled. Only with `externalSource`.'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  projects:
                    type: array
                    items:
                      $ref: '#/components/schemas/Project'
                  nextCursor:
                    type:
                      - string
                      - 'null'
                  total:
                    type: integer
                    description: Not set when the external filter is used.
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: read
      x-permission: projects:read
    post:
      tags:
        - Projects
      operationId: createProject
      summary: Create a project
      description: Requires `title`. `external` needs the scope `external:write`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProjectInput'
      responses:
        '201':
          description: Created.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  project:
                    $ref: '#/components/schemas/Project'
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: projects:write
      x-permission: projects:write
  /projects/{projectId}:
    get:
      tags:
        - Projects
      operationId: getProject
      summary: Get a project
      parameters:
        - $ref: '#/components/parameters/ProjectId'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  project:
                    $ref: '#/components/schemas/Project'
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: read
      x-permission: projects:read
    patch:
      tags:
        - Projects
      operationId: updateProject
      summary: Update a project
      description: At least one writable field is required.
      parameters:
        - $ref: '#/components/parameters/ProjectId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProjectInput'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  project:
                    $ref: '#/components/schemas/Project'
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: projects:write
      x-permission: projects:write
    delete:
      tags:
        - Projects
      operationId: deleteProject
      summary: Delete a project
      description: Deletes the project and its content. Only possible when the workspace allows deletion for API credentials.
      parameters:
        - $ref: '#/components/parameters/ProjectId'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  deletedProjectId:
                    type: string
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: projects:write
      x-permission: projects:delete
  /projects/{projectId}/tasks:
    get:
      tags:
        - Tasks
      operationId: listTasks
      summary: List tasks of a project
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/Cursor'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  tasks:
                    type: array
                    items:
                      $ref: '#/components/schemas/Task'
                  nextCursor:
                    type:
                      - string
                      - 'null'
                  total:
                    type: integer
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: read
      x-permission: tasks:read
    post:
      tags:
        - Tasks
      operationId: createTask
      summary: Create a task
      description: Requires `title`.
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/PersonaHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskInput'
      responses:
        '201':
          description: Created.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  task:
                    $ref: '#/components/schemas/Task'
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: tasks:write
      x-permission: tasks:write
  /projects/{projectId}/tasks/{taskId}:
    get:
      tags:
        - Tasks
      operationId: getTask
      summary: Get a task
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/TaskId'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  task:
                    $ref: '#/components/schemas/Task'
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: read
      x-permission: tasks:read
    patch:
      tags:
        - Tasks
      operationId: updateTask
      summary: Update a task
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/TaskId'
        - $ref: '#/components/parameters/PersonaHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskInput'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  task:
                    $ref: '#/components/schemas/Task'
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: tasks:write
      x-permission: tasks:write
    delete:
      tags:
        - Tasks
      operationId: deleteTask
      summary: Delete a task
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/TaskId'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  deletedTaskId:
                    type: string
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: tasks:write
      x-permission: tasks:delete
  /projects/{projectId}/tasks/upsert-by-external-key:
    post:
      tags:
        - Tasks
      operationId: upsertTaskByExternalKey
      summary: Create or update a task by external key
      description: >-
        Finds the task with `externalKey` in the project and updates it (200, `operation: updated`) or creates it (201, `operation:
        created`). Idempotent. `appendSummary` appends text to the description.
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/PersonaHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/TaskInput'
              required:
                - externalKey
              properties:
                appendSummary:
                  type: string
                  description: Text appended to the description on update.
      responses:
        '200':
          description: Updated.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  operation:
                    type: string
                    enum:
                      - updated
                  task:
                    $ref: '#/components/schemas/Task'
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '201':
          description: Created.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  operation:
                    type: string
                    enum:
                      - created
                  task:
                    $ref: '#/components/schemas/Task'
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: tasks:write
      x-permission: tasks:write
  /projects/{projectId}/tasks/{taskId}/subtasks:
    get:
      tags:
        - Subtasks
      operationId: listSubtasks
      summary: List subtasks
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/TaskId'
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/Cursor'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  subtasks:
                    type: array
                    items:
                      $ref: '#/components/schemas/Subtask'
                  nextCursor:
                    type:
                      - string
                      - 'null'
                  total:
                    type: integer
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: read
      x-permission: tasks:read
    post:
      tags:
        - Subtasks
      operationId: createSubtask
      summary: Create a subtask
      description: Requires `title`.
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/TaskId'
        - $ref: '#/components/parameters/PersonaHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubtaskInput'
      responses:
        '201':
          description: Created.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  subtask:
                    $ref: '#/components/schemas/Subtask'
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: tasks:write
      x-permission: tasks:write
  /projects/{projectId}/tasks/{taskId}/subtasks/{subtaskId}:
    get:
      tags:
        - Subtasks
      operationId: getSubtask
      summary: Get a subtask
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/TaskId'
        - $ref: '#/components/parameters/SubtaskId'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  subtask:
                    $ref: '#/components/schemas/Subtask'
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: read
      x-permission: tasks:read
    patch:
      tags:
        - Subtasks
      operationId: updateSubtask
      summary: Update a subtask
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/TaskId'
        - $ref: '#/components/parameters/SubtaskId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubtaskInput'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  subtask:
                    $ref: '#/components/schemas/Subtask'
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: tasks:write
      x-permission: tasks:write
    delete:
      tags:
        - Subtasks
      operationId: deleteSubtask
      summary: Delete a subtask
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/TaskId'
        - $ref: '#/components/parameters/SubtaskId'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  deletedSubtaskId:
                    type: string
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: tasks:write
      x-permission: tasks:delete
  /projects/{projectId}/initiatives:
    get:
      tags:
        - Initiatives
      operationId: listInitiatives
      summary: List initiatives
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/Cursor'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  initiatives:
                    type: array
                    items:
                      $ref: '#/components/schemas/Initiative'
                  nextCursor:
                    type:
                      - string
                      - 'null'
                  total:
                    type: integer
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: read
      x-permission: initiatives:read
    post:
      tags:
        - Initiatives
      operationId: createInitiative
      summary: Create an initiative
      description: Requires `title`.
      parameters:
        - $ref: '#/components/parameters/ProjectId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InitiativeInput'
      responses:
        '201':
          description: Created.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  initiative:
                    $ref: '#/components/schemas/Initiative'
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: projects:write
      x-permission: initiatives:write
  /projects/{projectId}/initiatives/{initiativeId}:
    get:
      tags:
        - Initiatives
      operationId: getInitiative
      summary: Get an initiative
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/InitiativeId'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  initiative:
                    $ref: '#/components/schemas/Initiative'
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: read
      x-permission: initiatives:read
    patch:
      tags:
        - Initiatives
      operationId: updateInitiative
      summary: Update an initiative
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/InitiativeId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InitiativeInput'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  initiative:
                    $ref: '#/components/schemas/Initiative'
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: projects:write
      x-permission: initiatives:write
    delete:
      tags:
        - Initiatives
      operationId: deleteInitiative
      summary: Delete an initiative
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/InitiativeId'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  deletedInitiativeId:
                    type: string
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: projects:write
      x-permission: initiatives:delete
  /projects/{projectId}/initiatives/upsert-by-external-key:
    post:
      tags:
        - Initiatives
      operationId: upsertInitiativeByExternalKey
      summary: Create or update an initiative by external key
      description: Updates the initiative with `externalKey` (200) or creates it (201). Idempotent.
      parameters:
        - $ref: '#/components/parameters/ProjectId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/InitiativeInput'
              required:
                - externalKey
      responses:
        '200':
          description: Updated.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  operation:
                    type: string
                    enum:
                      - updated
                  initiative:
                    $ref: '#/components/schemas/Initiative'
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '201':
          description: Created.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  operation:
                    type: string
                    enum:
                      - created
                  initiative:
                    $ref: '#/components/schemas/Initiative'
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: projects:write
      x-permission: initiatives:write
  /projects/{projectId}/milestones:
    get:
      tags:
        - Milestones
      operationId: listMilestones
      summary: List milestones
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/Cursor'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  milestones:
                    type: array
                    items:
                      $ref: '#/components/schemas/Milestone'
                  nextCursor:
                    type:
                      - string
                      - 'null'
                  total:
                    type: integer
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: read
      x-permission: projects:read
    post:
      tags:
        - Milestones
      operationId: createMilestone
      summary: Create milestone
      description: Requires `title`.
      parameters:
        - $ref: '#/components/parameters/ProjectId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MilestoneInput'
      responses:
        '201':
          description: Created.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  milestone:
                    $ref: '#/components/schemas/Milestone'
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: projects:write
      x-permission: projects:write
  /projects/{projectId}/milestones/{milestoneId}:
    get:
      tags:
        - Milestones
      operationId: getMilestone
      summary: Get milestone
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/MilestoneId'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  milestone:
                    $ref: '#/components/schemas/Milestone'
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: read
      x-permission: projects:read
    patch:
      tags:
        - Milestones
      operationId: updateMilestone
      summary: Update milestone
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/MilestoneId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MilestoneInput'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  milestone:
                    $ref: '#/components/schemas/Milestone'
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: projects:write
      x-permission: projects:write
    delete:
      tags:
        - Milestones
      operationId: deleteMilestone
      summary: Delete milestone
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/MilestoneId'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  deletedMilestoneId:
                    type: string
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: projects:write
      x-permission: projects:delete
  /projects/{projectId}/sprints:
    get:
      tags:
        - Sprints
      operationId: listSprints
      summary: List sprints
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/Cursor'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  sprints:
                    type: array
                    items:
                      $ref: '#/components/schemas/Sprint'
                  nextCursor:
                    type:
                      - string
                      - 'null'
                  total:
                    type: integer
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: read
      x-permission: projects:read
    post:
      tags:
        - Sprints
      operationId: createSprint
      summary: Create sprint
      description: Requires `name`.
      parameters:
        - $ref: '#/components/parameters/ProjectId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SprintInput'
      responses:
        '201':
          description: Created.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  sprint:
                    $ref: '#/components/schemas/Sprint'
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: projects:write
      x-permission: projects:write
  /projects/{projectId}/sprints/{sprintId}:
    get:
      tags:
        - Sprints
      operationId: getSprint
      summary: Get sprint
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/SprintId'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  sprint:
                    $ref: '#/components/schemas/Sprint'
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: read
      x-permission: projects:read
    patch:
      tags:
        - Sprints
      operationId: updateSprint
      summary: Update sprint
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/SprintId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SprintInput'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  sprint:
                    $ref: '#/components/schemas/Sprint'
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: projects:write
      x-permission: projects:write
    delete:
      tags:
        - Sprints
      operationId: deleteSprint
      summary: Delete sprint
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/SprintId'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  deletedSprintId:
                    type: string
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: projects:write
      x-permission: projects:delete
  /projects/{projectId}/categories:
    get:
      tags:
        - Categories
      operationId: listCategories
      summary: List categories
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/Cursor'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  categories:
                    type: array
                    items:
                      $ref: '#/components/schemas/Category'
                  nextCursor:
                    type:
                      - string
                      - 'null'
                  total:
                    type: integer
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: read
      x-permission: projects:read
    post:
      tags:
        - Categories
      operationId: createCategory
      summary: Create category
      description: Requires `name`.
      parameters:
        - $ref: '#/components/parameters/ProjectId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CategoryInput'
      responses:
        '201':
          description: Created.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  category:
                    $ref: '#/components/schemas/Category'
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: projects:write
      x-permission: projects:write
  /projects/{projectId}/categories/{categoryId}:
    get:
      tags:
        - Categories
      operationId: getCategory
      summary: Get category
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/CategoryId'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  category:
                    $ref: '#/components/schemas/Category'
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: read
      x-permission: projects:read
    patch:
      tags:
        - Categories
      operationId: updateCategory
      summary: Update category
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/CategoryId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CategoryInput'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  category:
                    $ref: '#/components/schemas/Category'
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: projects:write
      x-permission: projects:write
    delete:
      tags:
        - Categories
      operationId: deleteCategory
      summary: Delete category
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/CategoryId'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  deletedCategoryId:
                    type: string
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: projects:write
      x-permission: projects:delete
  /projects/{projectId}/project-groups:
    get:
      tags:
        - Project groups
      operationId: listProjectGroups
      summary: List projectGroups
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/Cursor'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  projectGroups:
                    type: array
                    items:
                      $ref: '#/components/schemas/ProjectGroup'
                  nextCursor:
                    type:
                      - string
                      - 'null'
                  total:
                    type: integer
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: read
      x-permission: projects:read
    post:
      tags:
        - Project groups
      operationId: createProjectGroup
      summary: Create projectGroup
      description: Requires `name`.
      parameters:
        - $ref: '#/components/parameters/ProjectId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProjectGroupInput'
      responses:
        '201':
          description: Created.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  projectGroup:
                    $ref: '#/components/schemas/ProjectGroup'
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: projects:write
      x-permission: projects:write
  /projects/{projectId}/project-groups/{groupId}:
    get:
      tags:
        - Project groups
      operationId: getProjectGroup
      summary: Get projectGroup
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/GroupId'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  projectGroup:
                    $ref: '#/components/schemas/ProjectGroup'
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: read
      x-permission: projects:read
    patch:
      tags:
        - Project groups
      operationId: updateProjectGroup
      summary: Update projectGroup
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/GroupId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProjectGroupInput'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  projectGroup:
                    $ref: '#/components/schemas/ProjectGroup'
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: projects:write
      x-permission: projects:write
    delete:
      tags:
        - Project groups
      operationId: deleteProjectGroup
      summary: Delete projectGroup
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/GroupId'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  deletedProjectGroupId:
                    type: string
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: projects:write
      x-permission: projects:delete
  /projects/{projectId}/comments:
    get:
      tags:
        - Comments
      operationId: listComments
      summary: List comments
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - name: targetId
          in: query
          schema:
            type: string
          description: Only comments on this object.
        - name: targetType
          in: query
          schema:
            type: string
          description: Only comments on this object type (e.g. `task`).
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/Cursor'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  comments:
                    type: array
                    items:
                      $ref: '#/components/schemas/Comment'
                  nextCursor:
                    type:
                      - string
                      - 'null'
                  total:
                    type: integer
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: read
      x-permission: projects:read
    post:
      tags:
        - Comments
      operationId: createComment
      summary: Create comment
      description: Requires `content, targetId, targetType`.
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/PersonaHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CommentInput'
      responses:
        '201':
          description: Created.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  comment:
                    $ref: '#/components/schemas/Comment'
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: projects:write
      x-permission: projects:write
  /projects/{projectId}/comments/{commentId}:
    get:
      tags:
        - Comments
      operationId: getComment
      summary: Get comment
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/CommentId'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  comment:
                    $ref: '#/components/schemas/Comment'
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: read
      x-permission: projects:read
    patch:
      tags:
        - Comments
      operationId: updateComment
      summary: Update comment
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/CommentId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CommentInput'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  comment:
                    $ref: '#/components/schemas/Comment'
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: projects:write
      x-permission: projects:write
    delete:
      tags:
        - Comments
      operationId: deleteComment
      summary: Delete comment
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/CommentId'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  deletedCommentId:
                    type: string
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: projects:write
      x-permission: projects:delete
  /projects/{projectId}/activities:
    get:
      tags:
        - Activities
      operationId: listActivities
      summary: List project activity
      description: Activity stream of the project, newest first.
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/Cursor'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  activities:
                    type: array
                    items:
                      $ref: '#/components/schemas/Activity'
                  nextCursor:
                    type:
                      - string
                      - 'null'
                  total:
                    type: integer
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: read
      x-permission: projects:read
  /search:
    get:
      tags:
        - Search
      operationId: search
      summary: Search projects and tasks
      description: >-
        Compact search across the projects the credential can reach. Not paginated; `truncated` is true when the scan was cut short.
        Separate rate limit.
      parameters:
        - name: q
          in: query
          required: true
          schema:
            type: string
            minLength: 2
          description: Search text, at least 2 characters.
        - name: limit
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 50
            default: 20
        - name: includeDone
          in: query
          schema:
            type: boolean
            default: false
          description: Include completed tasks and projects.
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  query:
                    type: string
                  projects:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        title:
                          type: string
                        status:
                          type: string
                      additionalProperties: true
                  tasks:
                    type: array
                    items:
                      type: object
                      additionalProperties: true
                      description: Compact task reference.
                  truncated:
                    type: boolean
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: read
      x-permission: tasks:read
  /me/today:
    get:
      tags:
        - Search
      operationId: getMyToday
      summary: My day
      description: >-
        Open tasks assigned to the credential's user, grouped for today (overdue, due today, upcoming), plus the user's focus state. Needs a
        credential that belongs to a user.
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  focus:
                    type:
                      - object
                      - 'null'
                    additionalProperties: true
                  requestId:
                    type: string
                additionalProperties: true
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: read
      x-permission: tasks:read
  /me/personas:
    get:
      tags:
        - Agent personas
      operationId: listMyPersonas
      summary: List my agent personas (incl. archived) and settings
      description: Needs the Firebase ID token of the signed-in user (not an API or AI token).
      x-auth: firebase-id-token
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success: { type: boolean }
                  personas: { type: array, items: { $ref: '#/components/schemas/AgentPersona' } }
                  settings:
                    type: object
                    properties:
                      autoCreatePersonas: { type: boolean }
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
    post:
      tags:
        - Agent personas
      operationId: createMyPersona
      summary: Create an agent persona
      description: >-
        Name 2-32 chars (letters, digits, space, - and _; no URLs; reserved names refused), unique per owner, max 25 active. The colour is assigned collision-free unless `colorIndex` is given.
      x-auth: firebase-id-token
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PersonaWriteBody'
      responses:
        '201':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success: { type: boolean }
                  persona: { $ref: '#/components/schemas/AgentPersona' }
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
  /me/personas/{personaId}:
    patch:
      tags:
        - Agent personas
      operationId: updateMyPersona
      summary: Rename, recolour, change role/emoji/aliases, archive or reactivate a persona
      description: Changes fan out to the workspace projections. Archived personas are refused for new writes (409 persona-archived).
      x-auth: firebase-id-token
      parameters:
        - name: personaId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PersonaWriteBody'
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success: { type: boolean }
                  persona: { $ref: '#/components/schemas/AgentPersona' }
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
  /me/persona-settings:
    patch:
      tags:
        - Agent personas
      operationId: updateMyPersonaSettings
      summary: Switch automatic creation of unknown personas on or off
      x-auth: firebase-id-token
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [autoCreatePersonas]
              properties:
                autoCreatePersonas: { type: boolean }
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success: { type: boolean }
                  settings:
                    type: object
                    properties:
                      autoCreatePersonas: { type: boolean }
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
  /workspace-personas/{personaId}:
    patch:
      tags:
        - Agent personas
      operationId: setWorkspacePersonaStatus
      summary: Block or unblock an agent persona in a workspace (Owner/Admin)
      description: >-
        A blocked persona's writes fall back to the human attribution (`X-ProjectFlow-Persona-Ignored: blocked`). Needs the Firebase ID token of a workspace Owner or Admin.
      x-auth: firebase-id-token
      parameters:
        - name: personaId
          in: path
          required: true
          schema:
            type: string
        - name: tenantId
          in: query
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [status]
              properties:
                status: { type: string, enum: [active, blocked] }
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success: { type: boolean }
                  persona: { $ref: '#/components/schemas/WorkspaceAgentPersona' }
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
  /feedback:
    post:
      tags:
        - Feedback ingest
      operationId: submitFeedback
      summary: Send app feedback with an optional screenshot
      description: >-
        Creates a task labelled `Feedback` + the category in the key's target project, with a structured context block,
        the reporter and the screenshot as task attachment (EXIF/metadata removed). Authenticates with an app feedback key
        (`pff_...`), never a workspace token. Not part of the token-scope model; errors use `{ error, message, details? }`.
        Limits: 60 reports/min and 1000/day per key, 10/min and 100/day per `installId`, 30/min per IP.
      security:
        - feedbackKeyAuth: []
      x-auth: feedback-key
      parameters:
        - name: Idempotency-Key
          in: header
          required: false
          description: >-
            Client-generated id (a UUID; 8-128 chars of `[A-Za-z0-9_-]`), kept 24 h. A retry with the same key and the
            same report returns the original ticket (`Idempotent-Replay: true`); the same key with another report is 422.
          schema:
            type: string
        - name: X-App-Attest
          in: header
          required: false
          description: App Attest assertion. Stored with the ticket, not verified yet.
          schema:
            type: string
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - report
              properties:
                report:
                  $ref: '#/components/schemas/FeedbackReport'
                screenshot:
                  type: string
                  format: binary
                  description: One JPEG or PNG, at most 5 MB. The type is detected from the bytes, not the part's Content-Type.
            encoding:
              report:
                contentType: application/json
              screenshot:
                contentType: image/jpeg, image/png
      responses:
        '201':
          description: Ticket created (or the original ticket on an idempotent replay).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeedbackTicket'
        '400':
          description: Validation failed (`invalid_report` with `details`, `invalid_screenshot`, `invalid_request`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeedbackError'
        '401':
          description: Missing, unknown or revoked feedback key (`unauthorized`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeedbackError'
        '403':
          description: Workspace suspended (`workspace_suspended`) or API access disabled by the plan (`plan_api_disabled`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeedbackError'
        '409':
          description: A request with this Idempotency-Key is still running (`in_progress`, `Retry-After`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeedbackError'
        '410':
          description: The key's target project no longer exists (`project_unavailable`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeedbackError'
        '413':
          description: Screenshot over 5 MB or report part over 64 KB (`too_large`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeedbackError'
        '422':
          description: Idempotency-Key reused for a different report (`idempotency_key_reused`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeedbackError'
        '429':
          description: Rate limit hit (`rate_limited`); wait `Retry-After` seconds.
          headers:
            Retry-After:
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeedbackError'
  /files:
    get:
      tags:
        - Files
      operationId: listFiles
      summary: List files
      description: >-
        Listed, non-chat files, newest first. Guests must pass a project they belong to. Storage paths and provider handles are stripped;
        there is no download URL yet.
      parameters:
        - name: projectId
          in: query
          schema:
            type: string
          description: Only files of this project.
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/Cursor'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  files:
                    type: array
                    items:
                      $ref: '#/components/schemas/File'
                  nextCursor:
                    type:
                      - string
                      - 'null'
                  total:
                    type: integer
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: read
      x-permission: files:read
  /files/{fileId}:
    get:
      tags:
        - Files
      operationId: getFile
      summary: Get file metadata
      parameters:
        - $ref: '#/components/parameters/FileId'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  file:
                    $ref: '#/components/schemas/File'
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: read
      x-permission: files:read
  /members:
    get:
      tags:
        - Members
      operationId: listMembers
      summary: List workspace members
      description: >-
        Members of the workspace (or of one project) with id, name, email and role — to assign work by name. Emails set to private in the
        profile are omitted.
      parameters:
        - name: projectId
          in: query
          schema:
            type: string
          description: Only members of this project.
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/Cursor'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  members:
                    type: array
                    items:
                      $ref: '#/components/schemas/Member'
                  nextCursor:
                    type:
                      - string
                      - 'null'
                  total:
                    type: integer
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: read
      x-permission: members:read
  /wiki:
    get:
      tags:
        - Wiki
      operationId: listWikiPages
      summary: List or search wiki pages
      description: >-
        Page entries without bodies, newest first. Without projectId the workspace wiki; with projectId that project's wiki; with q a search
        over every space the caller reaches. Project-scoped tokens only reach their project.
      parameters:
        - name: projectId
          in: query
          schema:
            type: string
          description: Project wiki instead of the workspace wiki.
        - name: parentId
          in: query
          schema:
            type: string
          description: Only direct children of this page.
        - name: q
          in: query
          schema:
            type: string
          description: Search text (title and body).
        - name: includeArchived
          in: query
          schema:
            type: boolean
          description: true includes archived pages.
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/Cursor'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  pages:
                    type: array
                    items:
                      $ref: '#/components/schemas/WikiPage'
                  nextCursor:
                    type:
                      - string
                      - 'null'
                  total:
                    type: integer
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: read
      x-permission: wiki:read
    post:
      tags:
        - Wiki
      operationId: createWikiPage
      summary: Create a wiki page from Markdown
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - title
              properties:
                title:
                  type: string
                  maxLength: 200
                markdown:
                  type: string
                  maxLength: 200000
                  description: Headings, lists, checklists, quotes, code, links, bold/italic.
                projectId:
                  type: string
                  description: 'Create in this project''s wiki (default: workspace wiki).'
                parentId:
                  type: string
                  description: Parent page in the same space.
                icon:
                  type: string
                  description: Emoji.
                linkedTaskRefs:
                  type: array
                  items:
                    type: string
                  description: '"projectId/taskId".'
      responses:
        '201':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  page:
                    $ref: '#/components/schemas/WikiPage'
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: projects:write
      x-permission: wiki:write
  /wiki/{docId}:
    get:
      tags:
        - Wiki
      operationId: getWikiPage
      summary: Get a wiki page as Markdown
      parameters:
        - $ref: '#/components/parameters/DocId'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  page:
                    allOf:
                      - $ref: '#/components/schemas/WikiPage'
                      - type: object
                        properties:
                          markdown:
                            type: string
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: read
      x-permission: wiki:read
    patch:
      tags:
        - Wiki
      operationId: updateWikiPage
      summary: Update a wiki page
      description: >-
        `markdown` replaces the body (or is appended with `append: true`); the previous body is kept as a page version (reason `api`).
        `archived` archives/restores.
      parameters:
        - $ref: '#/components/parameters/DocId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  maxLength: 200
                markdown:
                  type: string
                  maxLength: 200000
                append:
                  type: boolean
                archived:
                  type: boolean
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  page:
                    $ref: '#/components/schemas/WikiPage'
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: projects:write
      x-permission: wiki:write
  /notebooks:
    get:
      tags:
        - Notebooks
      operationId: listNotebooks
      summary: List notebooks and lists
      description: >-
        Notebooks with their lists (id, title, entry count, fields by label and type, saved views) the caller may read. Private notebooks stay private (also for admins).
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                additionalProperties: true
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: read
      x-permission: notebooks:read
  /meeting-notes:
    get:
      tags:
        - Notebooks
      operationId: searchMeetingNotes
      summary: Search meeting notes
      description: >-
        Recorded meetings live in notebook entries. Searches title and summary of the meetings in lists the caller may read;
        transcript hits only where the caller may edit the list. Each hit carries meetingId, notebookId, listId, entryId, atSec, snippet and url.
      parameters:
        - name: query
          in: query
          required: true
          schema:
            type: string
        - name: limit
          in: query
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                additionalProperties: true
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: read
      x-permission: notebooks:read
  /meeting-notes/{meetingId}:
    get:
      tags:
        - Notebooks
      operationId: getMeetingNotes
      summary: Get meeting notes
      description: >-
        Summary, decisions, open questions, tasks and url of one meeting. With by=entry the path id is the notebook entry id.
        The transcript is included only if the caller may edit the entry's list.
      parameters:
        - name: meetingId
          in: path
          required: true
          schema:
            type: string
        - name: by
          in: query
          required: false
          schema:
            type: string
            enum: [meeting, entry]
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                additionalProperties: true
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: read
      x-permission: notebooks:read
  /lists/entries:
    post:
      tags:
        - Notebooks
      operationId: addListEntry
      summary: Add a list entry
      description: >-
        Target by listId or listQuery (fuzzy title; ambiguous → 400 with candidates). Values by field label or one-line text (👍/👎, #tag, @option, dates, 12,90€). The answer lists similar existing entries.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                listId:
                  type: string
                  description: List id.
                listQuery:
                  type: string
                  description: List title (fuzzy).
                values:
                  type: object
                  description: Field label → value.
                text:
                  type: string
                  description: One-line capture text.
                timeZone:
                  type: string
                  description: IANA zone for relative dates.
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                additionalProperties: true
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: projects:write
      x-permission: notebooks:write
  /lists/{listId}:
    get:
      tags:
        - Notebooks
      operationId: getList
      summary: Get a list
      description: >-
        Fields, saved views, pattern card and the first 50 entries (values by field label).
      parameters:
        - name: listId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                additionalProperties: true
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: read
      x-permission: notebooks:read
  /lists/{listId}/query:
    post:
      tags:
        - Notebooks
      operationId: queryList
      summary: Query a list
      description: >-
        Filter (by field label: equals, notEquals, contains, gt, lt, answered, notAnswered, ratingAtLeast 0..1), saved view by name, full-text and sort; limit ≤ 200.
      parameters:
        - name: listId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                view:
                  type: string
                  description: Saved view name.
                filter:
                  type: array
                  description: Rules { field, op, value }.
                match:
                  type: string
                  description: all | any
                text:
                  type: string
                  description: Search text.
                sort:
                  type: object
                  description: '{ field, dir }'
                limit:
                  type: integer
                  description: Default 50, max 200.
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                additionalProperties: true
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: read
      x-permission: notebooks:read
  /lists/{listId}/entries/{entryId}:
    get:
      tags:
        - Notebooks
      operationId: getListEntry
      summary: Get a list entry
      description: >-
        One entry with values by field label.
      parameters:
        - name: listId
          in: path
          required: true
          schema:
            type: string
        - name: entryId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                additionalProperties: true
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: read
      x-permission: notebooks:read
    patch:
      tags:
        - Notebooks
      operationId: updateListEntry
      summary: Update a list entry
      description: >-
        Only the given labels change; clear empties labels; checked ticks the first checkbox field. Entries cannot be deleted through the API.
      parameters:
        - name: listId
          in: path
          required: true
          schema:
            type: string
        - name: entryId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                values:
                  type: object
                  description: Field label → value.
                clear:
                  type: array
                  description: Labels to empty.
                checked:
                  type: boolean
                  description: Tick/untick.
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                additionalProperties: true
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: projects:write
      x-permission: notebooks:write
  /forms:
    get:
      tags:
        - Forms
      operationId: listForms
      summary: List forms
      description: 'Forms visible to the token creator: workspace Owner/Admin, or owner/editor of the form.'
      parameters:
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/Cursor'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  forms:
                    type: array
                    items:
                      $ref: '#/components/schemas/Form'
                  nextCursor:
                    type:
                      - string
                      - 'null'
                  total:
                    type: integer
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: read
      x-permission: forms:read
  /forms/{formId}:
    get:
      tags:
        - Forms
      operationId: getForm
      summary: Get a form
      description: Includes `definition` of the published version.
      parameters:
        - $ref: '#/components/parameters/FormId'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  form:
                    $ref: '#/components/schemas/Form'
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: read
      x-permission: forms:read
  /forms/{formId}/responses:
    get:
      tags:
        - Forms
      operationId: listFormResponses
      summary: List form responses
      description: IP address and user agent are stripped.
      parameters:
        - $ref: '#/components/parameters/FormId'
        - name: status
          in: query
          schema:
            type: string
          description: Filter by response status.
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/Cursor'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  responses:
                    type: array
                    items:
                      $ref: '#/components/schemas/FormResponse'
                  nextCursor:
                    type:
                      - string
                      - 'null'
                  total:
                    type: integer
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: read
      x-permission: forms:read
  /webhooks:
    get:
      tags:
        - Webhooks
      operationId: listWebhooks
      summary: List webhook endpoints
      description: Secrets are never returned. Needs Owner/Admin as token creator and a plan with webhooks.
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  allowed:
                    type: boolean
                  eventTypes:
                    type: array
                    items:
                      type: string
                  webhooks:
                    type: array
                    items:
                      $ref: '#/components/schemas/Webhook'
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: webhooks:manage
      x-permission: webhooks:manage
    post:
      tags:
        - Webhooks
      operationId: createWebhook
      summary: Create a webhook endpoint
      description: Returns the signing secret once. Max 10 endpoints per workspace. `https` only, ports 443/8443, no private addresses.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookInput'
      responses:
        '201':
          description: Created.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  webhook:
                    $ref: '#/components/schemas/Webhook'
                  secret:
                    type: string
                    description: Signing secret. Shown only in this response.
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: webhooks:manage
      x-permission: webhooks:manage
  /webhooks/{webhookId}:
    patch:
      tags:
        - Webhooks
      operationId: updateWebhook
      summary: Update a webhook endpoint
      parameters:
        - $ref: '#/components/parameters/WebhookId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                url:
                  type: string
                  format: uri
                events:
                  type: array
                  items:
                    $ref: '#/components/schemas/WebhookEventType'
                description:
                  type: string
                enabled:
                  type: boolean
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  webhook:
                    $ref: '#/components/schemas/Webhook'
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: webhooks:manage
      x-permission: webhooks:manage
    delete:
      tags:
        - Webhooks
      operationId: deleteWebhook
      summary: Delete a webhook endpoint
      description: Deletes the endpoint, its secret and its delivery log.
      parameters:
        - $ref: '#/components/parameters/WebhookId'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  deletedWebhookId:
                    type: string
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: webhooks:manage
      x-permission: webhooks:manage
  /webhooks/{webhookId}/rotate-secret:
    post:
      tags:
        - Webhooks
      operationId: rotateWebhookSecret
      summary: Rotate the signing secret
      description: The old secret keeps signing for 24 hours (a second `v1=` in the signature header).
      parameters:
        - $ref: '#/components/parameters/WebhookId'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  secret:
                    type: string
                  previousSecretValidUntil:
                    type:
                      - string
                      - 'null'
                    format: date-time
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: webhooks:manage
      x-permission: webhooks:manage
  /webhooks/{webhookId}/test:
    post:
      tags:
        - Webhooks
      operationId: testWebhook
      summary: Send a webhook.test event
      parameters:
        - $ref: '#/components/parameters/WebhookId'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  ok:
                    type: boolean
                  delivery:
                    $ref: '#/components/schemas/WebhookDelivery'
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: webhooks:manage
      x-permission: webhooks:manage
  /webhooks/{webhookId}/deliveries:
    get:
      tags:
        - Webhooks
      operationId: listWebhookDeliveries
      summary: List recent deliveries
      description: Last 50 deliveries, kept 30 days.
      parameters:
        - $ref: '#/components/parameters/WebhookId'
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/Cursor'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  deliveries:
                    type: array
                    items:
                      $ref: '#/components/schemas/WebhookDelivery'
                  nextCursor:
                    type:
                      - string
                      - 'null'
                  total:
                    type: integer
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: webhooks:manage
      x-permission: webhooks:manage
  /webhooks/{webhookId}/deliveries/{deliveryId}/redeliver:
    post:
      tags:
        - Webhooks
      operationId: redeliverWebhook
      summary: Redeliver an event
      description: Resends the same body with a fresh signature.
      parameters:
        - $ref: '#/components/parameters/WebhookId'
        - $ref: '#/components/parameters/DeliveryId'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  ok:
                    type: boolean
                  delivery:
                    $ref: '#/components/schemas/WebhookDelivery'
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: webhooks:manage
      x-permission: webhooks:manage
  /projects/{projectId}/codex/sessions:
    get:
      tags:
        - Codex
      operationId: listCodexSessions
      summary: List coding-agent sessions
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/Cursor'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  sessions:
                    type: array
                    items:
                      $ref: '#/components/schemas/CodexSession'
                  nextCursor:
                    type:
                      - string
                      - 'null'
                  total:
                    type: integer
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: read
      x-permission: tasks:read
  /projects/{projectId}/codex/sessions/start:
    post:
      tags:
        - Codex
      operationId: startCodexSession
      summary: Start (or resume) a session
      description: Creates a session and links it to a task or initiative. 201 when created, 200 when an existing session with the same key resumed.
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/PersonaHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              description: Session start.
              additionalProperties: true
              required: []
              properties:
                sessionId:
                  type: string
                externalKey:
                  type: string
                  description: Stable key; the same key resumes the same session.
                title:
                  type: string
                summary:
                  type: string
                request:
                  type: string
                status:
                  type: string
                  enum:
                    - running
                    - completed
                    - blocked
                    - partial
                repoPath:
                  type: string
                branch:
                  type: string
                entity:
                  type: string
                  enum:
                    - task
                    - initiative
                taskId:
                  type: string
                initiativeId:
                  type: string
      responses:
        '200':
          description: Resumed.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  session:
                    $ref: '#/components/schemas/CodexSession'
                  operation:
                    type: string
                  linkedEntity:
                    type:
                      - object
                      - 'null'
                    additionalProperties: true
                  checkpoint:
                    type:
                      - object
                      - 'null'
                    additionalProperties: true
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '201':
          description: Created.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  session:
                    $ref: '#/components/schemas/CodexSession'
                  operation:
                    type: string
                  linkedEntity:
                    type:
                      - object
                      - 'null'
                    additionalProperties: true
                  checkpoint:
                    type:
                      - object
                      - 'null'
                    additionalProperties: true
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: tasks:write
      x-permission: tasks:write
  /projects/{projectId}/codex/sessions/checkpoint:
    post:
      tags:
        - Codex
      operationId: checkpointCodexSessionByKey
      summary: Add a checkpoint (session by key)
      parameters:
        - $ref: '#/components/parameters/ProjectId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              description: Checkpoint; the session is found via `sessionId` or `externalKey`.
              additionalProperties: true
              required: []
              properties:
                sessionId:
                  type: string
                externalKey:
                  type: string
                  description: Stable key; the same key resumes the same session.
                title:
                  type: string
                summary:
                  type: string
                request:
                  type: string
                status:
                  type: string
                  enum:
                    - running
                    - completed
                    - blocked
                    - partial
                repoPath:
                  type: string
                branch:
                  type: string
                entity:
                  type: string
                  enum:
                    - task
                    - initiative
                taskId:
                  type: string
                initiativeId:
                  type: string
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  session:
                    $ref: '#/components/schemas/CodexSession'
                  operation:
                    type: string
                  linkedEntity:
                    type:
                      - object
                      - 'null'
                    additionalProperties: true
                  checkpoint:
                    type:
                      - object
                      - 'null'
                    additionalProperties: true
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: tasks:write
      x-permission: tasks:write
  /projects/{projectId}/codex/sessions/finish:
    post:
      tags:
        - Codex
      operationId: finishCodexSessionByKey
      summary: Finish a session (by key)
      parameters:
        - $ref: '#/components/parameters/ProjectId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              description: Finish; the session is found via `sessionId` or `externalKey`.
              additionalProperties: true
              required: []
              properties:
                sessionId:
                  type: string
                externalKey:
                  type: string
                  description: Stable key; the same key resumes the same session.
                title:
                  type: string
                summary:
                  type: string
                request:
                  type: string
                status:
                  type: string
                  enum:
                    - running
                    - completed
                    - blocked
                    - partial
                repoPath:
                  type: string
                branch:
                  type: string
                entity:
                  type: string
                  enum:
                    - task
                    - initiative
                taskId:
                  type: string
                initiativeId:
                  type: string
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  session:
                    $ref: '#/components/schemas/CodexSession'
                  operation:
                    type: string
                  linkedEntity:
                    type:
                      - object
                      - 'null'
                    additionalProperties: true
                  checkpoint:
                    type:
                      - object
                      - 'null'
                    additionalProperties: true
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: tasks:write
      x-permission: tasks:write
  /projects/{projectId}/codex/sessions/{sessionId}/checkpoint:
    post:
      tags:
        - Codex
      operationId: checkpointCodexSession
      summary: Add a checkpoint to a session
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/SessionId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              description: Checkpoint.
              additionalProperties: true
              required: []
              properties:
                sessionId:
                  type: string
                externalKey:
                  type: string
                  description: Stable key; the same key resumes the same session.
                title:
                  type: string
                summary:
                  type: string
                request:
                  type: string
                status:
                  type: string
                  enum:
                    - running
                    - completed
                    - blocked
                    - partial
                repoPath:
                  type: string
                branch:
                  type: string
                entity:
                  type: string
                  enum:
                    - task
                    - initiative
                taskId:
                  type: string
                initiativeId:
                  type: string
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  session:
                    $ref: '#/components/schemas/CodexSession'
                  operation:
                    type: string
                  linkedEntity:
                    type:
                      - object
                      - 'null'
                    additionalProperties: true
                  checkpoint:
                    type:
                      - object
                      - 'null'
                    additionalProperties: true
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: tasks:write
      x-permission: tasks:write
  /projects/{projectId}/codex/sessions/{sessionId}/finish:
    post:
      tags:
        - Codex
      operationId: finishCodexSession
      summary: Finish a session
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/SessionId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              description: Finish.
              additionalProperties: true
              required: []
              properties:
                sessionId:
                  type: string
                externalKey:
                  type: string
                  description: Stable key; the same key resumes the same session.
                title:
                  type: string
                summary:
                  type: string
                request:
                  type: string
                status:
                  type: string
                  enum:
                    - running
                    - completed
                    - blocked
                    - partial
                repoPath:
                  type: string
                branch:
                  type: string
                entity:
                  type: string
                  enum:
                    - task
                    - initiative
                taskId:
                  type: string
                initiativeId:
                  type: string
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  session:
                    $ref: '#/components/schemas/CodexSession'
                  operation:
                    type: string
                  linkedEntity:
                    type:
                      - object
                      - 'null'
                    additionalProperties: true
                  checkpoint:
                    type:
                      - object
                      - 'null'
                    additionalProperties: true
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: tasks:write
      x-permission: tasks:write
  /projects/{projectId}/codex/followups:
    get:
      tags:
        - Codex
      operationId: listCodexFollowups
      summary: List follow-ups
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/Cursor'
      responses:
        '200':
          description: Success.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  followups:
                    type: array
                    items:
                      $ref: '#/components/schemas/CodexFollowup'
                  nextCursor:
                    type:
                      - string
                      - 'null'
                  total:
                    type: integer
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: read
      x-permission: tasks:read
  /projects/{projectId}/codex/followups/bulk-create:
    post:
      tags:
        - Codex
      operationId: bulkCreateCodexFollowups
      summary: Create follow-up tasks in bulk
      parameters:
        - $ref: '#/components/parameters/ProjectId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - followUps
              additionalProperties: true
              properties:
                sessionId:
                  type: string
                externalKey:
                  type: string
                initiativeId:
                  type: string
                summary:
                  type: string
                followUps:
                  type: array
                  items:
                    type: object
                    additionalProperties: true
                    properties:
                      title:
                        type: string
                      description:
                        type: string
                      priority:
                        type: string
      responses:
        '201':
          description: Created.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-API-Version:
              $ref: '#/components/headers/XApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    const: true
                  followups:
                    type: array
                    items:
                      $ref: '#/components/schemas/CodexFollowup'
                  requestId:
                    type: string
                    description: Echo of X-Request-Id.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-required-scope: tasks:write
      x-permission: tasks:write
webhooks:
  project.created:
    post:
      tags:
        - Webhook events
      operationId: event_project_created
      summary: project.created
      description: >-
        A project was created. Delivered at least once, without ordering guarantee. Success = HTTP 2xx within 10 s; redirects are not
        followed. Retries: 1 min, 5 min, 15 min, 30 min, 1 h, 2 h, 4 h, 8 h, 8 h; afterwards the endpoint is disabled.
      parameters:
        - name: X-ProjectFlow-Signature
          in: header
          required: true
          schema:
            type: string
          description: >-
            `t=<unix seconds>,v1=<hex HMAC-SHA256(secret, t + "." + rawBody)>`. After a secret rotation a second `v1=` appears for 24 h.
            Reject if `t` is older than 5 minutes; compare in constant time.
        - name: X-ProjectFlow-Event-Id
          in: header
          required: true
          schema:
            type: string
          description: Payload id, stable across retries.
        - name: X-ProjectFlow-Event-Type
          in: header
          required: true
          schema:
            type: string
            const: project.created
        - name: X-ProjectFlow-Delivery-Attempt
          in: header
          required: true
          schema:
            type: integer
            minimum: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/WebhookEvent'
                - properties:
                    type:
                      const: project.created
      responses:
        '204':
          description: Acknowledged. Any 2xx counts as success.
  project.updated:
    post:
      tags:
        - Webhook events
      operationId: event_project_updated
      summary: project.updated
      description: >-
        A project changed (rename, members, status within active states). Delivered at least once, without ordering guarantee. Success =
        HTTP 2xx within 10 s; redirects are not followed. Retries: 1 min, 5 min, 15 min, 30 min, 1 h, 2 h, 4 h, 8 h, 8 h; afterwards the
        endpoint is disabled.
      parameters:
        - name: X-ProjectFlow-Signature
          in: header
          required: true
          schema:
            type: string
          description: >-
            `t=<unix seconds>,v1=<hex HMAC-SHA256(secret, t + "." + rawBody)>`. After a secret rotation a second `v1=` appears for 24 h.
            Reject if `t` is older than 5 minutes; compare in constant time.
        - name: X-ProjectFlow-Event-Id
          in: header
          required: true
          schema:
            type: string
          description: Payload id, stable across retries.
        - name: X-ProjectFlow-Event-Type
          in: header
          required: true
          schema:
            type: string
            const: project.updated
        - name: X-ProjectFlow-Delivery-Attempt
          in: header
          required: true
          schema:
            type: integer
            minimum: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/WebhookEvent'
                - properties:
                    type:
                      const: project.updated
      responses:
        '204':
          description: Acknowledged. Any 2xx counts as success.
  project.archived:
    post:
      tags:
        - Webhook events
      operationId: event_project_archived
      summary: project.archived
      description: >-
        A project moved to Completed or Canceled. Delivered at least once, without ordering guarantee. Success = HTTP 2xx within 10 s;
        redirects are not followed. Retries: 1 min, 5 min, 15 min, 30 min, 1 h, 2 h, 4 h, 8 h, 8 h; afterwards the endpoint is disabled.
      parameters:
        - name: X-ProjectFlow-Signature
          in: header
          required: true
          schema:
            type: string
          description: >-
            `t=<unix seconds>,v1=<hex HMAC-SHA256(secret, t + "." + rawBody)>`. After a secret rotation a second `v1=` appears for 24 h.
            Reject if `t` is older than 5 minutes; compare in constant time.
        - name: X-ProjectFlow-Event-Id
          in: header
          required: true
          schema:
            type: string
          description: Payload id, stable across retries.
        - name: X-ProjectFlow-Event-Type
          in: header
          required: true
          schema:
            type: string
            const: project.archived
        - name: X-ProjectFlow-Delivery-Attempt
          in: header
          required: true
          schema:
            type: integer
            minimum: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/WebhookEvent'
                - properties:
                    type:
                      const: project.archived
      responses:
        '204':
          description: Acknowledged. Any 2xx counts as success.
  project.deleted:
    post:
      tags:
        - Webhook events
      operationId: event_project_deleted
      summary: project.deleted
      description: >-
        A project was deleted. Delivered at least once, without ordering guarantee. Success = HTTP 2xx within 10 s; redirects are not
        followed. Retries: 1 min, 5 min, 15 min, 30 min, 1 h, 2 h, 4 h, 8 h, 8 h; afterwards the endpoint is disabled.
      parameters:
        - name: X-ProjectFlow-Signature
          in: header
          required: true
          schema:
            type: string
          description: >-
            `t=<unix seconds>,v1=<hex HMAC-SHA256(secret, t + "." + rawBody)>`. After a secret rotation a second `v1=` appears for 24 h.
            Reject if `t` is older than 5 minutes; compare in constant time.
        - name: X-ProjectFlow-Event-Id
          in: header
          required: true
          schema:
            type: string
          description: Payload id, stable across retries.
        - name: X-ProjectFlow-Event-Type
          in: header
          required: true
          schema:
            type: string
            const: project.deleted
        - name: X-ProjectFlow-Delivery-Attempt
          in: header
          required: true
          schema:
            type: integer
            minimum: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/WebhookEvent'
                - properties:
                    type:
                      const: project.deleted
      responses:
        '204':
          description: Acknowledged. Any 2xx counts as success.
  task.created:
    post:
      tags:
        - Webhook events
      operationId: event_task_created
      summary: task.created
      description: >-
        A task was created. Delivered at least once, without ordering guarantee. Success = HTTP 2xx within 10 s; redirects are not followed.
        Retries: 1 min, 5 min, 15 min, 30 min, 1 h, 2 h, 4 h, 8 h, 8 h; afterwards the endpoint is disabled.
      parameters:
        - name: X-ProjectFlow-Signature
          in: header
          required: true
          schema:
            type: string
          description: >-
            `t=<unix seconds>,v1=<hex HMAC-SHA256(secret, t + "." + rawBody)>`. After a secret rotation a second `v1=` appears for 24 h.
            Reject if `t` is older than 5 minutes; compare in constant time.
        - name: X-ProjectFlow-Event-Id
          in: header
          required: true
          schema:
            type: string
          description: Payload id, stable across retries.
        - name: X-ProjectFlow-Event-Type
          in: header
          required: true
          schema:
            type: string
            const: task.created
        - name: X-ProjectFlow-Delivery-Attempt
          in: header
          required: true
          schema:
            type: integer
            minimum: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/WebhookEvent'
                - properties:
                    type:
                      const: task.created
      responses:
        '204':
          description: Acknowledged. Any 2xx counts as success.
  task.updated:
    post:
      tags:
        - Webhook events
      operationId: event_task_updated
      summary: task.updated
      description: >-
        A task changed (status, title, due date, priority, unassigned). Delivered at least once, without ordering guarantee. Success = HTTP
        2xx within 10 s; redirects are not followed. Retries: 1 min, 5 min, 15 min, 30 min, 1 h, 2 h, 4 h, 8 h, 8 h; afterwards the endpoint
        is disabled.
      parameters:
        - name: X-ProjectFlow-Signature
          in: header
          required: true
          schema:
            type: string
          description: >-
            `t=<unix seconds>,v1=<hex HMAC-SHA256(secret, t + "." + rawBody)>`. After a secret rotation a second `v1=` appears for 24 h.
            Reject if `t` is older than 5 minutes; compare in constant time.
        - name: X-ProjectFlow-Event-Id
          in: header
          required: true
          schema:
            type: string
          description: Payload id, stable across retries.
        - name: X-ProjectFlow-Event-Type
          in: header
          required: true
          schema:
            type: string
            const: task.updated
        - name: X-ProjectFlow-Delivery-Attempt
          in: header
          required: true
          schema:
            type: integer
            minimum: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/WebhookEvent'
                - properties:
                    type:
                      const: task.updated
      responses:
        '204':
          description: Acknowledged. Any 2xx counts as success.
  task.completed:
    post:
      tags:
        - Webhook events
      operationId: event_task_completed
      summary: task.completed
      description: >-
        A task was completed. Delivered at least once, without ordering guarantee. Success = HTTP 2xx within 10 s; redirects are not
        followed. Retries: 1 min, 5 min, 15 min, 30 min, 1 h, 2 h, 4 h, 8 h, 8 h; afterwards the endpoint is disabled.
      parameters:
        - name: X-ProjectFlow-Signature
          in: header
          required: true
          schema:
            type: string
          description: >-
            `t=<unix seconds>,v1=<hex HMAC-SHA256(secret, t + "." + rawBody)>`. After a secret rotation a second `v1=` appears for 24 h.
            Reject if `t` is older than 5 minutes; compare in constant time.
        - name: X-ProjectFlow-Event-Id
          in: header
          required: true
          schema:
            type: string
          description: Payload id, stable across retries.
        - name: X-ProjectFlow-Event-Type
          in: header
          required: true
          schema:
            type: string
            const: task.completed
        - name: X-ProjectFlow-Delivery-Attempt
          in: header
          required: true
          schema:
            type: integer
            minimum: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/WebhookEvent'
                - properties:
                    type:
                      const: task.completed
      responses:
        '204':
          description: Acknowledged. Any 2xx counts as success.
  task.reopened:
    post:
      tags:
        - Webhook events
      operationId: event_task_reopened
      summary: task.reopened
      description: >-
        A completed task was reopened. Delivered at least once, without ordering guarantee. Success = HTTP 2xx within 10 s; redirects are
        not followed. Retries: 1 min, 5 min, 15 min, 30 min, 1 h, 2 h, 4 h, 8 h, 8 h; afterwards the endpoint is disabled.
      parameters:
        - name: X-ProjectFlow-Signature
          in: header
          required: true
          schema:
            type: string
          description: >-
            `t=<unix seconds>,v1=<hex HMAC-SHA256(secret, t + "." + rawBody)>`. After a secret rotation a second `v1=` appears for 24 h.
            Reject if `t` is older than 5 minutes; compare in constant time.
        - name: X-ProjectFlow-Event-Id
          in: header
          required: true
          schema:
            type: string
          description: Payload id, stable across retries.
        - name: X-ProjectFlow-Event-Type
          in: header
          required: true
          schema:
            type: string
            const: task.reopened
        - name: X-ProjectFlow-Delivery-Attempt
          in: header
          required: true
          schema:
            type: integer
            minimum: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/WebhookEvent'
                - properties:
                    type:
                      const: task.reopened
      responses:
        '204':
          description: Acknowledged. Any 2xx counts as success.
  task.assigned:
    post:
      tags:
        - Webhook events
      operationId: event_task_assigned
      summary: task.assigned
      description: >-
        A task was assigned. Delivered at least once, without ordering guarantee. Success = HTTP 2xx within 10 s; redirects are not
        followed. Retries: 1 min, 5 min, 15 min, 30 min, 1 h, 2 h, 4 h, 8 h, 8 h; afterwards the endpoint is disabled.
      parameters:
        - name: X-ProjectFlow-Signature
          in: header
          required: true
          schema:
            type: string
          description: >-
            `t=<unix seconds>,v1=<hex HMAC-SHA256(secret, t + "." + rawBody)>`. After a secret rotation a second `v1=` appears for 24 h.
            Reject if `t` is older than 5 minutes; compare in constant time.
        - name: X-ProjectFlow-Event-Id
          in: header
          required: true
          schema:
            type: string
          description: Payload id, stable across retries.
        - name: X-ProjectFlow-Event-Type
          in: header
          required: true
          schema:
            type: string
            const: task.assigned
        - name: X-ProjectFlow-Delivery-Attempt
          in: header
          required: true
          schema:
            type: integer
            minimum: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/WebhookEvent'
                - properties:
                    type:
                      const: task.assigned
      responses:
        '204':
          description: Acknowledged. Any 2xx counts as success.
  task.deleted:
    post:
      tags:
        - Webhook events
      operationId: event_task_deleted
      summary: task.deleted
      description: >-
        A task was deleted. Delivered at least once, without ordering guarantee. Success = HTTP 2xx within 10 s; redirects are not followed.
        Retries: 1 min, 5 min, 15 min, 30 min, 1 h, 2 h, 4 h, 8 h, 8 h; afterwards the endpoint is disabled.
      parameters:
        - name: X-ProjectFlow-Signature
          in: header
          required: true
          schema:
            type: string
          description: >-
            `t=<unix seconds>,v1=<hex HMAC-SHA256(secret, t + "." + rawBody)>`. After a secret rotation a second `v1=` appears for 24 h.
            Reject if `t` is older than 5 minutes; compare in constant time.
        - name: X-ProjectFlow-Event-Id
          in: header
          required: true
          schema:
            type: string
          description: Payload id, stable across retries.
        - name: X-ProjectFlow-Event-Type
          in: header
          required: true
          schema:
            type: string
            const: task.deleted
        - name: X-ProjectFlow-Delivery-Attempt
          in: header
          required: true
          schema:
            type: integer
            minimum: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/WebhookEvent'
                - properties:
                    type:
                      const: task.deleted
      responses:
        '204':
          description: Acknowledged. Any 2xx counts as success.
  milestone.created:
    post:
      tags:
        - Webhook events
      operationId: event_milestone_created
      summary: milestone.created
      description: >-
        A milestone was created. Delivered at least once, without ordering guarantee. Success = HTTP 2xx within 10 s; redirects are not
        followed. Retries: 1 min, 5 min, 15 min, 30 min, 1 h, 2 h, 4 h, 8 h, 8 h; afterwards the endpoint is disabled.
      parameters:
        - name: X-ProjectFlow-Signature
          in: header
          required: true
          schema:
            type: string
          description: >-
            `t=<unix seconds>,v1=<hex HMAC-SHA256(secret, t + "." + rawBody)>`. After a secret rotation a second `v1=` appears for 24 h.
            Reject if `t` is older than 5 minutes; compare in constant time.
        - name: X-ProjectFlow-Event-Id
          in: header
          required: true
          schema:
            type: string
          description: Payload id, stable across retries.
        - name: X-ProjectFlow-Event-Type
          in: header
          required: true
          schema:
            type: string
            const: milestone.created
        - name: X-ProjectFlow-Delivery-Attempt
          in: header
          required: true
          schema:
            type: integer
            minimum: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/WebhookEvent'
                - properties:
                    type:
                      const: milestone.created
      responses:
        '204':
          description: Acknowledged. Any 2xx counts as success.
  milestone.updated:
    post:
      tags:
        - Webhook events
      operationId: event_milestone_updated
      summary: milestone.updated
      description: >-
        A milestone changed. Delivered at least once, without ordering guarantee. Success = HTTP 2xx within 10 s; redirects are not
        followed. Retries: 1 min, 5 min, 15 min, 30 min, 1 h, 2 h, 4 h, 8 h, 8 h; afterwards the endpoint is disabled.
      parameters:
        - name: X-ProjectFlow-Signature
          in: header
          required: true
          schema:
            type: string
          description: >-
            `t=<unix seconds>,v1=<hex HMAC-SHA256(secret, t + "." + rawBody)>`. After a secret rotation a second `v1=` appears for 24 h.
            Reject if `t` is older than 5 minutes; compare in constant time.
        - name: X-ProjectFlow-Event-Id
          in: header
          required: true
          schema:
            type: string
          description: Payload id, stable across retries.
        - name: X-ProjectFlow-Event-Type
          in: header
          required: true
          schema:
            type: string
            const: milestone.updated
        - name: X-ProjectFlow-Delivery-Attempt
          in: header
          required: true
          schema:
            type: integer
            minimum: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/WebhookEvent'
                - properties:
                    type:
                      const: milestone.updated
      responses:
        '204':
          description: Acknowledged. Any 2xx counts as success.
  milestone.completed:
    post:
      tags:
        - Webhook events
      operationId: event_milestone_completed
      summary: milestone.completed
      description: >-
        A milestone was completed. Delivered at least once, without ordering guarantee. Success = HTTP 2xx within 10 s; redirects are not
        followed. Retries: 1 min, 5 min, 15 min, 30 min, 1 h, 2 h, 4 h, 8 h, 8 h; afterwards the endpoint is disabled.
      parameters:
        - name: X-ProjectFlow-Signature
          in: header
          required: true
          schema:
            type: string
          description: >-
            `t=<unix seconds>,v1=<hex HMAC-SHA256(secret, t + "." + rawBody)>`. After a secret rotation a second `v1=` appears for 24 h.
            Reject if `t` is older than 5 minutes; compare in constant time.
        - name: X-ProjectFlow-Event-Id
          in: header
          required: true
          schema:
            type: string
          description: Payload id, stable across retries.
        - name: X-ProjectFlow-Event-Type
          in: header
          required: true
          schema:
            type: string
            const: milestone.completed
        - name: X-ProjectFlow-Delivery-Attempt
          in: header
          required: true
          schema:
            type: integer
            minimum: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/WebhookEvent'
                - properties:
                    type:
                      const: milestone.completed
      responses:
        '204':
          description: Acknowledged. Any 2xx counts as success.
  comment.created:
    post:
      tags:
        - Webhook events
      operationId: event_comment_created
      summary: comment.created
      description: >-
        A comment was added. `data` carries `targetType` and `targetId`. Delivered at least once, without ordering guarantee. Success = HTTP
        2xx within 10 s; redirects are not followed. Retries: 1 min, 5 min, 15 min, 30 min, 1 h, 2 h, 4 h, 8 h, 8 h; afterwards the endpoint
        is disabled.
      parameters:
        - name: X-ProjectFlow-Signature
          in: header
          required: true
          schema:
            type: string
          description: >-
            `t=<unix seconds>,v1=<hex HMAC-SHA256(secret, t + "." + rawBody)>`. After a secret rotation a second `v1=` appears for 24 h.
            Reject if `t` is older than 5 minutes; compare in constant time.
        - name: X-ProjectFlow-Event-Id
          in: header
          required: true
          schema:
            type: string
          description: Payload id, stable across retries.
        - name: X-ProjectFlow-Event-Type
          in: header
          required: true
          schema:
            type: string
            const: comment.created
        - name: X-ProjectFlow-Delivery-Attempt
          in: header
          required: true
          schema:
            type: integer
            minimum: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/WebhookEvent'
                - properties:
                    type:
                      const: comment.created
      responses:
        '204':
          description: Acknowledged. Any 2xx counts as success.
  webhook.test:
    post:
      tags:
        - Webhook events
      operationId: event_webhook_test
      summary: webhook.test
      description: >-
        Sent only by "Send test" (UI) or `POST /webhooks/{webhookId}/test`. Delivered at least once, without ordering guarantee. Success =
        HTTP 2xx within 10 s; redirects are not followed. Retries: 1 min, 5 min, 15 min, 30 min, 1 h, 2 h, 4 h, 8 h, 8 h; afterwards the
        endpoint is disabled.
      parameters:
        - name: X-ProjectFlow-Signature
          in: header
          required: true
          schema:
            type: string
          description: >-
            `t=<unix seconds>,v1=<hex HMAC-SHA256(secret, t + "." + rawBody)>`. After a secret rotation a second `v1=` appears for 24 h.
            Reject if `t` is older than 5 minutes; compare in constant time.
        - name: X-ProjectFlow-Event-Id
          in: header
          required: true
          schema:
            type: string
          description: Payload id, stable across retries.
        - name: X-ProjectFlow-Event-Type
          in: header
          required: true
          schema:
            type: string
            const: webhook.test
        - name: X-ProjectFlow-Delivery-Attempt
          in: header
          required: true
          schema:
            type: integer
            minimum: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/WebhookEvent'
                - properties:
                    type:
                      const: webhook.test
      responses:
        '204':
          description: Acknowledged. Any 2xx counts as success.
components:
  securitySchemes:
    feedbackKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: pff_...
      description: App feedback key (Settings > API > App feedback keys). Only valid for `POST /feedback` into its one project.
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: pfat_...
      description: >-
        Workspace API token. Scopes: `read`, `projects:write`, `tasks:write`, `external:write`, `webhooks:manage`. OAuth access tokens and
        personal access tokens (MCP) work for projects, tasks and initiatives only.
  schemas:
    AgentPersona:
      type: object
      description: A persona of the account ("My team"); a label on writes of its owner, never a principal.
      properties:
        id: { type: string }
        ownerId: { type: string }
        name: { type: string, minLength: 2, maxLength: 32 }
        nameKey: { type: string }
        aliases: { type: array, items: { type: string } }
        colorIndex: { type: integer, minimum: 1, maximum: 10 }
        emoji: { type: string }
        role: { type: string, maxLength: 80 }
        client: { type: string }
        status: { type: string, enum: [active, archived] }
        createdVia: { type: string, enum: [manual, auto] }
        createdAt: { type: string, format: date-time }
        updatedAt: { type: string, format: date-time }
        archivedAt: { type: string, format: date-time }
        lastUsedAt: { type: string, format: date-time }
        workspaceIds: { type: array, items: { type: string } }
    WorkspaceAgentPersona:
      type: object
      description: Workspace projection of a persona (created on its first write in the workspace).
      properties:
        personaId: { type: string }
        ownerId: { type: string }
        ownerName: { type: string }
        name: { type: string }
        colorIndex: { type: integer, minimum: 1, maximum: 10 }
        emoji: { type: string }
        role: { type: string }
        status: { type: string, enum: [active, archived, blocked] }
        firstUsedAt: { type: string, format: date-time }
        lastUsedAt: { type: string, format: date-time }
    PersonaWriteBody:
      type: object
      properties:
        name: { type: string }
        role: { type: string, maxLength: 80 }
        emoji: { type: string }
        colorIndex: { type: integer, minimum: 1, maximum: 10 }
        aliases: { type: array, items: { type: string } }
        status: { type: string, enum: [active, archived] }
    External:
      type: object
      description: External reference to an object in another system.
      additionalProperties: false
      properties:
        customerId:
          type: string
        ref:
          type: string
          maxLength: 200
        label:
          type: string
          maxLength: 120
        url:
          type: string
          format: uri
          maxLength: 2048
          description: http or https.
        meta:
          type: object
          description: Flat object, max 20 keys; values string (max 500), number, boolean or null.
          additionalProperties:
            type:
              - string
              - number
              - boolean
              - 'null'
    ExternalMap:
      type: object
      description: External references by source. Source keys match `^[a-z][a-z0-9_-]{1,31}$`, max 5.
      additionalProperties:
        $ref: '#/components/schemas/External'
      propertyNames:
        pattern: ^[a-z][a-z0-9_-]{1,31}$
    ExternalInput:
      type: object
      description: Write form of `external` (scope `external:write`). Each source is replaced as a whole, other sources stay; `null` removes a source.
      additionalProperties:
        oneOf:
          - $ref: '#/components/schemas/External'
          - type: 'null'
    FeedbackReport:
      type: object
      required:
        - title
        - category
        - reporter
        - context
      properties:
        title:
          type: string
          maxLength: 120
        description:
          type: string
          maxLength: 5000
        category:
          type: string
          enum:
            - bug
            - idea
            - question
            - other
        reporter:
          type: object
          required:
            - installId
          properties:
            name:
              type: string
              maxLength: 100
            email:
              type: string
              format: email
            installId:
              type: string
              pattern: '^[A-Za-z0-9._:-]{4,100}$'
        context:
          type: object
          required:
            - app
            - appVersion
            - build
            - platform
            - osVersion
            - device
            - locale
            - country
            - route
            - timestamp
          properties:
            app:
              type: string
              maxLength: 60
            appVersion:
              type: string
              maxLength: 40
            build:
              type: string
              maxLength: 40
            platform:
              type: string
              maxLength: 40
            osVersion:
              type: string
              maxLength: 40
            device:
              type: string
              maxLength: 80
            locale:
              type: string
              maxLength: 35
            country:
              type: string
              maxLength: 10
            route:
              type: string
              maxLength: 300
            timestamp:
              type: string
              format: date-time
            extra:
              type: object
              maxProperties: 20
              additionalProperties:
                type: string
                maxLength: 300
    FeedbackTicket:
      type: object
      required:
        - ticketId
        - taskId
        - url
      properties:
        ticketId:
          type: string
        taskId:
          type: string
        url:
          type: string
          format: uri
    FeedbackError:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: string
        message:
          type: string
        details:
          type: array
          items:
            type: string
    Error:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          const: false
        error:
          type: object
          required:
            - code
            - message
            - status
          properties:
            code:
              type: string
              description: >-
                Machine-readable code, e.g. `invalid_request`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`,
                `daily_write_limit`, `internal_error`, `plan-api-read-only`, `plan-api-disabled`, `plan-webhooks`, `plan-project-limit`.
            message:
              type: string
            status:
              type: integer
            details:
              type: object
              additionalProperties: true
              description: Extra fields, e.g. `retryAfter`.
        requestId:
          type: string
    Project:
      type: object
      additionalProperties: true
      description: A project. The stored document may carry more fields than listed.
      required:
        - id
      properties:
        id:
          type: string
        title:
          type: string
        description:
          type: string
        status:
          type: string
        priority:
          type: string
        startDate:
          type: string
        dueDate:
          type: string
        isPrivate:
          type: boolean
        memberIds:
          type: array
          items:
            type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        external:
          $ref: '#/components/schemas/ExternalMap'
    ProjectInput:
      type: object
      additionalProperties: true
      properties:
        title:
          type: string
        description:
          type: string
        status:
          type: string
        projectState:
          type: string
        projectType:
          type: string
        projectCategory:
          type: string
        templateId:
          type: string
        operatingMode:
          type: string
        brief:
          type: object
          additionalProperties: true
        dueDate:
          type: string
        startDate:
          type: string
        priority:
          type: string
        isPrivate:
          type: boolean
        modules:
          type: object
          additionalProperties: true
        links:
          type: array
          items:
            type: object
            additionalProperties: true
        visibilityGroupIds:
          type: array
          items:
            type: string
        githubRepo:
          type: object
          additionalProperties: true
        members:
          type: array
          items:
            type: object
            additionalProperties: true
        memberIds:
          type: array
          items:
            type: string
        roles:
          type: object
          additionalProperties: true
        external:
          $ref: '#/components/schemas/ExternalInput'
    Task:
      type: object
      additionalProperties: true
      description: A task. The stored document may carry more fields than listed.
      required:
        - id
      properties:
        id:
          type: string
        projectId:
          type: string
        title:
          type: string
        description:
          type: string
        status:
          type: string
        priority:
          type: string
        startDate:
          type: string
        dueDate:
          type: string
        isCompleted:
          type: boolean
        assigneeIds:
          type: array
          items:
            type: string
        category:
          type: string
        sprintId:
          type: string
        initiativeId:
          type: string
        dependencies:
          type: array
          items:
            type: string
        externalKey:
          type: string
        source:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        external:
          $ref: '#/components/schemas/ExternalMap'
        recurrence:
          $ref: '#/components/schemas/TaskRecurrence'
    TaskRecurrence:
      type: object
      description: >-
        Repeat rule of a recurring task (stored on every instance of the series). The next instance is created when
        this one is completed, and with mode `fixed` also at local midnight of this instance's day. Instance ids are
        deterministic (`<seriesId>__r<index>`), so there is exactly one task per occurrence.
      properties:
        rule:
          type: string
          example: FREQ=WEEKLY;BYDAY=MO,TH
          description: >-
            RRULE subset. FREQ=DAILY|WEEKLY|MONTHLY|YEARLY (required); INTERVAL=1..999; BYDAY = weekday list (WEEKLY,
            e.g. MO,TU,WE,TH,FR for weekdays) or one nth weekday (MONTHLY, 1MO..4MO, -1FR = last Friday);
            BYMONTHDAY=1..31 or -1 (MONTHLY; days past the month end fall on its last day); COUNT=1..1000 or
            UNTIL=YYYYMMDD (inclusive). Yearly on 29 Feb falls on 28 Feb in common years.
        mode:
          type: string
          enum: [fixed, afterCompletion]
          description: fixed follows the calendar; afterCompletion counts INTERVAL from the local completion day.
        timeZone:
          type: string
          description: IANA zone of the series (decides "today" and the completion day). Read-only after creation unless sent.
        seriesId:
          type: string
          readOnly: true
        index:
          type: integer
          readOnly: true
        anchor:
          type: string
          readOnly: true
        occurrence:
          type: string
          readOnly: true
          description: Scheduled day of this instance (YYYY-MM-DD).
    TaskRecurrenceInput:
      type: object
      nullable: true
      description: Send `{ rule, mode?, timeZone? }` to make a task repeat or change its rule; `null` stops repeating.
      required: [rule]
      properties:
        rule:
          type: string
          example: FREQ=MONTHLY;BYMONTHDAY=-1
        mode:
          type: string
          enum: [fixed, afterCompletion]
          default: fixed
        timeZone:
          type: string
    TaskInput:
      type: object
      additionalProperties: true
      properties:
        recurrence:
          $ref: '#/components/schemas/TaskRecurrenceInput'
        title:
          type: string
        description:
          type: string
        status:
          type: string
        priority:
          type: string
        startDate:
          type: string
        dueDate:
          type: string
        isCompleted:
          type: boolean
        assignee:
          type: string
        assigneeId:
          type: string
        assigneeIds:
          type: array
          items:
            type: string
        assignedGroupIds:
          type: array
          items:
            type: string
        category:
          type: string
        dependencies:
          type: array
          items:
            type: string
        sprintId:
          type: string
        initiativeId:
          type: string
        externalKey:
          type: string
          description: Idempotency handle for `upsert-by-external-key`.
        source:
          type: string
        external:
          $ref: '#/components/schemas/ExternalInput'
    Subtask:
      type: object
      additionalProperties: true
      description: A subtask. The stored document may carry more fields than listed.
      required:
        - id
      properties:
        id:
          type: string
        title:
          type: string
        isCompleted:
          type: boolean
        assigneeId:
          type: string
        completedBy:
          type: string
        completedAt:
          type: string
          format: date-time
        createdAt:
          type: string
          format: date-time
    SubtaskInput:
      type: object
      additionalProperties: true
      properties:
        title:
          type: string
        isCompleted:
          type: boolean
        assigneeId:
          type: string
        completedBy:
          type: string
        completedAt:
          type: string
          format: date-time
    Initiative:
      type: object
      additionalProperties: true
      description: An initiative. The stored document may carry more fields than listed.
      required:
        - id
      properties:
        id:
          type: string
        title:
          type: string
        description:
          type: string
        status:
          type: string
        priority:
          type: string
        startDate:
          type: string
        dueDate:
          type: string
        assigneeIds:
          type: array
          items:
            type: string
        externalKey:
          type: string
        health:
          type: string
        successMetric:
          type: string
        outcome:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    InitiativeInput:
      type: object
      additionalProperties: true
      properties:
        title:
          type: string
        description:
          type: string
        status:
          type: string
        priority:
          type: string
        startDate:
          type: string
        dueDate:
          type: string
        assigneeIds:
          type: array
          items:
            type: string
        assignedGroupIds:
          type: array
          items:
            type: string
        externalKey:
          type: string
        source:
          type: string
        successMetric:
          type: string
        outcome:
          type: string
        health:
          type: string
        completedAt:
          type: string
          format: date-time
    Milestone:
      type: object
      additionalProperties: true
      description: A milestone. The stored document may carry more fields than listed.
      required:
        - id
      properties:
        id:
          type: string
        title:
          type: string
        description:
          type: string
        status:
          type: string
          description: Default `Pending`.
        dueDate:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        external:
          $ref: '#/components/schemas/ExternalMap'
    MilestoneInput:
      type: object
      additionalProperties: true
      required:
        - title
      properties:
        title:
          type: string
        description:
          type: string
        status:
          type: string
        dueDate:
          type: string
        external:
          $ref: '#/components/schemas/ExternalInput'
    Sprint:
      type: object
      additionalProperties: true
      description: A sprint. The stored document may carry more fields than listed.
      required:
        - id
      properties:
        id:
          type: string
        name:
          type: string
        status:
          type: string
          description: Default `Planning`.
        startDate:
          type: string
        endDate:
          type: string
        goal:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    SprintInput:
      type: object
      additionalProperties: true
      required:
        - name
      properties:
        name:
          type: string
        status:
          type: string
        startDate:
          type: string
        endDate:
          type: string
        goal:
          type: string
    Category:
      type: object
      additionalProperties: true
      description: A task category. The stored document may carry more fields than listed.
      required:
        - id
      properties:
        id:
          type: string
        name:
          type: string
        color:
          type: string
        createdAt:
          type: string
          format: date-time
    CategoryInput:
      type: object
      additionalProperties: true
      required:
        - name
      properties:
        name:
          type: string
        color:
          type: string
    ProjectGroup:
      type: object
      additionalProperties: true
      description: A group of project members. The stored document may carry more fields than listed.
      required:
        - id
      properties:
        id:
          type: string
        name:
          type: string
        memberIds:
          type: array
          items:
            type: string
        createdAt:
          type: string
          format: date-time
    ProjectGroupInput:
      type: object
      additionalProperties: true
      required:
        - name
      properties:
        name:
          type: string
        memberIds:
          type: array
          items:
            type: string
    Comment:
      type: object
      additionalProperties: true
      description: A comment on a task, milestone or other object. The stored document may carry more fields than listed.
      required:
        - id
      properties:
        id:
          type: string
        content:
          type: string
        targetId:
          type: string
        targetType:
          type: string
        userId:
          type: string
        userDisplayName:
          type: string
        createdAt:
          type: string
          format: date-time
    CommentInput:
      type: object
      additionalProperties: true
      required:
        - content
        - targetId
        - targetType
      properties:
        content:
          type: string
        targetId:
          type: string
        targetType:
          type: string
          description: e.g. `task`.
    Activity:
      type: object
      additionalProperties: true
      description: An entry of the project activity stream. The stored document may carry more fields than listed.
      required:
        - id
      properties:
        id:
          type: string
        message:
          type: string
        target:
          type: string
        targetId:
          type: string
        userId:
          type: string
        createdAt:
          type: string
          format: date-time
    Member:
      type: object
      required:
        - id
        - name
        - role
      properties:
        id:
          type: string
          description: User id (use as assigneeIds / memberIds).
        name:
          type: string
        email:
          type: string
        role:
          type: string
          enum:
            - Owner
            - Admin
            - Member
            - Guest
        title:
          type: string
    WikiPage:
      type: object
      required:
        - id
        - title
        - space
      properties:
        id:
          type: string
        title:
          type: string
        icon:
          type: string
        space:
          type: string
          enum:
            - workspace
            - project
        projectId:
          type: string
        parentId:
          type: string
        excerpt:
          type: string
        linkedTaskRefs:
          type: array
          items:
            type: string
        archived:
          type: boolean
        revision:
          type: integer
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    File:
      type: object
      additionalProperties: true
      description: File metadata. Storage paths and provider handles are stripped. The stored document may carry more fields than listed.
      required:
        - id
      properties:
        id:
          type: string
        name:
          type: string
        projectId:
          type: string
        mimeType:
          type: string
        size:
          type: integer
        createdAt:
          type: string
          format: date-time
    Form:
      type: object
      additionalProperties: true
      description: A form. The stored document may carry more fields than listed.
      required:
        - id
      properties:
        id:
          type: string
        title:
          type: string
        status:
          type: string
        definition:
          type: object
          additionalProperties: true
          description: Published version (only on `GET /forms/{formId}`).
        createdAt:
          type: string
          format: date-time
    FormResponse:
      type: object
      additionalProperties: true
      description: A form submission. IP and user agent are stripped. The stored document may carry more fields than listed.
      required:
        - id
      properties:
        id:
          type: string
        formId:
          type: string
        status:
          type: string
        answers:
          type: object
          additionalProperties: true
        createdAt:
          type: string
          format: date-time
    WebhookEventType:
      type: string
      enum:
        - project.created
        - project.updated
        - project.archived
        - project.deleted
        - task.created
        - task.updated
        - task.completed
        - task.reopened
        - task.assigned
        - task.deleted
        - milestone.created
        - milestone.updated
        - milestone.completed
        - comment.created
    WebhookInput:
      type: object
      required:
        - url
        - events
      properties:
        url:
          type: string
          description: HTTPS endpoint.
          format: uri
        events:
          type: array
          items:
            $ref: '#/components/schemas/WebhookEventType'
        description:
          type: string
    Webhook:
      type: object
      additionalProperties: true
      properties:
        id:
          type: string
        url:
          type: string
        events:
          type: array
          items:
            $ref: '#/components/schemas/WebhookEventType'
        description:
          type: string
        enabled:
          type: boolean
        createdAt:
          type: string
          format: date-time
    WebhookDelivery:
      type: object
      additionalProperties: true
      properties:
        id:
          type: string
        eventId:
          type: string
        eventType:
          type: string
        status:
          type: string
          enum:
            - pending
            - succeeded
            - failed
        responseCode:
          type:
            - integer
            - 'null'
        durationMs:
          type: integer
        attempts:
          type: integer
        error:
          type:
            - string
            - 'null'
        createdAt:
          type: string
          format: date-time
    CodexSession:
      type: object
      additionalProperties: true
      description: A coding-agent session. The stored document may carry more fields than listed.
      required:
        - id
      properties:
        id:
          type: string
        title:
          type: string
        status:
          type: string
          enum:
            - running
            - completed
            - blocked
            - partial
        externalKey:
          type: string
        summary:
          type: string
        repoPath:
          type: string
        branch:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    CodexFollowup:
      type: object
      additionalProperties: true
      description: A follow-up created by a coding-agent session. The stored document may carry more fields than listed.
      required:
        - id
      properties:
        id:
          type: string
        title:
          type: string
        description:
          type: string
        sessionId:
          type: string
        createdAt:
          type: string
          format: date-time
    WebhookActor:
      type: object
      required:
        - type
        - id
      properties:
        type:
          type: string
          enum:
            - user
            - integration
            - flow
          description: '`integration` covers API tokens and AI clients.'
        id:
          type:
            - string
            - 'null'
          description: User id, token creator uid or flow id; null when unknown.
        tokenId:
          type: string
          description: Set for workspace API tokens. Ignore events with your own tokenId (echo protection).
    WebhookEvent:
      type: object
      required:
        - id
        - type
        - occurredAt
        - tenantId
        - actor
        - data
      properties:
        id:
          type: string
          description: Stable across retries; deduplicate by it.
        type:
          $ref: '#/components/schemas/WebhookEventType'
        occurredAt:
          type: string
          format: date-time
        tenantId:
          type: string
        actor:
          $ref: '#/components/schemas/WebhookActor'
        data:
          type: object
          description: 'Current state of the object at delivery time (deleted objects: last known title).'
          additionalProperties: true
          properties:
            id:
              type: string
            projectId:
              type: string
            title:
              type: string
            status:
              type:
                - string
                - 'null'
            dueDate:
              type: string
            assigneeIds:
              type: array
              items:
                type: string
            external:
              $ref: '#/components/schemas/ExternalMap'
            url:
              type: string
              format: uri
            targetType:
              type: string
              description: Comments only.
            targetId:
              type: string
              description: Comments only.
        changes:
          type: object
          description: Changed fields, `{ from, to }` each.
          additionalProperties:
            type: object
            properties:
              from: {}
              to: {}
  parameters:
    PersonaHeader:
      name: X-ProjectFlow-Persona
      in: header
      required: false
      description: >-
        Agent persona the write is attributed to ("Mira · agent of <you>"): a persona name or `id:<personaId>` of the token owner
        (auto-created when unknown unless switched off in "My team"). Only user-bound credentials (OAuth, personal token) and only
        on writes; a workspace API token gets `400 persona-requires-user-token`. Errors `persona-invalid-name` 400,
        `persona-not-found` 404, `persona-archived` 409, `persona-limit` 429. When the workspace policy `personas` is off or the
        persona is blocked, the write succeeds without persona and the response carries `X-ProjectFlow-Persona-Ignored: policy|blocked`.
      schema:
        type: string
        maxLength: 80
    Limit:
      name: limit
      in: query
      description: Page size.
      schema:
        type: integer
        minimum: 1
        maximum: 200
        default: 100
    Cursor:
      name: cursor
      in: query
      description: Opaque cursor from the previous response's `nextCursor`.
      schema:
        type: string
    ProjectId:
      name: projectId
      in: path
      required: true
      schema:
        type: string
    TaskId:
      name: taskId
      in: path
      required: true
      schema:
        type: string
    SubtaskId:
      name: subtaskId
      in: path
      required: true
      schema:
        type: string
    InitiativeId:
      name: initiativeId
      in: path
      required: true
      schema:
        type: string
    MilestoneId:
      name: milestoneId
      in: path
      required: true
      schema:
        type: string
    SprintId:
      name: sprintId
      in: path
      required: true
      schema:
        type: string
    CategoryId:
      name: categoryId
      in: path
      required: true
      schema:
        type: string
    GroupId:
      name: groupId
      in: path
      required: true
      schema:
        type: string
    CommentId:
      name: commentId
      in: path
      required: true
      schema:
        type: string
    DocId:
      name: docId
      in: path
      required: true
      schema:
        type: string
      description: Wiki page id.
    FileId:
      name: fileId
      in: path
      required: true
      schema:
        type: string
    FormId:
      name: formId
      in: path
      required: true
      schema:
        type: string
    WebhookId:
      name: webhookId
      in: path
      required: true
      schema:
        type: string
    DeliveryId:
      name: deliveryId
      in: path
      required: true
      schema:
        type: string
    SessionId:
      name: sessionId
      in: path
      required: true
      schema:
        type: string
  headers:
    XRequestId:
      description: Request id; echoes a sent `X-Request-Id`.
      schema:
        type: string
    XApiVersion:
      description: API major version.
      schema:
        type: string
        const: '1'
    XRateLimitLimit:
      description: Size of the token bucket.
      schema:
        type: integer
    XRateLimitRemaining:
      description: Requests left in the bucket.
      schema:
        type: integer
    XRateLimitReset:
      description: Seconds until the bucket is full again.
      schema:
        type: integer
    RetryAfter:
      description: Seconds to wait before retrying (429).
      schema:
        type: integer
  responses:
    BadRequest:
      description: '`invalid_request`: malformed body, missing field, invalid cursor.'
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
        X-RateLimit-Limit:
          $ref: '#/components/headers/XRateLimitLimit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/XRateLimitRemaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/XRateLimitReset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: '`unauthorized`: missing, invalid or revoked token.'
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
        X-RateLimit-Limit:
          $ref: '#/components/headers/XRateLimitLimit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/XRateLimitRemaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/XRateLimitReset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: >-
        `forbidden` or a plan code (`plan-api-read-only`, `plan-api-disabled`, `plan-webhooks`): missing scope or permission, or the plan
        does not allow it.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
        X-RateLimit-Limit:
          $ref: '#/components/headers/XRateLimitLimit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/XRateLimitRemaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/XRateLimitReset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: '`not_found`.'
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
        X-RateLimit-Limit:
          $ref: '#/components/headers/XRateLimitLimit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/XRateLimitRemaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/XRateLimitReset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Conflict:
      description: '`conflict`, e.g. webhook limit reached.'
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
        X-RateLimit-Limit:
          $ref: '#/components/headers/XRateLimitLimit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/XRateLimitRemaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/XRateLimitReset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: '`rate_limited` or `daily_write_limit`.'
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
        X-RateLimit-Limit:
          $ref: '#/components/headers/XRateLimitLimit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/XRateLimitRemaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/XRateLimitReset'
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
