{
  "openapi": "3.1.0",
  "info": {
    "title": "Flow Relay API",
    "version": "1.0.0",
    "description": "Project-scoped REST API for context handoffs and AI insights. The MCP server and editor extension are clients of this same API.",
    "contact": {
      "name": "Flow Relay",
      "url": "https://www.flowrelay.it/docs"
    }
  },
  "servers": [
    {
      "url": "https://www.flowrelay.it/api/v1"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Projects"
    },
    {
      "name": "Handoffs"
    },
    {
      "name": "Insights"
    },
    {
      "name": "Events"
    },
    {
      "name": "Integrations"
    },
    {
      "name": "Jobs"
    },
    {
      "name": "Discord"
    },
    {
      "name": "Work items"
    },
    {
      "name": "Plans"
    },
    {
      "name": "Time"
    },
    {
      "name": "Reports"
    },
    {
      "name": "Portfolio"
    }
  ],
  "paths": {
    "/projects": {
      "get": {
        "operationId": "list_projects",
        "summary": "List accessible projects",
        "description": "Returns the tenant context for the key owner: account type, organization memberships and every personal or organization project the key can access (role-scoped). `key` is the prefix of the work item keys of the project (`PAY` in `PAY-12`).",
        "tags": [
          "Projects"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "example": {
                  "account_type": "business",
                  "organizations": [
                    {
                      "id": "8c2b1a90-1234-4abc-9def-0123456789ab",
                      "name": "Acme",
                      "slug": "acme",
                      "role": "admin",
                      "is_temporary_admin": false
                    }
                  ],
                  "projects": [
                    {
                      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                      "name": "Payments",
                      "slug": "payments",
                      "key": "PAY",
                      "description": "Billing and checkout",
                      "organization_id": "8c2b1a90-1234-4abc-9def-0123456789ab",
                      "organization_name": "Acme",
                      "organization_slug": "acme",
                      "project_type": "organization",
                      "access_role": "admin",
                      "created_at": "2026-05-01T09:12:00Z",
                      "updated_at": "2026-06-20T14:03:00Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "429": {
            "description": "Rate limit exceeded (60/min/key)."
          }
        }
      }
    },
    "/handoffs": {
      "get": {
        "operationId": "list_handoffs",
        "summary": "List handoffs",
        "description": "Lists handoffs across accessible projects, newest first. Without project_id it spans every project the key can access.",
        "tags": [
          "Handoffs"
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by status.",
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "archived",
                "all"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum rows to return (1–100).",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "required": false,
            "description": "Restrict to a single project.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "example": {
                  "handoffs": [
                    {
                      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                      "project_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                      "kind": "project",
                      "title": "Checkout refactor handoff",
                      "summary": "Migrated the checkout flow to the new pricing engine.",
                      "status": "active",
                      "sources": [
                        "github",
                        "linear"
                      ],
                      "key_changes": [
                        "Replaced legacy tax calc"
                      ],
                      "decisions": [
                        "Use flat per-artifact pricing"
                      ],
                      "open_questions": [
                        "Backfill historical invoices?"
                      ],
                      "next_steps": [
                        "Wire the new webhook"
                      ],
                      "completion_percentage": null,
                      "related_event_ids": [
                        "d4e5f6a7-b8c9-0123-def4-23456789013a"
                      ],
                      "scope_type": "project",
                      "project_name": "Payments",
                      "created_at": "2026-06-20T14:03:00Z",
                      "updated_at": "2026-06-20T14:03:00Z",
                      "markdown": "# Checkout refactor handoff\n\n> Migrated the checkout flow…"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The body or a query parameter is invalid: an unknown field, an unknown source, an unsupported filter dimension or an out-of-range number. The response names the offending field and lists the allowed values."
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "404": {
            "description": "Project not found or not accessible by this key."
          }
        }
      },
      "post": {
        "operationId": "create_handoff",
        "summary": "Generate a handoff",
        "description": "Enqueues a project handoff generation and returns a job id. Poll GET /jobs/{jobId} until status is completed. When sources/filters are omitted the project saved scope preferences are used.",
        "tags": [
          "Handoffs"
        ],
        "parameters": [],
        "responses": {
          "202": {
            "description": "Accepted – job enqueued.",
            "content": {
              "application/json": {
                "example": {
                  "jobId": "c3d4e5f6-a7b8-9012-cdef-123456789012",
                  "status": "pending"
                }
              }
            }
          },
          "400": {
            "description": "project_id is missing or invalid, or the body failed validation (unknown field / source / filter value). The response names the field and lists allowed values."
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "404": {
            "description": "Project not found or not accessible by this key."
          },
          "429": {
            "description": "Rate limit exceeded (60/min/key)."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "project_id": {
                    "type": "string",
                    "description": "Project UUID to generate the handoff for (from GET /projects)."
                  },
                  "sources": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "github",
                        "slack",
                        "discord",
                        "linear",
                        "notion",
                        "jira",
                        "gitlab",
                        "bitbucket",
                        "azure_devops",
                        "figma",
                        "confluence",
                        "microsoft_outlook",
                        "microsoft_teams",
                        "sentry",
                        "datadog",
                        "pagerduty",
                        "asana",
                        "gmail",
                        "buildkite",
                        "circleci",
                        "vercel",
                        "incident_io",
                        "netlify",
                        "render",
                        "railway",
                        "cloudflare_pages",
                        "clickup",
                        "monday_com",
                        "shortcut",
                        "intercom",
                        "zendesk",
                        "snyk",
                        "fireflies",
                        "zoom",
                        "grafana",
                        "google_calendar",
                        "google_drive",
                        "launchdarkly",
                        "hcp_terraform",
                        "sonarqube",
                        "miro",
                        "new_relic",
                        "jira_service_management",
                        "posthog",
                        "hubspot",
                        "salesforce",
                        "heroku",
                        "alertmanager",
                        "pulumi",
                        "google_meet",
                        "microsoft_teams_meetings",
                        "fathom"
                      ]
                    },
                    "description": "Restrict generation to these sources. Each must be a known source id; an unknown value is rejected with 400 (not silently ignored). Omit to use every connected source."
                  },
                  "filters": {
                    "$ref": "#/components/schemas/SourceFilter",
                    "description": "Per-source projects / eventTypes / branches / priorities (AND-combined). Keys must be source ids (unknown keys are rejected with 400); the values are provider-driven and matched leniently – an unmatched value simply returns no events. Fetch GET /handoffs/filters for the set selectable on a project."
                  }
                },
                "required": [
                  "project_id"
                ]
              },
              "example": {
                "project_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                "sources": [
                  "github",
                  "linear"
                ],
                "filters": {
                  "github": {
                    "branches": [
                      "main"
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/handoffs/filters": {
      "get": {
        "operationId": "handoff_filters",
        "summary": "List selectable filter options",
        "description": "Returns the real selectable filter values per connected source for a project: resources (repos / channels / boards / Figma files), branches, event types, and priorities. Use these to build a valid SourceFilter instead of guessing. The response also carries a \"figma\" availability block: Figma can be selected only on projects in the Global processing region, and selecting it attaches visual context (frame renders) at a flat 1-credit surcharge.",
        "tags": [
          "Handoffs"
        ],
        "parameters": [
          {
            "name": "project_id",
            "in": "query",
            "required": true,
            "description": "Project UUID (from GET /projects) to resolve filter options for.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "example": {
                  "filters": {
                    "github": {
                      "projects": [
                        {
                          "id": "acme/payments",
                          "label": "acme/payments"
                        }
                      ],
                      "eventTypes": [
                        {
                          "value": "push",
                          "label": "Push"
                        }
                      ],
                      "priorities": [],
                      "branches": [
                        {
                          "value": "main",
                          "label": "main"
                        }
                      ]
                    },
                    "linear": {
                      "projects": [
                        {
                          "id": "f1e2d3c4-b5a6-7890-1234-567890abcdef",
                          "label": "Core"
                        }
                      ],
                      "eventTypes": [
                        {
                          "value": "issue",
                          "label": "Issue"
                        }
                      ],
                      "priorities": [
                        {
                          "value": "high",
                          "label": "High"
                        }
                      ]
                    }
                  },
                  "figma": {
                    "selectable": true,
                    "region": "default",
                    "scope": "personal",
                    "canManageResidency": true,
                    "residencyHref": "/projects/3fa85f64-5717-4562-b3fc-2c963f66afa6#data-residency"
                  }
                }
              }
            }
          },
          "400": {
            "description": "project_id is missing or not a valid UUID."
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "404": {
            "description": "Project not found or not accessible by this key."
          }
        }
      }
    },
    "/projects/{id}/insights": {
      "get": {
        "operationId": "list_insights",
        "summary": "List project insights",
        "description": "Lists AI insights for a project, newest first. Release notes and plan reviews are stored as insights too, so they show up here alongside the three analysis kinds. Optionally filter by kind and status.",
        "tags": [
          "Insights"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Project UUID (from GET /projects).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "description": "Filter by insight kind.",
            "schema": {
              "type": "string",
              "enum": [
                "cross_source_correlation",
                "onboarding_brief",
                "architecture_insight",
                "release_notes",
                "plan_review"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by status.",
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "archived",
                "all"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum rows to return (1–100).",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "example": {
                  "insights": [
                    {
                      "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
                      "project_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                      "kind": "architecture_insight",
                      "title": "Pricing engine trade-offs",
                      "summary": "Flat per-artifact pricing simplifies billing at the cost of margin variance.",
                      "data": {
                        "tradeOffs": [],
                        "risks": [],
                        "patterns": [],
                        "recommendations": []
                      },
                      "model_used": "gemini-3.8-flash",
                      "status": "active",
                      "related_event_ids": [
                        "d4e5f6a7-b8c9-0123-def4-23456789013a"
                      ],
                      "sources": [
                        "github"
                      ],
                      "created_at": "2026-06-21T08:00:00Z",
                      "updated_at": "2026-06-21T08:00:00Z",
                      "markdown": "# Pricing engine trade-offs\n\n> Flat per-artifact pricing…"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The body or a query parameter is invalid: an unknown field, an unknown source, an unsupported filter dimension or an out-of-range number. The response names the offending field and lists the allowed values."
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "404": {
            "description": "Project not found or not accessible by this key."
          }
        }
      }
    },
    "/projects/{id}/insights/{kind}": {
      "post": {
        "operationId": "create_insight",
        "summary": "Generate an insight",
        "description": "Enqueues an insight generation for the project and returns a job id. The accepted body fields depend on kind. Poll GET /jobs/{jobId} for the result.",
        "tags": [
          "Insights"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Project UUID (from GET /projects).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "description": "Insight kind. `plan_review` writes a status report from the numbers of the plan (5 credits) and needs a project role that can write.",
            "schema": {
              "type": "string",
              "enum": [
                "correlation",
                "onboarding",
                "architecture",
                "release_notes",
                "plan_review"
              ]
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted – job enqueued.",
            "content": {
              "application/json": {
                "example": {
                  "jobId": "e7f8a9b0-1c2d-3e4f-5a6b-7c8d9e0f1a2b",
                  "status": "pending"
                }
              }
            }
          },
          "400": {
            "description": "Unsupported insight kind, or the body failed validation (unknown field / source / filter value, or a field that does not apply to this kind). The response names the field and lists allowed values."
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "404": {
            "description": "Project not found or not accessible by this key."
          },
          "429": {
            "description": "Rate limit exceeded (60/min/key)."
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "lookbackHours": {
                    "type": "integer",
                    "description": "correlation only – window in hours (1–2160, default 168). Rejected on other kinds."
                  },
                  "lookbackDays": {
                    "type": "integer",
                    "description": "onboarding / architecture – window in days (1–365, default 30 / 14). Rejected on correlation and on release_notes, which always covers the last 14 days."
                  },
                  "newMemberRole": {
                    "type": "string",
                    "description": "onboarding only – role of the person being onboarded."
                  },
                  "focusArea": {
                    "type": "string",
                    "description": "onboarding only – area to emphasise."
                  },
                  "focusQuestion": {
                    "type": "string",
                    "description": "architecture only – the question to investigate."
                  },
                  "source": {
                    "type": "string",
                    "enum": [
                      "github",
                      "gitlab",
                      "bitbucket",
                      "azure_devops"
                    ],
                    "description": "release_notes only – the code source to read (default github)."
                  },
                  "repo": {
                    "type": "string",
                    "description": "release_notes only – restrict to one repository, matched against the events' repository name. Defaults to every repository the project tracks."
                  },
                  "style": {
                    "type": "string",
                    "enum": [
                      "release_notes",
                      "pr_description"
                    ],
                    "description": "release_notes only – output shape (default release_notes)."
                  },
                  "sources": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "github",
                        "slack",
                        "discord",
                        "linear",
                        "notion",
                        "jira",
                        "gitlab",
                        "bitbucket",
                        "azure_devops",
                        "figma",
                        "confluence",
                        "microsoft_outlook",
                        "microsoft_teams",
                        "sentry",
                        "datadog",
                        "pagerduty",
                        "asana",
                        "gmail",
                        "buildkite",
                        "circleci",
                        "vercel",
                        "incident_io",
                        "netlify",
                        "render",
                        "railway",
                        "cloudflare_pages",
                        "clickup",
                        "monday_com",
                        "shortcut",
                        "intercom",
                        "zendesk",
                        "snyk",
                        "fireflies",
                        "zoom",
                        "grafana",
                        "google_calendar",
                        "google_drive",
                        "launchdarkly",
                        "hcp_terraform",
                        "sonarqube",
                        "miro",
                        "new_relic",
                        "jira_service_management",
                        "posthog",
                        "hubspot",
                        "salesforce",
                        "heroku",
                        "alertmanager",
                        "pulumi",
                        "google_meet",
                        "microsoft_teams_meetings",
                        "fathom"
                      ]
                    },
                    "description": "Restrict to these sources. Unknown values are rejected with 400. On release_notes it widens the scope past the code source named by `source` (a build source alongside the repository, say); omit it to read that source alone."
                  },
                  "filters": {
                    "$ref": "#/components/schemas/SourceFilter",
                    "description": "Per-source filters (AND-combined). Keys must be source ids (unknown keys are rejected with 400); values are matched leniently (see GET /handoffs/filters)."
                  },
                  "maxEvents": {
                    "type": "integer",
                    "description": "Cap the events fed to the model (1–1000). Rejected on release_notes."
                  }
                }
              },
              "example": {
                "focusQuestion": "Is the pricing engine coupling billing to providers?",
                "lookbackDays": 14
              }
            }
          }
        }
      }
    },
    "/projects/{id}/qa": {
      "post": {
        "operationId": "ask_project",
        "summary": "Ask a question about a project",
        "description": "Answers one question grounded in the project context: the indexed codebase, connected baselines and the last 14 days of scoped activity. Synchronous – the answer comes back in the response, there is no job to poll. The answer cites the events it relied on as `ev:` plus the first 8 characters of the event id. Costs 2 credits.",
        "tags": [
          "Projects"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Project UUID (from GET /projects).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "example": {
                  "answer": "Checkout moved off the legacy queue because the retry semantics could double-charge on a partial failure…",
                  "citations": [
                    "ev:a1b2c3d4",
                    "ev:9f8e7d6c"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "question missing, empty, longer than 2000 characters, or an unknown body field was sent."
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "402": {
            "description": "The plan does not allow this flow."
          },
          "404": {
            "description": "Project not found or not accessible by this key."
          },
          "429": {
            "description": "Rate limit exceeded (60/min/key)."
          },
          "504": {
            "description": "The answer took longer than 60s. Narrow the question."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "question": {
                    "type": "string",
                    "description": "The question, 1 to 2000 characters."
                  },
                  "filters": {
                    "$ref": "#/components/schemas/SourceFilter",
                    "description": "Per-source filters (AND-combined) narrowing the activity considered."
                  }
                },
                "required": [
                  "question"
                ]
              },
              "example": {
                "question": "Why did we move checkout off the legacy queue?"
              }
            }
          }
        }
      }
    },
    "/events": {
      "get": {
        "operationId": "list_events",
        "summary": "List context events",
        "description": "Lists recent context events, newest first. With project_id it spans the project members and scoped sources; without it returns the key owner personal-stream events.",
        "tags": [
          "Events"
        ],
        "parameters": [
          {
            "name": "source",
            "in": "query",
            "required": false,
            "description": "Filter by source. Unknown values are rejected with 400.",
            "schema": {
              "type": "string",
              "enum": [
                "github",
                "slack",
                "discord",
                "linear",
                "notion",
                "jira",
                "gitlab",
                "bitbucket",
                "azure_devops",
                "figma",
                "confluence",
                "microsoft_outlook",
                "microsoft_teams",
                "sentry",
                "datadog",
                "pagerduty",
                "asana",
                "gmail",
                "buildkite",
                "circleci",
                "vercel",
                "incident_io",
                "netlify",
                "render",
                "railway",
                "cloudflare_pages",
                "clickup",
                "monday_com",
                "shortcut",
                "intercom",
                "zendesk",
                "snyk",
                "fireflies",
                "zoom",
                "grafana",
                "google_calendar",
                "google_drive",
                "launchdarkly",
                "hcp_terraform",
                "sonarqube",
                "miro",
                "new_relic",
                "jira_service_management",
                "posthog",
                "hubspot",
                "salesforce",
                "heroku",
                "alertmanager",
                "pulumi",
                "google_meet",
                "microsoft_teams_meetings",
                "fathom"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum rows to return (1–200).",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "required": false,
            "description": "Restrict to a project scope.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "example": {
                  "events": [
                    {
                      "id": "d4e5f6a7-b8c9-0123-def4-23456789013a",
                      "user_id": "0a9b8c7d-6e5f-4a3b-2c1d-0e9f8a7b6c5d",
                      "source": "github",
                      "event_type": "push",
                      "title": "Push to acme/payments",
                      "content": "3 commits on main",
                      "created_at": "2026-06-20T13:55:00Z"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The body or a query parameter is invalid: an unknown field, an unknown source, an unsupported filter dimension or an out-of-range number. The response names the offending field and lists the allowed values."
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "404": {
            "description": "Project not found or not accessible by this key."
          }
        }
      }
    },
    "/integrations": {
      "get": {
        "operationId": "list_integrations",
        "summary": "List integrations",
        "description": "Lists connected integrations. With project_id it returns the project-scoped resources with health and provider coverage; without it returns the key owner connected sources.",
        "tags": [
          "Integrations"
        ],
        "parameters": [
          {
            "name": "project_id",
            "in": "query",
            "required": false,
            "description": "Return project-scoped integrations instead of personal ones.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "example": {
                  "integrations": [
                    {
                      "source": "github",
                      "workspace_id": "acme",
                      "workspace_name": "Acme",
                      "connected_at": "2026-05-01T09:00:00Z",
                      "scope": "project",
                      "resource_type": "repository",
                      "connection_status": "active",
                      "providers_connected": 2,
                      "last_validated_at": "2026-06-20T10:00:00Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "404": {
            "description": "Project not found or not accessible by this key."
          }
        }
      }
    },
    "/integrations/untracked": {
      "get": {
        "operationId": "untracked_integrations",
        "summary": "List untracked resources",
        "description": "Returns active resources (last 30 days) that produced events but are not yet assigned to any project. The response is a bare array, sorted by most recent activity.",
        "tags": [
          "Integrations"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "example": [
                  {
                    "source": "slack",
                    "resource_id": "C0123",
                    "resource_name": "#incidents",
                    "resource_type": "channel",
                    "event_count": 42,
                    "last_event_at": "2026-06-20T12:00:00Z"
                  }
                ]
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "500": {
            "description": "Discovery failed for a connected source."
          }
        }
      }
    },
    "/jobs/{jobId}": {
      "get": {
        "operationId": "get_job",
        "summary": "Poll an async job",
        "description": "Returns the job record and, once completed, the generated artifact. `kind` names the generation (`project_handoff`, `cross_source_correlation`, `onboarding_brief`, `architecture_insight`, `release_notes`, `project_digest`) and `result_kind` tells you where the artifact lives (`handoff`, `insight` – release notes included – or `digest`). The artifact carries a `markdown` field with the canonical rendering – identical to the dashboard copy button. Poll this after any 202 response until status is completed or failed. While the job runs, `progress.phase` reports the stage the worker actually reached (`loading_context`, `retrieving`, `generating`, `saving`); it is null until the first phase is written.",
        "tags": [
          "Jobs"
        ],
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "UUID of the job returned in a prior 202 (POST /handoffs or POST /projects/{id}/insights/{kind}). Project-scoped: only readable if you can access the job's project.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "example": {
                  "job": {
                    "id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
                    "project_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                    "kind": "project_handoff",
                    "status": "completed",
                    "result_kind": "handoff",
                    "result_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                    "error": null,
                    "error_code": null,
                    "progress": {
                      "phase": "saving",
                      "at": "2026-06-20T14:02:55Z"
                    },
                    "created_at": "2026-06-20T14:02:00Z",
                    "updated_at": "2026-06-20T14:03:00Z"
                  },
                  "result": {
                    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                    "title": "Checkout refactor handoff",
                    "markdown": "# Checkout refactor handoff\n\n> Migrated the checkout flow…"
                  }
                }
              }
            }
          },
          "400": {
            "description": "jobId is not a valid UUID."
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "404": {
            "description": "Job not found or not accessible."
          }
        }
      }
    },
    "/discord/channels": {
      "get": {
        "operationId": "discord_channels",
        "summary": "List Discord channels",
        "description": "Lists the text channels in the Discord guild connected to the key owner.",
        "tags": [
          "Discord"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "example": {
                  "channels": [
                    {
                      "id": "987654",
                      "name": "general",
                      "type": 0
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "No guild associated with this integration."
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "404": {
            "description": "Discord not connected."
          }
        }
      }
    },
    "/discord/send": {
      "post": {
        "operationId": "discord_send",
        "summary": "Send a Discord message",
        "description": "Sends to a channel in the connected guild. Provide exactly one of: content (inline text); handoff_id or insight_id (renders that artifact to Markdown and attaches it as a .md file); or artifact (last_handoff / last_correlation / last_onboarding / last_architecture / last_release_notes, with project_id) to send the latest active artifact of that kind. Rendered artifacts use the same Markdown as the dashboard copy button and are always delivered as a .md attachment. The channel must belong to the connected guild (cross-tenant posts are rejected).",
        "tags": [
          "Discord"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "example": {
                  "ok": true,
                  "message_id": "111222333444555666"
                }
              }
            }
          },
          "400": {
            "description": "channel_id missing, or no content / artifact provided."
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "403": {
            "description": "Channel does not belong to the connected guild."
          },
          "404": {
            "description": "Discord not connected, or the requested artifact does not exist / is not accessible."
          },
          "502": {
            "description": "Discord rejected the message."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channel_id": {
                    "type": "string",
                    "description": "Target channel id – a Discord snowflake from GET /discord/channels."
                  },
                  "content": {
                    "type": "string",
                    "description": "Inline message text. Mutually exclusive with handoff_id / insight_id / artifact."
                  },
                  "handoff_id": {
                    "type": "string",
                    "description": "UUID of a handoff (from GET /handoffs). Rendered to Markdown and sent as a .md attachment."
                  },
                  "insight_id": {
                    "type": "string",
                    "description": "UUID of an insight (from GET /projects/{id}/insights). Sent as a .md attachment."
                  },
                  "artifact": {
                    "type": "string",
                    "enum": [
                      "last_handoff",
                      "last_correlation",
                      "last_onboarding",
                      "last_architecture",
                      "last_release_notes"
                    ],
                    "description": "Send the latest active artifact of a kind. Requires project_id."
                  },
                  "project_id": {
                    "type": "string",
                    "description": "Project UUID. Required only when artifact is set."
                  }
                },
                "required": [
                  "channel_id"
                ]
              },
              "example": {
                "channel_id": "987654321098765432",
                "artifact": "last_handoff",
                "project_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
              }
            }
          }
        }
      }
    },
    "/my-work": {
      "get": {
        "operationId": "list_my_work",
        "summary": "List my work",
        "description": "Lists the work items assigned to the key owner across every accessible project: open items plus the ones finished in the last 7 days. Dates are wall-clock times in the time zone of each item project, named on the project.",
        "tags": [
          "Work items"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "example": {
                  "items": [
                    {
                      "id": "4b8e2f1a-9c3d-4e5f-8a7b-6c5d4e3f2a10",
                      "key": "FR-12",
                      "title": "Move invoices to Paddle",
                      "status": "in_progress",
                      "blocked": false,
                      "priority": 3,
                      "kind": "task",
                      "percentComplete": 40,
                      "start": "2026-09-28T08:00",
                      "finish": "2026-10-02T17:00",
                      "deadline": "2026-10-09T17:00",
                      "updatedAt": "2026-09-28T09:14:03Z",
                      "url": "https://www.flowrelay.it/projects/3fa85f64-5717-4562-b3fc-2c963f66afa6/work?item=FR-12",
                      "project": {
                        "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                        "name": "Billing",
                        "timezone": "Europe/Rome"
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "429": {
            "description": "Rate limit exceeded (60/min/key)."
          }
        }
      }
    },
    "/projects/{id}/work-items": {
      "get": {
        "operationId": "list_work_items",
        "summary": "List work items",
        "description": "Lists the tasks and milestones of a project plan ordered by item number, with the dates computed by the scheduler. Dates are wall-clock times (`YYYY-MM-DDTHH:mm`) in the plan time zone returned as `timezone`. Pass `nextCursor` back as `cursor` to read the next page.",
        "tags": [
          "Work items"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Project UUID (from GET /projects).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Comma-separated statuses to keep (for example `todo,in_progress`). Omit for every status.",
            "schema": {
              "type": "string",
              "enum": [
                "backlog",
                "todo",
                "in_progress",
                "in_review",
                "done",
                "cancelled"
              ]
            }
          },
          {
            "name": "assignee",
            "in": "query",
            "required": false,
            "description": "Only `me` is accepted: the items assigned to the key owner.",
            "schema": {
              "type": "string",
              "enum": [
                "me"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page (1-200, default 100).",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The `nextCursor` of the previous page.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "example": {
                  "timezone": "Europe/Rome",
                  "items": [
                    {
                      "id": "4b8e2f1a-9c3d-4e5f-8a7b-6c5d4e3f2a10",
                      "key": "FR-12",
                      "number": 12,
                      "title": "Move invoices to Paddle",
                      "kind": "task",
                      "status": "in_progress",
                      "blocked": false,
                      "priority": 3,
                      "isSummary": false,
                      "parentId": "9d8c7b6a-5f4e-4d3c-8b2a-1f0e9d8c7b6a",
                      "percentComplete": 40,
                      "start": "2026-09-28T08:00",
                      "finish": "2026-10-02T17:00",
                      "deadline": "2026-10-09T17:00",
                      "durationMinutes": 2400,
                      "critical": true,
                      "assignees": [
                        {
                          "userId": "0a9b8c7d-6e5f-4a3b-2c1d-0e9f8a7b6c5d",
                          "name": "Ada Rossi"
                        }
                      ],
                      "version": 57,
                      "updatedAt": "2026-09-28T09:14:03Z",
                      "url": "https://www.flowrelay.it/projects/3fa85f64-5717-4562-b3fc-2c963f66afa6/work?item=FR-12"
                    }
                  ],
                  "nextCursor": 12
                }
              }
            }
          },
          "400": {
            "description": "The body or a query parameter is invalid: an unknown field, an unknown source, an unsupported filter dimension or an out-of-range number. The response names the offending field and lists the allowed values."
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "404": {
            "description": "Project not found or not accessible by this key."
          },
          "429": {
            "description": "Rate limit exceeded (60/min/key)."
          }
        }
      },
      "post": {
        "operationId": "create_work_item",
        "summary": "Create a work item",
        "description": "Creates a task or milestone and schedules it. The item gets the next number of the project and a key such as `FR-12`. Contributors can create items when the project allows it and can assign only themselves. Costs no credits.",
        "tags": [
          "Work items"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Project UUID (from GET /projects).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "example": {
                  "item": {
                    "id": "4b8e2f1a-9c3d-4e5f-8a7b-6c5d4e3f2a10",
                    "key": "FR-12",
                    "number": 12,
                    "title": "Move invoices to Paddle",
                    "kind": "task",
                    "status": "in_progress",
                    "blocked": false,
                    "priority": 3,
                    "isSummary": false,
                    "parentId": "9d8c7b6a-5f4e-4d3c-8b2a-1f0e9d8c7b6a",
                    "percentComplete": 40,
                    "start": "2026-09-28T08:00",
                    "finish": "2026-10-02T17:00",
                    "deadline": "2026-10-09T17:00",
                    "durationMinutes": 2400,
                    "critical": true,
                    "assignees": [
                      {
                        "userId": "0a9b8c7d-6e5f-4a3b-2c1d-0e9f8a7b6c5d",
                        "name": "Ada Rossi"
                      }
                    ],
                    "version": 57,
                    "updatedAt": "2026-09-28T09:14:03Z",
                    "url": "https://www.flowrelay.it/projects/3fa85f64-5717-4562-b3fc-2c963f66afa6/work?item=FR-12",
                    "description": "Replace the legacy invoice job with Paddle transactions.",
                    "predecessors": [
                      {
                        "key": "FR-3",
                        "type": "fs",
                        "lagMinutes": 0
                      }
                    ],
                    "successors": [
                      {
                        "key": "FR-15",
                        "type": "fs",
                        "lagMinutes": 0
                      }
                    ],
                    "evidence": [
                      {
                        "source": "github",
                        "kind": "commit",
                        "title": "FR-12 switch invoice webhook to Paddle",
                        "url": "https://github.com/acme/billing/commit/4f2a9c1",
                        "occurredAt": "2026-09-28T08:42:11Z"
                      }
                    ],
                    "commentCount": 2
                  },
                  "warnings": []
                }
              }
            }
          },
          "400": {
            "description": "The body or a query parameter is invalid: an unknown field, an unknown source, an unsupported filter dimension or an out-of-range number. The response names the offending field and lists the allowed values."
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "402": {
            "description": "Work management is not part of the plan, or the project reached its item limit."
          },
          "403": {
            "description": "The project role of the key owner cannot create items or assign other people."
          },
          "404": {
            "description": "Project or parent item not found or not accessible by this key."
          },
          "409": {
            "description": "The plan kept changing while the item was saved. Retry."
          },
          "429": {
            "description": "Rate limit exceeded (60/min/key)."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "description": "Title, 1 to 500 characters."
                  },
                  "description": {
                    "type": "string",
                    "description": "Plain text or Markdown, up to 50000 characters."
                  },
                  "parent": {
                    "type": "string",
                    "description": "Key or id of the parent item to nest under."
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "task",
                      "milestone"
                    ],
                    "description": "Task or milestone."
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "backlog",
                      "todo",
                      "in_progress",
                      "in_review",
                      "done",
                      "cancelled"
                    ],
                    "description": "Initial status."
                  },
                  "priority": {
                    "type": "integer",
                    "description": "0 lowest to 4 urgent."
                  },
                  "duration": {
                    "type": "string",
                    "description": "Working duration such as `4h`, `3d` or `2w` (the plan decides how long a day is), `3ed` for elapsed days, a trailing `?` for an estimate."
                  },
                  "deadline": {
                    "type": "string",
                    "description": "`YYYY-MM-DD` or `YYYY-MM-DDTHH:mm` in the plan time zone."
                  },
                  "assignee": {
                    "type": "string",
                    "description": "`me`, or the user id of a project member (managers only)."
                  }
                },
                "required": [
                  "title"
                ]
              },
              "example": {
                "title": "Move invoices to Paddle",
                "parent": "FR-3",
                "duration": "3d",
                "deadline": "2026-10-09",
                "assignee": "me"
              }
            }
          }
        }
      }
    },
    "/projects/{id}/work-items/{ref}": {
      "get": {
        "operationId": "get_work_item",
        "summary": "Get a work item",
        "description": "Returns one work item by key or id with its description, scheduled dates, assignees, dependencies, the ten most recent accepted evidence links and the comment count.",
        "tags": [
          "Work items"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Project UUID (from GET /projects).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ref",
            "in": "path",
            "required": true,
            "description": "Item key such as `FR-12`, or the item id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "example": {
                  "timezone": "Europe/Rome",
                  "item": {
                    "id": "4b8e2f1a-9c3d-4e5f-8a7b-6c5d4e3f2a10",
                    "key": "FR-12",
                    "number": 12,
                    "title": "Move invoices to Paddle",
                    "kind": "task",
                    "status": "in_progress",
                    "blocked": false,
                    "priority": 3,
                    "isSummary": false,
                    "parentId": "9d8c7b6a-5f4e-4d3c-8b2a-1f0e9d8c7b6a",
                    "percentComplete": 40,
                    "start": "2026-09-28T08:00",
                    "finish": "2026-10-02T17:00",
                    "deadline": "2026-10-09T17:00",
                    "durationMinutes": 2400,
                    "critical": true,
                    "assignees": [
                      {
                        "userId": "0a9b8c7d-6e5f-4a3b-2c1d-0e9f8a7b6c5d",
                        "name": "Ada Rossi"
                      }
                    ],
                    "version": 57,
                    "updatedAt": "2026-09-28T09:14:03Z",
                    "url": "https://www.flowrelay.it/projects/3fa85f64-5717-4562-b3fc-2c963f66afa6/work?item=FR-12",
                    "description": "Replace the legacy invoice job with Paddle transactions.",
                    "predecessors": [
                      {
                        "key": "FR-3",
                        "type": "fs",
                        "lagMinutes": 0
                      }
                    ],
                    "successors": [
                      {
                        "key": "FR-15",
                        "type": "fs",
                        "lagMinutes": 0
                      }
                    ],
                    "evidence": [
                      {
                        "source": "github",
                        "kind": "commit",
                        "title": "FR-12 switch invoice webhook to Paddle",
                        "url": "https://github.com/acme/billing/commit/4f2a9c1",
                        "occurredAt": "2026-09-28T08:42:11Z"
                      }
                    ],
                    "commentCount": 2
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "404": {
            "description": "Project or item not found or not accessible by this key."
          },
          "429": {
            "description": "Rate limit exceeded (60/min/key)."
          }
        }
      },
      "patch": {
        "operationId": "update_work_item",
        "summary": "Update a work item",
        "description": "Changes the fields you send and reschedules the plan. Sending the same values again leaves the item unchanged. Contributors can update the items assigned to them or created by them; dates and durations may need a project manager. Pass `ifVersion` (the `version` you read) to refuse the change when someone edited the item in the meantime. Costs no credits.",
        "tags": [
          "Work items"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Project UUID (from GET /projects).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ref",
            "in": "path",
            "required": true,
            "description": "Item key such as `FR-12`, or the item id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "example": {
                  "item": {
                    "id": "4b8e2f1a-9c3d-4e5f-8a7b-6c5d4e3f2a10",
                    "key": "FR-12",
                    "number": 12,
                    "title": "Move invoices to Paddle",
                    "kind": "task",
                    "status": "done",
                    "blocked": false,
                    "priority": 3,
                    "isSummary": false,
                    "parentId": "9d8c7b6a-5f4e-4d3c-8b2a-1f0e9d8c7b6a",
                    "percentComplete": 100,
                    "start": "2026-09-28T08:00",
                    "finish": "2026-10-02T17:00",
                    "deadline": "2026-10-09T17:00",
                    "durationMinutes": 2400,
                    "critical": true,
                    "assignees": [
                      {
                        "userId": "0a9b8c7d-6e5f-4a3b-2c1d-0e9f8a7b6c5d",
                        "name": "Ada Rossi"
                      }
                    ],
                    "version": 58,
                    "updatedAt": "2026-09-28T09:14:03Z",
                    "url": "https://www.flowrelay.it/projects/3fa85f64-5717-4562-b3fc-2c963f66afa6/work?item=FR-12",
                    "description": "Replace the legacy invoice job with Paddle transactions.",
                    "predecessors": [
                      {
                        "key": "FR-3",
                        "type": "fs",
                        "lagMinutes": 0
                      }
                    ],
                    "successors": [
                      {
                        "key": "FR-15",
                        "type": "fs",
                        "lagMinutes": 0
                      }
                    ],
                    "evidence": [
                      {
                        "source": "github",
                        "kind": "commit",
                        "title": "FR-12 switch invoice webhook to Paddle",
                        "url": "https://github.com/acme/billing/commit/4f2a9c1",
                        "occurredAt": "2026-09-28T08:42:11Z"
                      }
                    ],
                    "commentCount": 2
                  },
                  "warnings": []
                }
              }
            }
          },
          "400": {
            "description": "The body or a query parameter is invalid: an unknown field, an unknown source, an unsupported filter dimension or an out-of-range number. The response names the offending field and lists the allowed values."
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "402": {
            "description": "Work management is not part of the plan."
          },
          "403": {
            "description": "The project role of the key owner cannot change these fields on this item."
          },
          "404": {
            "description": "Project or item not found or not accessible by this key."
          },
          "409": {
            "description": "`ifVersion` no longer matches: the item changed since you read it."
          },
          "422": {
            "description": "The plan cannot be scheduled with this change (no working time left on the calendar)."
          },
          "429": {
            "description": "Rate limit exceeded (60/min/key)."
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "backlog",
                      "todo",
                      "in_progress",
                      "in_review",
                      "done",
                      "cancelled"
                    ],
                    "description": "New status. `done` sets progress to 100."
                  },
                  "percentComplete": {
                    "type": "integer",
                    "description": "Progress 0 to 100. 100 marks the item done."
                  },
                  "title": {
                    "type": "string",
                    "description": "Title, 1 to 500 characters."
                  },
                  "description": {
                    "type": "string",
                    "description": "Plain text or Markdown, up to 50000 characters."
                  },
                  "priority": {
                    "type": "integer",
                    "description": "0 lowest to 4 urgent."
                  },
                  "blocked": {
                    "type": "boolean",
                    "description": "Flag or unflag the item as blocked. A flag, not a status."
                  },
                  "duration": {
                    "type": "string",
                    "description": "Working duration such as `4h`, `3d` or `2w`."
                  },
                  "deadline": {
                    "type": "string",
                    "description": "`YYYY-MM-DD` or `YYYY-MM-DDTHH:mm` in the plan time zone, or null to clear it."
                  },
                  "ifVersion": {
                    "type": "integer",
                    "description": "Apply only if the item still has this `version`."
                  }
                }
              },
              "example": {
                "status": "done",
                "ifVersion": 57
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "delete_work_item",
        "summary": "Delete a work item",
        "description": "Soft-deletes the item and its sub-items, removes their dependencies and assignments from the plan and reschedules it. The deletion is recorded as one batch in the change history, so a project manager can restore it. Contributors can delete only the items they created. Costs no credits.",
        "tags": [
          "Work items"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Project UUID (from GET /projects).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ref",
            "in": "path",
            "required": true,
            "description": "Item key such as `FR-12`, or the item id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content."
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "402": {
            "description": "Work management is not part of the plan."
          },
          "403": {
            "description": "The project role of the key owner cannot delete this item."
          },
          "404": {
            "description": "Project or item not found or not accessible by this key."
          },
          "422": {
            "description": "The plan cannot be scheduled after the change."
          },
          "429": {
            "description": "Rate limit exceeded (60/min/key)."
          }
        }
      }
    },
    "/projects/{id}/work-items/{ref}/evidence": {
      "get": {
        "operationId": "list_work_item_evidence",
        "summary": "List the evidence of a work item",
        "description": "Returns the activity linked to one work item, newest first: accepted evidence (commits, pull requests, builds, deploys, incidents, meetings, documents and manual links) plus the suggested evidence routed to the key owner. Project owners and managers also see the suggestions that name no author. `author` is a name only when the activity is attributed through a confirmed linked account and the organization allows named authors, otherwise null. `ref` also accepts a former project key and the key a tracker gave a mirrored item.",
        "tags": [
          "Work items"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Project UUID (from GET /projects).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ref",
            "in": "path",
            "required": true,
            "description": "Item key such as `FR-12`, the tracker key of a mirrored item such as `PAY-123`, or the item id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "example": {
                  "evidence": [
                    {
                      "id": "9e8d7c6b-5a4f-4e3d-8c2b-1a0f9e8d7c6b",
                      "source": "github",
                      "kind": "pull_request",
                      "reference": "acme/billing#41",
                      "url": "https://github.com/acme/billing/pull/41",
                      "title": "FR-12 switch invoice webhook",
                      "occurredAt": "2026-09-28T08:30:00Z",
                      "origin": "key_reference",
                      "status": "accepted",
                      "confidence": 1,
                      "author": "Ada Rossi"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "404": {
            "description": "Project or item not found or not accessible by this key."
          },
          "429": {
            "description": "Rate limit exceeded (60/min/key)."
          }
        }
      },
      "post": {
        "operationId": "link_work_item_evidence",
        "summary": "Link evidence to a work item",
        "description": "Attaches an https link (a pull request, commit, build, deploy, incident, document or anything else) to a work item as accepted evidence. It joins the activity trail of the item and its evidence coverage. Sending the same link again updates its title, kind and time and creates no duplicate. Viewers cannot link. Costs no credits.",
        "tags": [
          "Work items"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Project UUID (from GET /projects).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ref",
            "in": "path",
            "required": true,
            "description": "Item key such as `FR-12`, or the item id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "example": {
                  "linked": true,
                  "url": "https://github.com/acme/billing/pull/41"
                }
              }
            }
          },
          "400": {
            "description": "The body or a query parameter is invalid: an unknown field, an unknown source, an unsupported filter dimension or an out-of-range number. The response names the offending field and lists the allowed values."
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "402": {
            "description": "Work management is not part of the plan."
          },
          "403": {
            "description": "The key owner is a viewer of this project."
          },
          "404": {
            "description": "Project or item not found or not accessible by this key."
          },
          "429": {
            "description": "Rate limit exceeded (60/min/key)."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "The https link, up to 500 characters."
                  },
                  "title": {
                    "type": "string",
                    "description": "Title, 1 to 300 characters. Defaults to the link itself."
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "commit",
                      "branch",
                      "pull_request",
                      "review",
                      "build",
                      "deploy",
                      "incident",
                      "ticket",
                      "message",
                      "meeting",
                      "document",
                      "other"
                    ],
                    "description": "What the link points to."
                  },
                  "occurredAt": {
                    "type": "string",
                    "description": "When the work happened, ISO 8601. Defaults to now."
                  }
                },
                "required": [
                  "url"
                ]
              },
              "example": {
                "url": "https://github.com/acme/billing/pull/41",
                "kind": "pull_request",
                "occurredAt": "2026-09-28T08:30:00Z"
              }
            }
          }
        }
      }
    },
    "/projects/{id}/suggestions": {
      "get": {
        "operationId": "list_suggestions",
        "summary": "List pending suggestions",
        "description": "Returns the pending suggestions of a plan that the key owner can act on: `status_change` (a status proposed from linked activity, first offered to the assignee and shown to managers after three working days), `create_item` (an action item from a meeting transcript), `dependency` (a blocking link found in a mirrored tracker) and `evidence` (activity that looks related to an item). `forYou` marks the ones routed to the key owner. Nothing changes until a suggestion is accepted.",
        "tags": [
          "Work items"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Project UUID (from GET /projects).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "example": {
                  "suggestions": [
                    {
                      "id": "0f3e1d2c-4b5a-4987-8a6b-5c4d3e2f1a09",
                      "type": "status_change",
                      "item": "FR-12",
                      "payload": {
                        "from": "in_progress",
                        "to": "in_review",
                        "reason": "Pull request opened: acme/billing#41"
                      },
                      "origin": "evidence_rule",
                      "forYou": true,
                      "createdAt": "2026-09-28T10:00:00Z"
                    },
                    {
                      "id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
                      "type": "create_item",
                      "item": null,
                      "payload": {
                        "title": "Send the revised invoice template to finance",
                        "description": null,
                        "parent": null,
                        "reason": "From the meeting \"Billing sync\" of 2026-09-27"
                      },
                      "origin": "meeting",
                      "forYou": false,
                      "createdAt": "2026-09-27T16:10:00Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "404": {
            "description": "Project not found or not accessible by this key."
          },
          "429": {
            "description": "Rate limit exceeded (60/min/key)."
          }
        }
      }
    },
    "/projects/{id}/suggestions/{suggestionId}": {
      "post": {
        "operationId": "decide_suggestion",
        "summary": "Accept or dismiss a suggestion",
        "description": "`accept` applies the suggestion with the permissions of the key owner: the status change, the new item, the dependency or the evidence link. `dismiss` closes it. A status change whose item moved on in the meantime expires instead of overwriting the newer status. Costs no credits.",
        "tags": [
          "Work items"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Project UUID (from GET /projects).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "suggestionId",
            "in": "path",
            "required": true,
            "description": "Suggestion UUID (from GET /projects/{id}/suggestions).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "example": {
                  "status": "accepted",
                  "numbers": {},
                  "version": 58
                }
              }
            }
          },
          "400": {
            "description": "The body or a query parameter is invalid: an unknown field, an unknown source, an unsupported filter dimension or an out-of-range number. The response names the offending field and lists the allowed values."
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "403": {
            "description": "The project role of the key owner cannot make this change."
          },
          "404": {
            "description": "Project or suggestion not found, or the suggestion is not visible to this key."
          },
          "409": {
            "description": "The suggestion was already decided, or the item changed since it was made."
          },
          "422": {
            "description": "The suggestion no longer describes a change that can be applied."
          },
          "429": {
            "description": "Rate limit exceeded (60/min/key)."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "accept",
                      "dismiss"
                    ],
                    "description": "What to do with the suggestion."
                  }
                },
                "required": [
                  "action"
                ]
              },
              "example": {
                "action": "accept"
              }
            }
          }
        }
      }
    },
    "/projects/{id}/imports": {
      "post": {
        "operationId": "create_import",
        "summary": "Start a plan import",
        "description": "Starts importing an MS Project XML file (MSPDI, from Project desktop Save As > XML), an Oracle Primavera P6 file (.xer), or a CSV file and returns a signed upload URL. Upload the file with `PUT` to `upload.signedUrl` within 2 hours, sending `Content-Type: application/xml`, `text/plain` or `text/csv` and no Authorization header (50 MB at most), then call `POST /projects/{id}/imports/{importId}` with `{\"action\": \"parse\"}`. Project managers only. Costs no credits.",
        "tags": [
          "Plans"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Project UUID (from GET /projects).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "example": {
                  "importId": "6d1f0c2a-8b3e-4f5a-9c7d-2e1f0a9b8c7d",
                  "upload": {
                    "bucket": "plan-imports",
                    "path": "3fa85f64-5717-4562-b3fc-2c963f66afa6/6d1f0c2a-8b3e-4f5a-9c7d-2e1f0a9b8c7d/launch-plan.xml",
                    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1cmwiOiJwbGFuLWltcG9ydHMvLi4uIn0.signature",
                    "signedUrl": "https://xyzcompany.supabase.co/storage/v1/object/upload/sign/plan-imports/3fa85f64-5717-4562-b3fc-2c963f66afa6/6d1f0c2a-8b3e-4f5a-9c7d-2e1f0a9b8c7d/launch-plan.xml?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1cmwiOiJwbGFuLWltcG9ydHMvLi4uIn0.signature"
                  }
                }
              }
            }
          },
          "400": {
            "description": "The body or a query parameter is invalid: an unknown field, an unknown source, an unsupported filter dimension or an out-of-range number. The response names the offending field and lists the allowed values."
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "402": {
            "description": "Importing plans is not part of the plan (Starter and above)."
          },
          "403": {
            "description": "The key owner is not a manager of this project."
          },
          "404": {
            "description": "Project not found or not accessible by this key."
          },
          "429": {
            "description": "Rate limit exceeded (60/min/key, and 10 imports per hour per user)."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "mspdi",
                      "csv",
                      "xer"
                    ],
                    "description": "`mspdi` for an MS Project XML file, `xer` for an Oracle Primavera P6 export, `csv` for a spreadsheet export."
                  },
                  "fileName": {
                    "type": "string",
                    "description": "Name of the file, up to 255 characters. Shown in the import history."
                  }
                },
                "required": [
                  "kind",
                  "fileName"
                ]
              },
              "example": {
                "kind": "mspdi",
                "fileName": "launch-plan.xml"
              }
            }
          }
        }
      },
      "get": {
        "operationId": "list_imports",
        "summary": "List plan imports",
        "description": "Lists the ten most recent imports of a project, newest first, with their status, preview, warnings and results.",
        "tags": [
          "Plans"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Project UUID (from GET /projects).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "example": {
                  "imports": [
                    {
                      "id": "6d1f0c2a-8b3e-4f5a-9c7d-2e1f0a9b8c7d",
                      "kind": "mspdi",
                      "status": "preview",
                      "file_name": "launch-plan.xml",
                      "preview": {
                        "name": "Launch plan",
                        "counts": {
                          "tasks": 312,
                          "summaries": 41,
                          "milestones": 9,
                          "links": 356,
                          "assignments": 288,
                          "calendars": 2
                        },
                        "baselines": [
                          0
                        ],
                        "customFields": [
                          {
                            "key": "workstream",
                            "label": "Workstream",
                            "type": "text"
                          }
                        ],
                        "resources": [
                          {
                            "ref": "3",
                            "name": "Ada Rossi",
                            "email": "ada@acme.dev",
                            "suggested": "f3a2b1c0-9d8e-4f7a-8b6c-5d4e3f2a1b0c"
                          },
                          {
                            "ref": "7",
                            "name": "Contractor",
                            "email": null,
                            "suggested": null
                          }
                        ],
                        "settings": {
                          "projectStart": "2026-10-05T08:00",
                          "statusDate": null,
                          "minutesPerDay": 480,
                          "minutesPerWeek": 2400,
                          "daysPerMonth": 20,
                          "calendar": "Standard"
                        },
                        "sample": [
                          {
                            "ref": "1",
                            "level": 1,
                            "name": "Discovery",
                            "durationMinutes": 4800,
                            "start": "2026-10-05T08:00",
                            "finish": "2026-10-16T17:00"
                          }
                        ],
                        "existingItems": 0,
                        "csv": null
                      },
                      "warnings": [
                        {
                          "code": "split_task",
                          "message": "2 split tasks were imported as one continuous bar.",
                          "refs": [
                            "58",
                            "61"
                          ]
                        }
                      ],
                      "stats": {},
                      "error": null,
                      "created_at": "2026-09-28T09:20:11Z",
                      "applied_at": null
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "404": {
            "description": "Project not found or not accessible by this key."
          },
          "429": {
            "description": "Rate limit exceeded (60/min/key)."
          }
        }
      }
    },
    "/projects/{id}/imports/{importId}": {
      "get": {
        "operationId": "get_import",
        "summary": "Get a plan import",
        "description": "Returns one import. `status` moves from `uploading` to `parsing`, then `preview` (read the counts, the resources to map and the `warnings`) and, after `apply`, to `applying` and `applied` with the results in `stats`. `failed` carries the reason in `error`. The `preview` is dropped once the import is applied or discarded. Poll every few seconds while it is `parsing` or `applying`.",
        "tags": [
          "Plans"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Project UUID (from GET /projects).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "importId",
            "in": "path",
            "required": true,
            "description": "Import UUID (from POST /projects/{id}/imports).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "example": {
                  "import": {
                    "id": "6d1f0c2a-8b3e-4f5a-9c7d-2e1f0a9b8c7d",
                    "kind": "mspdi",
                    "status": "preview",
                    "file_name": "launch-plan.xml",
                    "preview": {
                      "name": "Launch plan",
                      "counts": {
                        "tasks": 312,
                        "summaries": 41,
                        "milestones": 9,
                        "links": 356,
                        "assignments": 288,
                        "calendars": 2
                      },
                      "baselines": [
                        0
                      ],
                      "customFields": [
                        {
                          "key": "workstream",
                          "label": "Workstream",
                          "type": "text"
                        }
                      ],
                      "resources": [
                        {
                          "ref": "3",
                          "name": "Ada Rossi",
                          "email": "ada@acme.dev",
                          "suggested": "f3a2b1c0-9d8e-4f7a-8b6c-5d4e3f2a1b0c"
                        },
                        {
                          "ref": "7",
                          "name": "Contractor",
                          "email": null,
                          "suggested": null
                        }
                      ],
                      "settings": {
                        "projectStart": "2026-10-05T08:00",
                        "statusDate": null,
                        "minutesPerDay": 480,
                        "minutesPerWeek": 2400,
                        "daysPerMonth": 20,
                        "calendar": "Standard"
                      },
                      "sample": [
                        {
                          "ref": "1",
                          "level": 1,
                          "name": "Discovery",
                          "durationMinutes": 4800,
                          "start": "2026-10-05T08:00",
                          "finish": "2026-10-16T17:00"
                        }
                      ],
                      "existingItems": 0,
                      "csv": null
                    },
                    "warnings": [
                      {
                        "code": "split_task",
                        "message": "2 split tasks were imported as one continuous bar.",
                        "refs": [
                          "58",
                          "61"
                        ]
                      }
                    ],
                    "stats": {},
                    "error": null,
                    "created_at": "2026-09-28T09:20:11Z",
                    "applied_at": null
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "404": {
            "description": "Project or import not found or not accessible by this key."
          },
          "429": {
            "description": "Rate limit exceeded (60/min/key)."
          }
        }
      },
      "post": {
        "operationId": "run_import_action",
        "summary": "Parse, apply or discard an import",
        "description": "`parse` reads the uploaded file and builds the preview (for a CSV file you can pass the column `mapping` and the `dateOrder`, otherwise both are guessed). `apply` creates the items, links, assignments, calendars, baselines and custom fields in one batch: `append` adds them after the existing items, `replace` deletes the existing items first. `resourceMap` maps each resource of the file to a project member (`resourceId` from the preview suggestions) or to nobody. `discard` deletes the uploaded file. Project managers only.",
        "tags": [
          "Plans"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Project UUID (from GET /projects).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "importId",
            "in": "path",
            "required": true,
            "description": "Import UUID (from POST /projects/{id}/imports).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "example": {
                  "status": "applying"
                }
              }
            }
          },
          "202": {
            "description": "`parse` or `apply` started. Poll GET /projects/{id}/imports/{importId}."
          },
          "400": {
            "description": "The body or a query parameter is invalid: an unknown field, an unknown source, an unsupported filter dimension or an out-of-range number. The response names the offending field and lists the allowed values."
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "403": {
            "description": "The key owner is not a manager of this project."
          },
          "404": {
            "description": "Project or import not found or not accessible by this key."
          },
          "409": {
            "description": "The import is not in a state that allows this action (apply needs a preview; a running import cannot be discarded)."
          },
          "429": {
            "description": "Rate limit exceeded (60/min/key)."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "parse",
                      "apply",
                      "discard"
                    ],
                    "description": "What to do with the import."
                  },
                  "mapping": {
                    "type": "object",
                    "description": "CSV only, with `parse`: field name to zero-based column index, for example `{\"name\": 0, \"duration\": 2}`. Fields: `id`, `name`, `outline_level`, `wbs`, `duration`, `start`, `finish`, `predecessors`, `percent_complete`, `status`, `notes`, `resources`, `milestone`, `deadline`, `priority`."
                  },
                  "dateOrder": {
                    "type": "string",
                    "enum": [
                      "ymd",
                      "dmy",
                      "mdy"
                    ],
                    "description": "CSV only, with `parse`: how dates are written."
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "append",
                      "replace"
                    ],
                    "description": "With `apply`: add to the plan or replace it."
                  },
                  "applySettings": {
                    "type": "boolean",
                    "description": "With `apply`: also take the project start, status date, day length and calendars from the file."
                  },
                  "resourceMap": {
                    "type": "object",
                    "description": "With `apply`: resource `ref` of the preview to a project member `resourceId`, or null for nobody. Unmapped resources are not assigned."
                  }
                },
                "required": [
                  "action"
                ]
              },
              "example": {
                "action": "apply",
                "mode": "append",
                "resourceMap": {
                  "3": "f3a2b1c0-9d8e-4f7a-8b6c-5d4e3f2a1b0c",
                  "7": null
                }
              }
            }
          }
        }
      }
    },
    "/projects/{id}/export": {
      "get": {
        "operationId": "export_plan",
        "summary": "Export a plan",
        "description": "Downloads the project plan as an MS Project XML file (tasks, outline, dependencies, constraints, deadlines, progress, calendars, resources, assignments and saved baselines) that Project desktop opens with File > Open, or as a CSV file with one row per item. Dates are wall-clock times in the plan time zone.",
        "tags": [
          "Plans"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Project UUID (from GET /projects).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": true,
            "description": "`mspdi` for MS Project XML, `csv` for a spreadsheet.",
            "schema": {
              "type": "string",
              "enum": [
                "mspdi",
                "csv"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/xml": {
                "schema": {
                  "type": "string"
                },
                "example": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<Project xmlns=\"http://schemas.microsoft.com/project\">\n  <SaveVersion>14</SaveVersion>\n  <Name>Billing.xml</Name>\n  <Title>Billing</Title>\n  <StartDate>2026-09-28T08:00:00</StartDate>\n  <Tasks>\n    <Task>\n      <UID>12</UID>\n      <Name>Move invoices to Paddle</Name>\n      <Start>2026-09-28T08:00:00</Start>\n      <Finish>2026-10-02T17:00:00</Finish>\n      <Duration>PT40H0M0S</Duration>\n      <PercentComplete>40</PercentComplete>\n    </Task>\n  </Tasks>\n</Project>"
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                },
                "example": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<Project xmlns=\"http://schemas.microsoft.com/project\">\n  <SaveVersion>14</SaveVersion>\n  <Name>Billing.xml</Name>\n  <Title>Billing</Title>\n  <StartDate>2026-09-28T08:00:00</StartDate>\n  <Tasks>\n    <Task>\n      <UID>12</UID>\n      <Name>Move invoices to Paddle</Name>\n      <Start>2026-09-28T08:00:00</Start>\n      <Finish>2026-10-02T17:00:00</Finish>\n      <Duration>PT40H0M0S</Duration>\n      <PercentComplete>40</PercentComplete>\n    </Task>\n  </Tasks>\n</Project>"
              }
            }
          },
          "400": {
            "description": "The body or a query parameter is invalid: an unknown field, an unknown source, an unsupported filter dimension or an out-of-range number. The response names the offending field and lists the allowed values."
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "402": {
            "description": "Exporting plans is not part of the plan (Starter and above)."
          },
          "404": {
            "description": "Project not found or not accessible by this key."
          },
          "429": {
            "description": "Rate limit exceeded (60/min/key)."
          }
        }
      }
    },
    "/time-entries": {
      "get": {
        "operationId": "list_time_entries",
        "summary": "List your logged time",
        "description": "Returns the hours the key owner logged between two dates, oldest first, with the status of the weekly timesheet each entry belongs to. Only the key owner's own time: there is no way to read someone else's entries through this endpoint.",
        "tags": [
          "Time"
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "description": "First day, YYYY-MM-DD.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "description": "Last day, YYYY-MM-DD, at most 92 days after `from`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "example": {
                  "entries": [
                    {
                      "id": "5e4d3c2b-1a09-4f8e-9d7c-6b5a4f3e2d1c",
                      "projectId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                      "item": "FR-12",
                      "date": "2026-09-29",
                      "minutes": 90,
                      "note": "Pairing on the retry logic",
                      "source": "manual",
                      "status": "draft"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The body or a query parameter is invalid: an unknown field, an unknown source, an unsupported filter dimension or an out-of-range number. The response names the offending field and lists the allowed values."
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "429": {
            "description": "Rate limit exceeded (60/min/key)."
          }
        }
      },
      "post": {
        "operationId": "log_time",
        "summary": "Log time",
        "description": "Adds time to the key owner's own timesheet for the week of `date`. Logging again on the same item and day adds up and never overwrites. Organization projects accept time only while the organization has time tracking turned on, and a submitted or approved week can no longer change. Costs no credits.",
        "tags": [
          "Time"
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "example": {
                  "logged": 90,
                  "date": "2026-09-29",
                  "week": "2026-09-28"
                }
              }
            }
          },
          "400": {
            "description": "The body or a query parameter is invalid: an unknown field, an unknown source, an unsupported filter dimension or an out-of-range number. The response names the offending field and lists the allowed values."
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "403": {
            "description": "The organization has not turned time tracking on."
          },
          "404": {
            "description": "Project or item not found or not accessible by this key."
          },
          "409": {
            "description": "The week is submitted or approved."
          },
          "429": {
            "description": "Rate limit exceeded (60/min/key)."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "projectId": {
                    "type": "string",
                    "description": "Project UUID (from GET /projects)."
                  },
                  "ref": {
                    "type": "string",
                    "description": "Item key such as `FR-12`, or the item id. Without it the time counts on the project as a whole."
                  },
                  "date": {
                    "type": "string",
                    "description": "Day worked, YYYY-MM-DD."
                  },
                  "minutes": {
                    "type": "integer",
                    "description": "Whole minutes, 1 to 1440. A day never holds more than 24 hours."
                  },
                  "note": {
                    "type": "string",
                    "description": "Up to 500 characters."
                  }
                },
                "required": [
                  "projectId",
                  "date",
                  "minutes"
                ]
              },
              "example": {
                "projectId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                "ref": "FR-12",
                "date": "2026-09-29",
                "minutes": 90
              }
            }
          }
        }
      }
    },
    "/projects/{id}/evm": {
      "get": {
        "operationId": "get_earned_value",
        "summary": "Get earned value and costs",
        "description": "Returns the cost picture of a plan at its status date: planned and actual cost, and the earned value figures (planned value, earned value, variances, SPI, CPI, TCPI and the three estimates at completion) measured against a baseline. Amounts are whole cents in the currency of the organization. Actual cost comes from logged hours at the rate in force that day when any were logged, otherwise from progress. Project managers only, on plans that include costs. Costs no credits.",
        "tags": [
          "Reports"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Project UUID (from GET /projects).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "baseline",
            "in": "query",
            "required": false,
            "description": "Baseline slot to measure against, 0 to 10.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "example": {
                  "currency": "EUR",
                  "statusDate": "2026-09-29",
                  "baseline": 0,
                  "actualsFrom": "timesheets",
                  "plannedCostCents": 4820000,
                  "actualCostCents": 2130000,
                  "budgetCents": 5000000,
                  "earnedValue": {
                    "budgetAtCompletionCents": 4800000,
                    "plannedValueCents": 2400000,
                    "earnedValueCents": 2160000,
                    "actualCostCents": 2130000,
                    "scheduleVarianceCents": -240000,
                    "costVarianceCents": 30000,
                    "spi": 0.9,
                    "cpi": 1.01,
                    "tcpi": 0.99,
                    "estimateAtCompletionCents": {
                      "cpi": 4733000,
                      "budgetRate": 4770000,
                      "cpiSpi": 4818000
                    },
                    "estimateToCompleteCents": 2603000,
                    "varianceAtCompletionCents": 67000
                  },
                  "curve": [
                    {
                      "weekEnding": "2026-10-04",
                      "baselineCents": 2500000,
                      "currentCents": 2300000
                    }
                  ],
                  "generatedFor": "2026-09-29"
                }
              }
            }
          },
          "400": {
            "description": "The body or a query parameter is invalid: an unknown field, an unknown source, an unsupported filter dimension or an out-of-range number. The response names the offending field and lists the allowed values."
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "402": {
            "description": "Costs and earned value are not part of the plan (Business and above)."
          },
          "403": {
            "description": "The key owner is not a manager of this project."
          },
          "404": {
            "description": "Project not found or not accessible by this key."
          },
          "429": {
            "description": "Rate limit exceeded (60/min/key)."
          }
        }
      }
    },
    "/projects/{id}/forecast": {
      "get": {
        "operationId": "get_forecast",
        "summary": "Forecast the finish of a plan",
        "description": "Simulates the plan thousands of times and returns, for the project and for each open milestone, the dates by which half, four out of five and nineteen out of twenty of the runs are done, the chance of meeting the target finish or a milestone deadline and the items most often on the critical path. mode=schedule (default) varies the durations of the open tasks (uncertainty low, medium or high; tasks marked as estimates vary one step wider); mode=throughput uses how many items the team finished each week over the last twelve weeks and needs at least four weeks of history. The same plan version always gives the same forecast. Dates are wall-clock times in the plan time zone. Included from the Business plan. Costs no credits.",
        "tags": [
          "Reports"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Project UUID (from GET /projects).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "mode",
            "in": "query",
            "required": false,
            "description": "What to simulate.",
            "schema": {
              "type": "string",
              "enum": [
                "schedule",
                "throughput"
              ]
            }
          },
          {
            "name": "uncertainty",
            "in": "query",
            "required": false,
            "description": "How far durations may vary in schedule mode.",
            "schema": {
              "type": "string",
              "enum": [
                "low",
                "medium",
                "high"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "example": {
                  "mode": "schedule",
                  "uncertainty": "medium",
                  "iterations": 2000,
                  "planVersion": 41,
                  "project": {
                    "plan": "2026-12-18T17:00",
                    "target": "2026-12-11T17:00",
                    "p50": "2026-12-22T17:00",
                    "p80": "2027-01-08T17:00",
                    "p95": "2027-01-20T17:00",
                    "chance": 0.18
                  },
                  "milestones": [
                    {
                      "id": "5f2d6a10-0e3b-4c7a-9d18-2b6c4e8f1a30",
                      "ref": "WEB-14",
                      "title": "Design freeze",
                      "plan": "2026-10-09T17:00",
                      "deadline": null,
                      "p50": "2026-10-12T17:00",
                      "p80": "2026-10-16T17:00",
                      "p95": "2026-10-23T17:00",
                      "chance": 0.31
                    }
                  ],
                  "critical": [
                    {
                      "id": "8a1c3e5f-7b9d-4f20-8c41-6d5e4f3a2b10",
                      "ref": "WEB-7",
                      "title": "Payment webhook",
                      "index": 0.92
                    }
                  ],
                  "histogram": [
                    {
                      "from": "2026-12-15",
                      "to": "2026-12-19",
                      "count": 240
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The body or a query parameter is invalid: an unknown field, an unknown source, an unsupported filter dimension or an out-of-range number. The response names the offending field and lists the allowed values."
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "402": {
            "description": "Forecasts are not part of the plan (Business and above)."
          },
          "404": {
            "description": "Project not found or not accessible by this key."
          },
          "429": {
            "description": "Rate limit exceeded (60/min/key)."
          }
        }
      }
    },
    "/projects/{id}/whatif": {
      "post": {
        "operationId": "plan_whatif",
        "summary": "Ask a what-if question about a plan",
        "description": "Turns a what-if question written in words into changes to the work (set a duration, delay a start, cancel an item, add a link) and lets the scheduler compute the result: the new finish of the project and of each milestone, how many items move and what becomes critical. The model only maps the words to changes using the keys of the plan; every date comes from the scheduler. Whatever cannot be expressed is listed in left_out. Nothing is saved and the plan is not changed. Viewers cannot ask. Included from the Business plan. Costs 5 credits.",
        "tags": [
          "Plans"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Project UUID (from GET /projects).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "example": {
                  "explanation": "Made WEB-7 three weeks long, assuming the current dependencies.",
                  "changes": [
                    "Set WEB-7 to 3w"
                  ],
                  "left_out": [],
                  "comparison": {
                    "projectFinish": {
                      "now": "2026-12-18T17:00",
                      "scenario": "2027-01-08T17:00",
                      "deltaWorkingDays": 15
                    },
                    "milestones": [
                      {
                        "ref": "WEB-14",
                        "title": "Design freeze",
                        "now": "2026-10-09T17:00",
                        "scenario": "2026-10-30T17:00",
                        "deltaWorkingDays": 15
                      }
                    ],
                    "moved": 4,
                    "criticalBecame": 1,
                    "criticalLeft": 0,
                    "warnings": 0
                  },
                  "errors": []
                }
              }
            }
          },
          "400": {
            "description": "The body or a query parameter is invalid: an unknown field, an unknown source, an unsupported filter dimension or an out-of-range number. The response names the offending field and lists the allowed values."
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "402": {
            "description": "Scenarios are not part of the plan (Business and above), or the plan is out of credits."
          },
          "403": {
            "description": "The key owner is a viewer of this project."
          },
          "404": {
            "description": "Project not found or not accessible by this key."
          },
          "429": {
            "description": "Rate limit exceeded (60/min/key)."
          },
          "504": {
            "description": "The answer took longer than 60 seconds."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "question": {
                    "type": "string",
                    "description": "The what-if question, 5 to 500 characters."
                  }
                },
                "required": [
                  "question"
                ]
              },
              "example": {
                "question": "What if the payment integration takes three weeks longer?"
              }
            }
          }
        }
      }
    },
    "/portfolio": {
      "get": {
        "operationId": "get_portfolio",
        "summary": "Get the portfolio of an organization",
        "description": "Returns the projects of an organization that the key owner can open, each with its progress, forecast finish, next milestone, open risks and health. Health is a verdict (green, amber or red) computed every night from the plan: schedule slip against the baseline or the target finish, overdue items, scope added since the baseline and the latest build, deploy and incident signals. A project manager can set the verdict by hand, and then overridden is true with the comment. Costs are not included here: use GET /projects/{id}/evm. Included from the Business plan. Costs no credits.",
        "tags": [
          "Portfolio"
        ],
        "parameters": [
          {
            "name": "organization_id",
            "in": "query",
            "required": true,
            "description": "Organization UUID (from GET /projects, the organizationId of a project).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "example": {
                  "organizationId": "4b1f0c6e-2a3d-4e5f-8a9b-0c1d2e3f4a5b",
                  "projects": [
                    {
                      "id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
                      "key": "WEB",
                      "name": "Website relaunch",
                      "status": "active",
                      "programId": null,
                      "percentComplete": 62,
                      "projectStart": "2026-08-03T08:00",
                      "scheduledFinish": "2026-12-18T17:00",
                      "targetFinish": "2026-12-11T17:00",
                      "openRisks": 3,
                      "nextMilestone": {
                        "ref": "WEB-14",
                        "title": "Design freeze",
                        "finish": "2026-10-09T17:00"
                      },
                      "health": {
                        "verdict": "amber",
                        "overridden": false,
                        "comment": null,
                        "schedule": "amber",
                        "cost": null,
                        "scope": "green",
                        "delivery": "green",
                        "computedOn": "2026-09-29",
                        "slipWorkingDays": 5,
                        "overdueItems": 2,
                        "openItems": 31
                      }
                    }
                  ],
                  "programs": [
                    {
                      "id": "2f6b1d0e-9a8b-4c7d-8e6f-5a4b3c2d1e0f",
                      "name": "Growth"
                    }
                  ],
                  "dependencies": [
                    {
                      "from": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
                      "to": "0d3b5a7c-1e2f-4a6b-9c8d-7e6f5a4b3c2d",
                      "count": 2
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The body or a query parameter is invalid: an unknown field, an unknown source, an unsupported filter dimension or an out-of-range number. The response names the offending field and lists the allowed values."
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "402": {
            "description": "The organization plan does not include portfolio management (Business and above)."
          },
          "404": {
            "description": "Organization not found or the key owner is not a member."
          },
          "429": {
            "description": "Rate limit exceeded (60/min/key)."
          }
        }
      }
    },
    "/projects/{id}/raid": {
      "get": {
        "operationId": "list_raid",
        "summary": "List the RAID register",
        "description": "Returns the risks, assumptions, issues, decisions and dependencies of a project, highest number first. Entries that are not closed by default. The score is probability times impact, present on risks and issues.",
        "tags": [
          "Work items"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Project UUID (from GET /projects).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "description": "Filter by type.",
            "schema": {
              "type": "string",
              "enum": [
                "risk",
                "assumption",
                "issue",
                "decision",
                "dependency"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by status. Omit for every entry that is not closed.",
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "monitoring",
                "closed",
                "all"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Max records to return (1-200, default 50).",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "example": {
                  "entries": [
                    {
                      "id": "9d8c7b6a-5f4e-4d3c-8b2a-1f0e9d8c7b6a",
                      "number": 4,
                      "type": "risk",
                      "title": "Payment provider certification may slip",
                      "description": "",
                      "status": "open",
                      "probability": 3,
                      "impact": 5,
                      "score": 15,
                      "response": "Book the certification slot now.",
                      "ownerId": null,
                      "dueOn": "2026-10-16",
                      "item": "FR-12",
                      "createdAt": "2026-09-28T09:10:00Z"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The body or a query parameter is invalid: an unknown field, an unknown source, an unsupported filter dimension or an out-of-range number. The response names the offending field and lists the allowed values."
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "404": {
            "description": "Project not found or not accessible by this key."
          },
          "429": {
            "description": "Rate limit exceeded (60/min/key)."
          }
        }
      },
      "post": {
        "operationId": "add_raid_entry",
        "summary": "Add a RAID entry",
        "description": "Adds a risk, assumption, issue, decision or dependency to the register of a project. Viewers cannot add. Probability and impact are 1 to 5. Costs no credits.",
        "tags": [
          "Work items"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Project UUID (from GET /projects).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "example": {
                  "id": "9d8c7b6a-5f4e-4d3c-8b2a-1f0e9d8c7b6a",
                  "number": 4
                }
              }
            }
          },
          "400": {
            "description": "The body or a query parameter is invalid: an unknown field, an unknown source, an unsupported filter dimension or an out-of-range number. The response names the offending field and lists the allowed values."
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "403": {
            "description": "The key owner is a viewer of this project."
          },
          "404": {
            "description": "Project not found or not accessible by this key."
          },
          "429": {
            "description": "Rate limit exceeded (60/min/key)."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "risk",
                      "assumption",
                      "issue",
                      "decision",
                      "dependency"
                    ],
                    "description": "Type of the entry."
                  },
                  "title": {
                    "type": "string",
                    "description": "1 to 300 characters."
                  },
                  "description": {
                    "type": "string",
                    "description": "Up to 10,000 characters."
                  },
                  "probability": {
                    "type": "integer",
                    "description": "1 to 5, for risks and issues."
                  },
                  "impact": {
                    "type": "integer",
                    "description": "1 to 5, for risks and issues."
                  },
                  "response": {
                    "type": "string",
                    "description": "The planned response, or for a decision what was decided and why."
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "open",
                      "monitoring",
                      "closed"
                    ],
                    "description": "Defaults to open."
                  },
                  "dueOn": {
                    "type": "string",
                    "description": "YYYY-MM-DD."
                  }
                },
                "required": [
                  "kind",
                  "title"
                ]
              },
              "example": {
                "kind": "risk",
                "title": "Payment provider certification may slip",
                "probability": 3,
                "impact": 5,
                "dueOn": "2026-10-16"
              }
            }
          }
        }
      }
    },
    "/projects/{id}/automations": {
      "get": {
        "operationId": "list_automations",
        "summary": "List the automation rules of a project",
        "description": "Returns the automation rules of a project: each with a plain sentence that says what starts it, what it checks and what it does, its trigger, conditions and actions as stored, how many times it ran and how the last run went. Read only: rules are changed in the app. Available from the Team plan. Costs no credits.",
        "tags": [
          "Work items"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Project UUID (from GET /projects).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "example": {
                  "automations": [
                    {
                      "id": "5c4b3a29-1807-4f6e-9d5c-4b3a2918f7e6",
                      "name": "Close out",
                      "enabled": true,
                      "summary": "When an item moves to Done, and priority is at least High: notify the assignees.",
                      "trigger": {
                        "type": "status_changed",
                        "to": "done"
                      },
                      "conditions": [
                        {
                          "field": "priority",
                          "op": "gte",
                          "value": 3
                        }
                      ],
                      "actions": [
                        {
                          "type": "notify",
                          "to": "assignees",
                          "message": "{{key}} is done"
                        }
                      ],
                      "runCount": 12,
                      "lastRunAt": "2026-10-08T14:20:00Z",
                      "lastStatus": "ok"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "404": {
            "description": "Project not found or not accessible by this key."
          },
          "429": {
            "description": "Rate limit exceeded (60/min/key)."
          }
        }
      }
    },
    "/projects/{id}/templates": {
      "get": {
        "operationId": "list_templates",
        "summary": "List the plan templates of a project",
        "description": "Returns the templates saved for the project: those of its organization, or your own on a personal project. A template is a whole plan or one item with its subtasks, kept as names, notes, durations and links, never people or dates. Costs no credits.",
        "tags": [
          "Work items"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Project UUID (from GET /projects).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "example": {
                  "templates": [
                    {
                      "id": "7e6d5c4b-3a29-4180-b6f5-e4d3c2b1a098",
                      "kind": "item",
                      "name": "Release checklist",
                      "description": "Steps before a release",
                      "itemCount": 6,
                      "createdAt": "2026-09-20T09:00:00Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "404": {
            "description": "Project not found or not accessible by this key."
          },
          "429": {
            "description": "Rate limit exceeded (60/min/key)."
          }
        }
      }
    },
    "/projects/{id}/templates/{templateId}/apply": {
      "post": {
        "operationId": "apply_template",
        "summary": "Add a template to a plan",
        "description": "Adds the items of a template to the plan, at the top level or under an existing item, as one change that the history can undo. Only project managers can. Costs no credits.",
        "tags": [
          "Work items"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Project UUID (from GET /projects).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "description": "Template UUID (from GET /projects/{id}/templates).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "example": {
                  "created": 6,
                  "version": 42
                }
              }
            }
          },
          "400": {
            "description": "The body or a query parameter is invalid: an unknown field, an unknown source, an unsupported filter dimension or an out-of-range number. The response names the offending field and lists the allowed values."
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "402": {
            "description": "Work management is not part of the plan, or the project reached its item limit."
          },
          "403": {
            "description": "The key owner is not a manager of the project."
          },
          "404": {
            "description": "Project, template or parent item not found or not accessible by this key."
          },
          "409": {
            "description": "The plan kept changing while the items were saved. Retry."
          },
          "429": {
            "description": "Rate limit exceeded (60/min/key)."
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "parent": {
                    "type": "string",
                    "description": "Key or id of the item to add the template under. Omit for the top level."
                  }
                }
              },
              "example": {
                "parent": "FR-12"
              }
            }
          }
        }
      }
    },
    "/projects/{id}/approvals": {
      "get": {
        "operationId": "list_approvals",
        "summary": "List the change requests of a project",
        "description": "Returns the last 50 change requests of an organization project: what was asked in plain language, who asked, who decided and when. Change requests are included from the Business plan; on a personal project or a plan without them the list is empty. Costs no credits.",
        "tags": [
          "Work items"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Project UUID (from GET /projects).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Use pending to list only the requests waiting for a decision.",
            "schema": {
              "type": "string",
              "enum": [
                "pending"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "example": {
                  "approvals": [
                    {
                      "id": "2c1b0a9f-8e7d-4c6b-9a5f-4e3d2c1b0a9f",
                      "kind": "scope",
                      "title": "Move the launch by one week",
                      "note": "The vendor needs another week.",
                      "summary": [
                        "Change duration of FR-12 \"Launch\""
                      ],
                      "status": "pending",
                      "requestedBy": "Ada Lovelace",
                      "decidedBy": null,
                      "decidedAt": null,
                      "decisionNote": null,
                      "createdAt": "2026-09-28T09:00:00Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "404": {
            "description": "Project not found or not accessible by this key."
          },
          "429": {
            "description": "Rate limit exceeded (60/min/key)."
          }
        }
      },
      "post": {
        "operationId": "request_change",
        "summary": "Ask for a change to a work item",
        "description": "Creates a change request for one work item. A second person decides it in the plan, and approving applies the change as the approver. Use it when the key owner may not make the change directly, or wants it reviewed. Changes use the same fields as PATCH on a work item. Organization projects on the Business plan or above only. Costs no credits.",
        "tags": [
          "Work items"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Project UUID (from GET /projects).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "example": {
                  "id": "2c1b0a9f-8e7d-4c6b-9a5f-4e3d2c1b0a9f",
                  "status": "pending"
                }
              }
            }
          },
          "400": {
            "description": "The body or a query parameter is invalid: an unknown field, an unknown source, an unsupported filter dimension or an out-of-range number. The response names the offending field and lists the allowed values."
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "402": {
            "description": "Change approvals are not part of the plan."
          },
          "403": {
            "description": "The key owner cannot change this plan, or the change touches a field the key owner may not see."
          },
          "404": {
            "description": "Project or item not found or not accessible by this key."
          },
          "409": {
            "description": "The key owner has too many requests waiting for a decision."
          },
          "429": {
            "description": "Rate limit exceeded (60/min/key)."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "item": {
                    "type": "string",
                    "description": "Key such as FR-12 or id of the work item."
                  },
                  "title": {
                    "type": "string",
                    "description": "What you want changed, 1 to 200 characters."
                  },
                  "note": {
                    "type": "string",
                    "description": "Why, up to 2,000 characters."
                  },
                  "changes": {
                    "type": "object",
                    "description": "The fields to change: title, description, status, priority, blocked, percentComplete, duration or deadline."
                  }
                },
                "required": [
                  "item",
                  "title",
                  "changes"
                ]
              },
              "example": {
                "item": "FR-12",
                "title": "Move the launch by one week",
                "note": "The vendor needs another week.",
                "changes": {
                  "duration": "6d"
                }
              }
            }
          }
        }
      }
    },
    "/projects/{id}/approvals/{approvalId}": {
      "patch": {
        "operationId": "decide_approval",
        "summary": "Decide a change request",
        "description": "Approves or rejects a pending change request, or withdraws one you made. Approving applies the change as the approver and reschedules the plan. A request needs a second person: the key owner cannot approve or reject a request they made. Costs no credits.",
        "tags": [
          "Work items"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Project UUID (from GET /projects).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "approvalId",
            "in": "path",
            "required": true,
            "description": "Change request UUID (from GET /projects/{id}/approvals).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "example": {
                  "status": "approved",
                  "batchId": "5d4c3b2a-1f0e-4d9c-8b7a-6f5e4d3c2b1a"
                }
              }
            }
          },
          "400": {
            "description": "The body or a query parameter is invalid: an unknown field, an unknown source, an unsupported filter dimension or an out-of-range number. The response names the offending field and lists the allowed values."
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "402": {
            "description": "Change approvals are not part of the plan."
          },
          "403": {
            "description": "The key owner cannot decide change requests, asked for this one, or tried to withdraw a request made by someone else."
          },
          "404": {
            "description": "Project or request not found or not accessible by this key."
          },
          "409": {
            "description": "The request is no longer pending, was decided in the meantime, or applying it failed (`status` is failed)."
          },
          "429": {
            "description": "Rate limit exceeded (60/min/key)."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "decision": {
                    "type": "string",
                    "enum": [
                      "approve",
                      "reject",
                      "withdraw"
                    ],
                    "description": "What to do with the request. Only the person who asked can withdraw."
                  },
                  "note": {
                    "type": "string",
                    "description": "Why, up to 1,000 characters."
                  }
                },
                "required": [
                  "decision"
                ]
              },
              "example": {
                "decision": "approve",
                "note": "Fine by me."
              }
            }
          }
        }
      }
    },
    "/projects/{id}/digests": {
      "get": {
        "operationId": "list_digests",
        "summary": "List project digests",
        "description": "Lists past scheduled activity digests for a project, newest first.",
        "tags": [
          "Projects"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Project UUID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Max records to return (1-50, default 10).",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "example": {
                  "digests": [
                    {
                      "id": "7c9e3b12-4567-89ab-cdef-0123456789ab",
                      "projectId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                      "generatedBy": "11111111-2222-3333-4444-555555555555",
                      "periodStart": "2026-07-17T00:00:00Z",
                      "periodEnd": "2026-07-24T00:00:00Z",
                      "content": {
                        "title": "Weekly Digest",
                        "summary": "Major progress on API v1 and checkout flow."
                      },
                      "markdown": "# Weekly Digest\n...",
                      "createdAt": "2026-07-24T00:00:05Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "404": {
            "description": "Project not found or not accessible by this key."
          },
          "429": {
            "description": "Rate limit exceeded (60/min/key)."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Flow Relay API key, prefixed with fr_."
      }
    },
    "schemas": {
      "Source": {
        "type": "string",
        "description": "A Flow Relay integration source id.",
        "enum": [
          "github",
          "slack",
          "discord",
          "linear",
          "notion",
          "jira",
          "gitlab",
          "bitbucket",
          "azure_devops",
          "figma",
          "confluence",
          "microsoft_outlook",
          "microsoft_teams",
          "sentry",
          "datadog",
          "pagerduty",
          "asana",
          "gmail",
          "buildkite",
          "circleci",
          "vercel",
          "incident_io",
          "netlify",
          "render",
          "railway",
          "cloudflare_pages",
          "clickup",
          "monday_com",
          "shortcut",
          "intercom",
          "zendesk",
          "snyk",
          "fireflies",
          "zoom",
          "grafana",
          "google_calendar",
          "google_drive",
          "launchdarkly",
          "hcp_terraform",
          "sonarqube",
          "miro",
          "new_relic",
          "jira_service_management",
          "posthog",
          "hubspot",
          "salesforce",
          "heroku",
          "alertmanager",
          "pulumi",
          "google_meet",
          "microsoft_teams_meetings",
          "fathom"
        ]
      },
      "SourceFilter": {
        "type": "object",
        "description": "Per-source filters, AND-combined. Keyed by source id (see Source); an unknown key is rejected with 400. The array values are provider-driven and matched leniently – an unmatched value returns no events rather than an error. Discover the values selectable on a project via GET /handoffs/filters.",
        "propertyNames": {
          "$ref": "#/components/schemas/Source"
        },
        "additionalProperties": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "projects": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Resource ids (repos, channels, boards)."
            },
            "branches": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Git branch names. Git sources only."
            },
            "eventTypes": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Flow Relay event-type values for the source."
            },
            "priorities": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Lowercase priority values. jira / linear / sentry / pagerduty only."
            }
          }
        }
      }
    }
  }
}
