# Side Space > Side Space is a shared drive for media teams. Every save is a version; every version can carry > JSON "sidecars" (tags, the AI prompt that made it, transcripts, media facts) and "renditions" > (thumbnail, 720p proxy). Programs and AI agents use the same HTTP API as the apps. ## Start here - API description (OpenAPI 3.1): /v1/openapi.yaml - Every operation with its scope and example calls: /v1/operations.json (JSON) or /llms-full.txt (plain text, with rules to paste into AGENTS.md or CLAUDE.md). - Errors: {"error":{"code","message","details"?,"request_id"}}. Match on code; on 429 or 503 wait Retry-After seconds; quote request_id (also the X-Request-Id header) when reporting a problem. - A helper (a subagent, a render job) gets its own narrower token: POST /v1/token/derive {"name","scopes"?,"space_ids"?,"expires_in_seconds"?}. Revoking a token ends the ones derived from it. - Authenticate with a personal access token: `Authorization: Bearer ssp_…`. A person makes one with `side token create NAME --scope files:read` (or in the app); it is shown once. Tokens carry scopes and belong to a space (the CLI's current one, or --space NAME; --all-spaces for a token that reaches every space). - A token made for one space reaches it without naming it: every /v1/spaces/{sid}/… path also answers at /v1/space/… (GET /v1/space is the space itself). Other credentials get 400 space_required there. - Scopes: files:read, files:write (includes read), sidecars:write (any namespace) or sidecars:write: (one, or a family with a trailing *), renditions:write, events:read, shares:manage, members:manage, webhooks:manage, runs:write, pipelines:manage, plugins:manage, comments:write, admin. - Apps acting for people use OAuth 2.1 (authorization code + PKCE S256): metadata at /.well-known/oauth-authorization-server; developers register with `side app create NAME --redirect URI [--confidential]`, or apps register themselves (RFC 7591). What a person grants becomes a token (scopes and spaces they picked; never admin), revocable like any token. - An agent (AI agent or service account) is a member of its own: `side agent create NAME`, add it to a space with its address, then `side token create NAME --agent ID`. Every change it makes is marked as an agent's in the journal (`actor_kind: "agent"`) and in the apps. ## MCP Connect an MCP client to `/mcp` on this server (streamable HTTP). Clients that support MCP authorization need nothing else: a 401 points them (WWW-Authenticate resource_metadata) to /.well-known/oauth-protected-resource/mcp and /.well-known/oauth-authorization-server; they register at /oauth/register, the person signs in and approves in the browser, and the client gets an hour-long token plus a refresh token. Other clients send `Authorization: Bearer ssp_…`. Tools: list_spaces, search, list_folder, describe_file (what a video or image is, from its metadata, without downloading it), read_text, write_text, get_sidecar, put_sidecar, list_versions, label_version, compare_versions, restore_version, recent_changes, recent_activity, list_members, list_actions, run_action (transcribe, tag or convert a file and wait for the result), get_run. The token's scopes and spaces apply to every tool, and tools/list shows only the tools the token may use. ## Common calls - List spaces: GET /v1/spaces - Find files by name, metadata and comments: GET /v1/search?q=words[&space=ID][&type=video|image|audio|folder|other][&mode=auto|keyword|meaning] When the server has an embeddings model, files close in meaning follow the word matches (matched: ["meaning"], score), so "q=two people arguing on a beach" works. Hits in a transcript, a timed comment or a piece of transcript close in meaning carry moments: [{at_ms, until_ms, text, source}]. - Sandbox (fork): POST /v1/spaces/{sid}/forks {"name","path"?} makes a new drive of the same space sharing the files (instant, no copies; same members and plan, same workspace_id); work in it, GET /v1/spaces/{fork}/fork/changes, POST /v1/spaces/{fork}/fork/apply {"paths"?,"force"?,"dry_run"?}. A token for the space reaches its forks; to keep an agent to one fork, give it a token with drive_ids: [fork]. MCP: fork_space, fork_changes, apply_fork. - S3 tools (aws cli, rclone, boto3, any AWS SDK): `side token create NAME --scope files:write --s3` prints an access key id (SSAK…) and secret; point the tool at the server's S3 endpoint (port 8070 by default) with path-style addressing. Bucket = space (its name in lower case, spaces as dashes, or its id), key = path. Puts make versions, deletes go to the trash, multipart and presigned URLs work. - Browse: GET /v1/spaces/{sid}/nodes/{nid}/children (the root is the space's root_node_id) - Find by path: GET /v1/spaces/{sid}/paths/Ep01/Shots/a.mov - Versions: GET /v1/spaces/{sid}/nodes/{nid}/versions. Name one ("Client cut") with PUT /v1/spaces/{sid}/versions/{vid}/label {"label"}; a name belongs to one version of a file at a time. What changed: GET /v1/spaces/{sid}/versions/{a}/compare/{b} (bytes shared, media facts and sidecars that differ). The MCP tools take a version id, number or name. - Read a version's metadata: GET /v1/spaces/{sid}/versions/{vid}/sidecars - Write your results: PUT /v1/spaces/{sid}/versions/{vid}/sidecars/{ns} with {"doc": {…}}. Custom namespaces start with "x-" (e.g. x-acme.qc). A space manager can make a namespace writable by one member only (PUT /v1/spaces/{sid}/namespaces/{ns}). - Follow changes: GET /v1/spaces/{sid}/journal?after=SEQ (each entry has op, node, actor_kind), or the /v1/ws WebSocket for "something changed" signals, or `side events tail --json`. - Be told about changes: POST /v1/spaces/{sid}/webhooks {"url", "events", "path_glob", "mime_prefix"} (a space manager; tokens need webhooks:manage). Each event is one POST signed with `Side-Signature: t=…,v1=HMAC-SHA256(secret, "t.body")`, in order, retried until it gets a 2xx. - File bytes: POST /v1/spaces/{sid}/download-tickets returns a manifest and a ticket for the block gateway; the CLI (`side get`, `side put`) does this for you. ## Actions (AI and conversions) - What this server can do to files: GET /v1/spaces/{sid}/actions. First-party actions: side.transcribe (speech to timed text, into the "transcript" sidecar), side.tags (a vision model describes and tags a video or image, into "ai.tags"), side.convert (ffmpeg presets: mp4, webm, prores-proxy, wav, mp3, jpg, png, webp, gif; a new file next to the source). - Run one: POST /v1/spaces/{sid}/runs {"action", "path" (or version_id/node_id), "params"} (tokens need runs:write), then GET /v1/spaces/{sid}/runs/{rid} until state is done or failed. Results are cached by content: the same bytes with the same params answer at once (`cached: true`, and free); pass "fresh": true to run again. - Plans: each space has its own plan, limiting storage, file size, members and AI runs a month. A refusal is HTTP 402 with code quota_exceeded and a message saying which limit and when it renews: tell the person, don't retry. GET /v1/spaces/{sid}/plan shows limits and what was used. - Before running, read the file's sidecars: a transcript or tags may already be there. - Pipelines run an action on every new matching file: POST /v1/spaces/{sid}/pipelines {"name", "action", "params", "path_glob", "mime_prefix", "conditions", "after"} (a space manager; tokens need pipelines:manage); POST …/pipelines/{pid}/backfill does the files already there. conditions: min_size, max_size, min_duration_s, max_duration_s, min_width, min_height, has_audio. after: an action name; the pipeline then starts when that action finishes on a matching file instead of on save. Ready-made sets: GET /v1/spaces/{sid}/pipeline-templates, POST …/pipeline-templates/{id} {"path_glob", "backfill"}. - Plugins add third-party actions (x-vendor.plugin.action): POST /v1/spaces/{sid}/plugins {"manifest_url"} (a space manager; tokens need plugins:manage). A plugin is an HTTPS service that receives signed jobs and answers with sidecars and files; see /v1/openapi.yaml (PluginManifest, PluginJob, PluginResult). With "runtime": "runner" it has no endpoint: `side runner --plugin ID --secret S -- ./tool` (or any program calling POST /v1/plugin-runs/claim) takes its jobs on a machine of your own, e.g. with local models. ## Organizations and folder rules - A space may belong to an organization (GET /v1/orgs, /v1/orgs/{oid}/members, /spaces). Each member has one role in it, their own (there are no team groups). - Folders can limit or widen who may change what inside (never who sees it): GET /v1/spaces/{sid}/nodes/{nid}/access says your role at a file or folder and which folder decides it. A 403 on a write inside a folder with rules names the role it needs: tell the person rather than retrying, or write somewhere you may. - Audit export for organization admins: GET /v1/orgs/{oid}/audit?since=&until=&format=jsonl|csv (tokens need admin). ## Review comments - People leave review notes on files, often at a moment of a video: GET /v1/spaces/{sid}/nodes/{nid}/comments gives threads (at_ms = milliseconds into the media, region = a rectangle of the frame as fractions, replies nested). Add ?resolved=1 for done ones. - Answer or act on them: POST …/nodes/{nid}/comments {"body", "at_ms", "parent_id"} (tokens need comments:write); PATCH /v1/spaces/{sid}/comments/{cid} {"resolved": true} once fixed. - MCP tools: list_comments, add_comment, resolve_comment. Webhook events comment.created and comment.updated carry the comment. ## SDKs TypeScript (`@sidespace/sdk`), Python (`sidespace`), Go (`github.com/blendduck/sidespace/sdks/go`) and Rust (`sidespace`), passing one shared test suite: by-path upload, download (byte ranges), versions, edits (binary bodies for large ones), sidecars, search, `changes()`, webhook signature checks, and `run(space, path, action, params)` that waits for the result. ## Rules for agents - Writes never destroy: a save makes a new version, and any version can be restored. - Prefer writing results to a sidecar over writing new files next to the original. - Ask a person before deleting, moving many files, or changing members and shares.