All integration endpoints require authentication. Workspace-scoped routes also
require workspace context; OAuth provider/discovery routes and MCP registry
list/search routes do not. Individual sections call out additional role
requirements and the unauthenticated OAuth callback.
Endpoints
Endpoint contract
Each endpoint below has Auth, Request, Response, and Status details. Workspace routes require a session or CLI token plus membership; OAuth provider/discovery and registry list/search routes explicitly do not. Requests and responses are JSON unless noted. Workspace reads return200,
creates 201, deletes use the status stated by the endpoint, and registry sync
returns 202. The shared failures are 401 unauthenticated, 403 denied
workspace/role, 400 invalid JSON or fields, 404 missing or foreign resource,
409 conflict, and 500/503 for handler or unavailable-backend failures.
The route gates and handler branches are verified in
internal/api/router_orchestration.go, internal/api/mcp_*.go, and
internal/api/oauth*.go.
Auth: The endpoint-specific role or capability is authoritative; otherwise
the route requires an authenticated workspace member.
Request: Query parameters and JSON bodies are shown immediately under each
operation. Read and delete operations have no body unless stated.
Response: Successful responses are the JSON object/array described under
the operation; connection tests return { "status", "message?", "server_info?" }.
Status: In addition to the success status, invalid input is 400, denied
access is 403, a missing resource is 404, and backend/provider failures are
500 or 503 as noted by the operation.
Managed Integrations (Composio)
Read-only inventory of the Composio managed-integration provider. See the Integrations guide for the object model. RequiresCOMPOSIO_API_KEY on the server; when unset the endpoint
returns enabled: false with empty lists rather than an error.
Composio Inventory
user_id. Gated on workspace read. This is an operator
view; agents are scoped to a single user_id and never receive the full list.
Response: 200 OK
CLI:
crewship integration composio inventory.
Composio Toolkits
search, category,
and limit (max 100, default 40) are optional server-side filters. Read-gated;
returns enabled: false when the provider is unconfigured.
Response: 200 OK
CLI:
crewship integration composio toolkits [--search] [--category] [--limit].
Composio Tools
github has 846, gmail 61).
toolkit is required (400 otherwise). search and limit (max 100,
default 40) are optional server-side filters. Read-gated; returns
enabled: false when the provider is unconfigured.
Response: 200 OK
CLI:
crewship integration composio tools <toolkit> [--search] [--limit].
Composio Triggers
GMAIL_NEW_MESSAGE, GITHUB_PR_OPENED). toolkit, search, and
limit (max 100, default 40) are optional server-side filters. Read-gated;
returns enabled: false when the provider is unconfigured.
Response: 200 OK
CLI:
crewship integration composio triggers types [--toolkit] [--search] [--limit].
Composio Active Triggers
enabled: false when the provider is unconfigured.
Response: 200 OK
CLI:
crewship integration composio triggers active.
Composio Create Trigger
400 if slug or user_id is empty, or if the provider is
unconfigured.
Request body:
Response:
200 OK
crewship integration composio triggers enable <slug> --user <id>.
Composio Connect
Returns
400 if either field is empty, or if Composio is unconfigured.
Response: 200 OK
redirect_url to authorize. Returns 502 on an upstream
Composio failure. CLI: crewship integration composio connect <toolkit> --user <id>.
Composio Settings
Manage the per-workspace Composio API key from the app instead of the server env. The key is validated against Composio before being stored encrypted (AES-GCM). The effective key is resolved per request: the workspace key first, then the serverCOMPOSIO_API_KEY env fallback. The key
is never returned by any endpoint.
GET (read) returns the status; PUT/DELETE require workspace manage
(OWNER/ADMIN). PUT body: { "api_key": "ak_…", "label": "" }.
The Composio host is server-controlled via the COMPOSIO_BASE_URL env var, not
via this API.
Response (GET / PUT / DELETE): 200 OK
A
PUT with an invalid key returns 400 (Composio rejected it). CLI:
crewship integration composio key {show,set,remove}.
Composio Default Connector
Inspect / provision the workspace-wide default connector. When the server flagCOMPOSIO_DEFAULT_CONNECTOR is ON, every agent without an explicit
per-agent binding inherits this connector (full access to all the workspace’s
connected apps), and legacy non-Composio MCP servers are turned off at
resolve time (not deleted). See the
Integrations guide.
GET (read) reports state; PUT requires workspace manage (OWNER/ADMIN).
PUT body is optional: { "user_id": "<id>" } pins the default Composio user;
omit it to auto-derive the user when exactly one is connected. PUT errors
400 when zero users are connected (“connect an account first”) or when
multiple users exist (pin one). Re-running is idempotent and refreshes the
connector’s app set.
Response (GET / PUT): 200 OK
CLI:
crewship integration composio default {show,set,enable}.
Composio Agent Binding
Grant an agent per-app, tool-scoped access to a Composio user’s connected apps. For each granted app the binding provisions one tool-scoped Composio MCP server and persists the rows the runtime resolver reads — a per-(agent, app) workspace MCP server pointing at the per-user Composio MCP URL, a workspace credential holding the Composio API key, and an agent MCP binding joining them (cred_type: api_key, cred_header: x-api-key).
No resolver change is needed: the sidecar injects the x-api-key header on the
streamable-http request.
Each app carries a mode that maps to the MCP server’s allowed_tools:
GET (read) lists the agent’s per-app Composio bindings; POST/DELETE
require workspace manage (OWNER/ADMIN). POST body:
user_id is required (the Composio user the agent is scoped to). The legacy
shape { "user_id": "…", "toolkits": ["gmail"] } is still accepted — each
toolkit becomes an app at full. When neither apps nor toolkits is given,
every connected app is bound at full. Re-binding replaces the agent’s app
set: apps no longer present are removed (their server row + binding deleted).
read/custom with an empty resolved tool set returns 400. DELETE with
?toolkit=<slug> removes one app; without it, removes all the agent’s Composio
apps.
Response (POST): 200 OK
200 OK
POST returns 404 for an unknown/foreign agent and 400 when Composio is
unconfigured or no apps resolve. CLI:
crewship integration composio {bind,unbind,bindings} <agent> --user <id> [--app toolkit[:mode[:t1,t2]]]….
Composio Connected-Account Management
Lifecycle operations on an existing connected account. TheaccountId is the
Composio account id surfaced by the inventory endpoint.
All three require workspace manage (OWNER/ADMIN) and return 400 when
Composio is unconfigured.
- revoke — de-authorizes the account at the provider. Its credentials are invalidated upstream; the user must re-connect before it can be used again.
- refresh — refreshes the account’s credentials (e.g. exchanging a refresh token for a new access token).
- delete — permanently removes the connected account at the provider.
204 No Content on success; 502 when Composio returns an error.
CLI: crewship integration composio account {revoke,refresh,remove} <account-id>.
Workspace Integrations
Workspace-level MCP server definitions available to all crews and agents.List Workspace Integrations
workspace_id is required).
Request: No body.
Response: 200 OK
Response Fields
Create Workspace Integration
OWNER or ADMIN role
Request Body:
201 Created — integration object (enabled defaults to true).
Get Workspace Integration
workspace_id is required).
Request: No body.
Response: 200 OK
Update Workspace Integration
OWNER or ADMIN role
All fields optional: display_name, transport, endpoint, command, args_json, env_json, config_json, icon, enabled.
Response: 200 OK
Delete Workspace Integration
OWNER or ADMIN role
Response: 200 OK
Test Workspace Integration
create capability (the route’s
roleCreate gate); workspace context is required.
Request: No body.
Tests the MCP server connection. For stdio transport the server is not actually launched (that only happens inside a container at runtime) — instead the config is statically validated (the command must tokenize to a single executable — a full launch line that splits into more than one token is rejected, while a quoted path containing spaces is fine; args_json must be a valid JSON string array), returning status: "ok" when well-formed or status: "error" otherwise. Tokenizing is quote-aware, matching the CLI/UI split rules (see the MCP guide). For streamable-http (also http/sse) an MCP initialize handshake is attempted via an SSRF-safe HTTP client (private/loopback IPs blocked).
Response: 200 OK
Crew Integrations
Crew-level MCP bindings — either standalone servers or overrides linked to a workspace integration. This tier also carries per-tool enable/disable state.All Crew Integrations
workspace_id is required).
Request: No body.
Cross-crew overview of all crew-level integration bindings.
Response: 200 OK — array of crew integration objects.
List Crew Integrations
workspace_id is required).
Request: No body.
Response: 200 OK — array of crew MCP server bindings.
Create Crew Integration
OWNER, ADMIN, or MANAGER role
Request Body:
Response:
201 Created — crew MCP server object.
Update Crew Integration
OWNER or ADMIN role
All fields optional: display_name, transport, endpoint, command, args_json, env_json, config_json, icon, enabled. Changing transport re-validates against the merged final endpoint/command.
Response: 200 OK — updated crew integration object.
Delete Crew Integration
OWNER or ADMIN role
Response: 200 OK
Test Crew Integration
create capability; workspace context
is required. Request: No body.
Same probe semantics as the workspace test endpoint.
Response: 200 OK — { status, message?, server_info? } (see Test Workspace Integration).
List Crew Integration Tools
mcp_tool_bindings). Only tools that have been toggled or
seen via Refresh have a row; a tool
with no row is treated as enabled by default. This endpoint does
not contact the MCP server.
Response: 200 OK — a JSON array of tool-binding objects (no wrapper).
Update Crew Integration Tool
enabled = true).
Wraps the crewship integration tool enable/disable CLI subcommands.
Auth: OWNER or ADMIN role (canRole(role, "manage"))
Request Body: provide at least one of the following fields.
200 OK — the upserted tool-binding object (same shape as the List entries).
Refresh Crew Integration Tools
mcp_tool_bindings rows for this crew server against a
tool list supplied in the request body (typically posted by the
frontend after a successful test-connection round-trip). The server
does not contact the MCP server itself: new tools are inserted
enabled = true, existing tools have their description refreshed but
their enabled state left untouched, and tools absent from the payload
are left in place (never auto-revoked). An empty list is a no-op.
Auth: OWNER or ADMIN role (canRole(role, "manage"))
Request Body:
200 OK
total is the number of entries in the request tools array.
Agent MCP Bindings
Agent bindings link MCP servers (workspace or crew level) to specific agents, optionally with credential overrides.List Agent Bindings
workspace_id is required).
Request: No body.
Response: 200 OK — array of agent MCP binding objects.
Create Agent Binding
OWNER, ADMIN, or MANAGER role
Request Body:
Response:
201 Created — binding object.
Update Agent Binding
OWNER, ADMIN, or MANAGER role
All fields optional: credential_id (empty string clears), cred_type, cred_header, env_var_name (empty string clears), enabled, config_override_json.
Response: 200 OK
Delete Agent Binding
OWNER, ADMIN, or MANAGER role
Response: 200 OK
Resolve Agent Integrations
404.
workspace_id is required; the agent must belong to that
workspace.
Response: 200 OK — a JSON array. The array is empty when the agent has no
effective enabled integrations. endpoint, command, args_json, env_json,
config_json, icon, credential_id, and credential_name are nullable;
credential values and other secret material are never returned.
MCP Tool Call Audit
internal/api/mcp_audit.go:69). Use the filters to scope to a single agent, server, status, or time window.
Auth: authenticated workspace member (authed + workspace context — internal/api/router_orchestration.go:416). workspace_id is required (internal/api/mcp_audit.go:38).
Query Parameters:
Response:
200 OK — a JSON array (empty [] when nothing matches — internal/api/mcp_audit.go:96-99).
OAuth Flow
OAuth 2.0 flow for connecting external services (GitHub, Slack, Google, etc.) and storing tokens as credentials.List OAuth Providers
200 OK
Request: No body.
Initiate OAuth Flow
MANAGER+ role, or a member with the credential.create capability.
Request Body:
redirect_uri is optional; when omitted, Crewship uses its backend callback.
Response: 200 OK
OAuth Callback
No authentication required — this endpoint uses the state token for validation instead.
code and state query parameters are required; error may be
returned by the provider.
Response: 200 OK is an HTML success page that closes the authorization
window. It is not a JSON endpoint.
Exchange Token
MANAGER+ role, or a member with the credential.create capability.
Request Body: credential_id and code are required; redirect_uri,
code_verifier, and state are optional. When state is supplied without a
code_verifier, the server recovers the stored PKCE verifier.
200 OK — { "status": "ok", "credential_id": "cred_oauth" }.
Loopback
MANAGER+ role, or a member with the credential.create capability.
Request Body: { "credential_id": "cred_oauth" }.
Response: 200 OK
Discover OAuth Endpoints
{ "mcp_url": "https://mcp.example.com" }.
Response: 200 OK — { "auth_url", "token_url", "registration_endpoint?", "scopes?", "supports_pkce", "supports_dcr" }.
Auto-Connect Integration
OWNER or ADMIN role.
Request Body:
mcp_url is required; server_name defaults to mcp-server and
provider_hint is optional. With dynamic client registration, the response is
{ "status": "authorize", "auth_url": "...", "credential_id": "..." }.
When client registration is unavailable it returns 200 with
status: "needs_client_id", auth_url, token_url, scopes, and a message
so the caller can collect a client ID.
MCP Registry
Public registry of MCP server definitions for easy discovery and installation.List Registry Entries
{servers, total, limit, offset}.
Query Parameters: limit (default 50, max 200), offset (default 0),
trust_tier (anthropic, crewship, or community), and featured
(true/false/1/0).
Response: 200 OK
Search Registry
{servers, total, limit, offset, query}.
Query Parameters: q, plus the same limit, offset, trust_tier, and
featured filters as List. An empty q behaves like List.
Response: 200 OK — { "servers": [], "total": 0, "limit": 50, "offset": 0, "query": "github" }.
Sync Registry
OWNER or ADMIN role on the workspace.
Request: no body. Response: JSON status envelope below.
Response: 202 Accepted — { "status": "sync_started", "message": "..." }.
Manual sync is limited to once per hour; a request during the cooldown returns
429.