Skip to main content
A workspace is the top-level tenant in Crewship. Every crew, agent, credential, skill, and pipeline belongs to exactly one workspace, and a user joins a workspace with a role (OWNER, ADMIN, MANAGER, MEMBER, VIEWER). Reach for these endpoints whenever you need to read or change a workspace itself or anything scoped under it — its members and their capabilities, invitations, pipelines and their runs/versions/schedules/webhooks, and the workspace skills registry. The standalone workspace-metadata calls (list/create/get/update) sit at the top; everything else is nested under /api/v1/workspaces/{workspaceId}/....
Workspace-scoped endpoints are nested under /api/v1/workspaces/{workspaceId}/... and require:
  • A valid JWT session cookie or a CLI token (crewship_cli_…) in the Authorization header.
  • The authenticated user to be a member of the workspace (enforced by the wsCtx middleware, which also injects workspace_id and role into the request context).
Errors follow RFC 7807 Problem Details — responses include type, title, status, detail, and instance.

Endpoints


Workspace metadata

Read and manage the workspace record itself — list the ones you belong to, create new ones, and update name/slug/language.

List workspaces

Returns every workspace the authenticated user belongs to, ordered by created_at DESC. Soft-deleted workspaces (deleted_at IS NOT NULL) are excluded. Auth: Any authenticated user. Response: 200 OK

Create workspace

Provisions a new workspace and adds the calling user as OWNER in a single transaction. Auth: Any authenticated user. Request body:
Response: 201 Created — same shape as the List response item (without currentUserRole / counts).

Get workspace

Response: 200 OK — single workspace object (same fields as List) with currentUserRole populated from the JWT.

Update workspace

Partial update — only provided fields are changed. Setting preferred_language to an empty string clears it (NULL). Auth: OWNER or ADMIN (canRole "manage"). Request body: All fields optional.
0 behaves differently on run_retention_days than on the other three: run_retention_days rejects it, while credential_audit_retention_days, audit_log_retention_days and approvals_retention_days all accept it as an explicit “keep forever”. For those three, null means “use the product default” and 0 means never-delete — a distinction that matters because they share one command (workspace update), so 0 has to mean the same thing on all of them or an operator moving between flags gets a silent surprise. approvals_queue earns the same sentinel as the audit pair despite not being a compliance table: AfterDecide’s journal entry captures only approval_id/kind/comment, not reason or the full payload, so approvals_queue is the only place those survive at all, and an operator wanting to keep them indefinitely needs a real way to say so. See Migrations — 20260810170000 and Migrations — 20260901134904.
Response: 200 OK — updated workspace object.
The logo the workspace is drawn with in the workspace switcher, Admin lists and the Backups and Security scope; without one it shows its initial. The same rules as a profile picture: PNG, JPEG or WebP, at most 2MB and 4096 px a side. Setting or removing it is ADMIN+ and writes an audit entry (workspace.logo.update / workspace.logo.remove); both answer the workspace object, whose logo_url points at the GET route with a ?v= cache buster (or is null after a removal). The GET route needs a signed-in user but not membership, because instance administrators see every workspace. CLI: crewship workspace logo set <file> / crewship workspace logo remove.

Delete workspace

Soft-deletes the workspace and cascade-soft-deletes its crews and agents (deleted_at is set; membership join rows are removed). Deleted crews stop serving dispatches immediately; their runtime containers are reaped by the orchestrator’s idle-TTL lifecycle, the same path a single crew deletion relies on. On success the server broadcasts realtime events on the workspace channel — a crew.deleted per removed crew and a final workspace.deleted ({ id, slug }) — so connected clients redirect/refresh without a manual reload. Auth: OWNER only. The route sits behind canRole "manage" (ADMIN+) at the router, and the handler additionally requires the caller to be the workspace OWNER. Request body: Response: 200 OK — { "success": true }. Drive it from the CLI with crewship workspace delete.

Members

List the people in a workspace, add an existing user directly, provision a member by email, or remove one.

List members

Returns all members of the workspace ordered by created_at ASC, joined to users for display fields. Response: 200 OK

Add member

Adds an existing user to the workspace by user ID.
This takes a user_id and only a user_id. When all you have is an email address — whether or not it already has an account — use Create invitation: resolving an address to a user id here would hand every OWNER/ADMIN the account-existence oracle that signup no longer answers.
Auth: OWNER or ADMIN (canRole "manage"). Request body:
Response: 201 Created — the new member row.
Current releases allow unlimited members and do not return this license error. Resource licensing may change in future releases. If future enforcement caps the member count, adding a member that would exceed it returns 402 Payment Required with the limit detail in the JSON error body. The check runs before the request body is read, so a capped workspace rejects every add regardless of payload. The same limit applies to Create invitation.

Provision member

Creates an account when the email is new, adds it to the workspace, and returns a one-time setup URL. Existing users are not given a setup URL; they must already control their account. The URL expires after seven days. The instance URL must be configured or discoverable by the server. Auth: OWNER or ADMIN (canRole "manage"). Request body: email (required), role (optional; defaults to MEMBER; one of ADMIN, MANAGER, MEMBER, VIEWER), full_name (optional), create_only (optional boolean, defaults to false), access_mode (optional, trusted by default or restricted for Guest), and rights (optional array of {kind,id,operation} initial resource grants; empty by default). Restricted provisioning and initial grants commit together. Restricted ADMIN is invalid. A claimed account must accept a Guest invitation instead (409). An account that is OWNER or ADMIN in any workspace is refused (409), even if unclaimed. Trusted mode requires empty rights. Routine run rights also require the appropriate agent grants; project list and read are independent. Response: 201 Created
setup_url is an empty string for an existing account. A malformed email or role returns 400; a caller below ADMIN returns 403; an existing membership returns 409; and a missing public instance URL returns 503.

Remove member

Removes a workspace member. You cannot remove the workspace OWNER.
Auth: OWNER or ADMIN (canRole "manage"). Response: 200 OK
Removal is not just the membership row. Two other things happen, in this order:
  • Legacy Pages the member owns in this workspace are transferred to a crew first, per docs/specs/pages.md §7.1 rule 1b: the crew owning the most panels on the page, else a crew the departing member belongs to. If any page resolves to neither, the whole removal is refused with 409 and nothing changes — reassign those pages by hand and retry. Artifacts (projects, Designs, documents, Slides, workbooks and other human-owned content) are never handed to a crew: they need a person as successor, chosen through human-owned content custody, before the removal can succeed.
  • Every crew membership the user holds in this workspace is deleted, in the same transaction as the workspace_members row: both or neither. Crew membership grants on its own (crew-owned pages, crew credentials, and a per-crew role override folded into the effective role), so it cannot outlive the workspace membership it was predicated on.
Re-adding someone does not restore their crews. POST .../members creates a workspace membership and nothing else, so a returning member must be added back to each crew by hand, including any per-crew role override they held. This is deliberate: an override that survived a departure would silently re-elevate a user re-added at a lower role.
Crews in other workspaces are untouched — the purge is scoped through crews.workspace_id.

Change member role

Changes a member’s workspace role. Gated at MANAGER+ (canRole "create"), then subject to the role ladder enforced in the handler. Auth: MANAGER or above, plus the ladder:
  • You may only grant a role strictly below your own (roleRank[new] >= roleRank[caller] is rejected). An OWNER can therefore grant up to ADMIN, an ADMIN up to MANAGER, and so on. This means ownership is not transferable through this endpoint.
  • You may not modify a member ranked above your own.
  • The last OWNER cannot be demoted.
Request body: Response: 200 OK
Drive it from the CLI with crewship workspace member role.

Member capabilities

