{"openapi":"3.1.0","info":{"title":"SHIP API","version":"v1","description":"The SHIP product API: start and steer missions, and manage the projects, credentials and agents they run with."},"servers":[{"url":"https://api.letsship.ai/v1"}],"components":{"schemas":{"CreateOrganizationRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"slug":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9-]+$"}},"required":["name"]},"Organization":{"type":"object","properties":{"id":{"type":"string","example":"org_1a2b3c4d5e6f7a8b"},"name":{"type":"string","example":"Alex's Startup"},"slug":{"type":"string","example":"alexs-startup"},"createdByUserId":{"type":"string"},"createdAt":{"type":"integer"},"namePending":{"type":"boolean"}},"required":["id","name","slug","createdByUserId","createdAt","namePending"]},"Error":{"type":"object","properties":{"category":{"type":"string","enum":["auth","rate_limit","timeout","validation","infrastructure","agent","unknown"],"example":"validation"},"title":{"type":"string","example":"Invalid request"},"description":{"type":"string","example":"The 'projectId' parameter must be a UUID."},"retryable":{"type":"boolean","example":false},"code":{"type":"string","example":"credits_exhausted"}},"required":["category","title","description","retryable"]},"ListOrganizationsResponse":{"type":"object","properties":{"orgs":{"type":"array","items":{"$ref":"#/components/schemas/Organization"}}},"required":["orgs"]},"UpdateOrganizationRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"slug":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9-]+$"}}},"SlugAvailabilityResponse":{"type":"object","properties":{"slug":{"type":"string","example":"first-run-labs"},"available":{"type":"boolean"},"suggestion":{"type":["string","null"],"example":"first-run-labs-2"}},"required":["slug","available","suggestion"]},"SlugPreviewResponse":{"type":"object","properties":{"slug":{"type":"string","example":"alexs-startup"}},"required":["slug"]},"ListMembershipsResponse":{"type":"object","properties":{"memberships":{"type":"array","items":{"$ref":"#/components/schemas/Membership"}}},"required":["memberships"]},"CreateMembershipRequest":{"type":"object","properties":{"userId":{"type":"string","minLength":1},"role":{"allOf":[{"$ref":"#/components/schemas/OrgRole"},{"type":"string"}]}},"required":["userId","role"]},"Membership":{"type":"object","properties":{"orgId":{"type":"string"},"userId":{"type":"string"},"role":{"allOf":[{"$ref":"#/components/schemas/OrgRole"},{"type":"string"}]},"createdAt":{"type":"integer"}},"required":["orgId","userId","role","createdAt"]},"OrgClosure":{"type":"object","properties":{"orgId":{"type":"string"},"closedAt":{"type":"integer"},"basis":{"type":"string","enum":["owner","ship"]},"settlements":{"type":"array","items":{"$ref":"#/components/schemas/ClosureSettlement"}}},"required":["orgId","closedAt","basis","settlements"]},"CreateTokenRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"Human label shown in the token list. Not an identifier.","example":"laptop CLI"},"scopes":{"type":"array","items":{"type":"string"},"maxItems":25,"default":[],"description":"Scopes to delegate to the token. Every entry must be a declared scope AND within the caller's own grant ceiling (a token can never carry authority its minter lacks) - otherwise 403, naming each refused entry. Defaults to none.","example":["missions:run","missions:read"]},"expiresInDays":{"type":"integer","minimum":1,"maximum":365,"default":90,"description":"Lifetime in days from now. Tokens always expire; there is no non-expiring option.","example":90},"projectId":{"type":"string","minLength":1,"description":"Bind the token to ONE project. Missions, runs, environments, artifacts and scheduled tasks then refuse anything outside it - the narrowest useful grant for a third-party integration. The project records themselves stay readable across the org. The project must belong to your org, otherwise 404. Omitted: the token is org-wide.","example":"proj_f0e324d8a104d8e4ae9426e4"}},"required":["name"]},"CreatedToken":{"type":"object","properties":{"id":{"type":"string","example":"tok-pat-9b8e2a3f"},"name":{"type":"string","example":"laptop CLI"},"token":{"type":"string","description":"The raw bearer token. Shown once, at creation, and never again.","example":"pat_yYqk7Fp2R8x…"},"scopes":{"type":"array","items":{"type":"string"},"example":["missions:run"]},"projectId":{"type":["string","null"],"description":"The project this token is bound to, or null when it is org-wide.","example":null},"expiresAt":{"type":"integer","example":1743465600000},"createdAt":{"type":"integer","example":1735689600000}},"required":["id","name","token","scopes","projectId","expiresAt","createdAt"]},"TokenList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TokenSummary"}}},"required":["data"]},"RevokeTokenResult":{"type":"object","properties":{"kind":{"type":"string","enum":["revoked","already-revoked"],"example":"revoked"},"tokenId":{"type":"string","example":"tok-9b8e2a3f"},"revokedAt":{"type":"integer","example":1735689600000}},"required":["kind","tokenId","revokedAt"]},"AuthorizationServerMetadata":{"type":"object","properties":{"issuer":{"type":"string"},"token_endpoint":{"type":"string"},"revocation_endpoint":{"type":"string"},"jwks_uri":{"type":"string"},"grant_types_supported":{"type":"array","items":{"type":"string"}},"scopes_supported":{"type":"array","items":{"type":"string"}},"token_endpoint_auth_methods_supported":{"type":"array","items":{"type":"string"}},"agent_auth":{"type":"object","additionalProperties":{}}},"required":["issuer","token_endpoint","revocation_endpoint","jwks_uri","grant_types_supported","scopes_supported","token_endpoint_auth_methods_supported","agent_auth"]},"ProtectedResourceMetadata":{"type":"object","properties":{"resource":{"type":"string"},"resource_name":{"type":"string"},"authorization_servers":{"type":"array","items":{"type":"string"}},"scopes_supported":{"type":"array","items":{"type":"string"}},"bearer_methods_supported":{"type":"array","items":{"type":"string"}},"resource_documentation":{"type":"string"}},"required":["resource","resource_name","authorization_servers","scopes_supported","bearer_methods_supported","resource_documentation"]},"Jwks":{"type":"object","properties":{"keys":{"type":"array","items":{"type":"object","additionalProperties":{}}}},"required":["keys"]},"AgentIdentityRequest":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["anonymous"]},"agent_name":{"type":"string","maxLength":200,"description":"What the agent calls itself. Shown on the claim page as the agent's own words; the person names the delegation.","example":"Release notes agent"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["service_auth"]},"login_hint":{"type":"string","minLength":1,"maxLength":320,"example":"ada@example.com"},"agent_name":{"type":"string","maxLength":200,"description":"What the agent calls itself. Shown on the claim page as the agent's own words; the person names the delegation.","example":"Release notes agent"}},"required":["type","login_hint"]},{"type":"object","properties":{"type":{"type":"string","enum":["identity_assertion"]},"assertion_type":{"type":"string","description":"urn:ietf:params:oauth:token-type:id-jag. The auth.md v0.1 value verified_email (with the email as the assertion) is accepted as service_auth.","example":"urn:ietf:params:oauth:token-type:id-jag"},"assertion":{"type":"string","minLength":1,"maxLength":16384},"agent_name":{"type":"string","maxLength":200,"description":"What the agent calls itself. Shown on the claim page as the agent's own words; the person names the delegation.","example":"Release notes agent"}},"required":["type","assertion_type","assertion"]}]},"AgentRegistrationResponse":{"type":"object","properties":{"registration_id":{"type":"string","example":"reg_4kQ2..."},"registration_type":{"type":"string","enum":["anonymous","service_auth","identity_assertion"]},"identity_assertion":{"type":"string"},"assertion_expires":{"type":"string"},"pre_claim_scopes":{"type":"array","items":{"type":"string"}},"scopes":{"type":"array","items":{"type":"string"}},"claim_url":{"type":"string"},"claim_token":{"type":"string","description":"Returned once. Keep it in memory for the claim, never longer."},"claim_token_expires":{"type":"string"},"post_claim_scopes":{"type":"array","items":{"type":"string"}},"claim":{"$ref":"#/components/schemas/ClaimCeremony"}},"required":["registration_id","registration_type"]},"AgentAuthError":{"type":"object","properties":{"error":{"type":"string","example":"issuer_not_enabled"},"error_description":{"type":"string"},"max_age":{"type":"integer"},"registration_id":{"type":"string"},"registration_type":{"type":"string"},"claim_url":{"type":"string"},"claim_token":{"type":"string","description":"Returned once. Keep it in memory for the claim, never longer."},"claim_token_expires":{"type":"string"},"post_claim_scopes":{"type":"array","items":{"type":"string"}},"claim":{"$ref":"#/components/schemas/ClaimCeremony"}},"required":["error","error_description"]},"InitiateClaimRequest":{"type":"object","properties":{"claim_token":{"type":"string","minLength":1,"maxLength":200},"email":{"type":"string","minLength":1,"maxLength":320,"example":"ada@example.com"}},"required":["claim_token","email"]},"InitiateClaimResponse":{"type":"object","properties":{"registration_id":{"type":"string"},"claim_attempt_id":{"type":"string"},"status":{"type":"string","enum":["initiated"]},"expires_at":{"type":"string"},"claim_attempt":{"$ref":"#/components/schemas/ClaimCeremony"}},"required":["registration_id","claim_attempt_id","status","expires_at","claim_attempt"]},"OAuthTokenRequest":{"type":"object","properties":{"grant_type":{"type":"string","example":"urn:ietf:params:oauth:grant-type:jwt-bearer"},"assertion":{"type":"string"},"claim_token":{"type":"string"},"resource":{"type":"string","description":"RFC 8707 resource: the API (default) or the MCP server."},"code":{"type":"string"},"redirect_uri":{"type":"string"},"client_id":{"type":"string"},"code_verifier":{"type":"string"},"refresh_token":{"type":"string"}},"required":["grant_type"]},"OAuthTokenResponse":{"type":"object","properties":{"access_token":{"type":"string"},"token_type":{"type":"string","enum":["Bearer"]},"expires_in":{"type":"integer"},"scope":{"type":"string"},"refresh_token":{"type":"string"},"identity_assertion":{"type":"string"},"assertion_expires":{"type":"string"}},"required":["access_token","token_type","expires_in","scope"]},"OAuthError":{"type":"object","properties":{"error":{"type":"string","example":"invalid_grant"},"error_description":{"type":"string"}},"required":["error"]},"OAuthRevokeRequest":{"type":"object","properties":{"token":{"type":"string"},"token_type_hint":{"type":"string"}},"required":["token"]},"SecurityEventError":{"type":"object","properties":{"err":{"type":"string","example":"invalid_issuer"},"description":{"type":"string"}},"required":["err","description"]},"AgentDelegationList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AgentDelegation"}}},"required":["data"]},"RevokeAgentDelegationResult":{"type":"object","properties":{"kind":{"type":"string","enum":["revoked","already-revoked"]},"delegationId":{"type":"string"},"revokedAt":{"type":"integer"},"revokedTokens":{"type":"integer","description":"Live access tokens that stopped working with it."}},"required":["kind","delegationId","revokedAt","revokedTokens"]},"ClientRegistrationRequest":{"type":"object","properties":{"redirect_uris":{"type":"array","items":{"type":"string"},"example":["http://127.0.0.1:33418/callback"]},"client_name":{"type":"string","maxLength":200,"example":"Claude Code"},"client_uri":{"type":"string"},"logo_uri":{"type":"string"},"grant_types":{"type":"array","items":{"type":"string"},"example":["authorization_code","refresh_token"]},"response_types":{"type":"array","items":{"type":"string"}},"token_endpoint_auth_method":{"type":"string","example":"none"},"application_type":{"type":"string","example":"native"}},"required":["redirect_uris"]},"ClientRegistrationResponse":{"type":"object","properties":{"client_id":{"type":"string","example":"cli_7Hc2..."},"client_id_issued_at":{"type":"integer"},"client_name":{"type":"string"},"redirect_uris":{"type":"array","items":{"type":"string"}},"grant_types":{"type":"array","items":{"type":"string"}},"response_types":{"type":"array","items":{"type":"string"}},"token_endpoint_auth_method":{"type":"string","enum":["none"]}},"required":["client_id","client_id_issued_at","redirect_uris","grant_types","response_types","token_endpoint_auth_method"]},"Me":{"type":"object","properties":{"principalType":{"type":"string","enum":["cookie","user","service","system","agent"],"description":"agent: a self-registered agent nobody has claimed yet. It has no user, org, role or scopes, and reaches only /me and /scopes until a person claims it.","example":"user"},"userId":{"type":["string","null"],"example":"user_9b8e2a3f3c4d4e5f9a8b"},"orgId":{"type":["string","null"],"example":"org_7c1f2a"},"role":{"$ref":"#/components/schemas/OrgRole"},"capabilities":{"type":"array","items":{"$ref":"#/components/schemas/Capability"},"example":["pipeline:control","config:write"]},"scopes":{"type":"array","items":{"type":"string"},"example":["projects:read","missions:run"]},"projectId":{"type":["string","null"],"description":"The project this credential is bound to, or null when it is org-wide. A bound token can read and act only on that project, and on nothing org-wide - so a caller can see the boundary it works within rather than discovering it through a 404.","example":null}},"required":["principalType","userId","orgId","role","capabilities","scopes","projectId"]},"SetupProgress":{"type":"object","properties":{"orgId":{"type":"string"},"reachedCount":{"type":"integer","minimum":0},"totalCount":{"type":"integer","minimum":1},"complete":{"type":"boolean"},"next":{"$ref":"#/components/schemas/SetupMilestoneId"},"activeGroup":{"$ref":"#/components/schemas/SetupGroupId"},"activeGroupProgress":{"type":["object","null"],"properties":{"reachedCount":{"type":"integer","minimum":0},"totalCount":{"type":"integer","minimum":1}},"required":["reachedCount","totalCount"]},"groups":{"type":"array","items":{"$ref":"#/components/schemas/SetupGroup"}},"firstMission":{"type":["object","null"],"properties":{"issueId":{"type":"string","example":"SFM-1"},"orgSlug":{"type":"string"},"url":{"type":"string","format":"uri"}},"required":["issueId","orgSlug","url"]},"guides":{"type":"array","items":{"$ref":"#/components/schemas/SetupGuide"}}},"required":["orgId","reachedCount","totalCount","complete","next","activeGroup","activeGroupProgress","groups","firstMission","guides"]},"SetupMilestoneId":{"type":["string","null"],"enum":["workspace","first_mission","first_review","first_merge","preview_deployment","agent_instructions","mcp_servers","custom_sandbox","teammate","steer_mission","checkpoints","scheduled_task","agent_to_pr"]},"UpdateSetupMilestoneRequest":{"type":"object","properties":{"mark":{"$ref":"#/components/schemas/SetupMark"}},"required":["mark"]},"SetupGroupId":{"type":["string","null"],"enum":["first_mission","team","explore"]},"UpdateSetupGroupRequest":{"type":"object","properties":{"mark":{"$ref":"#/components/schemas/SetupMark"}},"required":["mark"]},"SetupGuideId":{"type":"string","enum":["mission-control","mission-detail","mission-results"]},"UpdateSetupGuideRequest":{"type":"object","properties":{"step":{"type":"integer","minimum":0,"maximum":20},"completed":{"type":"boolean","default":false}},"required":["step"]},"SetupGuide":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/SetupGuideId"},"step":{"type":"integer","minimum":0},"completedAt":{"type":["integer","null"]}},"required":["id","step","completedAt"]},"ListNoticesResponse":{"type":"object","properties":{"orgId":{"type":"string"},"notices":{"type":"array","items":{"$ref":"#/components/schemas/Notice"}}},"required":["orgId","notices"]},"NoticeDismissal":{"type":"object","properties":{"orgId":{"type":"string"},"noticeId":{"type":"string"},"dismissedAt":{"type":"integer"}},"required":["orgId","noticeId","dismissedAt"]},"ScopeCatalog":{"type":"object","properties":{"groups":{"type":"array","items":{"$ref":"#/components/schemas/ScopeGroup"}}},"required":["groups"]},"CreateInviteRequest":{"type":"object","properties":{"email":{"type":"string","format":"email"},"role":{"allOf":[{"$ref":"#/components/schemas/OrgRole"},{"type":"string"}]}},"required":["email","role"]},"Invite":{"type":"object","properties":{"id":{"type":"string","example":"invite_9b8e2a3f3c4d4e5f9a8b"},"email":{"type":"string","format":"email"},"role":{"allOf":[{"$ref":"#/components/schemas/OrgRole"},{"type":"string"}]},"orgId":{"type":"string"},"status":{"$ref":"#/components/schemas/InviteStatus"},"invitedByUserId":{"type":["string","null"]},"expiresAtSec":{"type":"integer"},"createdAt":{"type":"integer"}},"required":["id","email","role","orgId","status","invitedByUserId","expiresAtSec","createdAt"]},"ListInvitesResponse":{"type":"object","properties":{"invites":{"type":"array","items":{"$ref":"#/components/schemas/Invite"}}},"required":["invites"]},"RevokeInviteResponse":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]},"Project":{"type":"object","properties":{"id":{"type":"string","example":"proj_9b8e2a3f3c4d4e5f9a8b"},"orgId":{"type":"string","example":"org_1a2b3c4d5e6f7a8b"},"slug":{"type":"string","example":"ship-frontend"},"name":{"type":"string","example":"SHIP - Frontend"},"status":{"$ref":"#/components/schemas/ProjectStatus"},"tracker":{"$ref":"#/components/schemas/ProjectTracker"},"trackerConnectorId":{"type":["string","null"],"example":"conn_linear_abcdef"},"trackerTeamId":{"type":["string","null"],"example":"SHIP"},"trackerProjectId":{"type":["string","null"]},"scmConnectorId":{"type":"string","example":"conn_github_abcdef"},"scmOwner":{"type":"string","example":"acme-co"},"scmRepo":{"type":"string","example":"frontend"},"llmConnectorId":{"type":"string","example":"conn_anthropic_abcdef"},"autoMerge":{"type":"boolean","example":false},"issueCode":{"type":["string","null"],"example":"PAG"},"defaultSandboxTemplateId":{"type":["string","null"],"example":null},"createdAt":{"type":"integer","example":1735689600000},"missingConnectorKinds":{"type":"array","items":{"type":"string","enum":["tracker","scm","llm"]},"example":[]}},"required":["id","orgId","slug","name","status","tracker","trackerConnectorId","trackerTeamId","trackerProjectId","scmConnectorId","scmOwner","scmRepo","llmConnectorId","autoMerge","issueCode","defaultSandboxTemplateId","createdAt"]},"CreateProjectRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"tracker":{"allOf":[{"$ref":"#/components/schemas/ProjectTracker"},{"default":"linear"}]},"linearTeamKey":{"type":"string","minLength":1},"repoFullName":{"type":"string","pattern":"^[^/\\s]+\\/[^/\\s]+$"},"issueCode":{"$ref":"#/components/schemas/IssueCode"}},"required":["name","repoFullName"]},"DuplicateProjectError":{"type":"object","properties":{"category":{"type":"string","enum":["validation"]},"title":{"type":"string","enum":["Conflict"]},"description":{"type":"string"},"retryable":{"type":"boolean","enum":[false]},"conflictingProjectId":{"type":"string"}},"required":["category","title","description","retryable","conflictingProjectId"]},"UpdateProjectRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"status":{"$ref":"#/components/schemas/ProjectStatus"},"autoMerge":{"type":"boolean"},"issueCode":{"$ref":"#/components/schemas/IssueCode"},"defaultSandboxTemplateId":{"type":["string","null"],"minLength":1},"linearTeamKey":{"type":"string","minLength":1},"repoFullName":{"type":"string","pattern":"^[^/\\s]+\\/[^/\\s]+$"}}},"DeleteProjectResponse":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]},"id":{"type":"string"}},"required":["ok","id"]},"ListOffersResponse":{"type":"object","properties":{"currency":{"type":"string","enum":["USD"]},"trialCredits":{"type":"integer","exclusiveMinimum":0},"offers":{"type":"array","items":{"$ref":"#/components/schemas/BillingOffer"}},"referencePerCreditUsd":{"type":"number","exclusiveMinimum":0},"team":{"$ref":"#/components/schemas/TeamPlanOffer"},"enterprise":{"$ref":"#/components/schemas/EnterpriseOffer"},"limits":{"type":"object","properties":{"free":{"type":"object","properties":{"projects":{"type":"integer","exclusiveMinimum":0},"agentsAtOnce":{"type":"integer","exclusiveMinimum":0}},"required":["projects","agentsAtOnce"]},"packs":{"type":"object","properties":{"projects":{"type":["integer","null"],"exclusiveMinimum":0},"agentsAtOnce":{"type":"integer","exclusiveMinimum":0}},"required":["projects","agentsAtOnce"]}},"required":["free","packs"]}},"required":["currency","trialCredits","offers","referencePerCreditUsd","team","enterprise","limits"]},"BillingSummary":{"type":"object","properties":{"orgId":{"type":"string"},"plan":{"$ref":"#/components/schemas/BillingPlan"},"cohort":{"anyOf":[{"$ref":"#/components/schemas/BillingCohort"},{"type":"null"},{"type":"null"}]},"mode":{"$ref":"#/components/schemas/BillingMode"},"balance":{"type":"integer","minimum":0},"sources":{"type":"array","items":{"$ref":"#/components/schemas/CreditSource"}},"low":{"type":"boolean"},"canStartMission":{"type":"boolean"},"canManage":{"type":"boolean"},"coveredByShip":{"type":"boolean"},"missionCeiling":{"type":"integer","exclusiveMinimum":0},"sandboxLimit":{"anyOf":[{"type":"integer","exclusiveMinimum":0},{"type":"null"},{"type":"null"}]},"projects":{"type":"object","properties":{"used":{"type":"integer","minimum":0},"limit":{"type":["integer","null"]}},"required":["used","limit"]},"trackerTriggers":{"$ref":"#/components/schemas/TrackerTriggerPolicy"},"usage":{"$ref":"#/components/schemas/BillingUsage"},"openCreditRequest":{"anyOf":[{"$ref":"#/components/schemas/CreditRequestSummary"},{"type":"null"},{"type":"null"}]},"creditRequestsGoTo":{"$ref":"#/components/schemas/CreditRequestRecipient"},"purchase":{"$ref":"#/components/schemas/BillingPurchaseState"},"subscription":{"anyOf":[{"$ref":"#/components/schemas/TeamSubscription"},{"type":"null"},{"type":"null"}]},"advice":{"anyOf":[{"$ref":"#/components/schemas/PlanAdvice"},{"type":"null"},{"type":"null"}]},"trial":{"$ref":"#/components/schemas/BillingTrialState"}},"required":["orgId","plan","cohort","mode","balance","sources","low","canStartMission","canManage","coveredByShip","missionCeiling","sandboxLimit","projects","trackerTriggers","usage","openCreditRequest","creditRequestsGoTo","purchase","subscription","advice","trial"]},"ListLedgerResponse":{"type":"object","properties":{"entries":{"type":"array","items":{"$ref":"#/components/schemas/LedgerEntry"}},"nextCursor":{"type":["string","null"]}},"required":["entries","nextCursor"]},"CreateCreditRequest":{"type":"object","properties":{"orgId":{"type":"string","minLength":1},"message":{"type":"string","minLength":1,"maxLength":2000}},"required":["message"]},"CreditRequestResponse":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["open"]},"appended":{"type":"boolean"},"routedTo":{"$ref":"#/components/schemas/CreditRequestRecipient"}},"required":["id","status","appended","routedTo"]},"UpdateBillingSettingsRequest":{"type":"object","properties":{"orgId":{"type":"string","minLength":1},"trackerTriggers":{"$ref":"#/components/schemas/TrackerTriggerPolicy"}},"required":["trackerTriggers"]},"CreateCheckoutSessionRequest":{"type":"object","properties":{"orgId":{"type":"string","minLength":1},"offer":{"$ref":"#/components/schemas/CheckoutOffer"},"quantity":{"type":"integer","exclusiveMinimum":0},"teamPlan":{"$ref":"#/components/schemas/TeamPlanId"},"startNowConsent":{"$ref":"#/components/schemas/StartNowConsent"}},"required":["offer"]},"CheckoutSessionResponse":{"type":"object","properties":{"checkoutId":{"type":"string"},"url":{"type":"string","format":"uri"}},"required":["checkoutId","url"]},"CheckoutSessionStatus":{"type":"object","properties":{"checkoutId":{"type":"string"},"status":{"$ref":"#/components/schemas/CheckoutStatus"},"offer":{"$ref":"#/components/schemas/CheckoutOffer"},"credits":{"type":"integer","exclusiveMinimum":0},"teamPlan":{"anyOf":[{"type":"object","properties":{"plan":{"$ref":"#/components/schemas/TeamPlanId"},"name":{"type":"string"}},"required":["plan","name"]},{"type":"null"},{"type":"null"}]}},"required":["checkoutId","status","offer","credits","teamPlan"]},"ListOrdersResponse":{"type":"object","properties":{"orders":{"type":"array","items":{"$ref":"#/components/schemas/BillingOrder"}}},"required":["orders"]},"UpdateSubscriptionRequest":{"type":"object","properties":{"orgId":{"type":"string","minLength":1},"plan":{"$ref":"#/components/schemas/TeamPlanId"},"cancelAtPeriodEnd":{"type":"boolean"}}},"SubscriptionResponse":{"type":"object","properties":{"subscription":{"$ref":"#/components/schemas/TeamSubscription"}},"required":["subscription"]},"CreateWithdrawalRequest":{"type":"object","properties":{"reason":{"type":"string","maxLength":2000}}},"WithdrawalResponse":{"type":"object","properties":{"orderId":{"type":"string"},"submittedAt":{"type":"integer"},"creditsReversed":{"type":"integer","minimum":0},"refundUsd":{"type":"number","minimum":0}},"required":["orderId","submittedAt","creditsReversed","refundUsd"]},"SandboxCapacityResponse":{"type":"object","properties":{"orgId":{"type":"string"},"running":{"type":"integer","minimum":0},"limit":{"anyOf":[{"type":"integer","exclusiveMinimum":0},{"type":"null"},{"type":"null"}]},"waiting":{"type":"array","items":{"$ref":"#/components/schemas/SandboxCapacityWaiter"}},"platformSaturated":{"type":"boolean"},"capturedAt":{"type":"integer"}},"required":["orgId","running","limit","waiting","platformSaturated","capturedAt"]},"SandboxStatus":{"type":"string","enum":["running","stale","completed","stopped","failed"],"description":"How the agent's run in this sandbox stands. `running`: the agent works now. `completed`: the agent finished its work. `stopped`: something ended the run on purpose before it finished, for example a newer run, a stop of the mission or a person. `failed`: the agent reported a failure, or exited without a report. `stale`: the platform closed the run without a report, after its time limit or after a later attempt replaced it."},"ListSandboxesResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SandboxInstance"}},"nextCursor":{"type":["string","null"]}},"required":["data","nextCursor"]},"SandboxDetailResponse":{"type":"object","properties":{"sandbox":{"$ref":"#/components/schemas/SandboxInstance"},"runSessionId":{"type":["string","null"],"description":"The session that this run recorded when it started. `sessions` lists every session of this role on the mission, with this one first once its log is saved. Null for a run that recorded none."},"metrics":{"type":"array","items":{"$ref":"#/components/schemas/SandboxMetricSample"}},"sessions":{"type":"array","items":{"$ref":"#/components/schemas/SandboxSession"}},"liveFragments":{"type":"array","items":{"$ref":"#/components/schemas/LiveFragment"}}},"required":["sandbox","metrics","sessions","liveFragments"]},"SandboxLogPart":{"type":"string","enum":["session","system","prompt"]},"SandboxLogsResponse":{"type":"object","properties":{"sandboxId":{"type":"string"},"role":{"type":"string"},"sessionId":{"type":"string"},"part":{"$ref":"#/components/schemas/SandboxLogPart"},"content":{"type":"string"},"bytes":{"type":"integer"},"promptScope":{"$ref":"#/components/schemas/PromptScope"},"promptSpans":{"type":"array","items":{"$ref":"#/components/schemas/PromptSpan"}}},"required":["sandboxId","role","sessionId","part","content","bytes"]},"StopSandboxResponse":{"type":"object","properties":{"ok":{"type":"boolean"},"sandboxId":{"type":"string"}},"required":["ok","sandboxId"]},"SandboxEvent":{"oneOf":[{"type":"object","properties":{"event":{"type":"string","enum":["state"]},"data":{"$ref":"#/components/schemas/SandboxEventState"}},"required":["event","data"]},{"type":"object","properties":{"event":{"type":"string","enum":["fragment"]},"id":{"type":"integer","description":"The cursor of the event. Give it as `since` to continue."},"data":{"$ref":"#/components/schemas/LiveFragment"}},"required":["event","id","data"]},{"type":"object","properties":{"event":{"type":"string","enum":["end"]},"data":{"$ref":"#/components/schemas/SandboxEventEnd"}},"required":["event","data"]}],"description":"One frame of the stream. The SSE `event` field names the type and the `data` field holds the JSON. A `fragment` frame also has an `id` line. Comment lines (`: keepalive`) come at least every 15 seconds."},"PreviewEnvironmentStatus":{"type":"string","enum":["provisioning","active","destroying","destroyed","failed"]},"ListEnvironmentsResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Environment"}},"nextCursor":{"type":["string","null"]}},"required":["data","nextCursor"]},"EnvironmentDetailResponse":{"type":"object","properties":{"environment":{"$ref":"#/components/schemas/Environment"}},"required":["environment"]},"DestroyEnvironmentResponse":{"type":"object","properties":{"ok":{"type":"boolean"},"environmentId":{"type":"string"}},"required":["ok","environmentId"]},"MissionStage":{"type":"string","enum":["pending","supervisor","planning","coding","ci","review","deploying","qa","done","declined","needs_attention"]},"MissionActivity":{"type":"string","enum":["queued","planning","building","fixing_ci","addressing_review","addressing_qa","ci_running","ci_failed","reviewing","changes_requested","deploying","testing","qa_failed","ready_to_merge","auto_merging","needs_attention","merged","auto_merged","declined","pausing","paused","stopped"]},"PipelineProgress":{"type":"string","enum":["no_pr","ci_failed","review_changes_requested","qa_failed","awaiting_review","awaiting_deploy","awaiting_qa","running","awaiting_ci","ready_for_human","merged","declined","failed"]},"CheckState":{"type":"string","enum":["passed","failed","pending","none"]},"ReviewState":{"type":"string","enum":["approved","changes_requested","pending","none"]},"MissionDisposition":{"type":["string","null"],"enum":["product","probe","superseded","takeover"]},"ListMissionsResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MissionSummary"}},"total":{"type":"integer","minimum":0},"nextCursor":{"type":["string","null"]}},"required":["data","total","nextCursor"]},"CreateMissionRequest":{"type":"object","properties":{"projectId":{"type":"string","minLength":1},"title":{"type":"string","minLength":1,"maxLength":200,"description":"Omit only when `entry.prNumber` is set — the pull request's own title is then used.","example":"Add a rate limit to the public search endpoint"},"description":{"type":"string","maxLength":10000,"description":"Issue body. Acceptance criteria written here are parsed by the planner as it would for any issue."},"labels":{"type":"array","items":{"type":"string"},"maxItems":10},"entry":{"type":"object","properties":{"startAt":{"allOf":[{"$ref":"#/components/schemas/MissionEntryStage"},{"type":"string"}]},"plan":{"type":"string","minLength":1},"prNumber":{"type":"integer","exclusiveMinimum":0},"filePlan":{"type":"array","items":{"$ref":"#/components/schemas/MissionEntryFilePlanEntry"},"maxItems":200},"acceptanceCriteria":{"type":"array","items":{"type":"string","minLength":1},"maxItems":50}},"required":["startAt"]},"agents":{"type":"object","properties":{"planner":{"$ref":"#/components/schemas/AgentsOverrideRoleEntry"},"builder":{"$ref":"#/components/schemas/AgentsOverrideRoleEntry"},"reviewer":{"$ref":"#/components/schemas/AgentsOverrideRoleEntry"},"qa":{"$ref":"#/components/schemas/AgentsOverrideRoleEntry"}},"additionalProperties":false,"description":"Per-role harness/model override for THIS mission, identical in shape and precedence to PUT /missions/{issueId}/agents-override. Carried here because a created mission has no id until this call returns — setting it afterwards races the first dispatch."}},"required":["projectId"]},"CreateMissionResponse":{"type":"object","properties":{"issueId":{"type":"string","example":"SHIP-412"},"identifier":{"type":"string","example":"SHIP-412"},"url":{"type":"string","example":"https://linear.app/acme/issue/SHIP-412"}},"required":["issueId","identifier","url"]},"MissionDetailResponse":{"type":"object","properties":{"summary":{"$ref":"#/components/schemas/MissionSummary"},"runs":{"type":"array","items":{"$ref":"#/components/schemas/MissionRun"}},"stages":{"type":"array","items":{"$ref":"#/components/schemas/MissionStageCell"}},"events":{"type":"array","items":{"$ref":"#/components/schemas/MissionEvent"}},"stats":{"$ref":"#/components/schemas/MissionStats"},"stageOutcomes":{"$ref":"#/components/schemas/MissionStageOutcomes"},"proofRunSandboxId":{"type":["string","null"]}},"required":["summary","runs","stages","events","stats","stageOutcomes","proofRunSandboxId"]},"SetMissionDispositionRequest":{"type":"object","properties":{"disposition":{"$ref":"#/components/schemas/MissionDisposition"},"supersededBy":{"type":["string","null"],"minLength":1}},"required":["disposition"]},"SetMissionDispositionResponse":{"type":"object","properties":{"ok":{"type":"boolean"},"issueId":{"type":"string"},"disposition":{"$ref":"#/components/schemas/MissionDisposition"},"supersededBy":{"type":["string","null"]}},"required":["ok","issueId","disposition","supersededBy"]},"MissionProvenanceResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/StepProvenance"}}},"required":["data"]},"MissionInspectReport":{"type":"object","properties":{"issueId":{"type":"string"},"projectId":{"type":"string"},"taskId":{"type":"string"},"generatedAt":{"type":"string"},"sections":{"type":"object","properties":{"taskState":{"$ref":"#/components/schemas/InspectSection"},"retryReason":{"$ref":"#/components/schemas/InspectSection"},"ciSummary":{"$ref":"#/components/schemas/InspectSection"},"builderRetryBrief":{"$ref":"#/components/schemas/InspectSection"},"dispatchError":{"$ref":"#/components/schemas/InspectSection"},"latestReview":{"$ref":"#/components/schemas/InspectSection"},"latestQa":{"$ref":"#/components/schemas/InspectSection"},"runIndex":{"$ref":"#/components/schemas/InspectSection"},"provenance":{"$ref":"#/components/schemas/InspectSection"},"sessionSummaries":{"$ref":"#/components/schemas/InspectSection"},"sandboxes":{"$ref":"#/components/schemas/InspectSection"},"streamHeads":{"$ref":"#/components/schemas/InspectSection"}}}},"required":["issueId","projectId","taskId","generatedAt","sections"]},"PauseMissionResponse":{"type":"object","properties":{"ok":{"type":"boolean"},"issueId":{"type":"string"}},"required":["ok","issueId"]},"ResumeMissionResponse":{"type":"object","properties":{"ok":{"type":"boolean"},"issueId":{"type":"string"}},"required":["ok","issueId"]},"SendMissionInstructionRequest":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":10000,"description":"What the agents should do. Travels verbatim into the builder's prompt.","example":"Keep the current Node compatibility - override nopt rather than narrowing the supported range."},"kind":{"$ref":"#/components/schemas/MissionInstructionKind"}},"required":["body"]},"MissionInstructionReceipt":{"type":"object","properties":{"instructionId":{"type":"string","description":"Id this instruction was recorded under. Deduplicates a retried request.","example":"ins_9b8e2a3f3c4d"},"issueId":{"type":"string","example":"GH-1280"},"recorded":{"type":"boolean","enum":[true],"description":"The instruction is durably in the mission's inbox. Always true on a 200."},"missionActivity":{"type":["string","null"],"description":"The mission's activity at the moment the instruction landed.","example":"ready_to_merge"},"dispatch":{"$ref":"#/components/schemas/MissionInstructionDispatch"}},"required":["instructionId","issueId","recorded","missionActivity","dispatch"]},"StartMissionRequest":{"type":"object","properties":{"projectId":{"type":"string","minLength":1},"startAt":{"allOf":[{"$ref":"#/components/schemas/MissionEntryStage"},{"type":"string"}]},"plan":{"type":"string","minLength":1},"prNumber":{"type":"integer","exclusiveMinimum":0},"filePlan":{"type":"array","items":{"$ref":"#/components/schemas/MissionEntryFilePlanEntry"},"maxItems":200,"description":"Builder entry only. Files the supplied plan expects to touch."},"acceptanceCriteria":{"type":"array","items":{"type":"string","minLength":1},"maxItems":50,"description":"Builder entry only. Criteria supplied with the plan; they win over the ones scraped from the issue body."},"agents":{"type":"object","properties":{"planner":{"$ref":"#/components/schemas/AgentsOverrideRoleEntry"},"builder":{"$ref":"#/components/schemas/AgentsOverrideRoleEntry"},"reviewer":{"$ref":"#/components/schemas/AgentsOverrideRoleEntry"},"qa":{"$ref":"#/components/schemas/AgentsOverrideRoleEntry"}},"additionalProperties":false,"description":"Per-role harness/model override for THIS mission, identical in shape and precedence to PUT /missions/{issueId}/agents-override. Written before the run is triggered, so it is in place when the first stage dispatches."}},"required":["projectId"]},"StartMissionResponse":{"type":"object","properties":{"ok":{"type":"boolean"},"issueId":{"type":"string"}},"required":["ok","issueId"]},"StopMissionResponse":{"type":"object","properties":{"ok":{"type":"boolean"},"issueId":{"type":"string"}},"required":["ok","issueId"]},"ArchiveMissionResponse":{"type":"object","properties":{"ok":{"type":"boolean"},"issueId":{"type":"string"}},"required":["ok","issueId"]},"UnarchiveMissionResponse":{"type":"object","properties":{"ok":{"type":"boolean"},"issueId":{"type":"string"}},"required":["ok","issueId"]},"MergeMissionResponse":{"type":"object","properties":{"ok":{"type":"boolean"},"issueId":{"type":"string"},"status":{"type":"string","enum":["merged","updating_branch"]},"message":{"type":"string"}},"required":["ok","issueId","status"]},"DeclineMissionResponse":{"type":"object","properties":{"ok":{"type":"boolean"},"issueId":{"type":"string"}},"required":["ok","issueId"]},"SetAutoMergeRequest":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]},"SetAutoMergeResponse":{"type":"object","properties":{"ok":{"type":"boolean"},"issueId":{"type":"string"},"autoMerge":{"type":"boolean"}},"required":["ok","issueId","autoMerge"]},"AgentsOverrideRequest":{"type":"object","properties":{"projectId":{"type":"string","minLength":1},"agents":{"type":"object","properties":{"planner":{"$ref":"#/components/schemas/AgentsOverrideRoleEntry"},"builder":{"$ref":"#/components/schemas/AgentsOverrideRoleEntry"},"reviewer":{"$ref":"#/components/schemas/AgentsOverrideRoleEntry"},"qa":{"$ref":"#/components/schemas/AgentsOverrideRoleEntry"}},"additionalProperties":false},"baseBranch":{"type":"string","minLength":1}},"required":["projectId"]},"AgentsOverrideResponse":{"type":"object","properties":{"ok":{"type":"boolean"},"issueId":{"type":"string"}},"required":["ok","issueId"]},"GetAgentsOverrideResponse":{"type":"object","properties":{"issueId":{"type":"string"},"override":{"$ref":"#/components/schemas/AgentsOverrideRecord"}},"required":["issueId","override"]},"ClearAgentsOverrideResponse":{"type":"object","properties":{"ok":{"type":"boolean"},"issueId":{"type":"string"}},"required":["ok","issueId"]},"CeilingApprovalRequest":{"type":"object","properties":{"projectId":{"type":"string","minLength":1}},"required":["projectId"]},"CeilingApprovalResponse":{"type":"object","properties":{"issueId":{"type":"string"},"ceiling":{"type":"integer","exclusiveMinimum":0}},"required":["issueId","ceiling"]},"ListArtifactsResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ArtifactSummary"}},"nextCursor":{"type":["string","null"]}},"required":["data","nextCursor"]},"ArtifactSummary":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"issueId":{"type":"string"},"sessionId":{"type":["string","null"]},"sandboxId":{"type":["string","null"]},"role":{"type":"string"},"kind":{"type":"string","enum":["screenshot","video","log","other"]},"contentType":{"type":"string"},"sizeBytes":{"type":"integer"},"caption":{"type":["string","null"]},"criterion":{"type":["string","null"]},"criterionPassed":{"type":["boolean","null"]},"createdAt":{"type":"string"},"expiresAt":{"type":["string","null"]},"url":{"type":"string"},"traceViewerUrl":{"type":["string","null"]}},"required":["id","projectId","issueId","sessionId","sandboxId","role","kind","contentType","sizeBytes","caption","criterion","criterionPassed","createdAt","expiresAt","url","traceViewerUrl"]},"AgentCatalog":{"type":"object","properties":{"roles":{"type":"array","items":{"$ref":"#/components/schemas/CatalogRole"}},"harnesses":{"type":"array","items":{"$ref":"#/components/schemas/CatalogHarness"}},"builtinAgents":{"type":"array","items":{"$ref":"#/components/schemas/CatalogBuiltinAgent"}},"builtinSandboxTemplate":{"$ref":"#/components/schemas/CatalogSandboxTemplate"},"instanceTypes":{"type":"array","items":{"$ref":"#/components/schemas/CatalogInstanceType"}},"customSizeLimits":{"type":"object","properties":{"minVcpu":{"type":"integer"},"maxVcpu":{"type":"integer"},"minMemoryMibPerVcpu":{"type":"integer"},"maxMemoryMib":{"type":"integer"},"minDiskMb":{"type":"integer"},"maxDiskMb":{"type":"integer"}},"required":["minVcpu","maxVcpu","minMemoryMibPerVcpu","maxMemoryMib","minDiskMb","maxDiskMb"]}},"required":["roles","harnesses","builtinAgents","builtinSandboxTemplate","instanceTypes","customSizeLimits"]},"ListAgentsResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Agent"}},"nextCursor":{"type":["string","null"]}},"required":["data","nextCursor"]},"CreateAgentRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"role":{"$ref":"#/components/schemas/AgentRoleKey"},"harness":{"$ref":"#/components/schemas/HarnessId"},"model":{"type":"string","minLength":1},"effort":{"type":"string","minLength":1},"sandbox":{"$ref":"#/components/schemas/AgentSandboxSelection"},"userPrompt":{"type":"string","maxLength":20000,"description":"Deprecated: not read by the pipeline; agent instructions and skills are configured in the target repo."},"skillRepos":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":50,"description":"Deprecated: not read by the pipeline; agent instructions and skills are configured in the target repo."}},"required":["name","role","harness","model","sandbox"]},"Agent":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"role":{"$ref":"#/components/schemas/AgentRoleKey"},"harness":{"$ref":"#/components/schemas/HarnessId"},"model":{"type":"string"},"effort":{"type":["string","null"]},"sandboxTemplateId":{"type":"string"},"userPrompt":{"type":["string","null"],"description":"Deprecated: not read by the pipeline; agent instructions and skills are configured in the target repo."},"skillRepos":{"type":"array","items":{"type":"string"},"description":"Deprecated: not read by the pipeline; agent instructions and skills are configured in the target repo."},"isBuiltin":{"type":"boolean"},"createdAt":{"type":"integer"},"updatedAt":{"type":"integer"}},"required":["id","orgId","name","role","harness","model","effort","sandboxTemplateId","userPrompt","skillRepos","isBuiltin","createdAt","updatedAt"]},"UpdateAgentRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"role":{"$ref":"#/components/schemas/AgentRoleKey"},"harness":{"$ref":"#/components/schemas/HarnessId"},"model":{"type":"string","minLength":1},"effort":{"type":["string","null"],"minLength":1},"sandboxTemplateId":{"type":"string","minLength":1},"userPrompt":{"type":["string","null"],"maxLength":20000,"description":"Deprecated: not read by the pipeline; agent instructions and skills are configured in the target repo."},"skillRepos":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":50,"description":"Deprecated: not read by the pipeline; agent instructions and skills are configured in the target repo."}}},"DeleteAgentResponse":{"type":"object","properties":{"ok":{"type":"boolean"},"id":{"type":"string"}},"required":["ok","id"]},"ListScheduledTasksResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Scheduled task"}},"nextCursor":{"type":["string","null"]}},"required":["data","nextCursor"]},"CreateScheduledTaskRequest":{"type":"object","properties":{"projectId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1,"maxLength":120},"prompt":{"type":"string","minLength":1,"maxLength":20000},"triggers":{"type":"array","items":{"$ref":"#/components/schemas/ScheduledTaskTrigger"},"minItems":1,"maxItems":1},"labels":{"$ref":"#/components/schemas/ScheduledTaskLabels"},"templateKey":{"type":"string","minLength":1,"maxLength":120},"skipIfPreviousOpen":{"type":"boolean"},"enabled":{"type":"boolean"}},"required":["projectId","name","prompt","triggers"]},"Scheduled task":{"type":"object","properties":{"createdByUserId":{"type":["string","null"]},"id":{"type":"string"},"orgId":{"type":"string"},"projectId":{"type":"string"},"name":{"type":"string"},"prompt":{"type":"string"},"templateKey":{"type":["string","null"]},"triggers":{"type":"array","items":{"$ref":"#/components/schemas/ScheduledTaskTrigger"}},"labels":{"$ref":"#/components/schemas/ScheduledTaskLabels"},"skipIfPreviousOpen":{"type":"boolean"},"enabled":{"type":"boolean"},"nextRunAt":{"type":["integer","null"]},"lastRunAt":{"type":["integer","null"]},"createdAt":{"type":"integer"},"updatedAt":{"type":"integer"}},"required":["id","orgId","projectId","name","prompt","templateKey","triggers","labels","skipIfPreviousOpen","enabled","nextRunAt","lastRunAt","createdAt","updatedAt"]},"ListScheduledTaskTemplatesResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ScheduledTaskTemplate"}}},"required":["data"]},"UpdateScheduledTaskRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"prompt":{"type":"string","minLength":1,"maxLength":20000},"triggers":{"type":"array","items":{"$ref":"#/components/schemas/ScheduledTaskTrigger"},"minItems":1,"maxItems":1},"labels":{"$ref":"#/components/schemas/ScheduledTaskLabels"},"skipIfPreviousOpen":{"type":"boolean"},"enabled":{"type":"boolean"}}},"DeleteScheduledTaskResponse":{"type":"object","properties":{"ok":{"type":"boolean"},"id":{"type":"string"}},"required":["ok","id"]},"ListScheduledTaskRunsResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ScheduledTaskRun"}},"nextCursor":{"type":["string","null"]}},"required":["data","nextCursor"]},"RunScheduledTaskResponse":{"type":"object","properties":{"ok":{"type":"boolean"},"runId":{"type":"string"},"issueId":{"type":["string","null"]},"status":{"$ref":"#/components/schemas/ScheduledTaskRunStatus"}},"required":["ok","runId","issueId","status"]},"OrchestratorConfig":{"type":"object","properties":{"orgId":{"type":"string"},"name":{"type":"string","example":"Orchestrator"},"blurb":{"type":"string"},"model":{"type":"string"},"vendor":{"$ref":"#/components/schemas/OrchestratorVendor"},"llmConnectorId":{"type":["string","null"]},"effectiveVendor":{"$ref":"#/components/schemas/OrchestratorVendor"},"assignableKeys":{"type":"array","items":{"$ref":"#/components/schemas/OrchestratorAssignableKey"}},"assignedCredentialUsableForInference":{"type":"boolean"},"modelsByVendor":{"$ref":"#/components/schemas/OrchestratorModelsByVendor"},"defaultModel":{"type":"string"},"isBuiltin":{"type":"boolean","enum":[true]},"inferenceEnabled":{"type":"boolean"},"dailySpendUsd":{"type":"number"},"updatedAt":{"type":["integer","null"]}},"required":["orgId","name","blurb","model","vendor","llmConnectorId","effectiveVendor","assignableKeys","assignedCredentialUsableForInference","modelsByVendor","defaultModel","isBuiltin","inferenceEnabled","dailySpendUsd","updatedAt"]},"UpdateOrchestratorConfigRequest":{"type":"object","properties":{"model":{"type":"string","minLength":1},"llmConnectorId":{"type":["string","null"],"minLength":1},"inferenceEnabled":{"type":"boolean"}}},"ListSandboxTemplatesResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SandboxTemplate"}},"nextCursor":{"type":["string","null"]}},"required":["data","nextCursor"]},"CreateSandboxTemplateRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"dockerfile":{"type":"string","minLength":1,"maxLength":100000},"starterId":{"type":"string","minLength":1},"size":{"$ref":"#/components/schemas/SandboxSize"},"instanceType":{"$ref":"#/components/schemas/SandboxTier"}},"required":["name"]},"SaveSandboxTemplateResponse":{"type":"object","properties":{"template":{"$ref":"#/components/schemas/SandboxTemplate"},"build":{"anyOf":[{"$ref":"#/components/schemas/SandboxTemplateBuild"},{"type":"null"},{"type":"null"}]}},"required":["template","build"]},"ListSandboxStartersResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SandboxStarter"}}},"required":["data"]},"SandboxTemplate":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"kind":{"$ref":"#/components/schemas/SandboxTemplateKind"},"projectId":{"type":["string","null"]},"starterId":{"type":["string","null"]},"dockerfile":{"type":"string"},"size":{"$ref":"#/components/schemas/StoredSandboxSize"},"instanceType":{"$ref":"#/components/schemas/SandboxInstanceTypeId"},"activeVersionId":{"type":["string","null"]},"activeVersion":{"type":["integer","null"]},"latestBuild":{"anyOf":[{"$ref":"#/components/schemas/SandboxTemplateBuildSummary"},{"type":"null"},{"type":"null"}]},"runningCount":{"type":"integer","minimum":0},"createdAt":{"type":"integer"},"updatedAt":{"type":"integer"}},"required":["id","orgId","name","kind","projectId","starterId","dockerfile","size","instanceType","activeVersionId","activeVersion","latestBuild","runningCount","createdAt","updatedAt"]},"UpdateSandboxTemplateRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"dockerfile":{"type":"string","minLength":1,"maxLength":100000},"size":{"$ref":"#/components/schemas/SandboxSize"},"instanceType":{"$ref":"#/components/schemas/SandboxTier"}}},"DeleteSandboxTemplateResponse":{"type":"object","properties":{"ok":{"type":"boolean"},"id":{"type":"string"}},"required":["ok","id"]},"SandboxTemplateBuild":{"type":"object","properties":{"id":{"type":"string"},"templateId":{"type":"string"},"versionId":{"type":"string"},"version":{"type":["integer","null"]},"status":{"$ref":"#/components/schemas/SandboxTemplateBuildStatus"},"phase":{"$ref":"#/components/schemas/SandboxTemplateBuildPhase"},"trigger":{"$ref":"#/components/schemas/SandboxTemplateBuildTrigger"},"queuedAt":{"type":"string"},"startedAt":{"type":["string","null"]},"finishedAt":{"type":["string","null"]},"durationMs":{"type":["integer","null"]},"stepsMs":{"type":["integer","null"]},"snapshotBytes":{"type":["integer","null"]},"warmMs":{"type":["integer","null"]},"failure":{"type":["object","null"],"properties":{"phase":{"$ref":"#/components/schemas/SandboxTemplateBuildPhase"},"reason":{"type":"string"},"message":{"type":"string"}},"required":["phase","reason","message"]}},"required":["id","templateId","versionId","version","status","phase","trigger","queuedAt","startedAt","finishedAt","durationMs","stepsMs","snapshotBytes","warmMs","failure"]},"ListSandboxTemplateBuildsResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SandboxTemplateBuild"}}},"required":["data"]},"SandboxTemplateBuildLogsResponse":{"type":"object","properties":{"buildId":{"type":"string"},"chunks":{"type":"array","items":{"$ref":"#/components/schemas/SandboxTemplateBuildLogChunk"}},"nextAfter":{"type":"integer"},"done":{"type":"boolean"}},"required":["buildId","chunks","nextAfter","done"]},"ListSandboxTemplateVersionsResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SandboxTemplateVersion"}}},"required":["data"]},"ListSandboxRegistriesResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SandboxRegistry"}}},"required":["data"]},"PutSandboxRegistryRequest":{"type":"object","properties":{"host":{"type":"string","minLength":1,"maxLength":300,"description":"Host name or URL; stored as the host alone."},"scheme":{"$ref":"#/components/schemas/RegistryAuthScheme"},"username":{"type":"string","minLength":1,"maxLength":200,"description":"Required for basic auth."},"secret":{"type":"string","minLength":1,"maxLength":4096,"description":"Token or password. Write-only."}},"required":["host","scheme","secret"]},"SandboxRegistry":{"type":"object","properties":{"id":{"type":"string"},"host":{"type":"string","example":"npm.pkg.github.com"},"scheme":{"$ref":"#/components/schemas/RegistryAuthScheme"},"username":{"type":["string","null"]},"createdAt":{"type":"integer"},"updatedAt":{"type":"integer"}},"required":["id","host","scheme","username","createdAt","updatedAt"]},"DeleteSandboxRegistryResponse":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]},"id":{"type":"string"}},"required":["ok","id"]},"McpProjectView":{"type":"object","properties":{"projectId":{"type":"string"},"configPath":{"type":"string"},"configPathSource":{"$ref":"#/components/schemas/McpConfigPathSource"},"configRef":{"type":["string","null"]},"configStatus":{"type":"string","enum":["ok","missing","invalid","unreadable"]},"configError":{"type":["string","null"]},"warnings":{"type":"array","items":{"type":"string"}},"servers":{"type":"array","items":{"$ref":"#/components/schemas/McpProjectServer"}}},"required":["projectId","configPath","configPathSource","configRef","configStatus","configError","warnings","servers"]},"UpdateMcpProjectRequest":{"type":"object","properties":{"configPath":{"type":["string","null"],"minLength":1,"maxLength":256,"pattern":"^[^/][^\\0]*$"}},"required":["configPath"]},"UpsertMcpBindingRequest":{"type":"object","properties":{"roles":{"type":"array","items":{"$ref":"#/components/schemas/McpRole"},"maxItems":4},"transport":{"$ref":"#/components/schemas/McpBindingTransport"},"remoteUrl":{"type":"string","maxLength":2048,"format":"uri"},"credential":{"$ref":"#/components/schemas/McpCredentialInput"},"approvedTools":{"type":"array","items":{"$ref":"#/components/schemas/McpApprovedTool"},"maxItems":200}},"required":["roles"]},"McpBinding":{"type":"object","properties":{"transport":{"$ref":"#/components/schemas/McpBindingTransport"},"status":{"$ref":"#/components/schemas/McpBindingStatus"},"statusDetail":{"type":["string","null"]},"roles":{"type":"array","items":{"$ref":"#/components/schemas/McpRole"}},"authKind":{"$ref":"#/components/schemas/McpAuthKind"},"pinnedUrl":{"type":["string","null"]},"packageSpec":{"type":["string","null"]},"allowedEgressHosts":{"type":"array","items":{"type":"string"}},"credentialFields":{"type":"array","items":{"type":"string"}},"toolSnapshot":{"type":"array","items":{"$ref":"#/components/schemas/McpToolSnapshotEntry"}},"approvedTools":{"type":"array","items":{"$ref":"#/components/schemas/McpApprovedTool"}},"toolsRefreshedAt":{"type":["integer","null"]},"effectiveToolCounts":{"type":"object","properties":{"planner":{"anyOf":[{"type":"integer"},{"type":"null"},{"type":"null"}]},"builder":{"anyOf":[{"type":"integer"},{"type":"null"},{"type":"null"}]},"reviewer":{"anyOf":[{"type":"integer"},{"type":"null"},{"type":"null"}]},"qa":{"anyOf":[{"type":"integer"},{"type":"null"},{"type":"null"}]}}},"createdAt":{"type":"integer"},"updatedAt":{"type":"integer"}},"required":["transport","status","statusDetail","roles","authKind","pinnedUrl","packageSpec","allowedEgressHosts","credentialFields","toolSnapshot","approvedTools","toolsRefreshedAt","effectiveToolCounts","createdAt","updatedAt"]},"DeleteMcpBindingResponse":{"type":"object","properties":{"deleted":{"type":"boolean","enum":[true]}},"required":["deleted"]},"ListMcpBindingsResponse":{"type":"object","properties":{"bindings":{"type":"array","items":{"$ref":"#/components/schemas/McpBindingInventoryItem"}}},"required":["bindings"]},"StartMcpOAuthRequest":{"type":"object","properties":{"scope":{"type":"string","maxLength":512},"returnTo":{"type":"string","maxLength":512,"pattern":"^\\/"}}},"StartMcpOAuthResponse":{"type":"object","properties":{"authorizeUrl":{"type":"string"},"expiresAt":{"type":"integer"}},"required":["authorizeUrl","expiresAt"]},"CompleteMcpOAuthRequest":{"type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":2048},"state":{"type":"string","minLength":16,"maxLength":256}},"required":["code","state"]},"CompleteMcpOAuthResponse":{"type":"object","properties":{"projectId":{"type":"string"},"serverName":{"type":"string"},"returnTo":{"type":["string","null"]}},"required":["projectId","serverName","returnTo"]},"ListIntegrationsResponse":{"type":"object","properties":{"orgId":{"type":["string","null"]},"integrations":{"type":"array","items":{"$ref":"#/components/schemas/Integration"}},"connect":{"type":"array","items":{"type":"object","properties":{"vendor":{"type":"string","enum":["linear","github"]},"url":{"type":["string","null"],"format":"uri"}},"required":["vendor","url"]}}},"required":["orgId","integrations","connect"]},"VaultCatalog":{"type":"object","properties":{"vendors":{"type":"array","items":{"$ref":"#/components/schemas/VaultCatalogVendor"}}},"required":["vendors"]},"ListVaultCredentialsResponse":{"type":"object","properties":{"credentials":{"type":"array","items":{"$ref":"#/components/schemas/VaultCredential"}}},"required":["credentials"]},"CreateVaultCredentialRequest":{"type":"object","properties":{"vendor":{"type":"string","minLength":1,"example":"anthropic"},"apiKey":{"type":"string","minLength":1},"displayName":{"type":["string","null"],"maxLength":200}},"required":["vendor","apiKey"]},"VaultCredential":{"type":"object","properties":{"id":{"type":"string","example":"conn_abcdef0123456789"},"orgId":{"type":"string"},"vendor":{"type":"string","example":"anthropic"},"vendorKind":{"$ref":"#/components/schemas/VendorKind"},"authScheme":{"$ref":"#/components/schemas/AuthScheme"},"credentialType":{"$ref":"#/components/schemas/CredentialType"},"displayName":{"type":["string","null"]},"dependentProjectCount":{"type":"integer"},"createdAt":{"type":"integer"},"updatedAt":{"type":"integer"}},"required":["id","orgId","vendor","vendorKind","authScheme","displayName","dependentProjectCount","createdAt","updatedAt"]},"UpdateVaultCredentialRequest":{"type":"object","properties":{"apiKey":{"type":"string","minLength":1},"displayName":{"type":["string","null"],"maxLength":200}}},"VendorKind":{"type":"string","enum":["tracker","scm","llm","notification"]},"ListConnectorsResponse":{"type":"object","properties":{"connectors":{"type":"array","items":{"$ref":"#/components/schemas/Connector"}}},"required":["connectors"]},"CreateConnectorRequest":{"type":"object","properties":{"vendor":{"type":"string","minLength":1,"example":"linear"},"vendorKind":{"$ref":"#/components/schemas/VendorKind"},"externalOrgId":{"type":"string","minLength":1},"displayName":{"type":["string","null"]},"secret":{"anyOf":[{"$ref":"#/components/schemas/LinearTrackerSecret"},{"$ref":"#/components/schemas/GithubScmSecret"},{"$ref":"#/components/schemas/AnthropicLlmSecret"},{"$ref":"#/components/schemas/OpenaiLlmSecret"}]},"githubUserAuthorization":{"type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":200}},"required":["code"]}},"required":["vendor","vendorKind","externalOrgId","secret"]},"Connector":{"type":"object","properties":{"id":{"type":"string","example":"conn_abcdef0123456789"},"orgId":{"type":"string"},"vendor":{"type":"string","example":"linear"},"vendorKind":{"$ref":"#/components/schemas/VendorKind"},"externalOrgId":{"type":"string","example":"linear-workspace-abc"},"displayName":{"type":["string","null"]},"credentialType":{"type":["string","null"],"enum":["oauth","api"]},"createdAt":{"type":"integer"},"updatedAt":{"type":"integer"}},"required":["id","orgId","vendor","vendorKind","externalOrgId","displayName","credentialType","createdAt","updatedAt"]},"UpdateConnectorRequest":{"type":"object","properties":{"displayName":{"type":["string","null"]},"secret":{"anyOf":[{"$ref":"#/components/schemas/LinearTrackerSecret"},{"$ref":"#/components/schemas/GithubScmSecret"},{"$ref":"#/components/schemas/AnthropicLlmSecret"},{"$ref":"#/components/schemas/OpenaiLlmSecret"}]}}},"RevokeConnectorResponse":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]},"affectedProjectCount":{"type":"integer"},"replacementConnectorId":{"type":["string","null"]}},"required":["ok","affectedProjectCount","replacementConnectorId"]},"OrgRole":{"type":["string","null"],"enum":["owner","admin","member"],"example":"admin"},"ClosureSettlement":{"type":"object","properties":{"orderId":{"type":"string"},"packCredits":{"type":"integer","exclusiveMinimum":0},"outcome":{"type":"string","enum":["withdrawn","refunded","forfeited"]},"credits":{"type":"integer","minimum":0},"refundUsd":{"type":"number","minimum":0},"refundStatus":{"anyOf":[{"type":"string","enum":["pending","succeeded","failed"]},{"type":"null"},{"type":"null"}]}},"required":["orderId","packCredits","outcome","credits","refundUsd","refundStatus"]},"TokenSummary":{"type":"object","properties":{"id":{"type":"string","example":"tok-pat-9b8e2a3f"},"name":{"type":"string","example":"laptop CLI"},"prefix":{"type":"string","example":"pat"},"scopes":{"type":"array","items":{"type":"string"},"example":["missions:run"]},"projectId":{"type":["string","null"],"description":"The project this token is bound to, or null when it is org-wide.","example":null},"expiresAt":{"type":"integer","example":1743465600000},"createdAt":{"type":"integer","example":1735689600000},"lastUsedAt":{"type":["integer","null"],"example":1735776000000},"revokedAt":{"type":["integer","null"],"example":null}},"required":["id","name","prefix","scopes","projectId","expiresAt","createdAt","lastUsedAt","revokedAt"]},"ClaimCeremony":{"type":"object","properties":{"user_code":{"type":"string","example":"482913"},"verification_uri":{"type":"string","example":"https://letsship.ai/claim?claim_attempt_token=cat_..."},"expires_in":{"type":"integer","example":600},"interval":{"type":"integer","example":5}},"required":["user_code","verification_uri","expires_in","interval"]},"AgentDelegation":{"type":"object","properties":{"id":{"type":"string","example":"dlg_7Hc..."},"name":{"type":"string"},"source":{"type":"string","description":"anonymous, service_auth, identity_assertion or authorization_code."},"orgId":{"type":"string"},"projectId":{"type":["string","null"]},"scopes":{"type":"array","items":{"type":"string"}},"providerName":{"type":["string","null"]},"createdAt":{"type":"integer"},"expiresAt":{"type":"integer"},"revokedAt":{"type":["integer","null"]},"lastUsedAt":{"type":["integer","null"]}},"required":["id","name","source","orgId","projectId","scopes","providerName","createdAt","expiresAt","revokedAt","lastUsedAt"]},"Capability":{"type":"string","enum":["pipeline:control","config:write","secrets:reveal","org:admin","billing:manage"],"example":"config:write"},"SetupGroup":{"type":"object","properties":{"id":{"allOf":[{"$ref":"#/components/schemas/SetupGroupId"},{"type":"string"}]},"title":{"type":"string","example":"Make it yours"},"reachedCount":{"type":"integer","minimum":0},"totalCount":{"type":"integer","minimum":0},"complete":{"type":"boolean"},"milestones":{"type":"array","items":{"$ref":"#/components/schemas/SetupMilestone"}}},"required":["id","title","reachedCount","totalCount","complete","milestones"]},"SetupMark":{"type":["string","null"],"enum":["completed","skipped"]},"Notice":{"type":"object","properties":{"id":{"type":"string"},"kind":{"$ref":"#/components/schemas/NoticeKind"},"severity":{"type":"string","enum":["critical","warning"]},"title":{"type":"string"},"message":{"type":"string"},"action":{"anyOf":[{"$ref":"#/components/schemas/NoticeAction"},{"type":"null"},{"type":"null"}]},"since":{"anyOf":[{"type":"integer"},{"type":"null"},{"type":"null"}]},"dismissible":{"type":"boolean"}},"required":["id","kind","severity","title","message","action","since","dismissible"]},"ScopeGroup":{"type":"object","properties":{"id":{"type":"string","example":"missions"},"title":{"type":"string","example":"Missions"},"description":{"type":"string","example":"Missions, their runs, verdicts and cost."},"levels":{"type":"array","items":{"$ref":"#/components/schemas/ScopeAccessLevel"},"description":"Ordered least to most privileged, and cumulative — each level is a superset of the one before it."},"reservedNote":{"type":"string","description":"Present when this row's top level grants a scope that currently gates no route."}},"required":["id","title","description","levels"]},"InviteStatus":{"type":"string","enum":["pending","accepted","revoked","expired"]},"ProjectStatus":{"type":"string","enum":["active","paused","archived"]},"ProjectTracker":{"type":"string","enum":["linear","github-issues","none"]},"IssueCode":{"type":"string","pattern":"^[A-Z][A-Z0-9]{1,4}$","example":"PAG"},"BillingOffer":{"type":"object","properties":{"offer":{"$ref":"#/components/schemas/CreditPack"},"credits":{"type":"integer","exclusiveMinimum":0},"priceUsd":{"type":"number","exclusiveMinimum":0},"perCreditUsd":{"type":"number","exclusiveMinimum":0},"savingsUsd":{"type":"number","minimum":0},"taxInclusive":{"type":"boolean","enum":[true]}},"required":["offer","credits","priceUsd","perCreditUsd","savingsUsd","taxInclusive"]},"TeamPlanOffer":{"type":"object","properties":{"plan":{"type":"string","enum":["team"]},"interval":{"type":"string","enum":["month"]},"rolloverMonths":{"type":"integer","minimum":0},"projectLimit":{"type":["integer","null"],"exclusiveMinimum":0},"plans":{"type":"array","items":{"$ref":"#/components/schemas/TeamPlanEntry"}},"extraCredits":{"type":"object","properties":{"minCredits":{"type":"integer","exclusiveMinimum":0},"maxCredits":{"type":"integer","exclusiveMinimum":0}},"required":["minCredits","maxCredits"]},"taxInclusive":{"type":"boolean","enum":[true]}},"required":["plan","interval","rolloverMonths","projectLimit","plans","extraCredits","taxInclusive"]},"EnterpriseOffer":{"type":"object","properties":{"plan":{"type":"string","enum":["enterprise"]},"interval":{"type":"string","enum":["year"]},"minCreditsPerYear":{"type":"integer","exclusiveMinimum":0},"perCreditUsd":{"type":"object","properties":{"max":{"type":"number","exclusiveMinimum":0},"min":{"type":"number","exclusiveMinimum":0}},"required":["max","min"]},"minAgentsAtOnce":{"type":"integer","exclusiveMinimum":0}},"required":["plan","interval","minCreditsPerYear","perCreditUsd","minAgentsAtOnce"]},"BillingPlan":{"type":"string","enum":["trial","sponsored","team","enterprise"]},"BillingCohort":{"type":"string","enum":["friend","design-partner","enterprise-trial","investor","internal"]},"BillingMode":{"type":"string","enum":["enforce","shadow","off"]},"CreditSource":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/CreditSourceKind"},"remaining":{"type":"integer","minimum":0},"expiresAt":{"type":["integer","null"]}},"required":["kind","remaining","expiresAt"]},"TrackerTriggerPolicy":{"type":"string","enum":["anyone","linked_members"]},"BillingUsage":{"type":"object","properties":{"periodDays":{"type":"integer","exclusiveMinimum":0},"credits":{"type":"integer","minimum":0},"missions":{"type":"integer","minimum":0,"description":"Missions the org started in the window, each counted once however many times it restarted. Always 0 while billing is off for the org (`mode` `off`), which meters no mission."},"valueUsd":{"type":"number","minimum":0},"perCreditUsd":{"type":"number","exclusiveMinimum":0},"basis":{"type":"string","enum":["packs","team","purchases"],"description":"The price `perCreditUsd` is: `team`, the org's plan rate; `purchases`, what the org paid per credit; `packs`, the lowest per-credit pack price (the org bought nothing)."},"estimate":{"type":"boolean","enum":[true]}},"required":["periodDays","credits","missions","valueUsd","perCreditUsd","basis","estimate"]},"CreditRequestSummary":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"integer"},"messageCount":{"type":"integer","exclusiveMinimum":0}},"required":["id","createdAt","messageCount"]},"CreditRequestRecipient":{"type":"string","enum":["founder","billing_contacts"]},"BillingPurchaseState":{"type":"object","properties":{"available":{"type":"boolean"},"reason":{"anyOf":[{"type":"string","enum":["checkout_closed","plan_not_purchasable","billing_manage_required"]},{"type":"null"},{"type":"null"}]},"credits":{"anyOf":[{"type":"string","enum":["packs","team_credits"]},{"type":"null"},{"type":"null"}]},"team":{"type":"boolean"}},"required":["available","reason","credits","team"]},"TeamSubscription":{"allOf":[{"$ref":"#/components/schemas/SubscribedPlan"},{"type":"object","properties":{"status":{"$ref":"#/components/schemas/TeamSubscriptionStatus"},"nextPlan":{"anyOf":[{"$ref":"#/components/schemas/SubscribedPlan"},{"type":"null"},{"type":"null"}]},"currentPeriodEnd":{"anyOf":[{"type":"integer"},{"type":"null"},{"type":"null"}]},"cancelAtPeriodEnd":{"type":"boolean"}},"required":["status","nextPlan","currentPeriodEnd","cancelAtPeriodEnd"]}]},"PlanAdvice":{"type":"object","properties":{"kind":{"type":"string","enum":["start","switch"]},"plan":{"$ref":"#/components/schemas/TeamPlanId"},"name":{"type":"string"},"priceUsd":{"type":"number","exclusiveMinimum":0},"agentsAtOnce":{"type":"integer","exclusiveMinimum":0},"periodDays":{"type":"integer","exclusiveMinimum":0},"credits":{"type":"integer","exclusiveMinimum":0},"currentCostUsd":{"type":"number","exclusiveMinimum":0},"planCostUsd":{"type":"number","exclusiveMinimum":0},"savingsUsd":{"type":"number","exclusiveMinimum":0}},"required":["kind","plan","name","priceUsd","agentsAtOnce","periodDays","credits","currentCostUsd","planCostUsd","savingsUsd"]},"BillingTrialState":{"type":"object","properties":{"status":{"type":"string","enum":["not_applicable","awaiting_repository","granted","not_eligible"]},"reason":{"anyOf":[{"type":"string","enum":["invited","identity_used"]},{"type":"null"},{"type":"null"}]},"credits":{"type":"integer","minimum":0}},"required":["status","reason","credits"]},"LedgerEntry":{"type":"object","properties":{"id":{"type":"string"},"kind":{"$ref":"#/components/schemas/LedgerEntryKind"},"at":{"type":"integer"},"credits":{"type":"integer"},"mode":{"$ref":"#/components/schemas/BillingMode"},"mission":{"type":["object","null"],"properties":{"issueId":{"type":"string"},"title":{"type":["string","null"]},"starts":{"type":"integer","minimum":0},"extraBlocks":{"type":"integer","minimum":0},"messages":{"type":"integer","minimum":0},"refunded":{"type":"integer","minimum":0}},"required":["issueId","title","starts","extraBlocks","messages","refunded"]},"grant":{"type":["object","null"],"properties":{"kind":{"$ref":"#/components/schemas/CreditSourceKind"},"expiresAt":{"type":["integer","null"]}},"required":["kind","expiresAt"]},"reason":{"type":["string","null"]}},"required":["id","kind","at","credits","mode","mission","grant","reason"]},"CheckoutOffer":{"type":"string","enum":["credit_pack_10","credit_pack_50","credit_pack_100","team","team_credits"]},"TeamPlanId":{"type":"string","enum":["starter","scale"]},"StartNowConsent":{"type":"object","properties":{"wordingVersion":{"type":"string","minLength":1}},"required":["wordingVersion"]},"CheckoutStatus":{"type":"string","enum":["pending","completed","expired","failed"]},"BillingOrder":{"type":"object","properties":{"id":{"type":"string"},"offer":{"$ref":"#/components/schemas/CheckoutOffer"},"quantity":{"type":"integer","exclusiveMinimum":0},"credits":{"type":"integer","exclusiveMinimum":0},"priceUsd":{"type":"number","exclusiveMinimum":0},"teamPlan":{"anyOf":[{"$ref":"#/components/schemas/TeamPlanId"},{"type":"null"},{"type":"null"}]},"status":{"$ref":"#/components/schemas/CheckoutStatus"},"purchasedAt":{"anyOf":[{"type":"integer"},{"type":"null"},{"type":"null"}]},"purchaserName":{"anyOf":[{"type":"string"},{"type":"null"},{"type":"null"}]},"isPurchaser":{"type":"boolean"},"creditsUsed":{"type":"integer","minimum":0},"creditsReversed":{"type":"integer","minimum":0},"periodStart":{"anyOf":[{"type":"integer"},{"type":"null"},{"type":"null"}]},"periodEnd":{"anyOf":[{"type":"integer"},{"type":"null"},{"type":"null"}]},"withdrawalStatement":{"type":"string"},"withdrawal":{"type":"object","properties":{"available":{"type":"boolean"},"until":{"anyOf":[{"type":"integer"},{"type":"null"},{"type":"null"}]},"reason":{"anyOf":[{"$ref":"#/components/schemas/WithdrawalUnavailableReason"},{"type":"null"},{"type":"null"}]},"submittedAt":{"anyOf":[{"type":"integer"},{"type":"null"},{"type":"null"}]}},"required":["available","until","reason","submittedAt"]}},"required":["id","offer","quantity","credits","priceUsd","teamPlan","status","purchasedAt","purchaserName","isPurchaser","creditsUsed","creditsReversed","periodStart","periodEnd","withdrawalStatement","withdrawal"]},"SandboxCapacityWaiter":{"type":"object","properties":{"issueId":{"type":"string"},"projectId":{"type":"string"},"role":{"type":"string"},"reason":{"type":"string","enum":["org","platform"]},"waitedMs":{"type":"integer","minimum":0}},"required":["issueId","projectId","role","reason","waitedMs"]},"SandboxInstance":{"type":"object","properties":{"sandboxId":{"type":"string"},"issueId":{"type":"string"},"projectId":{"type":["string","null"]},"role":{"type":"string"},"harness":{"type":["string","null"]},"harnessVersion":{"type":["string","null"]},"runId":{"type":["string","null"]},"status":{"$ref":"#/components/schemas/SandboxStatus"},"terminationReason":{"type":["string","null"]},"instanceType":{"type":["string","null"]},"createdAt":{"type":"integer"},"timeoutAt":{"type":["integer","null"]},"lastHeartbeatAt":{"type":["integer","null"]},"endedAt":{"type":["integer","null"],"description":"When the run ended, in epoch milliseconds. Null until the run ends."},"lastCpuPct":{"type":["number","null"]},"lastMemUsedMb":{"type":["integer","null"]},"lastMemTotalMb":{"type":["integer","null"]},"lastDiskUsedPct":{"type":["number","null"]},"lastMetricAt":{"type":["integer","null"]}},"required":["sandboxId","issueId","projectId","role","harness","harnessVersion","runId","status","terminationReason","instanceType","createdAt","timeoutAt","lastHeartbeatAt","endedAt","lastCpuPct","lastMemUsedMb","lastMemTotalMb","lastDiskUsedPct","lastMetricAt"]},"SandboxMetricSample":{"type":"object","properties":{"t":{"type":"integer"},"cpuPct":{"type":"number"},"memUsedMb":{"type":"integer"},"memTotalMb":{"type":"integer"},"diskUsedPct":{"type":"number"}},"required":["t","cpuPct","memUsedMb","memTotalMb","diskUsedPct"]},"SandboxSession":{"type":"object","properties":{"role":{"type":"string"},"sessionId":{"type":"string"},"ts":{"type":"string"},"outcome":{"type":["string","null"]},"logKey":{"type":["string","null"]},"systemKey":{"type":["string","null"]},"totalCostUsd":{"type":["number","null"]}},"required":["role","sessionId","ts","outcome","logKey","systemKey","totalCostUsd"]},"LiveFragment":{"type":"object","properties":{"kind":{"type":"string","enum":["thought","action","plan","error"]},"t":{"type":"integer"},"body":{"type":"string"},"action":{"type":"string"},"parameter":{"type":"string"},"result":{"type":"string"},"toolUseId":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"content":{"type":"string"},"status":{"type":"string"}},"required":["content","status"]}}},"required":["kind","t"]},"PromptScope":{"type":"string","enum":["repo-contributed","none","not-attributable"]},"PromptSpan":{"type":"object","properties":{"id":{"type":["string","null"]},"content":{"type":"string"},"kind":{"type":"string","enum":["repo-conventions","repo-role-prompt","mission-extension","mission-override","unattributed"]}},"required":["id","content","kind"]},"SandboxEventState":{"type":"object","properties":{"sandboxId":{"type":"string"},"issueId":{"type":"string"},"role":{"type":"string"},"status":{"$ref":"#/components/schemas/SandboxStatus"},"stage":{"type":["string","null"],"enum":["pending","supervisor","planning","coding","ci","review","deploying","qa","done","declined","needs_attention"]}},"required":["sandboxId","issueId","role","status","stage"],"description":"The first event of every stream: the run and its mission as they are when the stream opens. `stage` is the current stage of the mission, or null when the platform has no record of the mission."},"SandboxEventEnd":{"type":"object","properties":{"reason":{"$ref":"#/components/schemas/SandboxEventEndReason"},"status":{"$ref":"#/components/schemas/SandboxStatus"},"stage":{"type":["string","null"],"enum":["pending","supervisor","planning","coding","ci","review","deploying","qa","done","declined","needs_attention"]}},"required":["reason","status","stage"],"description":"The last event of a stream, with the status of the run and the stage of its mission at that time."},"Environment":{"type":"object","properties":{"environmentId":{"type":"string"},"projectId":{"type":"string"},"issueId":{"type":"string"},"prNumber":{"type":"integer"},"workerName":{"type":["string","null"]},"status":{"$ref":"#/components/schemas/PreviewEnvironmentStatus"},"createdAt":{"type":"integer"},"expiresAt":{"type":["integer","null"]},"destroyedAt":{"type":["integer","null"]}},"required":["environmentId","projectId","issueId","prNumber","workerName","status","createdAt","expiresAt","destroyedAt"]},"MissionSummary":{"type":"object","properties":{"issueId":{"type":"string"},"projectId":{"type":["string","null"]},"orgSlug":{"type":["string","null"]},"linearTitle":{"type":["string","null"]},"linearUrl":{"type":["string","null"]},"tracker":{"type":["string","null"],"enum":["linear","github-issues","none"]},"prNumber":{"type":["integer","null"]},"prUrl":{"type":["string","null"]},"ciUrl":{"type":["string","null"]},"repo":{"type":["string","null"]},"baseBranch":{"type":["string","null"]},"headBranch":{"type":["string","null"]},"checkState":{"$ref":"#/components/schemas/CheckState"},"reviewState":{"$ref":"#/components/schemas/ReviewState"},"testState":{"$ref":"#/components/schemas/TestState"},"diffAdded":{"type":["integer","null"]},"diffRemoved":{"type":["integer","null"]},"pipelineProgress":{"$ref":"#/components/schemas/PipelineProgress"},"activity":{"$ref":"#/components/schemas/MissionActivity"},"statusLabel":{"type":"string"},"currentStage":{"$ref":"#/components/schemas/MissionStage"},"cycleTimeMs":{"type":["integer","null"]},"cycleTimeRunning":{"type":"boolean"},"paused":{"type":"boolean"},"pauseSource":{"type":["string","null"]},"stopped":{"type":"boolean"},"stopping":{"type":"boolean"},"terminal":{"type":"boolean"},"escalation":{"$ref":"#/components/schemas/EscalationKind"},"prActionPending":{"type":["string","null"],"enum":["merge","decline"]},"mergeConflict":{"type":"boolean"},"pendingMerge":{"type":["object","null"],"properties":{"reason":{"type":"string","enum":["updating_branch"]},"baseBranch":{"type":"string"},"requestedAt":{"type":"string"}},"required":["reason","baseBranch","requestedAt"]},"autoMerge":{"type":"boolean"},"archived":{"type":"boolean"},"entryStage":{"$ref":"#/components/schemas/MissionEntryStage"},"totalCostUsd":{"type":["number","null"]},"costIncomplete":{"type":"boolean"},"billing":{"anyOf":[{"$ref":"#/components/schemas/MissionBilling"},{"type":"null"},{"type":"null"}]},"updatedAt":{"type":"integer"},"laneEnteredAt":{"type":["integer","null"]},"platformVersion":{"type":["string","null"]},"environment":{"type":["string","null"]},"straddled":{"type":["boolean","null"]},"disposition":{"$ref":"#/components/schemas/MissionDisposition"},"supersededBy":{"type":["string","null"]},"dispositionSignal":{"type":["string","null"]}},"required":["issueId","projectId","orgSlug","linearTitle","linearUrl","prNumber","prUrl","ciUrl","repo","baseBranch","headBranch","checkState","reviewState","testState","diffAdded","diffRemoved","pipelineProgress","activity","statusLabel","currentStage","cycleTimeMs","cycleTimeRunning","paused","pauseSource","stopped","stopping","terminal","prActionPending","mergeConflict","pendingMerge","autoMerge","archived","entryStage","totalCostUsd","costIncomplete","billing","updatedAt","laneEnteredAt"]},"MissionEntryStage":{"type":["string","null"],"enum":["builder","reviewer","qa"]},"MissionEntryFilePlanEntry":{"type":"object","properties":{"path":{"type":"string","minLength":1,"example":"src/search/rate-limit.ts"},"action":{"type":"string","enum":["create","modify","delete"],"example":"create"},"description":{"type":"string","default":"","example":"Token-bucket limiter for the search route"}},"required":["path","action"]},"AgentsOverrideRoleEntry":{"type":"object","properties":{"harness":{"type":"string","enum":["claude-code","codex","pi","kilo-code","open-code"]},"model":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"effort":{"type":"string","minLength":1},"providerRouting":{"type":"object","properties":{"order":{"type":"array","items":{"type":"string"}},"only":{"type":"array","items":{"type":"string"}},"ignore":{"type":"array","items":{"type":"string"}},"allowFallbacks":{"type":"boolean"},"requireParameters":{"type":"boolean"},"quantizations":{"type":"array","items":{"type":"string"}},"sort":{"type":"string"},"dataCollection":{"type":"string","enum":["allow","deny"]}},"additionalProperties":false},"checkpoint":{"type":"boolean"},"rejectOn":{"type":"string","enum":["critical","suggestion","trivial"]},"prompt":{"anyOf":[{"type":"string","minLength":1,"maxLength":512},{"$ref":"#/components/schemas/AgentsOverrideInlinePrompt"},{"$ref":"#/components/schemas/AgentsOverridePathPrompt"}]},"sandbox":{"type":"string","minLength":1,"maxLength":200},"size":{"$ref":"#/components/schemas/SandboxSize"},"mcp":{"type":"array","items":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$"},{"type":"object","properties":{"server":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$"},"tools":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"maxItems":200}},"required":["server"],"additionalProperties":false}]},"maxItems":32,"description":"Optional narrowing of the role's MCP servers/tools for this mission; can only remove access."}}},"MissionRun":{"type":"object","properties":{"sandboxId":{"type":"string"},"role":{"type":"string"},"label":{"type":"string"},"status":{"$ref":"#/components/schemas/SandboxStatus"},"harness":{"type":["string","null"]},"model":{"type":["string","null"]},"provider":{"type":["string","null"]},"servedProvider":{"type":["string","null"]},"effort":{"type":["string","null"]},"outcome":{"type":["string","null"]},"createdAt":{"type":"integer"},"endedAt":{"type":["integer","null"],"description":"When the run ended, in epoch milliseconds. Null until the run ends."},"latestSessionId":{"type":["string","null"]},"tokenUsage":{"type":["object","null"],"properties":{"totalCostUsd":{"type":["number","null"]},"inputTokens":{"type":["integer","null"]},"outputTokens":{"type":["integer","null"]}},"required":["totalCostUsd","inputTokens","outputTokens"]},"isCurrent":{"type":"boolean"},"result":{"$ref":"#/components/schemas/MissionRunResult"},"platformVersion":{"type":["string","null"]}},"required":["sandboxId","role","label","status","harness","model","provider","servedProvider","effort","outcome","createdAt","endedAt","latestSessionId","tokenUsage","isCurrent","result"]},"MissionStageCell":{"type":"object","properties":{"stage":{"$ref":"#/components/schemas/MissionStage"},"state":{"type":"string","enum":["done","active","pending","failed"]},"role":{"type":["string","null"]},"sandboxId":{"type":["string","null"]}},"required":["stage","state","role","sandboxId"]},"MissionEvent":{"type":"object","properties":{"ts":{"type":"integer"},"kind":{"type":"string","enum":["planner_done","builder_pushed","builder_no_changes","builder_failed","dev_pushed","dev_failed","ci_passed","ci_failed","cd_passed","cd_failed","deploy_skipped","review_approved","review_changes_requested","qa_passed","qa_failed","deployed","deploy_failed","merged","declined","stopped","platform_update","error","narration_dropped","stale_trigger_dropped","instruction_received","billing_paused","billing_resumed"]},"label":{"type":"string"},"detail":{"type":["string","null"]},"sandboxId":{"type":["string","null"]}},"required":["ts","kind","label","detail","sandboxId"]},"MissionStats":{"type":"object","properties":{"cycleTimeMs":{"type":["integer","null"]},"leadTimeMs":{"type":["integer","null"]},"leadTimeRunning":{"type":"boolean"},"totalCostUsd":{"type":["number","null"]},"unpricedModels":{"type":"array","items":{"type":"string"}},"totalInputTokens":{"type":["integer","null"]},"totalOutputTokens":{"type":["integer","null"]},"agentAttempts":{"type":"integer","minimum":0},"stages":{"type":"array","items":{"$ref":"#/components/schemas/MissionStageStat"}}},"required":["cycleTimeMs","leadTimeMs","leadTimeRunning","totalCostUsd","unpricedModels","totalInputTokens","totalOutputTokens","agentAttempts","stages"]},"MissionStageOutcomes":{"type":"object","properties":{"plan":{"$ref":"#/components/schemas/MissionPlanOutcome"},"build":{"$ref":"#/components/schemas/MissionBuildOutcome"},"review":{"$ref":"#/components/schemas/MissionReviewOutcome"},"qa":{"$ref":"#/components/schemas/MissionQaOutcome"}},"required":["plan","build","review","qa"]},"StepProvenance":{"type":"object","properties":{"stage":{"type":"string"},"attempt":{"type":"number"},"harness":{"type":"string"},"model":{"type":"string"},"provider":{"type":["string","null"]},"effort":{"type":["string","null"]},"baseSha":{"type":["string","null"]},"durationSeconds":{"type":"number"},"inferenceCostUsd":{"type":["number","null"]},"missingPriceKey":{"type":"string"},"inputTokens":{"type":"integer"},"outputTokens":{"type":"integer"},"cacheReadTokens":{"type":"integer"},"cacheCreationTokens":{"type":"integer"},"selfReportedCostUsd":{"type":["number","null"]},"priceVersion":{"type":"string"},"startedAt":{"type":"string"},"completedAt":{"type":"string"},"sessionId":{"type":["string","null"]}},"required":["stage","attempt","harness","model","provider","effort","baseSha","durationSeconds","inferenceCostUsd","inputTokens","outputTokens","cacheReadTokens","cacheCreationTokens","selfReportedCostUsd","priceVersion","startedAt","completedAt","sessionId"]},"InspectSection":{"type":"object","properties":{"ok":{"type":"boolean"},"data":{},"error":{"type":"string"}},"required":["ok"]},"MissionInstructionKind":{"type":"string","enum":["follow_up","note"],"default":"follow_up","description":"`follow_up` asks for a change and dispatches the builder against the mission's open PR, overriding cached review/QA verdicts. `note` records context for whatever runs next and dispatches nothing. Stated explicitly rather than inferred, so the outcome never depends on how the platform reads intent."},"MissionInstructionDispatch":{"type":"object","properties":{"willDispatch":{"type":"boolean","example":true},"role":{"type":["string","null"],"example":"builder"},"reason":{"$ref":"#/components/schemas/MissionInstructionDispatchReason"},"remedy":{"type":"string","description":"Present only when nothing was dispatched and the caller has a next step."}},"required":["willDispatch","role","reason"]},"AgentsOverrideRecord":{"type":["object","null"],"properties":{"agents":{"type":"object","properties":{"planner":{"$ref":"#/components/schemas/AgentsOverrideRoleEntry"},"builder":{"$ref":"#/components/schemas/AgentsOverrideRoleEntry"},"reviewer":{"$ref":"#/components/schemas/AgentsOverrideRoleEntry"},"qa":{"$ref":"#/components/schemas/AgentsOverrideRoleEntry"}},"additionalProperties":false},"baseBranch":{"type":"string","minLength":1}}},"CatalogRole":{"type":"object","properties":{"key":{"$ref":"#/components/schemas/AgentRoleKey"},"name":{"type":"string"},"roleLabel":{"type":"string"},"blurb":{"type":"string"}},"required":["key","name","roleLabel","blurb"]},"CatalogHarness":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/HarnessId"},"label":{"type":"string"},"executable":{"type":"boolean"},"models":{"type":"array","items":{"$ref":"#/components/schemas/CatalogModel"}}},"required":["id","label","executable","models"]},"CatalogBuiltinAgent":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"role":{"$ref":"#/components/schemas/AgentRoleKey"},"harness":{"$ref":"#/components/schemas/HarnessId"},"model":{"type":"string"},"userPrompt":{"type":"string","description":"Deprecated: not read by the pipeline; agent instructions and skills are configured in the target repo."},"skillRepos":{"type":"array","items":{"type":"string"},"description":"Deprecated: not read by the pipeline; agent instructions and skills are configured in the target repo."},"sandboxTemplateKey":{"type":"string"}},"required":["key","name","role","harness","model","userPrompt","skillRepos","sandboxTemplateKey"]},"CatalogSandboxTemplate":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"dockerfile":{"type":"string"}},"required":["key","name","dockerfile"]},"CatalogInstanceType":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/SandboxInstanceTypeId"},"label":{"type":"string"},"vcpu":{"type":"string"},"memory":{"type":"string"},"disk":{"type":"string"}},"required":["id","label","vcpu","memory","disk"]},"AgentRoleKey":{"type":"string","enum":["researcher","planner","builder","reviewer","deployer","tester"]},"HarnessId":{"type":"string","enum":["hermes","pi","kilo-code","open-code","claude-code","codex","copilot"]},"AgentSandboxSelection":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["existing"]},"templateId":{"type":"string","minLength":1}},"required":["kind","templateId"]},{"type":"object","properties":{"kind":{"type":"string","enum":["new"]},"template":{"$ref":"#/components/schemas/NewSandboxTemplateInput"}},"required":["kind","template"]}]},"ScheduledTaskTrigger":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["schedule"]},"schedule":{"$ref":"#/components/schemas/ScheduledTaskSchedule"}},"required":["kind","schedule"]}]},"ScheduledTaskLabels":{"type":"array","items":{"type":"string","minLength":1,"maxLength":100},"maxItems":10},"ScheduledTaskTemplate":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"blurb":{"type":"string"},"prompt":{"type":"string"},"suggestedSchedule":{"$ref":"#/components/schemas/ScheduledTaskSchedule"}},"required":["key","name","blurb","prompt","suggestedSchedule"]},"ScheduledTaskRun":{"type":"object","properties":{"billingActorUserId":{"type":["string","null"]},"id":{"type":"string"},"scheduledTaskId":{"type":"string"},"projectId":{"type":"string"},"scheduledFor":{"type":"integer"},"kind":{"$ref":"#/components/schemas/ScheduledTaskRunKind"},"status":{"$ref":"#/components/schemas/ScheduledTaskRunStatus"},"issueId":{"type":["string","null"]},"issueUrl":{"type":["string","null"]},"reason":{"type":["string","null"]},"lastError":{"type":["string","null"]},"createdAt":{"type":"integer"},"updatedAt":{"type":"integer"},"missionProgress":{"type":["string","null"]},"missionActivity":{"type":["string","null"]},"missionCostUsd":{"type":["number","null"]},"missionCostIncomplete":{"type":"boolean"},"missionTitle":{"type":["string","null"]}},"required":["id","scheduledTaskId","projectId","scheduledFor","kind","status","issueId","issueUrl","reason","lastError","createdAt","updatedAt","missionProgress","missionActivity","missionCostUsd","missionCostIncomplete","missionTitle"]},"ScheduledTaskRunStatus":{"type":"string","enum":["dispatching","dispatched","skipped","failed"]},"OrchestratorVendor":{"type":["string","null"],"enum":["anthropic","openai","openrouter"]},"OrchestratorAssignableKey":{"type":"object","properties":{"llmConnectorId":{"type":"string"},"vendor":{"allOf":[{"$ref":"#/components/schemas/OrchestratorVendor"},{"type":"string"}]},"displayName":{"type":"string"}},"required":["llmConnectorId","vendor","displayName"]},"OrchestratorModelsByVendor":{"type":"object","properties":{"anthropic":{"type":"array","items":{"$ref":"#/components/schemas/CatalogModel"}},"openai":{"type":"array","items":{"$ref":"#/components/schemas/CatalogModel"}},"openrouter":{"type":"array","items":{"$ref":"#/components/schemas/CatalogModel"}}},"required":["anthropic","openai","openrouter"]},"SandboxSize":{"anyOf":[{"$ref":"#/components/schemas/SandboxTier"},{"type":"object","properties":{"vcpu":{"type":"integer","example":2},"memoryMib":{"type":"integer","example":8192},"diskMb":{"type":"integer","example":16000}},"required":["vcpu","memoryMib","diskMb"]}]},"SandboxTier":{"type":"string","enum":["standard-1","standard-2","standard-3","standard-4"]},"SandboxStarter":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"dockerfile":{"type":"string"},"size":{"$ref":"#/components/schemas/SandboxSize"}},"required":["id","name","description","dockerfile","size"]},"SandboxTemplateKind":{"type":"string","enum":["org","repo"],"description":"`org`: defined in the console or API. `repo`: defined by a project's `.ship/sandbox.Dockerfile`; read-only here, edited in the repository."},"StoredSandboxSize":{"anyOf":[{"$ref":"#/components/schemas/SandboxInstanceTypeId"},{"type":"object","properties":{"vcpu":{"type":"integer","example":2},"memoryMib":{"type":"integer","example":8192},"diskMb":{"type":"integer","example":16000}},"required":["vcpu","memoryMib","diskMb"]}]},"SandboxInstanceTypeId":{"type":"string","enum":["lite","basic","standard-1","standard-2","standard-3","standard-4"]},"SandboxTemplateBuildSummary":{"type":"object","properties":{"id":{"type":"string"},"status":{"$ref":"#/components/schemas/SandboxTemplateBuildStatus"},"phase":{"$ref":"#/components/schemas/SandboxTemplateBuildPhase"},"finishedAt":{"type":["string","null"]}},"required":["id","status","phase","finishedAt"]},"SandboxTemplateBuildStatus":{"type":"string","enum":["queued","building","ready","failed"]},"SandboxTemplateBuildPhase":{"type":"string","enum":["validate","run-steps","snapshot","warm"]},"SandboxTemplateBuildTrigger":{"type":"string","enum":["save","base-change","repo-file","expiry","manual","rollback"]},"SandboxTemplateBuildLogChunk":{"type":"object","properties":{"seq":{"type":"integer"},"stream":{"type":"string","enum":["stdout","stderr","platform"]},"text":{"type":"string"},"at":{"type":"integer"}},"required":["seq","stream","text","at"]},"SandboxTemplateVersion":{"type":"object","properties":{"id":{"type":"string"},"templateId":{"type":"string"},"version":{"type":"integer"},"dockerfile":{"type":"string"},"size":{"$ref":"#/components/schemas/StoredSandboxSize"},"source":{"type":"string"},"active":{"type":"boolean"},"createdAt":{"type":"integer"},"latestBuild":{"anyOf":[{"$ref":"#/components/schemas/SandboxTemplateBuildSummary"},{"type":"null"},{"type":"null"}]}},"required":["id","templateId","version","dockerfile","size","source","active","createdAt","latestBuild"]},"RegistryAuthScheme":{"type":"string","enum":["bearer","basic"]},"McpConfigPathSource":{"type":"string","enum":["ship.yml","project","default"],"description":"Which layer named the MCP file: the repository's ship.yml (mcp.config), the path set on the project, or the default .mcp.json. ship.yml wins."},"McpProjectServer":{"type":"object","properties":{"name":{"type":"string"},"declared":{"anyOf":[{"$ref":"#/components/schemas/McpServerSummary"},{"type":"null"},{"type":"null"}]},"binding":{"anyOf":[{"$ref":"#/components/schemas/McpBinding"},{"type":"null"},{"type":"null"}]}},"required":["name","declared","binding"]},"McpRole":{"type":"string","enum":["planner","builder","reviewer","qa"]},"McpBindingTransport":{"type":"string","enum":["remote","isolate","local"],"description":"remote: the gateway proxies to the server's URL. isolate: the gateway runs the server's npm package in an isolated runtime. local: the server runs inside the agent's sandbox (no credential)."},"McpCredentialInput":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["none"]}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","enum":["headers"]},"headers":{"type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":4096}}},"required":["kind","headers"]},{"type":"object","properties":{"kind":{"type":"string","enum":["isolate-env"]},"env":{"type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":4096}},"allowedHosts":{"type":"array","items":{"type":"string","minLength":1,"maxLength":253},"minItems":1,"maxItems":10}},"required":["kind","env","allowedHosts"]}]},"McpApprovedTool":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":128},"attestedReadOnly":{"type":"boolean"}},"required":["name"]},"McpBindingStatus":{"type":"string","enum":["ready","needs_credential","needs_reconnect","origin_changed","bundling","bundle_failed","not_isolatable"]},"McpAuthKind":{"type":"string","enum":["none","headers","oauth","isolate-env"]},"McpToolSnapshotEntry":{"type":"object","properties":{"name":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"readOnlyHint":{"type":"boolean"},"destructiveHint":{"type":"boolean"}},"required":["name"]},"McpBindingInventoryItem":{"type":"object","properties":{"projectId":{"type":"string"},"projectName":{"type":"string"},"serverName":{"type":"string"},"transport":{"$ref":"#/components/schemas/McpBindingTransport"},"status":{"$ref":"#/components/schemas/McpBindingStatus"},"statusDetail":{"type":["string","null"]},"roles":{"type":"array","items":{"$ref":"#/components/schemas/McpRole"}},"authKind":{"$ref":"#/components/schemas/McpAuthKind"},"credentialFields":{"type":"array","items":{"type":"string"}},"updatedAt":{"type":"integer"}},"required":["projectId","projectName","serverName","transport","status","statusDetail","roles","authKind","credentialFields","updatedAt"],"description":"Where an MCP credential is used, for the org's credential inventory. Never the credential itself."},"Integration":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"vendor":{"type":"string","example":"linear"},"vendorKind":{"$ref":"#/components/schemas/VendorKind"},"externalOrgId":{"type":"string"},"displayName":{"type":["string","null"]},"createdAt":{"type":"integer"},"updatedAt":{"type":"integer"},"dependentProjectCount":{"type":"integer"},"reconnect":{"type":["object","null"],"properties":{"reason":{"type":"string"},"since":{"type":"integer"},"url":{"type":["string","null"],"format":"uri"}},"required":["reason","since","url"]}},"required":["id","orgId","vendor","vendorKind","externalOrgId","displayName","createdAt","updatedAt","dependentProjectCount","reconnect"]},"VaultCatalogVendor":{"type":"object","properties":{"vendor":{"type":"string"},"label":{"type":"string"},"vendorKind":{"$ref":"#/components/schemas/VendorKind"},"authScheme":{"$ref":"#/components/schemas/AuthScheme"},"oauthConnectPath":{"type":["string","null"]}},"required":["vendor","label","vendorKind","authScheme","oauthConnectPath"]},"AuthScheme":{"type":"string","enum":["oauth2","api_key"]},"CredentialType":{"type":["string","null"],"enum":["oauth","api"]},"LinearTrackerSecret":{"type":"object","properties":{"accessToken":{"type":"string"},"refreshToken":{"type":"string"},"expiresAt":{"type":"integer"},"workspaceId":{"type":"string"},"workspaceName":{"type":"string"},"apiKey":{"type":"string"}},"required":["accessToken","workspaceId"]},"GithubScmSecret":{"type":"object","properties":{"appId":{"type":"string"},"installationId":{"type":"string"},"privateKeyPem":{"type":"string"},"botLogin":{"type":"string"},"botUserId":{"type":"string"}},"required":["appId","installationId","privateKeyPem"]},"AnthropicLlmSecret":{"type":"object","properties":{"apiKey":{"type":"string"}},"required":["apiKey"]},"OpenaiLlmSecret":{"type":"object","properties":{"apiKey":{"type":"string"}}},"SetupMilestone":{"type":"object","properties":{"id":{"allOf":[{"$ref":"#/components/schemas/SetupMilestoneId"},{"type":"string"}]},"title":{"type":"string","example":"Invite a teammate"},"description":{"type":"string"},"reached":{"type":"boolean"},"status":{"$ref":"#/components/schemas/SetupMilestoneStatus"},"action":{"$ref":"#/components/schemas/SetupAction"},"docsUrl":{"type":["string","null"],"format":"uri"}},"required":["id","title","description","reached","status","action","docsUrl"]},"NoticeKind":{"type":"string","enum":["tracker_reconnect_required","credits_exhausted","credits_low","team_payment_overdue"]},"NoticeAction":{"type":"object","properties":{"kind":{"type":"string","enum":["reconnect_tracker","buy_credits","request_credits","update_payment_method"]},"label":{"type":"string"},"url":{"type":"string","format":"uri"}},"required":["kind","label","url"]},"ScopeAccessLevel":{"type":"object","properties":{"id":{"type":"string","example":"write"},"label":{"type":"string","example":"Read and write"},"scopes":{"type":"array","items":{"type":"string"},"description":"Exactly what this level grants. Empty means no access.","example":["missions:read","missions:write"]},"reserved":{"type":"boolean","description":"True when this level grants a scope that currently gates no route. Per-level, not per-group: a caller whose ceiling hides the reserved level must not see the group's note attached to an ordinary one."}},"required":["id","label","scopes"]},"CreditPack":{"type":"string","enum":["credit_pack_10","credit_pack_50","credit_pack_100"]},"TeamPlanEntry":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/TeamPlanId"},"name":{"type":"string"},"credits":{"type":"integer","exclusiveMinimum":0},"perCreditUsd":{"type":"number","exclusiveMinimum":0},"priceUsd":{"type":"number","exclusiveMinimum":0},"agentsAtOnce":{"type":"integer","exclusiveMinimum":0}},"required":["id","name","credits","perCreditUsd","priceUsd","agentsAtOnce"]},"CreditSourceKind":{"type":"string","enum":["trial","sponsored","plan","contract","purchase"]},"SubscribedPlan":{"type":"object","properties":{"plan":{"$ref":"#/components/schemas/TeamPlanId"},"name":{"type":"string"},"priceUsd":{"type":"number","exclusiveMinimum":0},"creditsPerMonth":{"type":"integer","exclusiveMinimum":0},"perCreditUsd":{"type":"number","exclusiveMinimum":0},"agentsAtOnce":{"type":"integer","exclusiveMinimum":0}},"required":["plan","name","priceUsd","creditsPerMonth","perCreditUsd","agentsAtOnce"]},"TeamSubscriptionStatus":{"type":"string","enum":["incomplete","active","past_due","canceled"]},"LedgerEntryKind":{"type":"string","enum":["mission","grant","adjustment","expiry"]},"WithdrawalUnavailableReason":{"type":"string","enum":["not_purchaser","not_completed","window_closed","all_used","already_withdrawn"]},"SandboxEventEndReason":{"type":"string","enum":["run_ended","stage_changed","time_cap"],"description":"Why the stream ended. `run_ended`: the run is no longer `running`. `stage_changed`: the mission moved to another stage while the run was still active. `time_cap`: the stream was open for `maxSeconds`. Open the stream again with `since` to continue."},"TestState":{"type":"string","enum":["passed","failed","pending","none"]},"EscalationKind":{"type":"string","enum":["error","handled"]},"MissionBilling":{"type":"object","properties":{"creditsUsed":{"type":"integer","minimum":0},"ceiling":{"type":"integer","exclusiveMinimum":0},"mode":{"$ref":"#/components/schemas/BillingMode"},"hold":{"anyOf":[{"$ref":"#/components/schemas/MissionHoldReason"},{"type":"null"},{"type":"null"}]}},"required":["creditsUsed","ceiling","mode","hold"]},"AgentsOverrideInlinePrompt":{"type":"object","properties":{"content":{"type":"string","minLength":1,"maxLength":30000},"mode":{"$ref":"#/components/schemas/AgentsOverridePromptMode"}},"required":["content"],"additionalProperties":false},"AgentsOverridePathPrompt":{"type":"object","properties":{"path":{"type":"string","minLength":1,"maxLength":512},"ref":{"type":"string","minLength":1},"mode":{"$ref":"#/components/schemas/AgentsOverridePromptMode"}},"required":["path"],"additionalProperties":false},"MissionRunResult":{"type":["object","null"],"properties":{"scope":{"type":"string","enum":["run","mission"]},"plan":{"$ref":"#/components/schemas/MissionPlanOutcome"},"build":{"$ref":"#/components/schemas/MissionBuildOutcome"},"review":{"$ref":"#/components/schemas/MissionReviewOutcome"},"qa":{"$ref":"#/components/schemas/MissionQaOutcome"},"failure":{"type":["string","null"]}},"required":["scope","plan","build","review","qa","failure"]},"MissionStageStat":{"type":"object","properties":{"stage":{"$ref":"#/components/schemas/MissionStage"},"label":{"type":"string"},"attempts":{"type":"integer","minimum":0},"durationMs":{"type":"integer","minimum":0},"percentOfCycle":{"type":"number","minimum":0},"costUsd":{"type":["number","null"]},"unpricedModels":{"type":"array","items":{"type":"string"}},"inputTokens":{"type":"integer","minimum":0},"outputTokens":{"type":"integer","minimum":0},"model":{"type":["string","null"]},"promptVersion":{"type":["string","null"]}},"required":["stage","label","attempts","durationMs","percentOfCycle","costUsd","unpricedModels","inputTokens","outputTokens","model","promptVersion"]},"MissionPlanOutcome":{"type":["object","null"],"properties":{"markdown":{"type":"string"},"acceptanceCriteria":{"type":"array","items":{"type":"string"}},"filePlan":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"action":{"type":"string","enum":["create","modify","delete"]},"description":{"type":"string"}},"required":["path","action","description"]}}},"required":["markdown","acceptanceCriteria","filePlan"]},"MissionBuildOutcome":{"type":["object","null"],"properties":{"prNumber":{"type":["integer","null"]},"prUrl":{"type":["string","null"]},"headSha":{"type":["string","null"]},"commitUrl":{"type":["string","null"]},"diffAdded":{"type":["integer","null"]},"diffRemoved":{"type":["integer","null"]},"changedFiles":{"type":["integer","null"]},"files":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"additions":{"type":"integer","minimum":0},"deletions":{"type":"integer","minimum":0},"status":{"type":"string"}},"required":["path","additions","deletions","status"]}}},"required":["prNumber","prUrl","diffAdded","diffRemoved","changedFiles","files"]},"MissionReviewOutcome":{"type":["object","null"],"properties":{"approved":{"type":"boolean"},"comments":{"type":"array","items":{"type":"object","properties":{"file":{"type":"string"},"line":{"type":["integer","null"]},"severity":{"type":"string","enum":["critical","suggestion","trivial"]},"comment":{"type":"string"}},"required":["file","line","severity","comment"]}}},"required":["approved","comments"]},"MissionQaOutcome":{"type":["object","null"],"properties":{"overall":{"type":"string","enum":["pass","fail"]},"criteria":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"pass":{"type":"boolean"},"evidence":{"type":"string"}},"required":["name","pass","evidence"]}},"proofSkipped":{"type":"boolean"}},"required":["overall","criteria","proofSkipped"]},"MissionInstructionDispatchReason":{"type":"string","enum":["follow_up_forced","note_recorded","pr_settled","no_pr"]},"CatalogModel":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"]},"NewSandboxTemplateInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"dockerfile":{"type":"string","minLength":1,"maxLength":100000},"size":{"$ref":"#/components/schemas/SandboxSize"},"instanceType":{"$ref":"#/components/schemas/SandboxInstanceTypeId"}},"required":["name","dockerfile"]},"ScheduledTaskSchedule":{"type":"object","properties":{"interval":{"$ref":"#/components/schemas/ScheduledTaskInterval"},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"timezone":{"type":"string","minLength":1},"weekday":{"$ref":"#/components/schemas/ScheduledTaskWeekday"},"dayOfMonth":{"type":"integer","minimum":1,"maximum":28}},"required":["interval","time","timezone"]},"ScheduledTaskRunKind":{"type":"string","enum":["scheduled","manual"]},"McpServerSummary":{"type":"object","properties":{"name":{"type":"string"},"transport":{"type":"string","enum":["http","sse","stdio"]},"origin":{"type":"string"},"path":{"type":"string"},"command":{"type":"string"},"displayArgs":{"type":"array","items":{"type":"string"}},"headerNames":{"type":"array","items":{"type":"string"}},"envNames":{"type":"array","items":{"type":"string"}},"secretRefs":{"type":"array","items":{"type":"string"}},"isolation":{"$ref":"#/components/schemas/McpIsolation"}},"required":["name","transport","headerNames","envNames","secretRefs","isolation"],"description":"A server as the repository declares it. Values are never included; only names."},"SetupMilestoneStatus":{"type":"string","enum":["open","reached","completed","skipped"]},"SetupAction":{"type":["object","null"],"properties":{"label":{"type":"string","example":"Invite a teammate"},"path":{"type":"string","example":"/settings/team"},"url":{"type":"string","format":"uri","example":"https://letsship.ai/settings/team"}},"required":["label","path","url"]},"MissionHoldReason":{"type":"string","enum":["user","checkpoint","capacity","usage_limit","backoff","credits","ceiling"]},"AgentsOverridePromptMode":{"type":"string","enum":["replace","extend"],"example":"extend"},"ScheduledTaskInterval":{"type":"string","enum":["daily","weekly","monthly"]},"ScheduledTaskWeekday":{"type":"string","enum":["monday","tuesday","wednesday","thursday","friday","saturday","sunday"]},"McpIsolation":{"type":"object","properties":{"kind":{"type":"string","enum":["remote","npm","not-isolatable"]},"packageSpec":{"type":"string"},"reason":{"type":"string","enum":["python","docker","repo-relative","binary"]}},"required":["kind"]}},"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API token (pat_ or mcp_ prefix)"}}},"paths":{"/organizations":{"post":{"x-audience":"public","tags":["organizations"],"summary":"Create an org (cookieAuth, makes caller owner)","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrganizationRequest"}}}},"responses":{"200":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Slug already taken","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"x-audience":"public","tags":["organizations"],"summary":"List the calling user's orgs","responses":{"200":{"description":"Orgs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListOrganizationsResponse"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/organizations/{orgId}":{"patch":{"x-audience":"public","tags":["organizations"],"summary":"Rename an org (cookieAuth, owner/admin only)","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"orgId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOrganizationRequest"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not permitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such org","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Slug already taken","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"x-audience":"public","tags":["organizations"],"summary":"Fetch an org (membership required)","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"orgId","in":"path"}],"responses":{"200":{"description":"Org","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"404":{"description":"Not found (or no membership)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/organizations/slug-availability":{"get":{"x-audience":"public","tags":["organizations"],"summary":"Check whether an organization slug is free","description":"Says whether the slug is free. A taken slug comes with a free variant to offer instead. Pass orgId to rename that organization: its own slug counts as free.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9-]+$"},"required":true,"name":"slug","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"orgId","in":"query"}],"responses":{"200":{"description":"Availability","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SlugAvailabilityResponse"}}}},"400":{"description":"Not a valid slug","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/organizations/slug-preview":{"get":{"x-audience":"public","tags":["organizations"],"summary":"Preview the slug the API would derive from an org name (onboarding helper)","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":120},"required":true,"name":"name","in":"query"}],"responses":{"200":{"description":"Derived slug","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SlugPreviewResponse"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/organizations/{orgId}/memberships":{"get":{"x-audience":"public","tags":["organizations"],"summary":"List memberships in an org","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"orgId","in":"path"}],"responses":{"200":{"description":"Members","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListMembershipsResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"x-audience":"public","tags":["organizations"],"summary":"Add a member to an org (owner|admin)","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"orgId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMembershipRequest"}}}},"responses":{"200":{"description":"Membership created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Membership"}}}},"403":{"description":"Role insufficient","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Org not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/organizations/{orgId}/close":{"post":{"x-audience":"public","tags":["organizations"],"summary":"Close the workspace: archived, and each paid pack's unused credits refunded, withdrawn or forfeited","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"orgId","in":"path"}],"responses":{"200":{"description":"Closed (or the first closure, retried)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgClosure"}}}},"403":{"description":"Not an owner (owner_required)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such org for this caller","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/tokens":{"post":{"x-audience":"public","tags":["admin"],"summary":"Create a personal access token","description":"Creates a personal access token (pat_) for the signed-in user in their organization. Tokens are created from a signed-in session, never by another token. The requested scopes must exist and must be within the user's own permissions: a token can never carry more authority than the person who created it, and a request that asks for more is refused with each offending scope named rather than quietly narrowed. The token value is returned once and cannot be retrieved again.","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTokenRequest"}}}},"responses":{"201":{"description":"Token created. `token` is shown here and never again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedToken"}}}},"403":{"description":"Caller is not a human org member, or requested a scope above their grant ceiling.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The caller belongs to no organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"x-audience":"public","tags":["admin"],"summary":"List your API tokens","description":"Lists the calling user's own tokens in their org - identity and lifecycle only, never a secret or a hash. Other members' tokens are never listed, regardless of role.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The caller's tokens.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenList"}}}},"404":{"description":"The caller belongs to no organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/tokens/{tokenId}":{"delete":{"x-audience":"public","tags":["admin"],"summary":"Revoke one of your own tokens","description":"Revokes a token the calling user owns, and only one they own. A token belonging to another member or another organization is reported as not found, so this route cannot be used to discover token ids. Revocation takes effect immediately.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"example":"tok-9b8e2a3f"},"required":true,"name":"tokenId","in":"path"}],"responses":{"200":{"description":"Token revoked (or was already revoked).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeTokenResult"}}}},"404":{"description":"No such token owned by the caller.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/oauth/authorization-server":{"get":{"x-audience":"public","tags":["agent-auth"],"summary":"Authorization server metadata (RFC 8414)","description":"The metadata document of the agent authorization server. It has the Auth.md agent_auth block and the providers whose ID-JAGs SHIP trusts. The console serves the same document at https://letsship.ai/.well-known/oauth-authorization-server, the well-known URL of the issuer.","responses":{"200":{"description":"The metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizationServerMetadata"}}}},"500":{"description":"This environment is not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/oauth/protected-resource":{"get":{"x-audience":"public","tags":["agent-auth"],"summary":"Protected resource metadata (RFC 9728)","description":"The metadata for one resource this authorization server issues tokens for: the API, the MCP server or the A2A endpoint. The API serves its own at https://api.letsship.ai/.well-known/oauth-protected-resource.","parameters":[{"schema":{"type":"string","minLength":1,"example":"https://mcp.letsship.ai/mcp"},"required":true,"name":"resource","in":"query"}],"responses":{"200":{"description":"The metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProtectedResourceMetadata"}}}},"404":{"description":"Not a resource of this server.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/oauth2/jwks":{"get":{"x-audience":"public","tags":["agent-auth"],"summary":"Signing keys (JWKS)","description":"The public key that signs every identity_assertion this server issues. Private key material never appears here.","responses":{"200":{"description":"The key set.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Jwks"}}}},"500":{"description":"The signing key is not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/agent/identity":{"post":{"x-audience":"public","tags":["agent-auth"],"summary":"Register an agent (Auth.md)","description":"An agent registers itself: anonymous (no user yet), service_auth (the user's email, confirmed by the user on the console) or identity_assertion (an ID-JAG from a trusted provider). Returns a service-signed identity_assertion or a claim ceremony, never a credential. Read https://letsship.ai/auth.md for the whole flow.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentIdentityRequest"}}}},"responses":{"200":{"description":"Registered.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRegistrationResponse"}}}},"400":{"description":"Invalid request, untrusted provider or a token that did not verify.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAuthError"}}}},"401":{"description":"interaction_required (claim ceremony) or login_required (stale provider login).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAuthError"}}}},"429":{"description":"Too many registrations from this address.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAuthError"}}}},"503":{"description":"The provider's signing keys could not be read. Try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAuthError"}}}}}}},"/agent/identity/claim":{"post":{"x-audience":"public","tags":["agent-auth"],"summary":"Start or renew a claim","description":"Binds an anonymous registration to the email of the person the agent acts for and returns a code for that person, or mints a new code for a pending registration whose code expired.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InitiateClaimRequest"}}}},"responses":{"200":{"description":"Claim started.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InitiateClaimResponse"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAuthError"}}}},"401":{"description":"invalid_claim_token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAuthError"}}}},"409":{"description":"claimed_or_in_flight.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAuthError"}}}},"410":{"description":"claim_expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAuthError"}}}}}}},"/oauth2/token":{"post":{"x-audience":"public","tags":["agent-auth"],"summary":"Token endpoint","description":"authorization_code with PKCE, and refresh_token with rotation, for clients that sign a person in through the console. RFC 7523 jwt-bearer: trade an identity_assertion for a one-hour access token. urn:workos:agent-auth:grant-type:claim: poll a claim (RFC 8628 vocabulary). `resource` (RFC 8707) binds the token to the API (default) or the MCP server.","requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/OAuthTokenRequest"}}}},"responses":{"200":{"description":"An access token. Never cached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthTokenResponse"}}}},"400":{"description":"RFC 6749 section 5.2 error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthError"}}}},"500":{"description":"server_error: this environment is not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthError"}}}}}}},"/oauth2/revoke":{"post":{"x-audience":"public","tags":["agent-auth"],"summary":"Revoke an access token (RFC 7009)","description":"Answers 200 for a known, unknown or already revoked token alike, so it reveals nothing.","requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/OAuthRevokeRequest"}}}},"responses":{"200":{"description":"Done."},"400":{"description":"The body is malformed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthError"}}}}}}},"/agent/event/notify":{"post":{"x-audience":"public","tags":["agent-auth"],"summary":"Receive a Security Event Token (RFC 8935)","description":"A trusted provider pushes a signed SET (RFC 8417, Content-Type application/secevent+jwt). The identity-assertion-revoked event kills the registration and every token under it.","requestBody":{"required":true,"content":{"application/secevent+jwt":{"schema":{"type":"string"}}}},"responses":{"202":{"description":"Accepted."},"400":{"description":"RFC 8935 section 2.4 error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecurityEventError"}}}}}}},"/agent-delegations":{"get":{"x-audience":"public","tags":["agent-auth"],"summary":"List the agents you authorized","description":"Your own agent delegations in your organization: claimed agent registrations, newest first, with what each may do and when it expires. Other members' delegations are never listed.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Your delegations.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentDelegationList"}}}},"404":{"description":"The caller belongs to no organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/agent-delegations/{delegationId}":{"delete":{"x-audience":"public","tags":["agent-auth"],"summary":"Revoke an agent","description":"Revokes one of your own delegations. Every access token issued under it stops working at once, and its identity assertion can no longer be exchanged. Another member's delegation reads as not found.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"example":"dlg_7Hc2..."},"required":true,"name":"delegationId","in":"path"}],"responses":{"200":{"description":"Revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeAgentDelegationResult"}}}},"404":{"description":"No such delegation of yours.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/oauth2/register":{"post":{"x-audience":"public","tags":["agent-auth"],"summary":"Register an OAuth client (RFC 7591)","description":"Dynamic client registration for public clients: PKCE, no client secret, token_endpoint_auth_method none. Redirect URIs must be https, http on a loopback host (any port), or a private-use scheme. A client can instead use the HTTPS URL of a Client ID Metadata Document as its client_id, with no registration.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientRegistrationRequest"}}}},"responses":{"201":{"description":"Registered.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientRegistrationResponse"}}}},"400":{"description":"invalid_redirect_uri or invalid_client_metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAuthError"}}}},"429":{"description":"Too many registrations from this address.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAuthError"}}}}}}},"/me":{"get":{"x-audience":"public","tags":["identity"],"summary":"Who am I: identity + org role + role-derived capabilities + token scopes","responses":{"200":{"description":"Caller identity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/me/setup":{"get":{"x-audience":"public","tags":["identity"],"summary":"What the org has set up so far, and what to do next","parameters":[{"schema":{"type":"string"},"required":false,"name":"orgId","in":"query"}],"responses":{"200":{"description":"Setup progress","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupProgress"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not one of the caller's orgs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"SITE_URL is not set, so the steps cannot link to the console (code not_configured)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/me/setup/milestones/{milestoneId}":{"put":{"x-audience":"public","tags":["identity"],"summary":"Mark a setup step complete or skipped for the caller, or take the mark back","parameters":[{"schema":{"allOf":[{"$ref":"#/components/schemas/SetupMilestoneId"},{"type":"string"}]},"required":true,"name":"milestoneId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"orgId","in":"query"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSetupMilestoneRequest"}}}},"responses":{"200":{"description":"Saved; the checklist as the caller now sees it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupProgress"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token acts for no person, so there is nobody to save it for (code person_required)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not one of the caller's orgs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"SITE_URL is not set, so the steps cannot link to the console (code not_configured)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/me/setup/groups/{groupId}":{"put":{"x-audience":"public","tags":["identity"],"summary":"Mark every open step of a setup group for the caller, or take the group's marks back","parameters":[{"schema":{"allOf":[{"$ref":"#/components/schemas/SetupGroupId"},{"type":"string"}]},"required":true,"name":"groupId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"orgId","in":"query"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSetupGroupRequest"}}}},"responses":{"200":{"description":"Saved; the checklist as the caller now sees it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupProgress"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token acts for no person, so there is nobody to save it for (code person_required)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not one of the caller's orgs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"SITE_URL is not set, so the steps cannot link to the console (code not_configured)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/me/guides/{guideId}":{"put":{"x-audience":"public","tags":["identity"],"summary":"Record how far the caller went through a first-mission guide","parameters":[{"schema":{"$ref":"#/components/schemas/SetupGuideId"},"required":true,"name":"guideId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"orgId","in":"query"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSetupGuideRequest"}}}},"responses":{"200":{"description":"Saved; a finished guide stays finished","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupGuide"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token acts for no person, so there is nobody to save it for (code person_required)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not one of the caller's orgs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/notices":{"get":{"x-audience":"public","tags":["notices"],"summary":"What needs attention in the org: a tracker to reconnect, credits running out","parameters":[{"schema":{"type":"string"},"required":false,"name":"orgId","in":"query"}],"responses":{"200":{"description":"Notices, without the ones the caller dismissed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListNoticesResponse"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not one of the caller's orgs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"SITE_URL is not set, so actions cannot link to the console (code not_configured)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/notices/{noticeId}/dismiss":{"post":{"x-audience":"public","tags":["notices"],"summary":"Close a dismissible notice for the caller, while its id lasts","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":200},"required":true,"name":"noticeId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"orgId","in":"query"}],"responses":{"200":{"description":"Dismissed; a repeat returns the first dismissal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NoticeDismissal"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token acts for no person, so there is nobody to close it for (code person_required)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not one of the caller's orgs, or no notice with this id now (code notice_not_found)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The notice is critical and stays until its cause is fixed (code notice_not_dismissible)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"SITE_URL is not set, so actions cannot link to the console (code not_configured)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/scopes":{"get":{"x-audience":"public","tags":["admin"],"summary":"The token scope catalogue","description":"The scope vocabulary grouped for a consent decision: one row per resource, each with ordered access levels naming the exact scopes they grant. Served so the console, the CLI and MCP read the same rows as the enforcement vocabulary, rather than each keeping a copy that can drift from it. Static content — it describes what CAN be granted, not what the caller may grant; pair it with the `grantableScopes` on the caller's session for that.","responses":{"200":{"description":"The catalogue.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScopeCatalog"}}}}}}},"/invites":{"post":{"x-audience":"public","tags":["invites"],"summary":"Invite a teammate by email into the caller's org (owner/admin; owner role owner-only)","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInviteRequest"}}}},"responses":{"200":{"description":"Invite created + emailed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invite"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Role insufficient","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Invite email failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"x-audience":"public","tags":["invites"],"summary":"List invites for the caller's org (owner/admin)","responses":{"200":{"description":"Invites","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListInvitesResponse"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Role insufficient","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/invites/{inviteId}":{"delete":{"x-audience":"public","tags":["invites"],"summary":"Revoke a pending invite in the caller's org (owner/admin)","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"inviteId","in":"path"}],"responses":{"200":{"description":"Revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeInviteResponse"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Role insufficient","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/projects":{"get":{"x-audience":"public","tags":["projects"],"summary":"List projects","description":"Lists the organization's projects, oldest first. When more projects exist, the response gives a `nextCursor`. Send it back as `cursor` to get the next page.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string"},"required":false,"name":"byTrackerConnectorId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"byTrackerTeamId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"byTrackerProjectId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"byScmConnectorId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"byScmOwner","in":"query"},{"schema":{"type":"string"},"required":false,"name":"byScmRepo","in":"query"}],"responses":{"200":{"description":"Page","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Project"}},"nextCursor":{"type":["string","null"]}},"required":["data","nextCursor"]}}}},"400":{"description":"A cursor this API did not issue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"x-audience":"public","tags":["projects"],"summary":"Create a project (with duplicate guard on tracker_team)","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProjectRequest"}}}},"responses":{"200":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"400":{"description":"Invalid or taken issue code, or no connected GitHub account can reach the repository (code repo_unreachable)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Free project limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Role insufficient","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Org not visible","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Duplicate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DuplicateProjectError"}}}},"502":{"description":"GitHub did not answer the repository access check (code github_unavailable, retryable)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/projects/{projectId}":{"get":{"x-audience":"public","tags":["projects"],"summary":"Fetch a project by id","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"projectId","in":"path"}],"responses":{"200":{"description":"Project","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"404":{"description":"Not found (or cross-tenant)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"x-audience":"public","tags":["projects"],"summary":"Update a project's name/status, or reconnect its GitHub repo / Linear team","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"projectId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProjectRequest"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"400":{"description":"Invalid or taken issue code, or no connected GitHub account can reach the re-picked repository (code repo_unreachable)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Role insufficient","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Team in use","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DuplicateProjectError"}}}},"502":{"description":"GitHub did not answer the repository access check (code github_unavailable, retryable)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"x-audience":"public","tags":["projects"],"summary":"Delete a project","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"projectId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteProjectResponse"}}}},"403":{"description":"Role insufficient","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/billing/offers":{"get":{"x-audience":"public","tags":["billing"],"summary":"The credit pack catalog, tax-inclusive USD; readable without signing in","responses":{"200":{"description":"Offer catalog","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListOffersResponse"}}}}}}},"/billing":{"get":{"x-audience":"public","tags":["billing"],"summary":"The selected org's balance, sources, limits and usage","parameters":[{"schema":{"type":"string","minLength":1},"required":false,"name":"orgId","in":"query"}],"responses":{"200":{"description":"Current billing entitlement","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingSummary"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not one of the caller's orgs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/billing/ledger":{"get":{"x-audience":"public","tags":["billing"],"summary":"Credits per mission, grants, adjustments and expiries, newest first","parameters":[{"schema":{"type":"string","minLength":1},"required":false,"name":"orgId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Ledger page","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListLedgerResponse"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Caller lacks billing:manage (code billing_manage_required)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not one of the caller's orgs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/billing/credit-requests":{"post":{"x-audience":"public","tags":["billing"],"summary":"Ask for more credits","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCreditRequest"}}}},"responses":{"201":{"description":"Request recorded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditRequestResponse"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not one of the caller's orgs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/billing/settings":{"patch":{"x-audience":"public","tags":["billing"],"summary":"Change who may start work from the tracker","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBillingSettingsRequest"}}}},"responses":{"200":{"description":"Updated summary","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingSummary"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Caller lacks billing:manage (code billing_manage_required)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not one of the caller's orgs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/billing/checkout-sessions":{"post":{"x-audience":"public","tags":["billing"],"summary":"Buy a credit pack, start a monthly plan (Starter or Scale), or add credits to a plan at its rate (opens at public launch)","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":128},"required":false,"name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCheckoutSessionRequest"}}}},"responses":{"200":{"description":"Hosted checkout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSessionResponse"}}}},"400":{"description":"The start-now request is missing or out of date (code consent_required), the plan to buy is missing or unknown (code team_plan_required), or the credits are out of range or a pack or plan quantity is not 1 (code quantity_out_of_range)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not a billing manager (billing_manage_required) or an Enterprise org (plan_not_purchasable)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Buying credits is not available yet (code not_available), or not one of the caller's orgs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The offer is not for this org's plan (code offer_not_for_plan), a plan checkout is already open (code checkout_in_progress), or no plan month is running yet for added credits (code team_month_required)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The payment page could not be opened (code checkout_failed); nothing was charged","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Checkout is not set up in this environment (code checkout_not_configured)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/billing/checkout-sessions/{checkoutId}":{"get":{"x-audience":"public","tags":["billing"],"summary":"A checkout's order status; credits come from the payment event, never the redirect","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"checkoutId","in":"path"}],"responses":{"200":{"description":"Order status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSessionStatus"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such checkout for the caller","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/billing/orders":{"get":{"x-audience":"public","tags":["billing"],"summary":"The org's pack purchases, with what is used, reversed and withdrawable","parameters":[{"schema":{"type":"string","minLength":1},"required":false,"name":"orgId","in":"query"}],"responses":{"200":{"description":"Orders","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListOrdersResponse"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not one of the caller's orgs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/billing/subscription":{"patch":{"x-audience":"public","tags":["billing"],"summary":"Change the monthly plan subscription: switch between Starter and Scale from the next renewal, or cancel or resume at the month's end","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSubscriptionRequest"}}}},"responses":{"200":{"description":"The subscription","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionResponse"}}}},"400":{"description":"Nothing to change (code nothing_to_change), or an unknown plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not a billing manager (code billing_manage_required)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not one of the caller's orgs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The org has no monthly plan (code team_subscription_required)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The change could not be made (code subscription_change_failed); nothing changed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Checkout is not set up in this environment (code checkout_not_configured)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/billing/orders/{orderId}/withdrawal":{"post":{"x-audience":"public","tags":["billing"],"summary":"Withdraw from a pack purchase within 14 days; the purchaser only, no reason needed","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"orderId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWithdrawalRequest"}}}},"responses":{"202":{"description":"Withdrawal submitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WithdrawalResponse"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not the purchaser (code withdrawal_unavailable)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such order","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The right has lapsed or was used (code withdrawal_unavailable)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/capacity":{"get":{"x-audience":"public","tags":["sandboxes"],"summary":"How many agents the org is running at once against its limit, and which missions wait","description":"Each agent runs in its own sandbox, so this counts running agents. Read from the platform's capacity, which is checked every minute. `limit` is how many agents the org runs at once, by its plan or its own agreement; `platformSaturated` means every agent slot on the platform is taken, so even an org under its limit waits.","parameters":[{"schema":{"type":"string","minLength":1},"required":false,"name":"orgId","in":"query"}],"responses":{"200":{"description":"Capacity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SandboxCapacityResponse"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such org for the caller","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Capacity not read recently","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes":{"get":{"x-audience":"public","tags":["sandboxes"],"summary":"List sandboxes for the caller's accessible projects","description":"Each sandbox is one agent run, newest first. Filter by project, status, mission (`issueId`) or agent role. The filters apply before `limit`, so a page holds up to `limit` matching runs. When more runs match, `nextCursor` is set: send it back as `cursor`, with the same filters, for the next page.","parameters":[{"schema":{"type":"string"},"required":false,"name":"projectId","in":"query"},{"schema":{"$ref":"#/components/schemas/SandboxStatus"},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Only the runs of this mission, by its issue id (for example ENG-42)."},"required":false,"name":"issueId","in":"query"},{"schema":{"type":"string","enum":["planner","builder","reviewer","qa"],"description":"Only the runs of this agent role."},"required":false,"name":"role","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":500,"default":200},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","minLength":1,"description":"`nextCursor` from the previous page, with the same filters. Leave it out for the newest runs."},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"Sandboxes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListSandboxesResponse"}}}},"400":{"description":"A cursor this API did not issue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{sandboxId}":{"get":{"x-audience":"public","tags":["sandboxes"],"summary":"Sandbox detail: registry row + metric series + session logs","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"sandboxId","in":"path"}],"responses":{"200":{"description":"Detail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SandboxDetailResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{sandboxId}/logs":{"get":{"x-audience":"public","tags":["sandboxes"],"summary":"Fetch a session's log content: agent stream-json (session), container stdout (system), or prompt","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"sandboxId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"role","in":"query"},{"schema":{"type":"string"},"required":true,"name":"sessionId","in":"query"},{"schema":{"allOf":[{"$ref":"#/components/schemas/SandboxLogPart"},{"default":"session"}]},"required":false,"name":"part","in":"query"}],"responses":{"200":{"description":"Log content","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SandboxLogsResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Log storage not bound","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{sandboxId}/stop":{"post":{"x-audience":"public","tags":["sandboxes"],"summary":"Stop the agent in a sandbox","description":"Ends the run before it finishes. Its work in progress is lost, and its status becomes `stopped`. The platform stops the sandbox a few seconds after this call, so read the sandbox again to see the new status. Only an org admin can stop a sandbox.","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"sandboxId","in":"path"}],"responses":{"200":{"description":"Stop requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StopSandboxResponse"}}}},"403":{"description":"Role insufficient","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{sandboxId}/events":{"get":{"x-audience":"public","tags":["sandboxes"],"summary":"Follow the live events of one agent run","description":"Server-sent events. The stream starts with `state`, then sends the recent events of the agent and each new event as the agent emits it. It ends with `end` when the run ends, when the mission of the run moves to another stage, or after `maxSeconds`. A comment line comes at least every 15 seconds while the stream is quiet. To continue after an end, open the stream again with the last `id` as `since`. A reconnect with a `Last-Event-ID` header to a run that ended gets 204, which tells an EventSource to stop.","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"sandboxId","in":"path"},{"schema":{"type":["integer","null"],"minimum":0,"description":"The `id` of the last event that you have. The stream sends the events after it, at most the newest 800. Ids count up by one, so a jump shows that older events were left out. Without a cursor, the stream starts with the last 20 events of the run. A `Last-Event-ID` header has the same effect."},"required":false,"name":"since","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":600,"default":300,"description":"The longest time that the stream stays open, in seconds (default 300, at most 600). At that time the stream sends `end` with the reason `time_cap`."},"required":false,"name":"maxSeconds","in":"query"}],"responses":{"200":{"description":"The event stream. Each frame matches `SandboxEvent`.","content":{"text/event-stream":{"schema":{"$ref":"#/components/schemas/SandboxEvent"}}}},"204":{"description":"A reconnect with `Last-Event-ID` to a run that ended: nothing more comes."},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/environments":{"get":{"x-audience":"public","tags":["environments"],"summary":"List preview environments for the caller's accessible projects","parameters":[{"schema":{"type":"string"},"required":false,"name":"issueId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"projectId","in":"query"},{"schema":{"$ref":"#/components/schemas/PreviewEnvironmentStatus"},"required":false,"name":"status","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":500,"default":200},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Environments","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListEnvironmentsResponse"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/environments/{environmentId}":{"get":{"x-audience":"public","tags":["environments"],"summary":"Environment detail","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"environmentId","in":"path"}],"responses":{"200":{"description":"Detail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnvironmentDetailResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"x-audience":"public","tags":["environments"],"summary":"Request teardown of a preview environment","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"environmentId","in":"path"}],"responses":{"200":{"description":"Teardown requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DestroyEnvironmentResponse"}}}},"403":{"description":"Role insufficient","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/missions":{"get":{"x-audience":"public","tags":["missions"],"summary":"List ticket+PR sessions for the caller's accessible projects","parameters":[{"schema":{"type":"string"},"required":false,"name":"projectId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"search","in":"query"},{"schema":{"$ref":"#/components/schemas/MissionStage"},"required":false,"name":"status","in":"query"},{"schema":{"$ref":"#/components/schemas/MissionActivity"},"required":false,"name":"activity","in":"query"},{"schema":{"$ref":"#/components/schemas/PipelineProgress"},"required":false,"name":"pipelineProgress","in":"query"},{"schema":{"$ref":"#/components/schemas/CheckState"},"required":false,"name":"checkState","in":"query"},{"schema":{"$ref":"#/components/schemas/ReviewState"},"required":false,"name":"reviewState","in":"query"},{"schema":{"type":["boolean","null"]},"required":false,"name":"awaitingAcceptance","in":"query"},{"schema":{"type":["boolean","null"]},"required":false,"name":"excludeClosed","in":"query"},{"schema":{"type":["boolean","null"]},"required":false,"name":"archived","in":"query"},{"schema":{"allOf":[{"$ref":"#/components/schemas/MissionDisposition"},{"type":"string"}]},"required":false,"name":"disposition","in":"query"},{"schema":{"type":["boolean","null"]},"required":false,"name":"excludeProbes","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false,"name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"default":0},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"Sessions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListMissionsResponse"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"x-audience":"public","tags":["missions"],"summary":"Create a mission: mints the tracker issue and starts the run in one call","description":"For a caller delegating work that has no tracker issue yet (typically a locally-authored spec handed over from a terminal). Creates a real issue in the project's tracker under your own connector (a Linear issue, or a GitHub issue on the project's repository for a GitHub-Issues project; a project with no tracker gets a platform-minted id), writes the hand-off against it, and starts the run last: by then the hand-off is already stored, so a mission never starts against a half-written entry. Use POST /missions/{issueId}/start instead when the issue already exists.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":128,"description":"Retrying a request with the same key charges it once and starts (or delivers) it once. Use a new key for new work.","example":"7f9c2ba4-e88f-11ee-9a1a-0242ac120002"},"required":false,"name":"idempotency-key","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMissionRequest"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMissionResponse"}}}},"400":{"description":"A GitHub-Issues project has no issue code to mint the mission's id with","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The org has no credits for this (code credits_exhausted)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Project not accessible","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"entry.startAt=reviewer|qa requires entry.prNumber","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"The org reached its daily mission limit (code daily_limit_reached)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The tracker call (Linear or GitHub) failed (code tracker_unavailable, retryable), or the issue was created but not assigned to the agent (code tracker_assign_failed, names the issue)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Project has no tracker team — finish onboarding; or Linear no longer accepts the project's authorization, or GitHub refused the App installation's token (code tracker_reconnect_required)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/missions/{issueId}":{"get":{"x-audience":"public","tags":["missions"],"summary":"Session detail: summary + role-based runs + stage swimlane","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"issueId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"orgSlug","in":"query"},{"schema":{"type":"string"},"required":false,"name":"projectId","in":"query"}],"responses":{"200":{"description":"Detail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MissionDetailResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"x-audience":"public","tags":["missions"],"summary":"Set (or clear) the human-asserted mission disposition (admin+): why the mission ended","description":"Records WHY a mission ended: 'product' (real work, resolved on its merits), 'probe' (a deliberate throwaway exploration), 'superseded' (obsoleted by another mission, in which case pass supersededBy), or 'takeover' (a human finished the work outside the pipeline). Human-asserted only: never written by inference, and heuristics may only propose a value for a human to confirm here.","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"issueId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetMissionDispositionRequest"}}}},"responses":{"200":{"description":"Disposition set","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetMissionDispositionResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"supersededBy requires disposition=superseded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/missions/{issueId}/provenance":{"get":{"x-audience":"public","tags":["missions"],"summary":"Raw per-attempt provenance records (harness/model/provider, token tiers, cost, duration)","description":"Every attempt's attribution row for the mission, in the order they were recorded: the harness, model, provider, token usage, cost and duration behind each stage attempt. This is the readout for comparing one configuration against another. Records are retained for about 30 days after the attempt, so a consumer that needs them for longer should snapshot them.","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"issueId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"orgSlug","in":"query"},{"schema":{"type":"string"},"required":false,"name":"projectId","in":"query"}],"responses":{"200":{"description":"Provenance records","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MissionProvenanceResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/missions/{issueId}/inspect":{"get":{"x-audience":"public","tags":["missions"],"summary":"Typed mission-inspection report: everything recorded about one mission, as one contract","description":"The full forensic report for a mission, available to agents and the CLI as well as the console: assembled prompts, provenance, dispatch errors and session logs. Requires the inspect:read scope. A section that could not be read reports ok:false with the error rather than being omitted, and a value that is simply absent reports ok:true with null data.","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"issueId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"orgSlug","in":"query"},{"schema":{"type":"string"},"required":false,"name":"projectId","in":"query"},{"schema":{"type":"string","description":"Comma-separated section filter; default all."},"required":false,"name":"sections","in":"query"}],"responses":{"200":{"description":"Report","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MissionInspectReport"}}}},"400":{"description":"Unknown section","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/missions/{issueId}/pause":{"post":{"x-audience":"public","tags":["missions"],"summary":"Pause (soft-hold) the development pipeline - enqueues to the orchestrator","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"issueId","in":"path"}],"responses":{"200":{"description":"Pause requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PauseMissionResponse"}}}},"403":{"description":"Insufficient role or scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/missions/{issueId}/resume":{"post":{"x-audience":"public","tags":["missions"],"summary":"Resume a paused development pipeline - enqueues to the orchestrator","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"issueId","in":"path"}],"responses":{"200":{"description":"Resume requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResumeMissionResponse"}}}},"403":{"description":"Insufficient role or scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/missions/{issueId}/instructions":{"post":{"x-audience":"public","tags":["missions"],"summary":"Send a follow-up instruction to a mission","description":"The API equivalent of commenting on the tracker issue, for callers with no tracker identity to post under. An instruction sent this way reaches the agents exactly as a comment would, and carries the same priority over the automated guards that would otherwise hold a stuck mission. A `follow_up` additionally puts the builder back on the mission's open pull request, overriding the review and QA verdicts already recorded: without that, re-triggering a mission whose pull request is already approved correctly concludes there is nothing to do. Returns a receipt naming what was recorded and what it will cause, so a caller never has to guess whether delivery succeeded.","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"issueId","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":128,"description":"Retrying a request with the same key charges it once and starts (or delivers) it once. Use a new key for new work.","example":"7f9c2ba4-e88f-11ee-9a1a-0242ac120002"},"required":false,"name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMissionInstructionRequest"}}}},"responses":{"200":{"description":"Instruction recorded. `dispatch` says what it will cause.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MissionInstructionReceipt"}}}},"402":{"description":"The org has no credits for this (code credits_exhausted)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient role or scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The mission is at its credit limit (code mission_ceiling_reached); approve continuing first","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"The org reached its daily mission limit (code daily_limit_reached)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/missions/{issueId}/start":{"post":{"x-audience":"public","tags":["missions"],"summary":"Start a mission: the entry point for handing an existing plan or build off to the AI agent team","description":"Hand a mission off to the AI agent team. Omit startAt for the default full run (planner first); pass startAt=builder with a plan to skip straight to coding; pass startAt=reviewer or startAt=qa with an existing prNumber to hand off an existing build. Starts the mission by exactly the same route every other trigger uses, so the entry record you pass here is what decides where the run begins.","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"issueId","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":128,"description":"Retrying a request with the same key charges it once and starts (or delivers) it once. Use a new key for new work.","example":"7f9c2ba4-e88f-11ee-9a1a-0242ac120002"},"required":false,"name":"idempotency-key","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartMissionRequest"}}}},"responses":{"200":{"description":"Started","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartMissionResponse"}}}},"402":{"description":"The org has no credits for this (code credits_exhausted)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Project not accessible","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"startAt=reviewer|qa requires prNumber","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"The org reached its daily mission limit (code daily_limit_reached)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/missions/{issueId}/stop":{"post":{"x-audience":"public","tags":["missions"],"summary":"Stop (hard stop) the development pipeline - enqueues to the orchestrator","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"issueId","in":"path"}],"responses":{"200":{"description":"Stop requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StopMissionResponse"}}}},"403":{"description":"Insufficient role or scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/missions/{issueId}/archive":{"post":{"x-audience":"public","tags":["missions"],"summary":"Archive a terminal session (admin+) - hidden from the default list","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"issueId","in":"path"}],"responses":{"200":{"description":"Archived","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArchiveMissionResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/missions/{issueId}/unarchive":{"post":{"x-audience":"public","tags":["missions"],"summary":"Unarchive a session (admin+) - restores it to the default list","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"issueId","in":"path"}],"responses":{"200":{"description":"Unarchived","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnarchiveMissionResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/missions/{issueId}/merge":{"post":{"x-audience":"public","tags":["missions"],"summary":"Approve & merge the session's open PR on GitHub (repo's own merge method)","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"issueId","in":"path"}],"responses":{"200":{"description":"Merged","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MergeMissionResponse"}}}},"202":{"description":"PR branch is behind its base — updating it; SHIP merges once CI passes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MergeMissionResponse"}}}},"403":{"description":"Insufficient role or scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Not mergeable / merge conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"GitHub error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/missions/{issueId}/decline":{"post":{"x-audience":"public","tags":["missions"],"summary":"Decline & close the session's open PR on GitHub without merging","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"issueId","in":"path"}],"responses":{"200":{"description":"Closed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeclineMissionResponse"}}}},"403":{"description":"Insufficient role or scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"GitHub error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/missions/{issueId}/auto-merge":{"post":{"x-audience":"public","tags":["missions"],"summary":"Set (or clear) a mission-level auto-merge override — takes precedence over the project default","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"issueId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetAutoMergeRequest"}}}},"responses":{"200":{"description":"Auto-merge override set","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetAutoMergeResponse"}}}},"403":{"description":"Insufficient role or scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/missions/{issueId}/agents-override":{"put":{"x-audience":"public","tags":["missions"],"summary":"Set a per-issue agents/baseBranch override — merged per-role, per-field onto the repo's ship.yml at resolution time (override field, then ship.yml field, then platform defaults); a role or field the override omits resolves from ship.yml","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"issueId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentsOverrideRequest"}}}},"responses":{"200":{"description":"Override stored","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentsOverrideResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Project not accessible","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"x-audience":"public","tags":["missions"],"summary":"Read the per-issue agents/baseBranch override, or null when none is set","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"issueId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"projectId","in":"query"}],"responses":{"200":{"description":"Override record (or null)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetAgentsOverrideResponse"}}}},"404":{"description":"Project not accessible","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"x-audience":"public","tags":["missions"],"summary":"Clear the per-issue agents/baseBranch override — the mission resolves from ship.yml again","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"issueId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"projectId","in":"query"}],"responses":{"200":{"description":"Override cleared","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClearAgentsOverrideResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Project not accessible","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/missions/{issueId}/ceiling-approvals":{"post":{"x-audience":"public","tags":["missions","billing"],"summary":"Let a mission paused at its credit ceiling continue","description":"Raises the mission's credit limit by one step (the organization's limit setting, or its plan's default) while the mission is paused at it, then resumes it: the charge that reached the limit is paid and the interrupted stage runs again. Requires the pipeline:control capability. Approving again while the raise is still landing returns the same limit.","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"issueId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CeilingApprovalRequest"}}}},"responses":{"202":{"description":"Ceiling raised","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CeilingApprovalResponse"}}}},"403":{"description":"Missing pipeline:control","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such project in scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The mission is not paused at its ceiling (code not_at_ceiling)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/artifacts":{"get":{"x-audience":"public","tags":["artifacts"],"summary":"List proof-of-work artifacts for the caller's accessible projects","parameters":[{"schema":{"type":"string"},"required":false,"name":"issueId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"projectId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"sandboxId","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":2000,"default":500},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Artifacts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListArtifactsResponse"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/artifacts/{id}":{"get":{"x-audience":"public","tags":["artifacts"],"summary":"Fetch a single artifact's metadata + signed serving url","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Artifact","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArtifactSummary"}}}},"404":{"description":"Not found (also for cross-tenant)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/agents/catalog":{"get":{"x-audience":"public","tags":["agents"],"summary":"Read-only catalog: roles, harnesses + models, built-in agents, default sandbox template","responses":{"200":{"description":"Catalog","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentCatalog"}}}}}}},"/agents":{"get":{"x-audience":"public","tags":["agents"],"summary":"List the caller's org agents","responses":{"200":{"description":"Agents","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListAgentsResponse"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"x-audience":"public","tags":["agents"],"summary":"Create an agent config","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAgentRequest"}}}},"responses":{"200":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Agent"}}}},"400":{"description":"Invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Role insufficient","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No org for caller","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"An inline sandbox's name is taken","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"An inline sandbox can't be used","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Sandbox builds unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/agents/{agentId}":{"get":{"x-audience":"public","tags":["agents"],"summary":"Fetch an agent by id","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"agentId","in":"path"}],"responses":{"200":{"description":"Agent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Agent"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"x-audience":"public","tags":["agents"],"summary":"Update an agent config","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"agentId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAgentRequest"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Agent"}}}},"400":{"description":"Invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Role insufficient","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"x-audience":"public","tags":["agents"],"summary":"Delete an agent config","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"agentId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAgentResponse"}}}},"403":{"description":"Role insufficient","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/scheduled-tasks":{"get":{"x-audience":"public","tags":["scheduled-tasks"],"summary":"List scheduled tasks across the caller's projects","description":"Newest first. Give `projectId` to list the scheduled tasks of one project. A token for one project lists only the tasks of that project.","parameters":[{"schema":{"type":"string","minLength":1,"description":"Only the scheduled tasks of this project. A project that the caller cannot reach gives an empty list."},"required":false,"name":"projectId","in":"query"}],"responses":{"200":{"description":"Scheduled tasks","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListScheduledTasksResponse"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"x-audience":"public","tags":["scheduled-tasks"],"summary":"Create a scheduled task","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateScheduledTaskRequest"}}}},"responses":{"200":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Scheduled task"}}}},"400":{"description":"Invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Role insufficient","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Project not accessible","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/scheduled-tasks/templates":{"get":{"x-audience":"public","tags":["scheduled-tasks"],"summary":"Read-only gallery of curated scheduled task templates","responses":{"200":{"description":"Templates","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListScheduledTaskTemplatesResponse"}}}}}}},"/scheduled-tasks/{scheduledTaskId}":{"get":{"x-audience":"public","tags":["scheduled-tasks"],"summary":"Fetch a scheduled task by id","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"scheduledTaskId","in":"path"}],"responses":{"200":{"description":"Scheduled task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Scheduled task"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"x-audience":"public","tags":["scheduled-tasks"],"summary":"Update a scheduled task","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"scheduledTaskId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateScheduledTaskRequest"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Scheduled task"}}}},"400":{"description":"Invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Role insufficient","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"x-audience":"public","tags":["scheduled-tasks"],"summary":"Delete a scheduled task and its run history","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"scheduledTaskId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteScheduledTaskResponse"}}}},"403":{"description":"Role insufficient","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/scheduled-tasks/{scheduledTaskId}/runs":{"get":{"x-audience":"public","tags":["scheduled-tasks"],"summary":"Run history for a scheduled task, with each run's mission state","description":"Newest first. When older runs exist, `nextCursor` is set: send it back as `cursor` for the next page.","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"scheduledTaskId","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50,"description":"Runs on one page, 1 to 200 (default 50)."},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","minLength":1,"description":"`nextCursor` from the previous page. Leave it out for the newest runs."},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"Runs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListScheduledTaskRunsResponse"}}}},"400":{"description":"A cursor this API did not issue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/scheduled-tasks/{scheduledTaskId}/run":{"post":{"x-audience":"public","tags":["scheduled-tasks"],"summary":"Run a scheduled task now, bypassing its schedule and skip guard","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"scheduledTaskId","in":"path"}],"responses":{"200":{"description":"Dispatched","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunScheduledTaskResponse"}}}},"403":{"description":"Role or scope insufficient","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Slot already claimed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/orchestrator":{"get":{"x-audience":"public","tags":["orchestrator"],"summary":"Read the org's orchestrator config (model + assigned key; org resolved server-side)","responses":{"200":{"description":"Config","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrchestratorConfig"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"x-audience":"public","tags":["orchestrator"],"summary":"Update the orchestrator's model and/or assigned Vault key","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOrchestratorConfigRequest"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrchestratorConfig"}}}},"400":{"description":"Invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Role insufficient","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found / no org","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandbox-templates":{"get":{"x-audience":"public","tags":["sandbox-templates"],"summary":"List the caller's org sandboxes","responses":{"200":{"description":"Sandboxes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListSandboxTemplatesResponse"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"x-audience":"public","tags":["sandbox-templates"],"summary":"Create a sandbox (steps on the platform base) and start its first build","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSandboxTemplateRequest"}}}},"responses":{"200":{"description":"Created, first build queued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveSandboxTemplateResponse"}}}},"403":{"description":"Role insufficient","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No org for caller","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Another sandbox in the organization has this name","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The definition or size can't be used","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Builds unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandbox-templates/starters":{"get":{"x-audience":"public","tags":["sandbox-templates"],"summary":"Ready-made sandbox definitions to start from","responses":{"200":{"description":"Starters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListSandboxStartersResponse"}}}}}}},"/sandbox-templates/{templateId}":{"get":{"x-audience":"public","tags":["sandbox-templates"],"summary":"Fetch a sandbox by id","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"templateId","in":"path"}],"responses":{"200":{"description":"Sandbox","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SandboxTemplate"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"x-audience":"public","tags":["sandbox-templates"],"summary":"Rename a sandbox, or change its definition or size (a new version, built at once)","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"templateId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSandboxTemplateRequest"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveSandboxTemplateResponse"}}}},"403":{"description":"Role insufficient","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Defined by a repository, or another sandbox has this name","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The definition or size can't be used","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Builds unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"x-audience":"public","tags":["sandbox-templates"],"summary":"Delete a sandbox","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"templateId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteSandboxTemplateResponse"}}}},"403":{"description":"Role insufficient","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"In use by an agent or a project default","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandbox-templates/{templateId}/builds":{"post":{"x-audience":"public","tags":["sandbox-templates"],"summary":"Build a sandbox's active version (or return the build already running)","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"templateId","in":"path"}],"responses":{"202":{"description":"Build queued, or the one already running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SandboxTemplateBuild"}}}},"403":{"description":"Role insufficient","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Builds unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"x-audience":"public","tags":["sandbox-templates"],"summary":"Recent builds of a sandbox, newest first","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"templateId","in":"path"}],"responses":{"200":{"description":"Builds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListSandboxTemplateBuildsResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandbox-templates/{templateId}/builds/latest":{"get":{"x-audience":"public","tags":["sandbox-templates"],"summary":"The latest build of a sandbox's active version","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"templateId","in":"path"}],"responses":{"200":{"description":"Latest build","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SandboxTemplateBuild"}}}},"404":{"description":"Not found or never built","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandbox-templates/{templateId}/builds/{buildId}":{"get":{"x-audience":"public","tags":["sandbox-templates"],"summary":"One build of a sandbox","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"templateId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"buildId","in":"path"}],"responses":{"200":{"description":"Build","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SandboxTemplateBuild"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandbox-templates/{templateId}/builds/{buildId}/logs":{"get":{"x-audience":"public","tags":["sandbox-templates"],"summary":"A build's log after a sequence number; poll with `after = nextAfter` until `done`","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"templateId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"buildId","in":"path"},{"schema":{"type":["integer","null"],"minimum":0,"default":0,"description":"Return chunks after this sequence number."},"required":false,"name":"after","in":"query"}],"responses":{"200":{"description":"Log chunks","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SandboxTemplateBuildLogsResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandbox-templates/{templateId}/versions":{"get":{"x-audience":"public","tags":["sandbox-templates"],"summary":"A sandbox's versions, newest first","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"templateId","in":"path"}],"responses":{"200":{"description":"Versions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListSandboxTemplateVersionsResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandbox-templates/{templateId}/versions/{versionId}/activate":{"post":{"x-audience":"public","tags":["sandbox-templates"],"summary":"Make a version the one missions use (rollback); rebuilds it only if its snapshot is gone","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"templateId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"versionId","in":"path"}],"responses":{"200":{"description":"Activated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveSandboxTemplateResponse"}}}},"403":{"description":"Role insufficient","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Defined by a repository","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Builds unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandbox-registries":{"get":{"x-audience":"public","tags":["sandbox-templates"],"summary":"List the org's private registries (never their secrets)","responses":{"200":{"description":"Registries","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListSandboxRegistriesResponse"}}}}}},"put":{"x-audience":"public","tags":["sandbox-templates"],"summary":"Store the credential for a registry host, replacing any stored for it","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PutSandboxRegistryRequest"}}}},"responses":{"200":{"description":"Stored","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SandboxRegistry"}}}},"403":{"description":"Role insufficient","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No org for caller","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Host or credential can't be used","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandbox-registries/{registryId}":{"delete":{"x-audience":"public","tags":["sandbox-templates"],"summary":"Delete a registry credential","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"registryId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteSandboxRegistryResponse"}}}},"403":{"description":"Role insufficient","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/mcp/projects/{projectId}":{"get":{"x-audience":"public","tags":["mcp"],"summary":"MCP servers the project's repository declares, with their bindings","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"projectId","in":"path"}],"responses":{"200":{"description":"Project MCP view","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpProjectView"}}}},"404":{"description":"Not found (also for other tenants)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"x-audience":"public","tags":["mcp"],"summary":"Set which repository file declares the project's MCP servers","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"projectId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMcpProjectRequest"}}}},"responses":{"200":{"description":"Updated view","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpProjectView"}}}},"400":{"description":"Invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Role insufficient","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also for other tenants)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The repository's ship.yml sets the path (mcp.config); change it there","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/mcp/projects/{projectId}/servers/{serverName}":{"put":{"x-audience":"public","tags":["mcp"],"summary":"Bind a declared MCP server: roles, approved tools and credential","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$"},"required":true,"name":"serverName","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertMcpBindingRequest"}}}},"responses":{"200":{"description":"Binding","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpBinding"}}}},"400":{"description":"Invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Role insufficient","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also for other tenants)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"x-audience":"public","tags":["mcp"],"summary":"Remove a binding and its credential","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$"},"required":true,"name":"serverName","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteMcpBindingResponse"}}}},"403":{"description":"Role insufficient","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also for other tenants)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/mcp/projects/{projectId}/servers/{serverName}/tools/refresh":{"post":{"x-audience":"public","tags":["mcp"],"summary":"Snapshot the server's current tool list for approval","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$"},"required":true,"name":"serverName","in":"path"}],"responses":{"200":{"description":"Binding with a fresh snapshot","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpBinding"}}}},"400":{"description":"Invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Role insufficient","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also for other tenants)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Binding not ready","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Gateway unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/mcp/bindings":{"get":{"x-audience":"public","tags":["mcp"],"summary":"List the MCP bindings in the caller's org, with their projects (no credentials)","responses":{"200":{"description":"Bindings","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListMcpBindingsResponse"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/mcp/projects/{projectId}/servers/{serverName}/oauth/start":{"post":{"x-audience":"public","tags":["mcp"],"summary":"Start OAuth consent for a bound remote MCP server","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$"},"required":true,"name":"serverName","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartMcpOAuthRequest"}}}},"responses":{"200":{"description":"Consent URL","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartMcpOAuthResponse"}}}},"400":{"description":"Invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Role insufficient","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The MCP server's OAuth step failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Not configured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/mcp/oauth/complete":{"post":{"x-audience":"public","tags":["mcp"],"summary":"Finish an MCP OAuth consent with the code the provider returned","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompleteMcpOAuthRequest"}}}},"responses":{"200":{"description":"Credential stored","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompleteMcpOAuthResponse"}}}},"400":{"description":"Invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Role insufficient","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The MCP server's OAuth step failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Not configured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/integrations":{"get":{"x-audience":"public","tags":["integrations"],"summary":"List the caller's tracker + scm integrations (org resolved server-side)","responses":{"200":{"description":"Integrations","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListIntegrationsResponse"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"SITE_URL is not set, so a connection to make or reconnect cannot link to the console (code not_configured)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/vault/catalog":{"get":{"x-audience":"public","tags":["vault"],"summary":"Read-only catalog: vendors the vault supports + their auth scheme","responses":{"200":{"description":"Catalog","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VaultCatalog"}}}}}}},"/vault/credentials":{"get":{"x-audience":"public","tags":["vault"],"summary":"List the caller's org credentials (no secrets; org resolved server-side)","responses":{"200":{"description":"Credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListVaultCredentialsResponse"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"x-audience":"public","tags":["vault"],"summary":"Add an API-key credential (encrypted at rest). OAuth vendors use the connect flow.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateVaultCredentialRequest"}}}},"responses":{"200":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VaultCredential"}}}},"400":{"description":"Invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Role insufficient","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No org for caller","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/vault/credentials/{credentialId}":{"patch":{"x-audience":"public","tags":["vault"],"summary":"Rotate the API key and/or rename a credential","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"credentialId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateVaultCredentialRequest"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VaultCredential"}}}},"400":{"description":"Invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Role insufficient","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/organizations/{orgId}/connectors":{"get":{"x-audience":"public","tags":["connectors"],"summary":"List org connectors (no secrets)","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"orgId","in":"path"},{"schema":{"$ref":"#/components/schemas/VendorKind"},"required":false,"name":"vendorKind","in":"query"}],"responses":{"200":{"description":"Connectors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListConnectorsResponse"}}}},"403":{"description":"Role insufficient","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Org not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"x-audience":"public","tags":["connectors"],"summary":"Create or upsert a connector with encrypted secret","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"orgId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateConnectorRequest"}}}},"responses":{"200":{"description":"Connector","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Connector"}}}},"403":{"description":"Role insufficient","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Org not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"External account already connected to another org","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"User authorization or the trial key is not set up here (code names which)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/connectors/{connectorId}":{"get":{"x-audience":"public","tags":["connectors"],"summary":"Fetch a connector (no secret)","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"connectorId","in":"path"}],"responses":{"200":{"description":"Connector","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Connector"}}}},"403":{"description":"Role insufficient","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"x-audience":"public","tags":["connectors"],"summary":"Update a connector (display name and/or re-encrypt secret)","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"connectorId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateConnectorRequest"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Connector"}}}},"403":{"description":"Role insufficient","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"x-audience":"public","tags":["connectors"],"summary":"Revoke (delete) a connector - moves a model key's projects to another model key","description":"Removes a connector. Each project that uses a model key moves to another model key of the organization, from the same provider when one exists. The API refuses the revoke with 409 when a project uses a tracker or repository connection, or uses the last model key of the organization. The error names those projects.","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"connectorId","in":"path"}],"responses":{"200":{"description":"Revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeConnectorResponse"}}}},"403":{"description":"Role insufficient","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"A project still uses the connector and nothing can take its place","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/connectors/{connectorId}/linear/teams":{"get":{"x-audience":"public","tags":["providers"],"summary":"List Linear teams visible to the connector","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"connectorId","in":"path"}],"responses":{"200":{"description":"Teams","content":{"application/json":{"schema":{"type":"object","properties":{"teams":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"}},"required":["id","key","name"]}},"error":{"type":["string","null"]}},"required":["teams","error"]}}}},"404":{"description":"Connector not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Linear OAuth client not configured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/connectors/{connectorId}/linear/teams/{teamId}/projects":{"get":{"x-audience":"public","tags":["providers"],"summary":"List Linear projects within a team","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"connectorId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"teamId","in":"path"}],"responses":{"200":{"description":"Projects","content":{"application/json":{"schema":{"type":"object","properties":{"projects":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}}},"required":["projects"]}}}},"404":{"description":"Connector not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Linear OAuth client not configured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/connectors/{connectorId}/github/repos":{"get":{"x-audience":"public","tags":["providers"],"summary":"List GitHub repos visible to the installation","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"connectorId","in":"path"}],"responses":{"200":{"description":"Repos","content":{"application/json":{"schema":{"type":"object","properties":{"repos":{"type":"array","items":{"type":"object","properties":{"full_name":{"type":"string"},"name":{"type":"string"},"owner":{"type":"object","properties":{"login":{"type":"string"}},"required":["login"]}},"required":["full_name","name","owner"]}}},"required":["repos"]}}}},"404":{"description":"Connector not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"webhooks":{}}