{"openapi":"3.1.0","info":{"title":"Radial API","version":"v1","description":"Script your issue tracker. Authenticate with a bearer `rk_` API key (or OAuth token). Scopes: read, triage, write. Identifiers are TEAM-NUMBER (e.g. ENG-123). Call GET /api/v1/workspace first to learn valid team keys, status names, labels, and member emails."},"servers":[{"url":"https://www.radial.build"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"An `rk_` API key or OAuth access token."}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"]}}},"User":{"type":["object","null"],"properties":{"email":{"type":["string","null"]},"name":{"type":["string","null"]},"isAgent":{"type":"boolean"}}},"Issue":{"type":"object","properties":{"id":{"type":"string","description":"TEAM-NUMBER identifier"},"url":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string"},"statusCategory":{"type":"string"},"priority":{"type":"string","enum":["none","urgent","high","medium","low"]},"assignee":{"$ref":"#/components/schemas/User"},"creator":{"$ref":"#/components/schemas/User"},"team":{"type":"string"},"project":{"type":["string","null"]},"cycle":{"type":["integer","null"]},"labels":{"type":"array","items":{"type":"string"}},"parent":{"type":["string","null"]},"estimate":{"type":["integer","null"]},"dueDate":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"completedAt":{"type":["string","null"]},"subIssues":{"type":"object","description":"Sub-issue progress: total direct non-archived children and how many are completed.","properties":{"total":{"type":"integer"},"completed":{"type":"integer"}},"required":["total","completed"]},"coverImageUrl":{"type":["string","null"],"description":"The issue's cover image bytes, or null. Fetch with the same bearer token as this request. Read-only: set a cover in the app."},"relations":{"type":"array","items":{"$ref":"#/components/schemas/Relation"}}}},"Relation":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["blocks","blocked_by","related","duplicate_of","duplicated_by"]},"issue":{"type":"string","description":"The other issue identifier"},"createdAt":{"type":"string"}}},"Comment":{"type":"object","properties":{"id":{"type":"string"},"author":{"$ref":"#/components/schemas/User"},"body":{"type":"string"},"parentId":{"type":["string","null"]},"attachmentId":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"deleted":{"type":"boolean"}}},"Attachment":{"type":"object","properties":{"id":{"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"kind":{"type":"string","enum":["html","image","other"]},"sizeBytes":{"type":"integer"},"uploadedBy":{"$ref":"#/components/schemas/User"},"createdAt":{"type":"string"},"previewUrl":{"type":"string"},"contentUrl":{"type":"string"}}},"Project":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string"},"priority":{"type":"string"},"color":{"type":"string"},"icon":{"type":["string","null"]},"lead":{"$ref":"#/components/schemas/User"},"startDate":{"type":["string","null"]},"targetDate":{"type":["string","null"]}}},"Team":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string","description":"Team key (composes issue ids, e.g. \"ENG-123\")"},"name":{"type":"string"},"icon":{"type":["string","null"]},"color":{"type":["string","null"]},"archived":{"type":"boolean"}}},"Label":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"},"team":{"type":["string","null"],"description":"Team key, or null for workspace-global"}}},"Cycle":{"type":"object","properties":{"id":{"type":"string"},"team":{"type":"string"},"number":{"type":"integer"},"name":{"type":["string","null"]},"startDate":{"type":"string"},"endDate":{"type":"string"}}},"Notification":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"issue":{"type":["string","null"]},"actor":{"$ref":"#/components/schemas/User"},"read":{"type":"boolean"},"createdAt":{"type":"string"}}},"Activity":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"actor":{"$ref":"#/components/schemas/User"},"from":{},"to":{},"createdAt":{"type":"string"}}},"RecentActivity":{"type":"object","properties":{"id":{"type":"string"},"issue":{"type":"string","description":"TEAM-NUMBER identifier"},"title":{"type":"string"},"from":{"type":["object","null"],"properties":{"status":{"type":"string"},"category":{"type":"string"}}},"to":{"type":["object","null"],"properties":{"status":{"type":"string"},"category":{"type":"string"}}},"actor":{"$ref":"#/components/schemas/User"},"at":{"type":"string"}}},"Event":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","description":"Event name, e.g. \"issue.created\""},"actor":{"oneOf":[{"$ref":"#/components/schemas/User"},{"type":"null"}]},"actorType":{"type":"string","enum":["user","system"]},"systemName":{"type":["string","null"]},"subjectType":{"type":"string"},"subjectId":{"type":["string","null"]},"data":{"type":"object","description":"Event-defined payload. Keys are snake_case and specific to the event type; the envelope camelCase convention does not apply inside."},"createdAt":{"type":"string"}}},"Workspace":{"type":"object","properties":{"workspace":{"type":"object","properties":{"slug":{"type":"string"}}},"teams":{"type":"array","items":{"type":"object"}},"statuses":{"type":"array","items":{"type":"object"}},"labels":{"type":"array","items":{"type":"object"}},"members":{"type":"array","items":{"type":"object"}},"priorities":{"type":"array","items":{"type":"string"}}}},"ApiKey":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string"},"scope":{"type":"string"},"lastUsedAt":{"type":["string","null"]},"revokedAt":{"type":["string","null"]},"createdAt":{"type":"string"}}},"BuildSession":{"type":"object","description":"One session that touched the build, with what produced it.","properties":{"id":{"type":"string"},"client":{"type":["string","null"]},"clientVersion":{"type":["string","null"]},"models":{"type":"array","items":{"type":"string"}},"user":{"type":["string","null"]},"capturedBy":{"type":["string","null"]},"firstSeen":{"type":["string","null"]},"lastSeen":{"type":["string","null"]},"events":{"type":"integer"},"tokens":{"type":["integer","null"]}}},"Build":{"type":"object","properties":{"issue":{"type":"string","description":"The issue the build belongs to, e.g. \"RAD-382\"."},"status":{"type":"string","enum":["open","finished"]},"branch":{"type":["string","null"]},"baseSha":{"type":["string","null"]},"headSha":{"type":["string","null"]},"prUrl":{"type":["string","null"]},"tier":{"type":["string","null"]},"agent":{"type":["string","null"],"description":"Derived: the latest session’s client."},"pipeline":{"type":"object","description":"The pipeline.json in force, with its sha256."},"sessions":{"type":"array","items":{"$ref":"#/components/schemas/BuildSession"}},"report":{"type":["object","null"]},"openedAt":{"type":"string"},"finishedAt":{"type":["string","null"]},"totals":{"type":"object","properties":{"wallS":{"type":["integer","null"]},"stages":{"type":"integer"},"children":{"type":"integer"},"gates":{"type":"integer"},"events":{"type":"integer"},"sessions":{"type":"integer"},"outcome":{"type":["string","null"]}}}}},"BuildStage":{"type":"object","description":"One stage ATTEMPT. Re-entering a stage appends the next attempt.","properties":{"id":{"type":"string"},"stage":{"type":"string"},"position":{"type":"integer"},"attempt":{"type":"integer"},"status":{"type":"string","enum":["started","done","red","skipped"]},"skipReason":{"type":["string","null"]},"actor":{"type":"object"},"headShaStart":{"type":["string","null"]},"headShaEnd":{"type":["string","null"]},"payload":{"type":"object"},"stamps":{"type":"array","items":{"type":"object"}},"startedAt":{"type":"string"},"endedAt":{"type":["string","null"]},"elapsedS":{"type":["integer","null"]}}},"BuildChild":{"type":"object","description":"A child window inside a build-stage attempt, with its rollup.","properties":{"id":{"type":"string"},"issue":{"type":"string"},"title":{"type":"string"},"stageId":{"type":"string"},"position":{"type":"integer"},"status":{"type":"string","enum":["open","done"]},"startedAt":{"type":"string"},"endedAt":{"type":["string","null"]},"elapsedS":{"type":["integer","null"]},"commits":{"type":"integer"},"surfaces":{"type":"array","items":{"type":"object"}},"determination":{"type":["string","null"],"enum":["done","partial","not_done","na",null]},"comment":{"type":["string","null"]},"gates":{"type":"object","properties":{"pass":{"type":"integer"},"failed":{"type":"integer"},"total":{"type":"integer"}}},"browse":{"type":"object","properties":{"pass":{"type":"integer"},"total":{"type":"integer"}}}}},"BuildGate":{"type":"object","description":"A verification row. `provenance` is decided by the server: `observed` needs the CLI’s execution envelope, `imported` names a source file, everything else is `asserted`.","properties":{"id":{"type":"string"},"eventId":{"type":"string"},"stageId":{"type":["string","null"]},"issue":{"type":["string","null"],"description":"The child window, or null for a tree gate."},"gate":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["command","reviewer","adversarial","browser","ci","manual","composite"]},"attempt":{"type":"integer"},"tierApplicability":{"type":["string","null"]},"result":{"type":"string","enum":["pass","partial","failed","na"]},"reason":{"type":["string","null"]},"provenance":{"type":"string","enum":["observed","imported","asserted"]},"elapsedS":{"type":["integer","null"]},"evidence":{"type":["string","null"]},"findings":{"type":["object","array","null"]},"execution":{"type":["object","null"]},"reviewer":{"type":["object","null"]},"sourcePath":{"type":["string","null"]},"actor":{"type":"object"},"createdAt":{"type":"string"}}},"BuildEvent":{"type":"object","properties":{"id":{"type":"string"},"eventId":{"type":"string"},"sessionId":{"type":"string"},"seq":{"type":"integer"},"stageId":{"type":["string","null"]},"issue":{"type":["string","null"]},"ts":{"type":"string"},"kind":{"type":"string","enum":["user","assistant","tool_use","tool_result","agent_start","agent_end","api_error","hook","pr_link","state","stamp"]},"actor":{"type":"string"},"name":{"type":["string","null"]},"text":{"type":["string","null"],"description":"Redacted before it is stored."},"tokens":{"type":["object","null"]},"meta":{"type":["object","null"]}}},"BuildReport":{"type":"object","description":"Delivery rows and the final state. Gate rows live in build_gates.","properties":{"rows":{"type":"array","items":{"type":"object","properties":{"issue":{"type":"string"},"title":{"type":"string"},"determination":{"type":"string","enum":["done","partial","not_done","na"]},"comment":{"type":"string"}}}},"totals":{"type":"object"},"state":{"type":"string"}}},"BuildArtifact":{"type":"object","description":"One raw session file. Downloadable only by its session’s user or an admin.","properties":{"id":{"type":"string"},"sessionId":{"type":"string"},"kind":{"type":"string","enum":["raw_transcript","log"]},"status":{"type":"string","enum":["pending","ready"]},"bytes":{"type":["integer","null"]},"sha256":{"type":["string","null"]},"redacted":{"type":"boolean"},"createdAt":{"type":"string"}}},"BuildRollup":{"type":"object","description":"What the issue page reads. On a parent, the build with one row per child; on a child, the same build sliced to its window.","properties":{"role":{"type":"string","enum":["parent","child"]},"build":{"$ref":"#/components/schemas/Build"},"parentIssue":{"type":"string"},"children":{"type":"array","items":{"$ref":"#/components/schemas/BuildChild"}},"stages":{"type":"array","items":{"$ref":"#/components/schemas/BuildStage"}},"gates":{"type":"array","items":{"$ref":"#/components/schemas/BuildGate"}},"artifacts":{"type":"array","items":{"$ref":"#/components/schemas/BuildArtifact"}},"slice":{"oneOf":[{"$ref":"#/components/schemas/BuildChild"},{"type":"null"}]}}}}},"paths":{"/api/v1":{"get":{"summary":"API index + identity","responses":{"200":{"description":"Index","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/me":{"get":{"summary":"Identity / whoami","responses":{"200":{"description":"Identity","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/workspace":{"get":{"summary":"Current workspace + reference data (teams, statuses, labels, members)","responses":{"200":{"description":"Workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workspace"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/issues":{"get":{"summary":"List issues","parameters":[{"name":"team","in":"query","schema":{"type":"string"}},{"name":"status","in":"query","schema":{"type":"string"},"description":"name or \"open\"/\"closed\""},{"name":"assignee","in":"query","schema":{"type":"string"}},{"name":"label","in":"query","schema":{"type":"string"}},{"name":"project","in":"query","schema":{"type":"string"}},{"name":"cycle","in":"query","schema":{"type":"string"}},{"name":"priority","in":"query","schema":{"type":"string"}},{"name":"includeArchived","in":"query","schema":{"type":"boolean"}},{"name":"limit","in":"query","schema":{"type":"integer"}},{"name":"cursor","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Issues page","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"$ref":"#/components/schemas/Issue"}},"nextCursor":{"type":["string","null"]}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Create an issue","requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string","description":"Plain text or markdown"},"status":{"type":"string"},"priority":{"type":"string","enum":["none","urgent","high","medium","low"]},"assignee":{"type":"string","description":"Member email, \"me\", or \"none\""},"labels":{"type":"array","items":{"type":"string"}},"project":{"type":"string","description":"Project name or id, or \"none\""},"cycle":{"type":"string","description":"Cycle number or id, or \"none\""},"estimate":{"type":"integer","minimum":0,"maximum":21},"dueDate":{"type":"string","description":"YYYY-MM-DD"},"parent":{"type":"string","description":"Parent issue id, or \"none\" to detach"}}},{"type":"object","required":["title"],"properties":{"team":{"type":"string"}}}]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"issue":{"$ref":"#/components/schemas/Issue"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/issues/{id}":{"get":{"summary":"Get an issue (with relations)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Issue identifier, e.g. \"ENG-123\"."}],"responses":{"200":{"description":"Issue","content":{"application/json":{"schema":{"type":"object","properties":{"issue":{"$ref":"#/components/schemas/Issue"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"summary":"Update an issue","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Issue identifier, e.g. \"ENG-123\"."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string","description":"Plain text or markdown"},"status":{"type":"string"},"priority":{"type":"string","enum":["none","urgent","high","medium","low"]},"assignee":{"type":"string","description":"Member email, \"me\", or \"none\""},"labels":{"type":"array","items":{"type":"string"}},"project":{"type":"string","description":"Project name or id, or \"none\""},"cycle":{"type":"string","description":"Cycle number or id, or \"none\""},"estimate":{"type":"integer","minimum":0,"maximum":21},"dueDate":{"type":"string","description":"YYYY-MM-DD"},"parent":{"type":"string","description":"Parent issue id, or \"none\" to detach"}}},{"type":"object","properties":{"archived":{"type":"boolean"}}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"issue":{"$ref":"#/components/schemas/Issue"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Permanently delete an issue","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Issue identifier, e.g. \"ENG-123\"."}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/issues/{id}/move":{"post":{"summary":"Move an issue to another team (re-keys the identifier)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Issue identifier, e.g. \"ENG-123\"."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["team"],"properties":{"team":{"type":"string"}}}}}},"responses":{"200":{"description":"Moved","content":{"application/json":{"schema":{"type":"object","properties":{"issue":{"$ref":"#/components/schemas/Issue"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/issues/{id}/claim":{"post":{"summary":"Atomically assign an issue to the caller","description":"One conditional write: succeeds when the issue is unassigned or already assigned to the caller (idempotent), and returns 409 with the current assignee in `error.details.assignee` when someone else holds it. Of N concurrent claims, exactly one succeeds. `status` (a status name) is set in the same write, resolved against the issue's team at write time; if concurrent moves keep re-teaming the issue, the claim gives up with a 409 and no `assignee`.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Issue identifier, e.g. \"ENG-123\"."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"}}}}}},"responses":{"200":{"description":"Claimed","content":{"application/json":{"schema":{"type":"object","properties":{"issue":{"$ref":"#/components/schemas/Issue"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Already assigned to someone else, or the issue kept moving between teams","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/issues/{id}/close":{"post":{"summary":"Close an issue","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Issue identifier, e.g. \"ENG-123\"."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"responses":{"200":{"description":"Closed","content":{"application/json":{"schema":{"type":"object","properties":{"issue":{"$ref":"#/components/schemas/Issue"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/issues/bulk":{"post":{"summary":"Apply one update to many issues","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"patch":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string","description":"Plain text or markdown"},"status":{"type":"string"},"priority":{"type":"string","enum":["none","urgent","high","medium","low"]},"assignee":{"type":"string","description":"Member email, \"me\", or \"none\""},"labels":{"type":"array","items":{"type":"string"}},"project":{"type":"string","description":"Project name or id, or \"none\""},"cycle":{"type":"string","description":"Cycle number or id, or \"none\""},"estimate":{"type":"integer","minimum":0,"maximum":21},"dueDate":{"type":"string","description":"YYYY-MM-DD"},"parent":{"type":"string","description":"Parent issue id, or \"none\" to detach"}}}}}}}},"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/issues/{id}/comments":{"get":{"summary":"List comments","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Issue identifier, e.g. \"ENG-123\"."}],"responses":{"200":{"description":"Comments","content":{"application/json":{"schema":{"type":"object","properties":{"comments":{"type":"array","items":{"$ref":"#/components/schemas/Comment"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Add a comment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Issue identifier, e.g. \"ENG-123\"."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["body"],"properties":{"body":{"type":"string"},"parentId":{"type":"string"},"attachmentId":{"type":"string","description":"Scope the comment to an HTML attachment (file-level thread)."}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"comment":{"$ref":"#/components/schemas/Comment"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/issues/{id}/build":{"get":{"summary":"The issue’s build — a parent’s rollup, or a child’s slice","description":"One build per issue. A parent answers with the build, its stages, one row per child window and the latest verify attempt’s tree gates; a CHILD answers with the same build sliced to its own window, so one component renders both.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Issue identifier, e.g. \"ENG-123\"."}],"responses":{"200":{"description":"The build","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BuildRollup"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No build recorded on this issue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Open, resume or reopen the build (idempotent)","description":"Creates the build when none exists (201) and resumes it otherwise (200), appending the calling session to `sessions[]`. A finished build is reopened. `draft` replays the stages a CLI journaled before this issue existed, stored with their journaled timestamps.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Issue identifier, e.g. \"ENG-123\"."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"session":{"type":"string","description":"The client session id running the CLI."},"client":{"type":"string","enum":["claude","codex","other"]},"clientVersion":{"type":"string"},"models":{"type":"array","items":{"type":"string"}},"capturedBy":{"type":"string"},"branch":{"type":"string"},"baseSha":{"type":"string"},"headSha":{"type":"string"},"prUrl":{"type":"string"},"tier":{"type":"string"},"pipeline":{"type":"object"},"draft":{"type":"object","description":"Stages and sessions journaled before the issue existed.","properties":{"slug":{"type":"string"},"stages":{"type":"array","items":{"type":"object"}},"sessions":{"type":"array","items":{"$ref":"#/components/schemas/BuildSession"}}}}}}}}},"responses":{"200":{"description":"Resumed","content":{"application/json":{"schema":{"type":"object","properties":{"build":{"$ref":"#/components/schemas/Build"},"created":{"type":"boolean"},"reopened":{"type":"boolean"},"otherLiveSessions":{"type":"array","items":{"$ref":"#/components/schemas/BuildSession"}}}}}}},"201":{"description":"Opened","content":{"application/json":{"schema":{"type":"object","properties":{"build":{"$ref":"#/components/schemas/Build"},"created":{"type":"boolean"},"reopened":{"type":"boolean"},"otherLiveSessions":{"type":"array","items":{"$ref":"#/components/schemas/BuildSession"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A draft stage carries an impossible timestamp","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete the build and its artifacts (workspace admins/owners)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Issue identifier, e.g. \"ENG-123\"."}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/issues/{id}/build/full":{"get":{"summary":"The whole build: every stage attempt, window, gate and artifact","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Issue identifier, e.g. \"ENG-123\"."}],"responses":{"200":{"description":"The build","content":{"application/json":{"schema":{"type":"object","properties":{"build":{"$ref":"#/components/schemas/Build"},"stages":{"type":"array","items":{"$ref":"#/components/schemas/BuildStage"}},"children":{"type":"array","items":{"$ref":"#/components/schemas/BuildChild"}},"gates":{"type":"array","items":{"$ref":"#/components/schemas/BuildGate"}},"artifacts":{"type":"array","items":{"$ref":"#/components/schemas/BuildArtifact"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/issues/{id}/build/stages":{"post":{"summary":"Start or finish a stage attempt","description":"`action: \"start\"` on a stage whose latest instance is done appends the next attempt; on an already-open one it returns that one. `action: \"done\"` validates the payload for the five shipped stage ids and accepts any object for a custom id.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Issue identifier, e.g. \"ENG-123\"."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["stage"],"properties":{"action":{"type":"string","enum":["start","done"],"default":"start"},"stage":{"type":"string","examples":["plan","prototype","materialize","build","verify"]},"position":{"type":"integer"},"status":{"type":"string","enum":["done","red","skipped"]},"reason":{"type":"string"},"payload":{"type":"object"},"stamps":{"type":"array","items":{"type":"object"}},"actor":{"type":"object"},"headSha":{"type":"string"},"startedAt":{"type":"string"},"endedAt":{"type":"string"}}}}}},"responses":{"200":{"description":"Finished","content":{"application/json":{"schema":{"type":"object","properties":{"stage":{"$ref":"#/components/schemas/BuildStage"}}}}}},"201":{"description":"Started","content":{"application/json":{"schema":{"type":"object","properties":{"stage":{"$ref":"#/components/schemas/BuildStage"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The build is finished; reopen it first","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The stage payload is missing a required key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/issues/{id}/build/children":{"post":{"summary":"Open or close a child window","description":"Every gate, event and stamp recorded while a window is open carries that child’s issue. One window at a time; an issue that is not a child of the build’s issue is refused with 422.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Issue identifier, e.g. \"ENG-123\"."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["issue"],"properties":{"action":{"type":"string","enum":["start","done"],"default":"start"},"issue":{"type":"string","examples":["RAD-383"]},"determination":{"type":"string","enum":["done","partial","not_done","na"]},"comment":{"type":"string"},"commits":{"type":"integer"},"surfaces":{"type":"array","items":{"type":"object"}},"position":{"type":"integer"},"startedAt":{"type":"string"},"endedAt":{"type":"string"}}}}}},"responses":{"200":{"description":"Closed","content":{"application/json":{"schema":{"type":"object","properties":{"child":{"$ref":"#/components/schemas/BuildChild"}}}}}},"201":{"description":"Opened","content":{"application/json":{"schema":{"type":"object","properties":{"child":{"$ref":"#/components/schemas/BuildChild"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The build is finished, or another child window is open","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"That issue is not a child of the build’s issue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/issues/{id}/build/gates":{"post":{"summary":"Append gate rows (a re-run is a new attempt, never an overwrite)","description":"Provenance is server-decided: `observed` requires the execution envelope `{argv, exit, durationMs, summary, runnerVersion}`; a row naming `sourcePath` is `imported`; everything else is `asserted`. A gate id outside the build’s pipeline config is refused with 422.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Issue identifier, e.g. \"ENG-123\"."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"gates":{"type":"array","items":{"$ref":"#/components/schemas/BuildGate"}}}}}}},"responses":{"200":{"description":"Acknowledged (already stored)","content":{"application/json":{"schema":{"type":"object","properties":{"stored":{"type":"integer"},"acknowledged":{"type":"integer"},"gates":{"type":"array","items":{"$ref":"#/components/schemas/BuildGate"}}}}}}},"201":{"description":"Stored","content":{"application/json":{"schema":{"type":"object","properties":{"stored":{"type":"integer"},"acknowledged":{"type":"integer"},"gates":{"type":"array","items":{"$ref":"#/components/schemas/BuildGate"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The build is finished and the rows are new","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/issues/{id}/build/events":{"get":{"summary":"The stitched event timeline, in timestamp order","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Issue identifier, e.g. \"ENG-123\"."},{"name":"q","in":"query","schema":{"type":"string"},"description":"Full-text search."},{"name":"session","in":"query","schema":{"type":"string"}},{"name":"child","in":"query","schema":{"type":"string"},"description":"e.g. RAD-383"},{"name":"kind","in":"query","schema":{"type":"string"}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer"}}],"responses":{"200":{"description":"Events","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/BuildEvent"}},"nextCursor":{"type":["string","null"]}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Append events (idempotent on the deterministic eventId)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Issue identifier, e.g. \"ENG-123\"."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["events"],"properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/BuildEvent"}},"session":{"$ref":"#/components/schemas/BuildSession"}}}}}},"responses":{"200":{"description":"Acknowledged","content":{"application/json":{"schema":{"type":"object","properties":{"stored":{"type":"integer"},"acknowledged":{"type":"integer"}}}}}},"201":{"description":"Stored","content":{"application/json":{"schema":{"type":"object","properties":{"stored":{"type":"integer"},"acknowledged":{"type":"integer"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The build is finished and the events are new","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/issues/{id}/build/report":{"put":{"summary":"Store the delivery rows and the final state","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Issue identifier, e.g. \"ENG-123\"."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BuildReport"}}}},"responses":{"200":{"description":"Stored","content":{"application/json":{"schema":{"type":"object","properties":{"build":{"$ref":"#/components/schemas/Build"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/issues/{id}/build/finish":{"post":{"summary":"Close the build (idempotent); pending artifacts are removed","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Issue identifier, e.g. \"ENG-123\"."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","description":"The build's outcome is derived from its latest verify attempt, not declared here.","properties":{"headSha":{"type":"string"},"prUrl":{"type":"string"}}}}}},"responses":{"200":{"description":"Finished","content":{"application/json":{"schema":{"type":"object","properties":{"build":{"$ref":"#/components/schemas/Build"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/issues/{id}/build/artifacts":{"post":{"summary":"Mint a signed upload URL for a session’s raw transcript","description":"The storage path is server-generated; the client never chooses where bytes land.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Issue identifier, e.g. \"ENG-123\"."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["sessionId","bytes","sha256"],"properties":{"sessionId":{"type":"string"},"kind":{"type":"string","enum":["raw_transcript","log"]},"bytes":{"type":"integer"},"sha256":{"type":"string","description":"64-character hex digest of the gzipped bytes."}}}}}},"responses":{"201":{"description":"Minted","content":{"application/json":{"schema":{"type":"object","properties":{"artifact":{"$ref":"#/components/schemas/BuildArtifact"},"uploadUrl":{"type":"string"},"token":{"type":"string"},"path":{"type":"string"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/issues/{id}/build/artifacts/{artifact}/confirm":{"post":{"summary":"Confirm an uploaded artifact (size + digest re-read from storage)","description":"A mismatch returns 422 and the stored object is removed.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Issue identifier, e.g. \"ENG-123\"."},{"name":"artifact","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Ready","content":{"application/json":{"schema":{"type":"object","properties":{"artifact":{"$ref":"#/components/schemas/BuildArtifact"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Digest or size mismatch; the object was removed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/issues/{id}/build/artifacts/{artifact}":{"get":{"summary":"A signed download URL for one session’s raw transcript","description":"Requires the artifact grant: the session’s own user, or a workspace admin/owner. Anyone else gets 403.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Issue identifier, e.g. \"ENG-123\"."},{"name":"artifact","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Signed URL","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"artifact":{"$ref":"#/components/schemas/BuildArtifact"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/issues/{id}/attachments":{"get":{"summary":"List an issue’s attachments","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Issue identifier, e.g. \"ENG-123\"."}],"responses":{"200":{"description":"Attachments","content":{"application/json":{"schema":{"type":"object","properties":{"attachments":{"type":"array","items":{"$ref":"#/components/schemas/Attachment"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Attach a file (e.g. an HTML prototype). Returns a Preview URL.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Issue identifier, e.g. \"ENG-123\"."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["filename","content"],"properties":{"filename":{"type":"string"},"content":{"type":"string","description":"File contents (utf8 text or base64)."},"encoding":{"type":"string","enum":["utf8","base64"],"default":"utf8"},"contentType":{"type":"string"}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"attachment":{"$ref":"#/components/schemas/Attachment"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large (over the 3 MB API cap)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/attachments/{id}":{"get":{"summary":"Get one attachment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Attachment id (uuid)"}],"responses":{"200":{"description":"Attachment","content":{"application/json":{"schema":{"type":"object","properties":{"attachment":{"$ref":"#/components/schemas/Attachment"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Soft-delete an attachment (leaves a tombstone; comments preserved).","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Attachment id (uuid)"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/attachments/{id}/content":{"get":{"summary":"Download an attachment’s raw bytes (CSP-sandboxed response).","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Attachment id (uuid)"}],"responses":{"200":{"description":"Raw file bytes"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/comments/{id}":{"delete":{"summary":"Soft-delete a comment (author only; leaves a tombstone).","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Comment id (uuid)"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"object","properties":{"id":{"type":"string"}}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/issues/{id}/relations":{"get":{"summary":"List relations","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Issue identifier, e.g. \"ENG-123\"."}],"responses":{"200":{"description":"Relations","content":{"application/json":{"schema":{"type":"object","properties":{"relations":{"type":"array","items":{"$ref":"#/components/schemas/Relation"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Add a relation","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Issue identifier, e.g. \"ENG-123\"."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["target","type"],"properties":{"target":{"type":"string"},"type":{"type":"string","enum":["blocks","blocked_by","related","duplicate_of","duplicated_by"]}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"relation":{"$ref":"#/components/schemas/Relation"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Remove a relation (by target + type)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Issue identifier, e.g. \"ENG-123\"."},{"name":"target","in":"query","schema":{"type":"string"}},{"name":"type","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Removed","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/issues/{id}/activity":{"get":{"summary":"An issue's activity history","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Issue identifier, e.g. \"ENG-123\"."}],"responses":{"200":{"description":"Activity","content":{"application/json":{"schema":{"type":"object","properties":{"activity":{"type":"array","items":{"$ref":"#/components/schemas/Activity"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/notifications":{"get":{"summary":"The credential's notifications","parameters":[{"name":"unread","in":"query","schema":{"type":"boolean"}},{"name":"limit","in":"query","schema":{"type":"integer"}},{"name":"cursor","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Notifications","content":{"application/json":{"schema":{"type":"object","properties":{"notifications":{"type":"array","items":{"$ref":"#/components/schemas/Notification"}},"nextCursor":{"type":["string","null"]}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Mark notifications read","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"read":{"type":"boolean"},"all":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/activity":{"get":{"summary":"Recent activity — workspace-wide status transitions in a time window","parameters":[{"name":"since","in":"query","schema":{"type":"string"},"description":"Window keyword (24h/48h/7d/30d), <n>h/<n>d duration, or ISO timestamp. Default 24h."},{"name":"until","in":"query","schema":{"type":"string"}},{"name":"team","in":"query","schema":{"type":"string"}},{"name":"project","in":"query","schema":{"type":"string"}},{"name":"category","in":"query","schema":{"type":"string"},"description":"Comma-separated destination categories, e.g. \"started,completed\"."},{"name":"status","in":"query","schema":{"type":"string"},"description":"Comma-separated destination status names."},{"name":"limit","in":"query","schema":{"type":"integer"}},{"name":"cursor","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Activity page","content":{"application/json":{"schema":{"type":"object","properties":{"activity":{"type":"array","items":{"$ref":"#/components/schemas/RecentActivity"}},"nextCursor":{"type":["string","null"]}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/events":{"get":{"summary":"Workspace event feed (owner/admin only; members get empty lists)","parameters":[{"name":"type","in":"query","schema":{"type":"string"},"description":"Comma-separated event names, e.g. \"issue.created,comment.added\""},{"name":"subjectType","in":"query","schema":{"type":"string"}},{"name":"subjectId","in":"query","schema":{"type":"string"}},{"name":"actorId","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer"}},{"name":"cursor","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Events page","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/Event"}},"nextCursor":{"type":["string","null"]}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/labels":{"get":{"summary":"List labels","responses":{"200":{"description":"Labels","content":{"application/json":{"schema":{"type":"object","properties":{"labels":{"type":"array","items":{"$ref":"#/components/schemas/Label"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Create a label","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"color":{"type":"string"},"team":{"type":"string"}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"label":{"$ref":"#/components/schemas/Label"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/labels/{id}":{"patch":{"summary":"Update a label","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Label id or name"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"color":{"type":"string"}}}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"label":{"$ref":"#/components/schemas/Label"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete a label","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Label id or name"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/cycles":{"get":{"summary":"List cycles","parameters":[{"name":"team","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Cycles","content":{"application/json":{"schema":{"type":"object","properties":{"cycles":{"type":"array","items":{"$ref":"#/components/schemas/Cycle"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Create a cycle","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["team","startDate","endDate"],"properties":{"team":{"type":"string"},"name":{"type":"string"},"startDate":{"type":"string"},"endDate":{"type":"string"}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"cycle":{"$ref":"#/components/schemas/Cycle"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/cycles/{id}":{"patch":{"summary":"Update a cycle","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Cycle id or number"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"startDate":{"type":"string"},"endDate":{"type":"string"}}}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"cycle":{"$ref":"#/components/schemas/Cycle"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete a cycle","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Cycle id or number"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/projects":{"get":{"summary":"List projects","responses":{"200":{"description":"Projects","content":{"application/json":{"schema":{"type":"object","properties":{"projects":{"type":"array","items":{"$ref":"#/components/schemas/Project"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Create a project","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"status":{"type":"string"},"priority":{"type":"string","enum":["none","urgent","high","medium","low"]},"lead":{"type":"string"},"color":{"type":"string"},"icon":{"type":["string","null"]},"description":{"type":"string"},"startDate":{"type":"string"},"targetDate":{"type":"string"}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"project":{"$ref":"#/components/schemas/Project"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/projects/{id}":{"get":{"summary":"Get a project","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Project id or name"}],"responses":{"200":{"description":"Project","content":{"application/json":{"schema":{"type":"object","properties":{"project":{"$ref":"#/components/schemas/Project"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"summary":"Update a project","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Project id or name"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"status":{"type":"string"},"priority":{"type":"string","enum":["none","urgent","high","medium","low"]},"lead":{"type":"string"},"color":{"type":"string"},"icon":{"type":["string","null"]},"description":{"type":"string"},"startDate":{"type":"string"},"targetDate":{"type":"string"},"archived":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"project":{"$ref":"#/components/schemas/Project"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete a project","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Project id or name"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/teams":{"get":{"summary":"List teams","responses":{"200":{"description":"Teams","content":{"application/json":{"schema":{"type":"object","properties":{"teams":{"type":"array","items":{"$ref":"#/components/schemas/Team"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Create a team (owner/admin). Seeds default workflow statuses.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","key"],"properties":{"name":{"type":"string"},"key":{"type":"string","description":"1–7 letters/digits starting with a letter"},"icon":{"type":"string"},"color":{"type":"string"}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"team":{"$ref":"#/components/schemas/Team"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/teams/{id}":{"patch":{"summary":"Update or archive a team (owner/admin). The key is immutable.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Team id or key"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"icon":{"type":"string"},"color":{"type":"string"},"archived":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"team":{"$ref":"#/components/schemas/Team"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete a team (owner/admin). Refused if it is the last team or has open issues.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Team id or key"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/api-keys":{"get":{"summary":"List API keys (owner/admin)","responses":{"200":{"description":"Keys","content":{"application/json":{"schema":{"type":"object","properties":{"keys":{"type":"array","items":{"$ref":"#/components/schemas/ApiKey"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Mint an API key (owner/admin). The plaintext key is returned once.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"scope":{"type":"string","enum":["read","triage","write"]}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/api-keys/{id}":{"delete":{"summary":"Revoke an API key (owner/admin)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Issue identifier, e.g. \"ENG-123\"."}],"responses":{"200":{"description":"Revoked","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/search":{"get":{"summary":"Search the workspace","description":"Prefix-aware full-text + fuzzy search across issues, comment bodies, and project names, ranked by relevance fused with recency and assignment. Also accepts an identifier (\"TEAM-123\") or a pasted issue URL. Defaults to issues only; pass `types` to widen.","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string"}},{"name":"types","in":"query","description":"Comma-separated kinds, or \"all\". Defaults to \"issue\".","schema":{"type":"string","example":"issue,comment,project"}},{"name":"limit","in":"query","schema":{"type":"integer"}}],"responses":{"200":{"description":"Results","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"TEAM-123 for issues/comments"},"kind":{"type":"string","enum":["issue","comment","project"]},"title":{"type":"string"},"snippet":{"type":"string","nullable":true,"description":"Plain-text excerpt around the match."},"status":{"type":"string"},"priority":{"type":"string"},"assignee":{"type":"string","nullable":true},"score":{"type":"number","description":"Fused relevance score."},"rank":{"type":"number","description":"Alias of score (back-compat)."}}}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/triage":{"get":{"summary":"Triage queue","parameters":[{"name":"team","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Issues","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"$ref":"#/components/schemas/Issue"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/export":{"get":{"summary":"Export the workspace","parameters":[{"name":"format","in":"query","schema":{"type":"string","enum":["json","csv"]}}],"responses":{"200":{"description":"Export"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/import":{"post":{"summary":"Bulk import issues","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope or forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}