Capabilities are per-member string grants layered on top of a member’s RBAC role. They let a workspace admin hand an individual user a specific higher-tier action — “let this MEMBER create routines” — without promoting them to MANAGER. The role still sets the baseline; capabilities only ever widen it. The closed set of ten capabilities (allCapabilities in internal/api/capabilities.go): Presets are named bundles for the common combinations: A member with no explicit set falls back to a role-derived default (OWNER/ADMIN → the v109 admin set (no routine.run) plus credentials:reveal, MANAGER → chat + routine.create + issue.create + memory.write, others → chat). An explicit set is always authoritative, so revoking credentials:reveal from an ADMIN sticks. That fallback is not the preset of the same name. It reproduces what the v109 migration wrote into the capability column, so a row the migration filled and a row still NULL resolve identically — and that migration ran before routine.run existed, so the fallback does not include it while the power and admin presets do. Nothing rests on the difference: every role at MANAGER+ clears the run gate on role alone. The capability lists returned by these endpoints are always sorted alphabetically. All three endpoints require the caller to be ADMIN or OWNER.
Path-param note: on the per-member capability endpoints the {memberId} segment is the member’s user ID (it is matched against workspace_members.user_id), not the workspace_members.id row ID used by Remove member. The user_id field in the response echoes the value you passed in.

Get member capabilities

Returns the resolved capability set and role for a single member. Listing a member’s capabilities reveals the workspace’s permission topology, so the endpoint is admin-gated. Auth: ADMIN or OWNER. Response: 200 OK

Update member capabilities

Mutates a member’s capability set. The body must contain exactly one of four mutation shapes: Empty arrays are rejected (a 400, not treated as a no-op) — to reset a member to chat-only, send {"set": ["chat"]} explicitly. chat is always implied: it is silently kept on set, and revoking it is rejected.
Auth: ADMIN or OWNER. Guards:
  • A caller cannot mutate their own capability row (defence against a downgrade-then-restore stunt) — 403.
  • OWNER capability rows are immutable — any attempt returns 403.
  • The request body is capped at 16 KB — a larger body returns 413.
Response: 200 OK — the post-mutation state (same shape as Get):

List all member capabilities (bulk)

Returns the resolved capabilities for every member of the workspace in one round-trip — this drives Settings → Members without an N+1 fan-out across the per-member endpoint. The Members page fetches it once on load, because the list’s capability chips, the side panel’s per-capability counts and the matrix all read it. Rows are ordered by membership created_at ASC so the roster renders stably between page loads. Auth: ADMIN or OWNER. Response: 200 OK

Invitations

Invitations issue a token-gated link that the recipient redeems via the auth flow. They expire after 7 days.

List invitations

Returns unaccepted invitations with pending, expired or revoked status and no redemption proof, ordered by created_at DESC, joined to users for the inviter. Response: 200 OK

Create invitation

Auth: OWNER or ADMIN (canRole "manage"). Assigning the ADMIN role requires the caller to be OWNER. Request body: access_mode is optional: trusted (default) or restricted (Guest). rights is an optional array of {kind,id,operation} resource grants, empty by default. Supported kinds are agent, routine and project; a routine supports View/Run, agents support discover/chat/run/delegate, and projects list/read/contribute/manage/delete_issues/write/delete. Trusted invitations require empty rights; Guest invitations cannot grant ADMIN. The server revalidates resources and issuer authority during redemption and installs membership and grants atomically. Existing accounts must explicitly confirm the account-wide restriction. Accounts that own or administer any workspace cannot become Guests. A stale matching Guest invitation returns 409 with code: invitation_changed; no partial account/membership is committed. Response: 201 Created — invitation object with the freshly minted wi1_ plus 64 lowercase hex proof (returned only by creation or explicit reissue). New stored values are sha256:v1: plus the SHA256 hex digest of the entire proof. On upgrade, legacy unaccepted links stored as raw tokens are invalidated. An authorized inviter must create a new invitation for the same email or explicitly reissue the pending row; the newly returned link can then be accepted. Accepted historical invitations and new versioned hash proofs are preserved. Signup redeems only the presented matching proof; ordinary signup gets its own workspace. Existing accounts explicitly accept through /join or the authenticated acceptance endpoint. Admission rechecks the inviter’s live trusted OWNER/ADMIN authority (ADMIN invitations need OWNER), recipient identity, parsed expiry, workspace and pending state. Different existing membership roles conflict without consuming the invitation; no role is silently upgraded.

Reissue invitation

No request body. A current trusted OWNER/ADMIN rotates an unaccepted proof and returns 200 with a fresh invitation object/link. ADMIN invitations require OWNER. Expired invitations may be reissued; current membership conflicts return 409. Old proof is immediately invalid. Nothing is mailed.

Revoke invitation

Same issuer checks. Returns 200 {"ok":true} for a pending invitation, 404 when unavailable, or 409 if changed concurrently. Existing memberships are untouched.

Pipelines

Pipelines (also called routines in the UI) are versioned, workspace-scoped DSL programs that orchestrate agent runs, sub-pipeline calls, parallel forks, and approval waitpoints. See the Pipelines guide and the DSL reference for authoring details.

List pipelines

Returns workspace-visible, non-ephemeral pipelines. Each row is enriched with author_agent_name (best-effort lookup) and the most recent 3 issue identifiers bound via missions.routine_id so the UI can render an “ENG-5, ENG-9 +1” chip without a second fetch. Query parameters: Response: 200 OK
The definition field is omitted from the List response and only returned by Get pipeline. step_count is the number of steps in the stored definition (omitted when the definition no longer parses). head_version is the published version the routine currently runs. last_recorded_run_id, last_run_outcome, last_invoked_at and last_invocation_status (lowercase: completed, failed, waiting, …) come from the most recent pipeline_runs row on both List and Get, and are omitted while the routine has never run. status is the governance state (active, proposed or disabled); icon and color are the presentation choices and are omitted until one is chosen.

Get pipeline

Returns the same shape as List but with the full definition (raw DSL JSON) inlined.

Delete pipeline

Soft-deletes the pipeline (deleted_at set). Versions, run history, and bound schedules/webhooks are retained.
Auth: OWNER or ADMIN (canRole "delete"). Response: 204 No Content

List routine drafts

Auth: workspace MANAGER+. Response: 200 OK, an array of up to 100 {slug, revision, updated_at} entries, newest edit first. Draft documents are read separately. 403 means insufficient role; 500 means the draft list could not be read.

Read a routine draft

Auth: workspace MANAGER+. Response: 200 OK, a RoutineDraft envelope containing id, workspace_id, slug, revision, base_pipeline_id, base_revision, document, updated_by, created_at and updated_at. With no saved draft, revision zero describes the current published recipe and its base revision. With no published recipe either, the document is {} and the base ID is empty. Missing drafts are therefore not 404. 403 means insufficient role; 500 means the read failed.

Save a routine draft

Auth: workspace MANAGER+; the authenticated user supplies updated_by. Request body: the draft envelope returned by the read operation, with edits inside document. Preserve id, revision, base_pipeline_id and base_revision. The document contains the ordinary save fields, including slug, name, description and an object definition; its slug must match the envelope. Incomplete definitions can be saved. Temporary publication tokens and legacy validation/governance bypass fields are discarded. Response: 200 OK, the exact newly stored RoutineDraft with its incremented revision. An unpublished draft can move to a free slug without changing its ID; a draft editing a published recipe cannot. Saving does not publish or activate a trigger. 400 means malformed input; 403 means insufficient role; 409 means the revision/base changed or the target slug is occupied; 500 means the write failed. Keep the returned envelope for the next edit or publication.

Discard a routine draft

Auth: workspace MANAGER+. Request body: {"id":"draft-id","revision":2}. Both identify the exact saved draft; a discarded and recreated draft has a different ID. Response: 204 No Content. Only that draft revision is deleted. 400 means invalid JSON; 403 means insufficient role; 409 means the ID/revision no longer matches; 500 means deletion failed. The published recipe remains available.

Publish a routine draft

Auth: workspace MANAGER+; normal publication capability review still applies. Request body: {"id":"draft-id","revision":2,"save_token":"...","approve_risk":false}. First obtain save_token from POST /api/v1/workspaces/{workspaceId}/pipelines/test_run for the exact saved definition and author crew. approve_risk: true explicitly confirms capability changes when publication reports that review is needed. Response: 201 Created, the saved recipe (RoutinePublishResponse) with its version and optional trigger result. Publishing atomically verifies and consumes the exact draft, checks its published base, and saves the recipe and trigger. Enabled recurring schedules that follow the head must have compatible inputs; disabled and version-pinned schedules do not block publication. 400 means malformed input; 403 means insufficient role; 409 means stale revision/base, capability review required, or incompatible schedule inputs; 422 means an invalid definition, trigger or publication proof; 500 means storage failed. Conflicts preserve both the draft and published recipe. A schedule conflict includes schedule_conflict: {schedule_id, name, reason}; a capability-review conflict includes risk_reasons.

Save pipeline

Creates or updates a pipeline for the calling user. authored_via is always set to "user_api" and author_user_id is extracted from the JWT (callers cannot forge identity). Auth: MANAGER+ (canRole "create"). Request body: Response: 201 Created — full pipeline object including definition, plus trigger when the body requested one. A 409 from the schedule-preset gate carries the plan that blocks the save so a client can open it rather than parse prose:
error is always publication blocked by schedule <name>: <reason>. reason is Input <name> is required by the new recipe for a missing required input, input "<name>": <what is wrong> for a value of the wrong type or outside its choices, or Stored inputs are unreadable. Two kinds of enabled plan are judged: plans that target this routine and follow head (no version pin), against their inputs; and plans that use this routine as their wake probe, pinned or not, against their wake_inputs. Disabled plans, and pinned plans targeting the routine, never block a save. A re-save whose definition is byte-identical to the stored one is never judged either, so a rename or description edit cannot start failing over a preset that was already imperfect. The same envelope comes back from Import, Rollback and the sidecar’s save_routine door. The definition is left unchanged on 409.

Test an unpublished definition

Auth: authenticated workspace MANAGER+. Request body: definition (object, required), author_crew_id (optional string belonging to this workspace), and sample_inputs (optional object). The endpoint checks the definition and applicable resource gates, then produces a static execution plan. It does not execute agents, scripts or HTTP steps. Response: 200 OK, a RunResult. A successful DRY_RUN_OK result includes save_token when the server’s signing key is configured. Send that token to /publish or /save within five minutes, with the same definition bytes. The token is bound to this workspace, authenticated user and definition hash; a successful response without a token is insufficient for normal publication. 400 means malformed input, 403 includes foreign crew references, 422 means an invalid definition, and 503 means the runner is not wired. Resource gates can also refuse the test with their specific missing-resource response. The separate sidecar endpoint /api/v1/internal/pipelines/test_run authenticates with X-Internal-Token. For actual external work, use Run.

Dry-run a saved pipeline

Returns the structured WouldExecute report for the supplied inputs plus the routine’s declared manifest — no agent invocations, no journal entries. The dry-run is an honest static plan, not a proof the run will succeed. Request body: Same shape as Run. All fields optional. Response: 200 OK — a RunResult (with would_execute) plus a sibling manifest object:
manifest is the routine’s full declared blast radius. It is best-effort: a stored definition that no longer parses leaves manifest null and still returns the report.

Run pipeline

Invokes a saved pipeline. Returns synchronously with the full RunResult; for live progress, subscribe to the workspace WebSocket channel and filter pipeline.* journal entries by run_id. Request body: Headers: Runs started on this route are recorded as user-driven: invoking_user_id is the authenticated caller and invoking_crew_id / invoking_agent_id are empty. The route does not read any X-Crewship-Invoking-* header — a JWT or CLI-token caller has no verified crew or agent identity, and a header would only let a member attribute the run (and the “From” crew on any approval card it raises) to a crew of their choosing. Agent-invoked runs are attributed through the sidecar’s run_routine tool, whose identity fields are checked server-side against the internal token’s crew binding and the agents table. Response: 200 OK — RunResult.

RunResult shape

Step failures. The status codes above are decided before dispatch. Once the run is executing, a failing step does not change the HTTP status: it fails the run, and the RunResult comes back 200 with status: "FAILED", failed_at_step and error_message. In particular, an HTTP step whose credential_ref cannot be resolved — the credential is missing, empty, or the credential store errors — fails that step before the request is sent; the step error names only the declared credential type (internal/pipeline/runner_http.go).

List pipeline runs (journal-backed)

Returns pipeline.run.* journal entries for the named pipeline, newest first. Query parameters: Each row carries id, ts, entry_type, severity, summary, pipeline_id, run_id, and the raw payload.

List pipeline run records (projection table)

Column-typed scan over pipeline_runs (migration v83). Faster than /runs because it skips the journal LIKE-pattern + json_extract path. Returns 503 with a legacy: "/runs" hint when the run store isn’t wired. Query parameters: Response: 200 OK — array of run records. Each record:
error_message is sanitised in this view (single-line, ≤200 chars). The full error stays in journal_entries.

List active runs (in-memory registry)

Returns the in-flight run set scoped to this workspace from the in-memory RunRegistry. Used by the dashboard’s “running now” badge and cancel buttons. Single-instance scope — in a multi-replica deployment, each replica only sees its own runs until a shared registry lands. Returns an empty list when the registry is not wired. Response: 200 OK

List workspace runs (cross-pipeline feed)

Workspace-scoped run feed for the /activity page. Returns recent runs across every pipeline with enrichment (pipeline_name, issue_identifier when triggered_via=issue). Sorted by started_at DESC. step_outputs is deliberately not included in this feed — it can carry many KB of agent transcript/tool-result JSON per row, and this endpoint is polled every few seconds by the dashboard. Fetch Get pipeline run for a specific run id to get its step outputs. Query parameters: Response: 200 OK

Get pipeline run

Returns the persisted state of a single run from pipeline_runs, joined to pipelines and missions for human-readable enrichment. step_outputs_json is parsed server-side into an object so the UI does not have to JSON.parse twice. Response: 200 OK — single row. Includes id, workspace_id, pipeline_id, pipeline_slug, pipeline_name, status, mode, current_step_id, step_outputs (parsed), output, started_at, ended_at, error_message, failed_at_step, cost_usd, duration_ms, triggered_via, triggered_by_id, idempotency_key, inputs (parsed), and issue_identifier. Unlike the workspace-runs feed, this view does not carry the invoking_crew_id / invoking_agent_id / invoking_user_id attribution fields.

Run-window file changes

Lists the files that changed on a run’s crew inside the run window — the deliverable for document-processing routines. Read-time, non-invasive: the run is resolved to its crew (invoking_crew_id, falling back to the pipeline’s author_crew_id), the crew’s host files are listed over the same IPC path the agent/crew file endpoints use (agent /output + /crew/shared), and only files whose modification time falls inside the run’s [started_at, ended_at] window are returned. A still-running run uses “now” as the upper bound. Auth: read capability (any non-empty role). The resolved crew is re-validated against the workspace before its files are read (tenant guard). Response: 200 OK
A run with no resolvable/in-workspace crew returns { "crew_id": "", "files": [] }. Download a listed file via crew files download / crewship crew files get <crew_id> <path>.
This is a correlation, not proof of authorship, and deliberately does not modify the pipeline executor. Because it keys on modification time within the window, the list can also include files written by a concurrent chat session on the same crew, files from another run whose window overlapped, or files authored earlier and merely re-saved (an mtime bump with no content change). Read it as “what changed on the crew while this ran”. See the routine result CLI docs.

Cancel pipeline run

Pre-empts an in-flight run by triggering its context. The run loop checks ctx.Err() between steps and propagates cancellation into the agent runner, which kills the underlying CLI process. Idempotent: cancelling an already-cancelled run is a no-op (200 with the same response). Cancelling a finished run returns 404 because the in-memory registry only tracks live runs. A run parked on an approval or event (WAITING) is cancelled in the run store too: the row becomes CANCELLED, its pending waitpoints are cancelled, and the response carries "parked": true. The cancel and any resume of that run (approve, signal, event, restart) exclude each other, so exactly one of them wins. If resumes keep taking the run, the endpoint answers 409 without changing anything; retrying the cancel is safe. Auth: OWNER or ADMIN (canRole "manage") — cancelling another user’s run is a manage-tier action. Response: 200 OK

Versions

Every save snapshots the pipeline, so you can inspect its history, fetch a specific revision, or roll the head pointer back.

List versions

Returns the version history (newest first) for a pipeline. Query parameters: limit (default 100). Response: 200 OK

Get one version

Returns a specific version including the full DSL definition.

Rollback to a version

Rolls the pipeline’s head pointer + definition_json back to the named version. History is preserved — rollback does not delete newer versions. Auth: OWNER or ADMIN (canRole "manage"). Request body:
Response: 200 OK — full pipeline object with the restored definition.

Import / export

Move a pipeline between workspaces as a portable bundle — export from one, import into another.

Export pipeline bundle

Returns a portable crewship-pipeline-bundle/v1 document. Author identity, runtime stats, and any installation-specific data are deliberately stripped — the receiving workspace fills them in at import time. Query parameters: Response: 200 OK
The bundle’s metadata.head_version field is misnamed in the current build — it actually carries invocation_count. Treat it as opaque metadata.

Import pipeline bundle

Creates a pipeline from a previously exported bundle. The receiving workspace becomes the author context; the original bundle’s source workspace id is preserved on the pipeline row as imported_from_url for audit. Imports skip the save validation gate by design — a marketplace bundle is presumed to have been validated in its source workspace. Auth: MANAGER+ (canRole "create") — importing creates a new pipeline row, same privilege as Save. Request body: the bundle JSON plus an explicit author_crew_id:
Response: 201 Created — full pipeline object.

Approval waitpoints

When a pipeline hits a step_wait of kind approval, the run parks and a waitpoint row is created. The UI’s /inbox lists pending waitpoints; approving or rejecting wakes the parked run.

Typed human decisions

An approval wait can declare decision_form with fields (routine input specifications) and actions (id, label, approved). The server freezes this form when it creates the waitpoint. Later recipe edits cannot change the question or validation for a pending decision. Standing trust does not auto-answer a form. The authenticated approve endpoint accepts the flat request {"approved":true,"action_id":"go","data":{"count":0,"enabled":false}}. The action must exist and its approved value must match. The server validates required fields and types without converting strings into numbers or booleans. Rejection relaxes required fields. 400 means an invalid answer, 403 means an unauthorized actor, and 409 means the decision was already answered or expired. The accepted JSON answer is the wait step output for downstream steps. Typed decisions require an authenticated workspace member with MANAGER+; the public token callback returns 403 even for a well-formed form answer. Their pending-list rows carry decision_form and omit callback_url. Legacy binary approvals retain the public callback and their historical output. Identity comes from authentication, never from an answer’s data fields.

List pending waitpoints

Returns up to 200 pending waitpoints across the workspace, newest first. Response: 200 OK

Approve / reject waitpoint

Completes a pending approval. Decider identity is taken from the request’s auth context, never from the body. Who can decide. A waitpoint is a question for a person. The resolve door accepts a decision from a workspace member with MANAGER+ (session or CLI token — the inbox, the routine page, crewship routine waitpoints approve) and from the holder of the token itself on the public callback. It refuses an agent — a crew-bound X-Internal-Token, a sidecar tool, a peer agent posting “GO” — and a request with no principal at all, with 403 and "reason": "waitpoint_decider_not_allowed". The waitpoint is left pending and the attempt is recorded in the audit log under the action waitpoint.decision_refused (crewship audit --action waitpoint.decision_refused), naming the actor and the run. No agent-facing route reaches this door today (internal tokens get 401 from the authed route before it), but the door checks the actor’s kind regardless, so wiring one later cannot become a way for an agent to satisfy a waitpoint. The inbox card carries the same audience as who_can_act: ["role:MANAGER"]. Request body:
An approved legacy wait returns the literal waited:approval:approved as its step output. An approved typed wait returns serialized DecisionAnswer JSON with action_id, data, and optional comment; downstream steps can parse that JSON. Rejected decisions follow the wait step’s failure behavior. Response: 200 OK

Defaults differ from the public callback — intentionally

This authed endpoint and the public token callback below both accept an optional approved field, but they resolve a missing field in opposite directions:
  • Here (authed, .../approve): omitted → false (deny). This is the JWT-authenticated, human/MANAGER+-driven path (requireRole(... "update")). A caller with a valid session making a considered decision is expected to state it; if a request is malformed enough to drop the field, failing closed means the gated run stays parked rather than being silently released.
  • Public token callback (POST /api/v1/waitpoint-tokens/{token}): omitted → true (approve). This endpoint has no JWT — the token in the path is the only credential — and exists for external systems (CI jobs, vendor webhooks) whose completion signal is often just “the task finished, hit this URL” with no body at all (trigger.dev wait.forToken parity). Requiring a JSON body here would break that integration pattern.
Both defaults are deliberate for their own caller population, not a shared contract — do not assume the two endpoints behave the same way when a request omits approved, and do not rely on either default when authoring a new integration: send the field explicitly.

Complete a waitpoint by token (public callback)

The public sibling of the approve endpoint (trigger.dev wait.forToken parity). An external system holding a waitpoint token completes the wait via an HTTP callback — no workspace JWT required: the high-entropy token in the path is the auth surface, the same model as the public webhook dispatch endpoint. This lets a human-in-the-loop or external-task wait be resolved by a third party (approval service, CI job, vendor webhook) rather than only through the inbox. The token and its callback_url are surfaced on the pending-waitpoints listing (internal/api/router_pipelines.go:127-131). Auth: none — the path token is the credential. The completion is attributed to the sentinel decider external-callback (not a user id) so audit queries can distinguish callback completions from inbox approvals (internal/api/pipeline_waitpoint_callback.go). This is not an agent door. The token travels only to person-facing surfaces — the inbox card, the pending-waitpoints listing, the CLI — and is never handed to an agent, so the only way an agent could reach this route is a person choosing to give the token away. The resolve door behind it is the same one the authed endpoint uses and refuses an agent actor by kind. Request body: optional. A bare POST with no body means “the external task finished, continue the run”.
Response: 200 OK
On success the parked run is resumed via the same path as the authed approve handler (internal/api/pipeline_waitpoint_callback.go:74-84).

Schedules

Schedules fire pipelines on a cron expression. The in-process scheduler ticks every minute and skips soft-deleted rows.

List schedules

Response: 200 OK

Create schedule

Accepts either target_pipeline_slug (UI-friendly) or target_pipeline_id (CLI-friendly). Auth: MANAGER+ (canRole "create"), or a MEMBER holding the routine.create capability. Request body: Response: 201 Created — schedule object.

Update schedule

Whole-row replace semantics — the caller sends the post-edit state, missing fields fall back to the existing row. This includes target_pipeline_version: an absent field keeps the existing version pin, an explicit "target_pipeline_version": null clears it (fires track head again). Likewise wake_fail_closed: absent keeps the existing policy, an explicit boolean sets it; clearing the wake gate resets the policy to fail-open. Auth: OWNER or ADMIN (canRole "manage"). Response: 200 OK — updated schedule.

Delete schedule

Soft delete. In-flight scheduled runs finish; no new runs fire.
Auth: OWNER or ADMIN (canRole "delete"). Response: 204 No Content

Webhooks

Webhooks let external systems trigger a pipeline by POSTing to a public URL. Each webhook has its own opaque token and optional HMAC signing secret. The public dispatch entrypoint (POST /api/v1/webhooks/{token}) is not under /workspaces/... — see the Webhooks API doc.

List webhooks

Returns all non-deleted webhooks. The signing_secret value is never returned outside the create response. Response: 200 OK

Create webhook

Auth: MANAGER+ (canRole "create") — a webhook mints a public dispatch URL, so creation is gated at MANAGER+. Request body: Response: 201 Created — webhook object including signing_secret (this is the only time it is returned, whether supplied or auto-generated; subsequent reads return only signing_secret_set: true).

Delete webhook

Soft delete.
Auth: OWNER or ADMIN (canRole "delete"). Response: 204 No Content

Skills

These endpoints manage the workspace-scoped write surface for the skills registry. Browsing skills (GET /api/v1/skills) is not workspace-scoped and lives in the Skills API doc.

Import skill (URL or paste)

Imports a single SKILL.md either by URL (SSRF-validated, HTTPS-only, no loopback / private addresses) or by pasted content. Re-imports of the same slug update in place. Auth: MANAGER+, or a trusted workspace member with explicit skill.create. Guest restrictions and scoped CLI skills:write still apply. Request body: Response: 201 Created
The import response carries only these four fields (created is true for a fresh row, false for an in-place update of an existing slug). Scan status and display name are persisted on the skill row but not echoed here — fetch the skill via GET /api/v1/skills/{skillId} to read them.

Bulk import from git repo

Walks a public git repository for SKILL.md files and upserts each through the same license-gated path as single-import. Per-skill rejections are reported in the response’s skipped list rather than failing the whole batch.
Local-path bulk import (the importer’s Paths field beyond the optional in-repo subdirectory filter) is intentionally not exposed — it would turn the endpoint into an arbitrary host-FS read primitive.
Auth: MANAGER+ (canRole "create"). Request body: Response: 200 OK

Generate skill (LLM)

Calls Anthropic with a condensed skill-creator system prompt, validates the output against the parser, and writes it back as a fresh row with source='GENERATED'. The generated content can then be edited via the regular import flow. Requires an ACTIVE Anthropic credential of type API_KEY (a real sk-ant-... — OAuth bearers from the Claude Code login flow are rejected because they only work against claude.ai, not the Messages API). Auth: MANAGER+ (canRole "create"). Request body: Response: 201 Created

Delete skill

Removes a skill from the registry. Cascades to agent_skills via FK. BUNDLED skills are refused — the binary re-seeds them on every startup, so a delete is a no-op churn and creates a malicious-operator window.
Auth: OWNER or ADMIN (canRole "manage"). The skills registry is shared global state; destructive operations get the higher tier. Response: 200 OK

preferred_language values

preferred_language accepts either the canonical English name or an ISO code. The resolver normalises both to the canonical name before storage. Supported values: Afrikaans (af), Arabic (ar), Bulgarian (bg), Bengali (bn), Catalan (ca), Czech (cs), Danish (da), German (de), Greek (el), English (en), Spanish (es), Estonian (et), Persian (fa), Finnish (fi), French (fr), Hebrew (he), Hindi (hi), Croatian (hr), Hungarian (hu), Indonesian (id), Italian (it), Japanese (ja), Korean (ko), Lithuanian (lt), Latvian (lv), Malay (ms), Norwegian (nb), Dutch (nl), Polish (pl), Portuguese (pt), Portuguese (Brazil) (pt-BR), Romanian (ro), Russian (ru), Slovak (sk), Slovenian (sl), Serbian (sr), Swedish (sv), Swahili (sw), Tamil (ta), Thai (th), Turkish (tr), Ukrainian (uk), Urdu (ur), Vietnamese (vi), Chinese (zh), Chinese (Traditional) (zh-TW). The list lives in internal/api/workspaces.go and must stay in sync with lib/languages.ts on the frontend.

See also

Test a routine step with sample data

Auth: workspace MANAGER+. Request body: definition (object) and step_id (string) are required. inputs is an optional object of recipe input values; step_outputs maps upstream step IDs to output strings. fixture_output supplies a replacement output for an agent, HTTP or script step. An empty string is an explicit sample. Transforms compute with the production transform implementation using the supplied inputs and step outputs. External steps only check the supplied output; the endpoint never calls agents, services or scripts. Only top-level steps are supported. Dependencies, conditions, retries and outcome graders are not run; external schema references are blocked. Optional env and secrets objects map names to sample strings; metadata supplies sample values for run.metadata.*. run.* aliases use the env map, as in live rendering. These are explicit test data, never values read from the server environment or credential vault. Use fake values for secret samples. Missing references cannot silently become empty values. Runtime samples are included in the fixture evidence hash. Response: 200 OK, RoutineFixtureResult: execution_mode, step_id, step_type, definition_hash, fixture_hash, output_source, output, valid, validation_declared, optional validation_reason, and limitations. valid: false reports a failed output check; no declared check is distinguished by validation_declared: false. These results are not publication proofs. 400 means invalid definition, unsupported step type, missing sample values or malformed input; 403 means insufficient role. A failed output check returns 200 with valid: false so clients can display its evidence.

Get member resource access

Read a complete resource access policy in a consistent membership/grants snapshot. workspaceId is the canonical workspace ID; memberId is the membership row ID, not the user ID. Auth: Authenticated current trusted OWNER/ADMIN of this workspace. Scoped CLI tokens additionally require workspace:admin or its wildcard. Existing restricted-session restrictions also apply to mixed memberships. Request: No body. Path parameters: workspaceId, memberId. No additional query parameters are required. Response: 200 OK, Cache-Control: no-store:
rights is an explicit array, including when empty. Agent operations are discover, chat, run, delegate; project operations are list, read, contribute, manage, delete_issues, write, delete; routine operations are view, results, run and edit. Grants do not open application routes whose restricted runtime integration is incomplete.

Replace member resource access

Atomically replace a member’s resource ceiling. Roles, capabilities and conversation audience remain additional checks. Auth: Authenticated current trusted OWNER/ADMIN of the target workspace; scoped CLI tokens require workspace:admin or its wildcard. The server derives the operator from authentication, never the request body. Request: JSON body, maximum 64 KiB. All four fields are required:
membership_id must match the path’s membership row. revision must match the current version read from GET. mode is trusted or restricted; rights contains at most 256 distinct {kind,id,operation} objects belonging to this workspace. Null/omitted rights and unknown fields are rejected. Empty restricted rights revoke all resource grants. Trusted mode restores ordinary workspace access and accepts only explicit crew manage shares for trusted MEMBER/MANAGER targets. Any account with a trusted-only share must explicitly revoke and save it before changing to Guest (422), including shares in other workspaces. OWNER/ADMIN targets cannot be restricted. Response: 200 OK, Cache-Control: no-store, the same complete policy shape as GET with the new revision. Revisions are opaque versions and may advance by more than one. No live shared process is forcibly terminated by this endpoint; new authorization checks enforce the updated policy. Unintegrated restricted execution routes remain denied.

Effective member access

Auth: Current trusted workspace OWNER/ADMIN; scoped CLI credentials require workspace:admin. The target is a membership row, not a user ID. Request: No body. Path parameters are workspaceId and memberId. Response: 200 OK, Cache-Control: no-store, JSON:
States are allowed, denied, conditional or unavailable. The explanation covers the saved policy, not unsaved editor changes. This response contains no private chat or run results.

Guest project issue list

Auth: Authenticated Guest membership of this workspace; exact project.list is required for every returned issue. Other workspace memberships do not bypass the account restriction. Request: No body. Query parameters: optional project_id, limit (default 100, maximum 500), offset (default zero), and q (up to 256 Unicode characters, trimmed). q performs literal substring matching on issue title or identifier with SQLite ASCII case folding. % and _ do not act as wildcards. Descriptions, comments and other resource metadata are never searched. The count and pages remain filtered by live project.list grants. An explicit ungranted project is 404. Response: 200 OK, an array of JSON objects with id, identifier, title, status, project_id, project_name and booleans can_read and can_contribute. Description is not included. X-Total-Count counts the filtered total and X-Next-Offset pages results.
Collection searches and empty-query lists share an authenticated user/workspace budget across browser sessions and CLI tokens: default 20 requests/minute with burst 15, and 20/minute with burst 5 per authorized project or all-project selection. Query/offset changes do not reset the budget. A temporary refusal returns 429, Cache-Control: no-store and integer Retry-After seconds, with a generic retry message and no workspace/audience counts. Scripts should wait at least that interval. Details and comments retain their separate behavior. The in-memory policy applies per server process, and finite capacity can also produce the same temporary refusal.

Guest project issue detail

Auth: Authenticated Guest membership and project.read on the issue’s current project in the selected workspace. Request: No body. issueId accepts the issue ID or its identifier. Response: 200 OK, the same JSON object as the Guest list plus an optional string description. Crew/agent references, comments, activity, related issues and run history are excluded. No mutation endpoint is enabled by this read.

Explain my access

Returns the authenticated member’s own effective access explanation, including membership_id, mode, revision, account_restricted, restriction_scope, explanation and saved-grant decisions (kind, id, optional name, operation, state, reason). Available to Guests without workspace administration. No target user parameter is accepted. An unavailable membership returns 404; a concurrent policy change returns 409. Responses use Cache-Control: no-store. Member policy responses also include read-only grant_details (kind, id, operation, issuer_id, created_at, live). Policy replacements preserve unchanged grants, including inactive ones. Optional reissue contains exact rights also present in rights, deliberately issued by the authenticated admin. Client-supplied grant metadata is ignored and recalculated in the response.

Guest issue projects

Authenticated Guest only. Returns projects with a live project.list grant, including empty projects: id, name, can_contribute, can_manage, intake_ready. Contribution requires both live project.read and project.contribute. Management requires live project.read and project.manage; both mutation hints also reflect token scopes. Intake readiness discloses a boolean, never the receiving crew or agent. Statuses: 200 filtered array; 401 authentication; 403 workspace gate; 404 unavailable membership; 500 database error. CLI: crewship issue shared projects.

Create a Guest issue

Auth: Guest, live project.read plus project.contribute; CLI tokens also require the existing workspace:admin mutation scope. Scope does not replace the resource grants or confer a workspace administrator role. Body: { "project_id": "project_123", "title": "Client request", "description": "Brief" }. Title is required, up to 4096 bytes; description up to 65536 bytes. Unknown fields are rejected. Crew, agent, author, assignee, routine and execution state are never accepted from the caller. The administrator-configured intake crew receives an unassigned BACKLOG issue; creation does not directly start an agent or routine. Existing workspace automations may process issue events. Returns 201 with the narrow Guest issue object, including can_contribute. The creation, authenticated creator, activity and durable journal intent commit atomically. Journal projection may be retried after commit. An explicit unavailable execution origin prevents the request being treated as autonomous agent authority. Statuses: 400 invalid input; 401 authentication; 403 workspace/token scope; 404 absent/revoked/foreign project; 409 intake not configured or unavailable; 500 database/audit failure (no issue committed). CLI: crewship issue shared create.

Arrange a Guest issue

Same read/contribute and token checks as creation. Body contains only { "status": "TODO" } or BACKLOG. Both the existing and requested state must be in that intake pair. Execution, review and terminal transitions retain the trusted workflow; this is not permission to bypass review or move an issue between projects. Returns 200 with the narrow current issue. Statuses: 400 invalid/unknown fields; 401 authentication; 403 scope/workspace; 404 unavailable issue or grants; 409 work already entered the trusted workflow; 500 database/audit failure. CLI: crewship issue shared move.

Read Guest-shared comments

Guest with a live read grant on the issue’s current project. Returns the latest 100 comments explicitly shared with that project, in chronological order. Each object contains id, body, author (You or Workspace member) and created_at. No member identifiers, email addresses, agent references, private staff comments or mention roster are returned. Old comments remain private after upgrade. Moving an issue to another project does not publish the original project’s shared comments to its new audience. Statuses: 200 array; 401 authentication; 403 workspace; 404 issue/read unavailable; 500 database failure. CLI: crewship issue shared comments.

Post a Guest-shared comment

Guest with live read and contribute grants, plus mutation token scope as above. Body: { "project_id": "project_123", "body": "Client question" }, 1–32768 bytes, unknown fields rejected. The body requires project_id (the expected audience) in addition to body. It must match the current issue project; a move returns 409 without publishing the draft. Agent mention links are refused with 400; shared comments do not request agent work. Returns 201 with the shared-comment object. It records the authenticated author, current project audience and audit in one transaction. Private comments and agent mentions are not exposed or triggered by this route. Statuses: 400 invalid body; 401 authentication; 403 workspace/token scope; 404 unavailable issue/grants; 409 changed audience or conflicting retry key; 500 database/audit intent failure (no comment committed). CLI: crewship issue shared comment.

Read project Guest issue intake

Trusted ADMIN/OWNER only. Returns project_id, crew_id, crew_name, revision; an unconfigured project has empty crew fields and revision zero. The administrative route is absent from the Guest allowlist. Statuses: 200 snapshot; 401 authentication; 403 workspace; 404 unavailable project/operator; 500 database failure. CLI: crewship project guest-intake.

Set project Guest issue intake

Trusted ADMIN/OWNER and the existing mutation token scope. Body: { "crew_id": "crew_123", "revision": 0 }. The crew must be active in the project’s workspace and have an active LEAD agent. The expected revision is mandatory; stale snapshots fail without retry. Configuration and its audit commit together. A crew/project workspace move invalidates the configuration. Returns 200 with the advanced snapshot. This routing configuration grants no agent or routine execution authority. Statuses: 400 invalid crew/body; 401 authentication; 403 workspace/token scope; 404 unavailable project/operator; 409 stale revision; 500 database/audit failure. CLI: crewship project guest-intake --crew CREW_ID. Guest issue create, move and comment endpoints accept optional Idempotency-Key (1–200 nonblank bytes). Guest forms retain an operation key for an uncertain submission and clear it after success; changing content or audience creates a new operation. Reuse the same key and exact body when retrying a lost response. A completed replay returns the original result and Operation-ID with Idempotency-Replayed: true, after fresh project grants and audience checks. Changed payload or audience returns 409; revoked grants return 404. Activity and durable journal intent commit with the mutation; projection failure retains a retryable outbox record rather than losing the audit. Guest-authored content carries no agent execution authority.

Guest routine definition library

Guest only. The directory returns current live routine View/Run shares as id, slug, name, status, can_view, can_results, can_run, runtime_ready, with X-Total-Count for the filtered directory. View is independent of graph execution and runtime installation. can_run is eligibility; invocation still checks current dependencies, definition, inputs, budget and runtime readiness. The detail accepts an ID or slug and additionally returns definition (JSON object), definition_hash and version. It requires an explicit live routine.view share. This includes authored prompts and defaults, so administrators must review the definition before sharing. Existing Run shares do not implicitly disclose definitions. The route does not resolve vault credentials, roster or issuer metadata, or add another person’s private run history. Authored literal content is shared as stored; administrators must review it before granting View. Statuses: 200 authorized projection; 401 authentication; 403 workspace/token scope; 404 absent/foreign/deleted/revoked definition or non-Guest membership; 500 unavailable data. No execution runtime is needed for View. CLI: crewship routine shared [routine-id-or-slug].

Guest project details

GET /api/v1/workspaces/{workspaceId}/restricted-projects/{projectId}

Requires the authenticated Guest’s current project Read and Manage shares. Manage explicitly shares the project description; existing Read shares retain their prior issue/file projection. Returns only id, name, description (empty when unset), version and can_manage. version is an opaque content/updated-time snapshot used to prevent overwriting changes, including edits through the trusted project API. can_manage intersects live Manage authority with the credential’s existing mutation scope. No lead, crew, credential, other-member identity or private activity is returned. Response: 200 OK

PUT /api/v1/workspaces/{workspaceId}/restricted-projects/{projectId}

Requires Read and Manage, an active account and current trusted grant issuers, checked in the same transaction as the update and audit. Body contains exactly name, description and the reviewed version. Name must be nonblank and at most 4096 UTF-8 bytes; description is a required string up to 65536 bytes, and empty clears it. Unknown fields are refused. Manage here supports basic project details; Milestones use dedicated routes; issue deletion additionally requires delete_issues. File writes and intake configuration remain separate. Both routes return 200 with the thin details projection; 400 invalid request, 401 unauthenticated, 404 unavailable local project/grant, 500 storage/audit failure. PUT additionally returns 403 for a limited mutation credential and 409 on changed details, with no update; reload, review and explicitly resubmit. Audit failure rolls back the update. CLI equivalents are project shared and project shared update.

Guest issue deletion

GET /api/v1/workspaces/{workspaceId}/restricted-issues/{issueId}/deletion

Requires current Guest project Read, Manage and explicit delete_issues shares, including live issuers. Returns id, identifier, title, project_id, status, opaque version and can_delete. Eligibility also requires this credential’s existing mutation scope, Backlog/Cancelled status and no active assignment, execution, pending task or sub-issue. Narrow credentials can inspect the preview with can_delete=false. The projection contains no private comments, agent identities or execution data. Response: 200 OK

DELETE /api/v1/workspaces/{workspaceId}/restricted-issues/{issueId}

Requires the same three rights and current mutation scope, rechecked in the transaction which deletes the issue and journals its actual human actor. The body is exactly the reviewed project, version and explicit confirmation:
Returns 204 with no body. Removes issue/comment attachment rows and reclaims only orphaned attachment digests after commit. Historical chat deletion receipts retain the existing trusted audience and disclose no deleted content. They do not open trusted chat/operation routes to a Guest. Audit or receipt failure rolls everything back. Existing Manage shares do not acquire deletion: administrators must issue delete_issues deliberately; source-file delete is a different operation. Both routes return 400 invalid input, 401 unauthenticated, 403 credential scope, 404 absent/foreign/unshared issue or inactive authority, and 500 storage failure. DELETE additionally returns 409 on changed project/version, ineligible status or active work, without deletion. There is no automatic retry. CLI equivalents: issue shared-delete-preview and issue shared-delete.

Guest milestone management

All routes require the authenticated Guest’s live project Read and Manage shares, a current local membership and active account/issuers. Writes also require the existing mutation credential scope. Metadata writes and audit commit together; audit failure rolls back the write. Unknown fields and foreign resources are refused. No crew, agent, member identity or private issue data is exposed.

GET /api/v1/workspaces/{workspaceId}/restricted-projects/{projectId}/milestones

limit defaults to100 (1–500), offset to0. X-Total-Count is the filtered project total; X-Can-Manage is the current credential’s mutation eligibility, including for an empty list. Row can_delete is true only for a removable empty milestone. Response: 200 OK

GET /api/v1/workspaces/{workspaceId}/restricted-projects/{projectId}/milestones/{milestoneId}

Response: 200 OK, the same single milestone object, scoped to this project.

POST /api/v1/workspaces/{workspaceId}/restricted-projects/{projectId}/milestones

Requires name, description and target_date strings. Name is nonblank and at most4096 UTF-8 bytes; description at most65536 bytes. Target date is empty or a valid YYYY-MM-DD. Status is active (default), completed or cancelled. The server chooses the ID and next position. Version/position overrides are refused.
Response: 201 Created, the new milestone object above.

PUT /api/v1/workspaces/{workspaceId}/restricted-projects/{projectId}/milestones/{milestoneId}

Requires the reviewed version and complete name, description, target_date, status and position (0–1000000). The unchanged legacy status may be preserved; new status values use active/completed/cancelled. A trusted edit also invalidates an old version. Conflicts return409 without changing content.
Response: 200 OK, the updated object with a new version.

DELETE /api/v1/workspaces/{workspaceId}/restricted-projects/{projectId}/milestones/{milestoneId}

The body contains only the reviewed version. Removal is empty-only: no issue is unlinked or changed, including stale references from another project.
Response: 204 No Content. Changed versions or linked work return409. All routes may return400 invalid input,401 authentication,403 credential access, 404 unavailable local membership/project/milestone or grants,500 storage/audit failure. CLI equivalents are project shared milestones and its create/update/delete subcommands. The UI keeps failed drafts and requires explicit review after conflicts.

Guest collaborative routine drafts

Both require current local Guest membership and explicit live routine View and Edit shares. GET returns draft_id, revision, base_revision, name, description, definition and can_edit. PUT accepts the same snapshot/content fields except can_edit, and requires token scope workspace:admin. Unknown fields, non-object definitions and omitted content are rejected. An empty draft_id with revision zero creates the collaborative draft against the exact published baseline; subsequent saves require its current ID and revision. Draft authority, account status, revision/base checks and content-free audit commit atomically. The route does not publish, execute, mint test proofs or approve risk. Author identities, execution origin, trigger and approval controls remain server-owned and are excluded from the projection. View alone sees only the published definition. Granting Edit additionally shares unfinished work with all current editors of that routine. Statuses: 200 snapshot/saved draft; 400 malformed body; 401 authentication; 403 workspace/token scope; 404 unavailable routine, View/Edit authority or local Guest membership; 409 changed draft or published base; 500 unavailable storage or audit. Conflicts are not retried. Trusted review/testing/publication remain required after a Guest saves changes.

Guest shared routine run history and outputs

Require the authenticated Guest’s live routine view and results shares. The routine accepts an ID or slug. Existing definition-only View and invocation-only Run shares do not acquire this audience automatically. No agent execution grant or installed runtime is needed for this read. The collection accepts limit (1–500, default 100) and offset (0–1000000, default 0). It returns an array of run_id, routine_id, status, mode, started_at and nullable ended_at; X-Total-Count is the visible total before pagination. The detail adds nullable output and a step_outputs string map. Inputs are not shown directly; outputs may contain them. Identities, errors, costs, transcripts and internal provenance are excluded. Detail rejects pagination parameters. Stored output content is limited to 256 KiB and the encoded response to 1 MiB; oversized detail returns 413. Credential-shaped content is scrubbed from final and step outputs, including historical reads. The explicit share covers this routine’s past/future regular pipeline runs. A run’s own, pinned-version and current-recipe private chat origins remain additional current read ceilings; absent or non-chat origins are unavailable through this projection. Both counts and rows apply these audiences before pagination. Issue-triggered runs and their replays are excluded. NULL-origin runs require valid start-journal evidence and the shared autonomous-run predicate; recorded human authority, missing authority, malformed payloads, missing evidence and unknown-origin replays are hidden. A foreign or hidden run returns the same 404. Private restricted runtime jobs retain actor/attempt/proof checks on their existing own-result endpoint and are not exposed by reading raw job output columns. Statuses: 200 authorized projection; 400 invalid pagination; 401 authentication; 403 workspace/token boundary; 404 absent/foreign/deleted routine or run, missing View/Results, inactive issuer, private origin or non-Guest; 413 oversized detail; 500 unavailable data. Responses are Cache-Control: no-store. CLI: crewship routine shared-runs <routine-id-or-slug> [run-id].

Resource access preset catalog

GET /api/v1/workspaces/{workspaceId}/access/presets returns {presets: [{definition, definition_hash}]}. Each definition includes its immutable preset_id, version, resource kind, managed operations, and explicit level bundles. The read requires the same live trusted workspace OWNER/ADMIN authority and workspace:admin credential scope as member-policy GET. Responses are Cache-Control: no-store. Listing does not change grants, membership revisions or saved selections. Catalog responses: 200 returns the definitions; 400 rejects invalid workspace context; 401 requires authentication; 403 rejects insufficient credential scope or route authority; 404 hides unavailable workspaces or live administrative authority; 500 reports an internal database failure. crew-levels v1 supports resource: {kind: "crew", id: "crew-id"} and levels none (no View/Use), view (view), and use (view,use). Preview returns CREW_DYNAMIC_AUDIENCE: shares include current and future agents; per-agent authority/runtime preflight still applies. No Delegate, credential visibility, existing conversations, activity or administration is granted. Apply preserves unrelated grants and original issuers; None removes only this crew’s View/Use and preserves any independent agent shares. The same existing preview/confirmed-apply endpoints and consent checks apply.

Informational preset selections

Administrative member access GET/PUT responses include preset_selections: [] or saved selection entries (id, kind, resource_id, preset_id, version, level, definition_hash, selected_at, optional selected_by, and state). Entries describe saved intent, not effective authority. A manual PUT may round-trip this read-only field but cannot create or rewrite a selection through it; the response is computed from stored canonical state. Own-access responses omit the administrative metadata.

Preview member access preset

POST /api/v1/workspaces/{workspaceId}/members/{memberId}/access/presets/preview is read-only. It requires current active trusted OWNER/ADMIN authority, the existing administrative GET credential boundary (workspace:admin for scoped credentials) and an existing restricted member. Responses use Cache-Control: no-store. Submit:
Only this resource’s managed operations change in the proposed policy. Unrelated and orthogonal rights remain intact. Explicit reissue names a retained managed right, never an unrelated or newly added right. Bounded strict JSON rejects unknown and trailing input. The response includes selection, definition_hash, nullable current_selection, complete before provenance, changes, after_rights, orthogonal_rights, warnings and confirmation_digest. One snapshot binds membership incarnation/revision, caller/issuer authority, role floors, resource state and exact consequences. Display names and future application timestamps are not authority; the digest never authorizes a write. Warnings explain Results history, conditional retained issue deletion, runtime gates and draft-only Edit. Preview changes no grants, choices, member revisions or policy audit; ordinary credential-use accounting still applies. Application uses the separate confirmed endpoint described below. Malformed/version/reissue/trusted-target input returns400; stale membership revision returns409 requiring a fresh preview; hidden/foreign targets return404 without their identities; administrative credential denial returns403. Database errors return500.

Apply a confirmed member access preset

POST /api/v1/workspaces/{workspaceId}/members/{memberId}/access/presets/apply requires the same current trusted workspace administrator and workspace:admin credential scope as policy replacement. Submit only {selection: <normalized preview selection>, confirmation_digest: <exact preview checksum>}. Bounded strict JSON rejects unknown and trailing fields. The existing restricted membership and immutable version/level must still match. The server recomputes the whole preview in the writer transaction and compares its digest before replacing canonical managed grants. Unrelated rights and unchanged grant IDs/issuers/timestamps remain intact; only deliberately named retained managed rights are reissued as the authenticated actor. It never changes mode, role or future publication authority. Canonical replacement, complete provenance/preset audit and final informational selection commit once. Any audit/selection failure rolls back all grants, revisions and metadata. The no-store response is the current complete administrative member policy with server-computed selections. Malformed consent returns400; changed membership/authority/resource/consequences returns409 and requires a new reviewed preview; foreign/hidden targets return404; credential denial returns403; transactional failures return500 without partial writes. The server never substitutes a refreshed revision or automatic reissue. On an uncertain network outcome, read current policy before producing new consent.

Human-owned content custody

GET /api/v1/workspaces/{workspaceId}/page-ownership lists human-owned content, such as private artifacts, that requires explicit succession. The route keeps its page-ownership name because artifacts are stored as Page rows; {pageID} is the artifact’s ID. Workspace owners and administrators can review its current owner and eligible successors. The endpoint returns metadata and current readers, without document, HTML, or drawing source. Use owner_user_id, limit (1–100, default 25), and the returned next_cursor to review one owner’s content across result pages. Keep the owner filter unchanged when following the cursor. Responses use Cache-Control: no-store. POST /api/v1/workspaces/{workspaceId}/page-ownership/{pageID} accepts expected_owner_user_id and successor_user_id. The successor must already have current read access and be an active trusted human workspace member. The server rechecks the actor, original owner and successor inside the transfer transaction. An owner changed since review returns 409. The operation preserves content and grant records; each existing grant still requires its issuer’s current authority. Transferring ownership does not reveal linked source content. Artifacts, including Documents, Slides, Boards and static projects, retain human custody when their storage is present. Legacy Pages keep their existing crew succession behavior. An owner departure that would remove private content custody returns a conflict until the affected content has been transferred. Instance administration alone does not expose workspace-private names or successor contacts. Workbooks are stricter. Only a workspace OWNER sees or transfers a workbook here, and only once its owner is no longer an active member: removed, suspended or restricted, or with a removal or erasure refused because of the workbook within the last 7 days. Otherwise a workspace OWNER gets 403 and anyone else 404, and the listing omits the workbook. Each workbook transfer writes an artifact.workbook_custody_transferred audit log entry in the same transaction. See When the owner leaves. CLI: crewship workspace page-ownership list and crewship workspace page-ownership transfer <page-id>. Scoped CLI credentials need workspace:admin for both listing and transfer. workspace:* and unrestricted tokens also carry this authority. Session callers need a current trusted workspace OWNER or ADMIN session.

Artifact creation policy

Workspace administrators can configure which crews may participate in agent artifact creation. The policy starts disabled with an empty crew allowlist and version 0. This administrative ceiling does not itself authorize an agent run; creation also requires the run’s human consent and content permissions. GET /api/v1/workspaces/{workspaceId}/artifact-creation-policy returns enabled, sorted crew_ids, version and limits (chat_run_create_limit, run_read_limit, crew_hourly_page_limit; defaults 3, 50 and 20), and scoped_default: true while no policy was ever saved and artifact_agent_access_modes is on, when chat runs of every live crew may use their artifact scope, and save_requires_run_token (default false). PUT /api/v1/workspaces/{workspaceId}/artifact-creation-policy accepts a request body of at most 64 KiB and requires all three request fields: enabled, the complete crew_ids allowlist, and base_version from the last read. A stale version returns 409 with code: "stale_policy"; read the latest policy before deciding on a replacement. An optional limits object changes only the limits it names (ranges 1–20, 1–500 and 1–1000; out of range returns 400); omitted limits keep their value. An optional boolean save_requires_run_token (omitted keeps its value) makes an agent page save without the agent run token fail with 403 and code: "run_token_required"; while it is false, such a save is accepted under the crew hourly limit only and counted in crewshipd_page_save_without_run_token_total (an agent holding only a per-agent v1 token counts as tokenless; the host’s own routine page.create is exempt). A save with the token counts against its run’s chat_run_create_limit. The limits and the requirement apply only with the artifact_agent_access_modes flag on (docs/specs/pages.md §7.1c). Only active crews from the selected workspace are accepted. Responses use Cache-Control: no-store. CLI access requires workspace:admin. Use crewship workspace artifact-policy show, then explicitly replace the policy with crewship workspace artifact-policy set --base-version <version> --enabled=true --crew-id <crew-id>. To disable creation and empty the allowlist, use --enabled=false --clear-crews with the reviewed --base-version. Workspace backups preserve this configuration and remap the allowed crews when restoring into a new workspace; live run principals require fresh admission. Authentication: a current trusted workspace OWNER or ADMIN session, or a CLI credential carrying workspace:admin. Statuses: 200 saved/read policy; 400 invalid request or crews; 401 invalid human credential; 403 insufficient current role or scope; 404 wrong workspace; 409 stale policy version; 413 body exceeds 64 KiB; 500 unavailable storage.

Shared draft validation and publication

POST /api/v1/workspaces/{workspaceId}/restricted-routine-library/{routineId}/draft/validate and POST /api/v1/workspaces/{workspaceId}/restricted-routine-library/{routineId}/draft/publish accept only {draft_id, revision, base_revision} from the reviewed shared draft. Validation returns valid: true, scope: "structure_only"; publication returns {id, version, publication_revision}. Both recheck current rights and return 409 for a stale snapshot or a busy writer. Publication requires Publish with Edit and View, refuses existing triggers with 422, and commits the stored recipe, immutable manifest, draft consumption and audit together. Neither endpoint creates execution authority for the generic runner. Draft save rejects description: null with 400. Responses use Cache-Control: no-store.

Withdraw a Guest publication

POST /api/v1/workspaces/{workspaceId}/restricted-routine-library/{routineId}/unpublish takes no body. A member with Publish on the routine, or a trusted workspace OWNER/ADMIN, withdraws the current Guest publication and receives {id, version, withdrawn_at}. The published version and its manifest are kept; new runs are refused and running ones stop before their next step. The change and its chained audit event (action: unpublish) commit together. A routine without a current Guest publication, or one already withdrawn, returns 409; missing or unauthorized routines return 404 and a request body returns 400. Withdrawal advances publication_revision, so a shared draft based on the withdrawn publication returns 409 on publish until it is reloaded. Publishing a reviewed shared draft again makes the routine runnable for new runs; runs accepted before the withdrawal stay stopped. Responses use Cache-Control: no-store.