{
  "about": "Every Side Space API operation with the token scope it needs and ready-to-adapt calls. Generated from /v1/openapi.yaml.",
  "auth": "Authorization: Bearer ssp_… (a personal access token) unless auth is \"none\".",
  "errors": "Errors are {\"error\":{\"code\",\"message\",\"details\"?,\"request_id\"}}; match on code. 429 and 503 carry Retry-After.",
  "operations": [
    {
      "id": "GET /chunks/{hash}",
      "method": "GET",
      "path": "/chunks/{hash}",
      "tag": "blockgw",
      "summary": "Download one chunk as plaintext (get ticket)",
      "auth": "none",
      "params": [
        {
          "name": "hash",
          "in": "path",
          "required": true,
          "type": "Hash"
        },
        {
          "name": "t",
          "in": "query",
          "required": true,
          "type": "string",
          "about": "Ticket from upload-sessions or download-tickets"
        }
      ],
      "returns": "200 string",
      "examples": {
        "curl": "curl \"$SIDESPACE_URL/chunks/$HASH\""
      }
    },
    {
      "id": "PUT /chunks/{hash}",
      "method": "PUT",
      "path": "/chunks/{hash}",
      "tag": "blockgw",
      "summary": "Upload one chunk (put ticket). The gateway checks BLAKE3(body) == hash; an existing chunk answers 200 without rewriting.",
      "auth": "none",
      "params": [
        {
          "name": "hash",
          "in": "path",
          "required": true,
          "type": "Hash"
        },
        {
          "name": "t",
          "in": "query",
          "required": true,
          "type": "string",
          "about": "Ticket from upload-sessions or download-tickets"
        }
      ],
      "returns": "200 Already stored",
      "examples": {
        "curl": "curl -X PUT \"$SIDESPACE_URL/chunks/$HASH\""
      }
    },
    {
      "id": "POST /edit",
      "method": "POST",
      "path": "/edit",
      "tag": "blockgw",
      "summary": "Apply byte edits to the version the ticket names (a put ticket with manifest_hash, made by the server for POST …/edits) and return the new manifest. Only the chunks around the edits are read, chunked and stored.",
      "auth": "none",
      "params": [
        {
          "name": "t",
          "in": "query",
          "required": true,
          "type": "string",
          "about": "Ticket from upload-sessions or download-tickets"
        }
      ],
      "body": [
        {
          "name": "ops",
          "type": "object[]",
          "required": true,
          "about": "Sorted, non-overlapping, offsets in the old file"
        },
        {
          "name": "truncate",
          "type": "integer",
          "about": "Cut the result to this many bytes afterwards"
        }
      ],
      "returns": "200 Manifest",
      "examples": {
        "curl": "curl -X POST -H \"Content-Type: application/json\" -d '{\"ops\":[]}' \"$SIDESPACE_URL/edit\""
      }
    },
    {
      "id": "GET /files/{version_id}",
      "method": "GET",
      "path": "/files/{version_id}",
      "tag": "blockgw",
      "summary": "Whole file as a stream, with Range support (get ticket bound to this version). Only chunks overlapping the range are read.",
      "auth": "none",
      "params": [
        {
          "name": "version_id",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "t",
          "in": "query",
          "required": true,
          "type": "string",
          "about": "Ticket from upload-sessions or download-tickets"
        },
        {
          "name": "Range",
          "in": "header",
          "type": "string"
        },
        {
          "name": "download",
          "in": "query",
          "type": "string",
          "about": "File name for Content-Disposition attachment"
        }
      ],
      "returns": "200 Full body",
      "examples": {
        "curl": "curl \"$SIDESPACE_URL/files/$VERSION_ID\""
      }
    },
    {
      "id": "POST /internal/has",
      "method": "POST",
      "path": "/internal/has",
      "tag": "blockgw",
      "summary": "Internal only. Which of these chunks are missing in this space.",
      "auth": "token",
      "body": [
        {
          "name": "hashes",
          "type": "Hash[]",
          "required": true
        },
        {
          "name": "space_id",
          "type": "string",
          "required": true
        }
      ],
      "returns": "200 Missing",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"hashes\":[],\"space_id\":\"…\"}' \"$SIDESPACE_URL/internal/has\""
      }
    },
    {
      "id": "GET /internal/manifests/{hash}",
      "method": "GET",
      "path": "/internal/manifests/{hash}",
      "tag": "blockgw",
      "summary": "Internal only, served by sidespace-server for the gateway's /files stream.",
      "auth": "token",
      "params": [
        {
          "name": "hash",
          "in": "path",
          "required": true,
          "type": "Hash"
        }
      ],
      "returns": "200 Manifest",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/internal/manifests/$HASH\""
      }
    },
    {
      "id": "POST /stream-upload",
      "method": "POST",
      "path": "/stream-upload",
      "tag": "blockgw",
      "summary": "Upload a whole file; the gateway chunks and stores it and returns the manifest (put ticket)",
      "auth": "none",
      "params": [
        {
          "name": "t",
          "in": "query",
          "required": true,
          "type": "string",
          "about": "Ticket from upload-sessions or download-tickets"
        }
      ],
      "returns": "200 Manifest",
      "examples": {
        "curl": "curl -X POST \"$SIDESPACE_URL/stream-upload\""
      }
    },
    {
      "id": "GET /v1/agents",
      "method": "GET",
      "path": "/v1/agents",
      "tag": "developer",
      "summary": "Agents the caller made",
      "auth": "session",
      "returns": "200 Agents",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/agents\""
      }
    },
    {
      "id": "POST /v1/agents",
      "method": "POST",
      "path": "/v1/agents",
      "tag": "developer",
      "summary": "Make an agent (AI agent or service account). Add it to spaces by its email address, then make it a token with agent_id.",
      "auth": "session",
      "body": [
        {
          "name": "name",
          "type": "string",
          "required": true
        }
      ],
      "returns": "201 User",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"name\":\"…\"}' \"$SIDESPACE_URL/v1/agents\""
      }
    },
    {
      "id": "DELETE /v1/agents/{id}",
      "method": "DELETE",
      "path": "/v1/agents/{id}",
      "tag": "developer",
      "summary": "Retire an agent - revokes its tokens and takes it out of every space (its past changes stay attributed to it)",
      "auth": "session",
      "params": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "204 Retired",
      "examples": {
        "curl": "curl -X DELETE -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/agents/$ID\""
      }
    },
    {
      "id": "POST /v1/ai/chat",
      "method": "POST",
      "path": "/v1/ai/chat",
      "tag": "ai",
      "summary": "One chat turn with Side Space AI, answered as Server-Sent Events",
      "auth": "scope",
      "scopes": [
        "runs:write"
      ],
      "body": [
        {
          "name": "messages",
          "type": "AIChatMessage[]",
          "required": true,
          "about": "The whole conversation so far, oldest first; starts and ends with a user message"
        },
        {
          "name": "model",
          "type": "string",
          "about": "One of GET /v1/ai/models; default: the server's default"
        },
        {
          "name": "system",
          "type": "string",
          "about": "Instructions of the app's own"
        }
      ],
      "returns": "200 string",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"messages\":[]}' \"$SIDESPACE_URL/v1/ai/chat\""
      }
    },
    {
      "id": "GET /v1/ai/models",
      "method": "GET",
      "path": "/v1/ai/models",
      "tag": "ai",
      "summary": "Models Side Space AI offers on this server (none, and enabled false, without an Anthropic key)",
      "auth": "token",
      "returns": "200 AIModelList",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/ai/models\""
      }
    },
    {
      "id": "GET /v1/apps",
      "method": "GET",
      "path": "/v1/apps",
      "tag": "developer",
      "summary": "OAuth apps the caller registered (signed-in apps only)",
      "auth": "session",
      "returns": "200 Apps",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/apps\""
      }
    },
    {
      "id": "POST /v1/apps",
      "method": "POST",
      "path": "/v1/apps",
      "tag": "developer",
      "summary": "Register an OAuth app. People connect it at /oauth/authorize; it gets tokens at /oauth/token (see /.well-known/oauth-authorization-server). Apps can also register themselves at /oauth/register (RFC 7591, public clients only).",
      "auth": "session",
      "body": [
        {
          "name": "name",
          "type": "string",
          "required": true
        },
        {
          "name": "redirect_uris",
          "type": "string[]",
          "required": true,
          "about": "https, http on localhost (any port), or the app's own scheme"
        },
        {
          "name": "client_uri",
          "type": "string",
          "about": "https home page shown on the consent page"
        },
        {
          "name": "confidential",
          "type": "boolean",
          "about": "Server-side app: gets a client_secret (shown once); PKCE becomes optional"
        },
        {
          "name": "logo_uri",
          "type": "string"
        }
      ],
      "returns": "201 The app (and its secret, once)",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"name\":\"…\",\"redirect_uris\":[]}' \"$SIDESPACE_URL/v1/apps\""
      }
    },
    {
      "id": "DELETE /v1/apps/{id}",
      "method": "DELETE",
      "path": "/v1/apps/{id}",
      "tag": "developer",
      "summary": "Delete an app; every grant made to it stops working",
      "auth": "session",
      "params": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "204 Deleted",
      "examples": {
        "curl": "curl -X DELETE -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/apps/$ID\""
      }
    },
    {
      "id": "POST /v1/auth/desktop/approve",
      "method": "POST",
      "path": "/v1/auth/desktop/approve",
      "tag": "auth",
      "summary": "Approve a desktop sign-in as the signed-in person (sessions only; access tokens get 403)",
      "auth": "session",
      "body": [
        {
          "name": "handle",
          "type": "string",
          "required": true
        },
        {
          "name": "space_id",
          "type": "string",
          "about": "One of the caller's spaces, for the app to work in. Required when the sign-in has `choose_space` (400 `space_required` without it); 403 for a space the caller is not a member of"
        }
      ],
      "returns": "200 DesktopLogin",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"handle\":\"…\"}' \"$SIDESPACE_URL/v1/auth/desktop/approve\""
      }
    },
    {
      "id": "POST /v1/auth/desktop/info",
      "method": "POST",
      "path": "/v1/auth/desktop/info",
      "tag": "auth",
      "summary": "Describe a pending desktop sign-in to the person about to approve it (signed-in app or website session only)",
      "auth": "session",
      "body": [
        {
          "name": "handle",
          "type": "string",
          "required": true
        }
      ],
      "returns": "200 DesktopLogin",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"handle\":\"…\"}' \"$SIDESPACE_URL/v1/auth/desktop/info\""
      }
    },
    {
      "id": "POST /v1/auth/desktop/poll",
      "method": "POST",
      "path": "/v1/auth/desktop/poll",
      "tag": "auth",
      "summary": "Collect the desktop app's tokens once the sign-in was approved (once)",
      "auth": "none",
      "body": [
        {
          "name": "handle",
          "type": "string",
          "required": true
        }
      ],
      "returns": "200 TokenPair",
      "examples": {
        "curl": "curl -X POST -H \"Content-Type: application/json\" -d '{\"handle\":\"…\"}' \"$SIDESPACE_URL/v1/auth/desktop/poll\""
      }
    },
    {
      "id": "POST /v1/auth/desktop/start",
      "method": "POST",
      "path": "/v1/auth/desktop/start",
      "tag": "auth",
      "summary": "Start signing a desktop app in through the browser",
      "auth": "none",
      "body": [
        {
          "name": "choose_space",
          "type": "boolean",
          "about": "The app works in one space (the CLI): the person picks one of their spaces when approving, and the poll returns it as `space_id`"
        },
        {
          "name": "device_name",
          "type": "string",
          "about": "Shown to the person approving, e.g. \"Pat's MacBook Pro\""
        },
        {
          "name": "platform",
          "type": "string"
        }
      ],
      "returns": "200 DesktopStart",
      "examples": {
        "curl": "curl -X POST -H \"Content-Type: application/json\" -d '{}' \"$SIDESPACE_URL/v1/auth/desktop/start\""
      }
    },
    {
      "id": "POST /v1/auth/email/start",
      "method": "POST",
      "path": "/v1/auth/email/start",
      "tag": "auth",
      "summary": "Send a 6-digit sign-in code (dev servers accept 000000 and log the code)",
      "auth": "none",
      "body": [
        {
          "name": "email",
          "type": "string",
          "required": true
        },
        {
          "name": "link",
          "type": "string",
          "about": "A website page the mail links to; the address and the code are added, so a click signs in"
        }
      ],
      "returns": "200 Code sent",
      "examples": {
        "curl": "curl -X POST -H \"Content-Type: application/json\" -d '{\"email\":\"…\"}' \"$SIDESPACE_URL/v1/auth/email/start\""
      }
    },
    {
      "id": "POST /v1/auth/email/verify",
      "method": "POST",
      "path": "/v1/auth/email/verify",
      "tag": "auth",
      "summary": "Exchange the code for tokens and register this device",
      "auth": "none",
      "body": [
        {
          "name": "code",
          "type": "string",
          "required": true
        },
        {
          "name": "device_name",
          "type": "string",
          "required": true
        },
        {
          "name": "email",
          "type": "string",
          "required": true
        },
        {
          "name": "platform",
          "type": "string",
          "required": true
        },
        {
          "name": "display_name",
          "type": "string",
          "about": "Used when the account is created"
        },
        {
          "name": "share_token",
          "type": "string",
          "about": "The share link the person signed in from; a new account remembers it"
        }
      ],
      "returns": "200 TokenPair",
      "examples": {
        "curl": "curl -X POST -H \"Content-Type: application/json\" -d '{\"code\":\"…\",\"device_name\":\"…\",\"email\":\"…\",\"platform\":\"…\"}' \"$SIDESPACE_URL/v1/auth/email/verify\""
      }
    },
    {
      "id": "POST /v1/auth/google/collect",
      "method": "POST",
      "path": "/v1/auth/google/collect",
      "tag": "auth",
      "summary": "The tokens of a finished Google sign-in, once",
      "auth": "none",
      "body": [
        {
          "name": "handle",
          "type": "string",
          "required": true
        }
      ],
      "returns": "200 TokenPair",
      "examples": {
        "curl": "curl -X POST -H \"Content-Type: application/json\" -d '{\"handle\":\"…\"}' \"$SIDESPACE_URL/v1/auth/google/collect\""
      }
    },
    {
      "id": "POST /v1/auth/google/start",
      "method": "POST",
      "path": "/v1/auth/google/start",
      "tag": "auth",
      "summary": "Begin signing in with Google; send the browser to url. It comes back to return_to with ?handle= (or ?error=)",
      "auth": "none",
      "body": [
        {
          "name": "return_to",
          "type": "string",
          "required": true,
          "about": "A page on the website"
        },
        {
          "name": "device_name",
          "type": "string"
        },
        {
          "name": "platform",
          "type": "string"
        }
      ],
      "returns": "200 Started",
      "examples": {
        "curl": "curl -X POST -H \"Content-Type: application/json\" -d '{\"return_to\":\"…\"}' \"$SIDESPACE_URL/v1/auth/google/start\""
      }
    },
    {
      "id": "GET /v1/auth/methods",
      "method": "GET",
      "path": "/v1/auth/methods",
      "tag": "auth",
      "summary": "Which ways in this server offers (email codes always; Google when it has a client)",
      "auth": "none",
      "returns": "200 The methods",
      "examples": {
        "curl": "curl \"$SIDESPACE_URL/v1/auth/methods\""
      }
    },
    {
      "id": "POST /v1/auth/oauth/decide",
      "method": "POST",
      "path": "/v1/auth/oauth/decide",
      "tag": "auth",
      "summary": "Allow or deny an app's authorization request as the signed-in person (sessions only)",
      "auth": "session",
      "body": [
        {
          "name": "allow",
          "type": "boolean",
          "required": true
        },
        {
          "name": "request",
          "type": "string",
          "required": true
        },
        {
          "name": "permissions",
          "type": "string[]",
          "about": "Optional permissions turned on; reading is always granted"
        },
        {
          "name": "space_ids",
          "type": "string[]"
        }
      ],
      "returns": "200 Where to go next",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"allow\":false,\"request\":\"…\"}' \"$SIDESPACE_URL/v1/auth/oauth/decide\""
      }
    },
    {
      "id": "POST /v1/auth/oauth/info",
      "method": "POST",
      "path": "/v1/auth/oauth/info",
      "tag": "auth",
      "summary": "Describe an app's authorization request to the signed-in person (sessions only; access tokens get 403)",
      "auth": "session",
      "body": [
        {
          "name": "request",
          "type": "string",
          "required": true
        }
      ],
      "returns": "200 The request",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"request\":\"…\"}' \"$SIDESPACE_URL/v1/auth/oauth/info\""
      }
    },
    {
      "id": "POST /v1/auth/refresh",
      "method": "POST",
      "path": "/v1/auth/refresh",
      "tag": "auth",
      "summary": "Rotate the refresh token and get a new access token",
      "auth": "none",
      "body": [
        {
          "name": "refresh_token",
          "type": "string",
          "required": true
        }
      ],
      "returns": "200 TokenPair",
      "examples": {
        "curl": "curl -X POST -H \"Content-Type: application/json\" -d '{\"refresh_token\":\"…\"}' \"$SIDESPACE_URL/v1/auth/refresh\""
      }
    },
    {
      "id": "GET /v1/auth/sso/callback",
      "method": "GET",
      "path": "/v1/auth/sso/callback",
      "tag": "orgs",
      "summary": "Where the identity provider sends the browser back (an HTML page)",
      "auth": "none",
      "returns": "200 Signed in",
      "examples": {
        "curl": "curl \"$SIDESPACE_URL/v1/auth/sso/callback\""
      }
    },
    {
      "id": "POST /v1/auth/sso/poll",
      "method": "POST",
      "path": "/v1/auth/sso/poll",
      "tag": "orgs",
      "summary": "Collect the tokens once the browser came back (once)",
      "auth": "none",
      "body": [
        {
          "name": "handle",
          "type": "string",
          "required": true
        }
      ],
      "returns": "200 TokenPair",
      "examples": {
        "curl": "curl -X POST -H \"Content-Type: application/json\" -d '{\"handle\":\"…\"}' \"$SIDESPACE_URL/v1/auth/sso/poll\""
      }
    },
    {
      "id": "POST /v1/auth/sso/saml/{workspace_id}/acs",
      "method": "POST",
      "path": "/v1/auth/sso/saml/{workspace_id}/acs",
      "tag": "orgs",
      "summary": "Where a workspace's SAML identity provider posts its response (HTTP-POST binding; an HTML page)",
      "auth": "none",
      "params": [
        {
          "name": "workspace_id",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 Signed in",
      "examples": {
        "curl": "curl -X POST \"$SIDESPACE_URL/v1/auth/sso/saml/$WORKSPACE_ID/acs\""
      }
    },
    {
      "id": "GET /v1/auth/sso/saml/{workspace_id}/metadata",
      "method": "GET",
      "path": "/v1/auth/sso/saml/{workspace_id}/metadata",
      "tag": "orgs",
      "summary": "A workspace's SAML service provider metadata (its entity ID is this URL)",
      "auth": "none",
      "params": [
        {
          "name": "workspace_id",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 The metadata",
      "examples": {
        "curl": "curl \"$SIDESPACE_URL/v1/auth/sso/saml/$WORKSPACE_ID/metadata\""
      }
    },
    {
      "id": "POST /v1/auth/sso/start",
      "method": "POST",
      "path": "/v1/auth/sso/start",
      "tag": "orgs",
      "summary": "Start signing in through the organization that owns the address's domain (OpenID Connect)",
      "auth": "none",
      "body": [
        {
          "name": "email",
          "type": "string",
          "required": true
        },
        {
          "name": "device_name",
          "type": "string"
        },
        {
          "name": "platform",
          "type": "string"
        }
      ],
      "returns": "200 SSOStart",
      "examples": {
        "curl": "curl -X POST -H \"Content-Type: application/json\" -d '{\"email\":\"…\"}' \"$SIDESPACE_URL/v1/auth/sso/start\""
      }
    },
    {
      "id": "POST /v1/billing/stripe",
      "method": "POST",
      "path": "/v1/billing/stripe",
      "tag": "billing",
      "summary": "Stripe's webhook endpoint (checked by its Stripe-Signature header)",
      "auth": "none",
      "params": [
        {
          "name": "Stripe-Signature",
          "in": "header",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 Received",
      "examples": {
        "curl": "curl -X POST \"$SIDESPACE_URL/v1/billing/stripe\""
      }
    },
    {
      "id": "GET /v1/devices",
      "method": "GET",
      "path": "/v1/devices",
      "tag": "auth",
      "summary": "My devices",
      "auth": "session",
      "returns": "200 Devices",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/devices\""
      }
    },
    {
      "id": "DELETE /v1/devices/{id}",
      "method": "DELETE",
      "path": "/v1/devices/{id}",
      "tag": "auth",
      "summary": "Revoke a device (its refresh token stops working at once)",
      "auth": "session",
      "params": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "204 Revoked",
      "examples": {
        "curl": "curl -X DELETE -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/devices/$ID\""
      }
    },
    {
      "id": "POST /v1/diagnostics/reports",
      "method": "POST",
      "path": "/v1/diagnostics/reports",
      "tag": "auth",
      "summary": "Send a failure report from a desktop app (when the person turned reports on)",
      "auth": "session",
      "body": [
        {
          "name": "kind",
          "type": "string",
          "required": true,
          "about": "mount, upload or download"
        },
        {
          "name": "message",
          "type": "string",
          "required": true
        },
        {
          "name": "app_version",
          "type": "string"
        },
        {
          "name": "detail",
          "type": "string"
        },
        {
          "name": "device",
          "type": "string"
        },
        {
          "name": "log_tail",
          "type": "string"
        },
        {
          "name": "os",
          "type": "string"
        }
      ],
      "returns": "204 Done",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"kind\":\"…\",\"message\":\"…\"}' \"$SIDESPACE_URL/v1/diagnostics/reports\""
      }
    },
    {
      "id": "GET /v1/facets",
      "method": "GET",
      "path": "/v1/facets",
      "tag": "search",
      "summary": "What a search can filter, count and sort by, named, and names for the sidecar namespaces (the library's tabs)",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "spaces",
          "in": "query",
          "type": "string",
          "about": "Comma-separated space ids; default every space of the caller"
        }
      ],
      "returns": "200 Fields and namespaces",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/facets\""
      }
    },
    {
      "id": "POST /v1/feedback",
      "method": "POST",
      "path": "/v1/feedback",
      "tag": "auth",
      "summary": "Send feedback from a desktop app (Send Feedback; a signed-in app's session, not an access token)",
      "auth": "session",
      "body": [
        {
          "name": "message",
          "type": "string",
          "required": true
        },
        {
          "name": "app_version",
          "type": "string"
        },
        {
          "name": "device_model",
          "type": "string"
        },
        {
          "name": "drive_id",
          "type": "string"
        },
        {
          "name": "email",
          "type": "string"
        },
        {
          "name": "kind",
          "type": "string"
        },
        {
          "name": "locale",
          "type": "string"
        },
        {
          "name": "log",
          "type": "string"
        },
        {
          "name": "os_version",
          "type": "string"
        },
        {
          "name": "screenshots",
          "type": "object[]"
        },
        {
          "name": "workspace_id",
          "type": "string"
        }
      ],
      "returns": "201 Received",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"message\":\"…\"}' \"$SIDESPACE_URL/v1/feedback\""
      }
    },
    {
      "id": "GET /v1/llms-full.txt",
      "method": "GET",
      "path": "/v1/llms-full.txt",
      "tag": "developer",
      "summary": "The agent guide (/llms.txt), rules to paste into AGENTS.md or CLAUDE.md, and every operation in plain text (no auth)",
      "auth": "none",
      "returns": "200 string",
      "examples": {
        "curl": "curl \"$SIDESPACE_URL/v1/llms-full.txt\""
      }
    },
    {
      "id": "GET /v1/me",
      "method": "GET",
      "path": "/v1/me",
      "tag": "auth",
      "summary": "The signed-in user",
      "auth": "token",
      "returns": "200 User",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/me\""
      }
    },
    {
      "id": "GET /v1/notifications",
      "method": "GET",
      "path": "/v1/notifications",
      "tag": "notifications",
      "summary": "",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "unread",
          "in": "query",
          "type": "boolean"
        },
        {
          "name": "cursor",
          "in": "query",
          "type": "string"
        },
        {
          "name": "limit",
          "in": "query",
          "type": "integer"
        }
      ],
      "returns": "200 NotificationPage",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/notifications\""
      }
    },
    {
      "id": "POST /v1/notifications/{id}/read",
      "method": "POST",
      "path": "/v1/notifications/{id}/read",
      "tag": "notifications",
      "summary": "",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "204 Marked read",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/notifications/$ID/read\""
      }
    },
    {
      "id": "GET /v1/openapi.yaml",
      "method": "GET",
      "path": "/v1/openapi.yaml",
      "tag": "developer",
      "summary": "This API description (no auth)",
      "auth": "none",
      "returns": "200 string",
      "examples": {
        "curl": "curl \"$SIDESPACE_URL/v1/openapi.yaml\""
      }
    },
    {
      "id": "GET /v1/operations.json",
      "method": "GET",
      "path": "/v1/operations.json",
      "tag": "developer",
      "summary": "Every operation with the scope it needs and example calls (curl, and TypeScript, Python, CLI and MCP where they exist), generated from this description (no auth)",
      "auth": "none",
      "returns": "200 Operations",
      "examples": {
        "curl": "curl \"$SIDESPACE_URL/v1/operations.json\""
      }
    },
    {
      "id": "GET /v1/orgs",
      "method": "GET",
      "path": "/v1/orgs",
      "tag": "orgs",
      "summary": "Your organizations",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "returns": "200 Organizations",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/orgs\""
      }
    },
    {
      "id": "POST /v1/orgs",
      "method": "POST",
      "path": "/v1/orgs",
      "tag": "orgs",
      "summary": "Make an organization with you as its owner (people only; tokens need admin)",
      "auth": "scope",
      "scopes": [
        "admin"
      ],
      "body": [
        {
          "name": "name",
          "type": "string",
          "required": true
        }
      ],
      "returns": "201 Org",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"name\":\"…\"}' \"$SIDESPACE_URL/v1/orgs\""
      }
    },
    {
      "id": "GET /v1/orgs/{oid}",
      "method": "GET",
      "path": "/v1/orgs/{oid}",
      "tag": "orgs",
      "summary": "",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "oid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 Org",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/orgs/$OID\""
      }
    },
    {
      "id": "PATCH /v1/orgs/{oid}",
      "method": "PATCH",
      "path": "/v1/orgs/{oid}",
      "tag": "orgs",
      "summary": "Rename (an admin)",
      "auth": "scope",
      "scopes": [
        "admin"
      ],
      "params": [
        {
          "name": "oid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "name",
          "type": "string",
          "required": true
        }
      ],
      "returns": "200 Org",
      "examples": {
        "curl": "curl -X PATCH -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"name\":\"…\"}' \"$SIDESPACE_URL/v1/orgs/$OID\""
      }
    },
    {
      "id": "GET /v1/orgs/{oid}/audit",
      "method": "GET",
      "path": "/v1/orgs/{oid}/audit",
      "tag": "orgs",
      "summary": "Audit export (an admin; tokens need admin), oldest first, at most 200 000 records",
      "auth": "scope",
      "scopes": [
        "admin"
      ],
      "params": [
        {
          "name": "oid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "since",
          "in": "query",
          "type": "string",
          "about": "RFC 3339 or YYYY-MM-DD; default 30 days before until"
        },
        {
          "name": "until",
          "in": "query",
          "type": "string",
          "about": "Default now"
        },
        {
          "name": "format",
          "in": "query",
          "type": "string"
        }
      ],
      "returns": "200 AuditRecord",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/orgs/$OID/audit\""
      }
    },
    {
      "id": "GET /v1/orgs/{oid}/members",
      "method": "GET",
      "path": "/v1/orgs/{oid}/members",
      "tag": "orgs",
      "summary": "",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "oid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 People",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/orgs/$OID/members\""
      }
    },
    {
      "id": "POST /v1/orgs/{oid}/members",
      "method": "POST",
      "path": "/v1/orgs/{oid}/members",
      "tag": "orgs",
      "summary": "Add someone by email (an admin; only an owner adds owners)",
      "auth": "scope",
      "scopes": [
        "members:manage"
      ],
      "params": [
        {
          "name": "oid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "email",
          "type": "string",
          "required": true
        },
        {
          "name": "role",
          "type": "OrgRole"
        }
      ],
      "returns": "201 OrgMember",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"email\":\"…\"}' \"$SIDESPACE_URL/v1/orgs/$OID/members\""
      }
    },
    {
      "id": "PATCH /v1/orgs/{oid}/members/{uid}",
      "method": "PATCH",
      "path": "/v1/orgs/{oid}/members/{uid}",
      "tag": "orgs",
      "summary": "Change a role (an admin; owners by an owner). The last owner stays.",
      "auth": "scope",
      "scopes": [
        "members:manage"
      ],
      "params": [
        {
          "name": "oid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "uid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "role",
          "type": "OrgRole",
          "required": true
        }
      ],
      "returns": "204 Done",
      "examples": {
        "curl": "curl -X PATCH -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"role\":{}}' \"$SIDESPACE_URL/v1/orgs/$OID/members/$UID\""
      }
    },
    {
      "id": "DELETE /v1/orgs/{oid}/members/{uid}",
      "method": "DELETE",
      "path": "/v1/orgs/{oid}/members/{uid}",
      "tag": "orgs",
      "summary": "Remove someone (an admin, or themself).",
      "auth": "scope",
      "scopes": [
        "members:manage"
      ],
      "params": [
        {
          "name": "oid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "uid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "204 Done",
      "examples": {
        "curl": "curl -X DELETE -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/orgs/$OID/members/$UID\""
      }
    },
    {
      "id": "GET /v1/orgs/{oid}/spaces",
      "method": "GET",
      "path": "/v1/orgs/{oid}/spaces",
      "tag": "orgs",
      "summary": "The organization's spaces (admins see all, members the ones they are in)",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "oid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 Spaces",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/orgs/$OID/spaces\""
      }
    },
    {
      "id": "GET /v1/orgs/{oid}/sso",
      "method": "GET",
      "path": "/v1/orgs/{oid}/sso",
      "tag": "orgs",
      "summary": "Single sign-on settings (an admin). A 404 still names the redirect URI and the DNS proof.",
      "auth": "scope",
      "scopes": [
        "admin"
      ],
      "params": [
        {
          "name": "oid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 SSOConfig",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/orgs/$OID/sso\""
      }
    },
    {
      "id": "PUT /v1/orgs/{oid}/sso",
      "method": "PUT",
      "path": "/v1/orgs/{oid}/sso",
      "tag": "orgs",
      "summary": "Connect an OpenID Connect provider for email domains (an owner)",
      "auth": "scope",
      "scopes": [
        "admin"
      ],
      "params": [
        {
          "name": "oid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "domains",
          "type": "string[]",
          "required": true
        },
        {
          "name": "client_id",
          "type": "string"
        },
        {
          "name": "client_secret",
          "type": "string"
        },
        {
          "name": "domain_proof",
          "type": "string",
          "about": "Value of the DNS TXT record _sidespace.\u003cdomain\u003e"
        },
        {
          "name": "idp_certificate_expires_at",
          "about": "SAML: when the soonest signing certificate in the metadata expires"
        },
        {
          "name": "idp_metadata",
          "type": "string",
          "about": "SAML: the identity provider's metadata XML"
        },
        {
          "name": "idp_metadata_url",
          "type": "string",
          "about": "SAML: where to fetch the metadata (https; fetched again daily)"
        },
        {
          "name": "idp_sso_url",
          "type": "string",
          "about": "SAML: the sign-in URL the metadata names (HTTP-Redirect)"
        },
        {
          "name": "issuer",
          "type": "string",
          "about": "OpenID Connect: the issuer URL. SAML: the identity provider's entity ID, read from its metadata"
        },
        {
          "name": "protocol",
          "type": "string"
        },
        {
          "name": "redirect_uri",
          "type": "string",
          "about": "Register it with the provider"
        },
        {
          "name": "required",
          "type": "boolean",
          "about": "Email codes stop working for these domains"
        },
        {
          "name": "saml_acs_url",
          "type": "string",
          "about": "SAML: the assertion consumer service URL (HTTP-POST) to register"
        },
        {
          "name": "saml_entity_id",
          "type": "string",
          "about": "SAML: the service provider entity ID (and metadata URL) to register"
        },
        {
          "name": "updated_at",
          "type": "Timestamp"
        }
      ],
      "returns": "200 SSOConfig",
      "examples": {
        "curl": "curl -X PUT -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"domains\":[]}' \"$SIDESPACE_URL/v1/orgs/$OID/sso\""
      }
    },
    {
      "id": "DELETE /v1/orgs/{oid}/sso",
      "method": "DELETE",
      "path": "/v1/orgs/{oid}/sso",
      "tag": "orgs",
      "summary": "Turn single sign-on off (an owner); email codes work again",
      "auth": "scope",
      "scopes": [
        "admin"
      ],
      "params": [
        {
          "name": "oid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "204 Done",
      "examples": {
        "curl": "curl -X DELETE -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/orgs/$OID/sso\""
      }
    },
    {
      "id": "GET /v1/orgs/{oid}/storage",
      "method": "GET",
      "path": "/v1/orgs/{oid}/storage",
      "tag": "storage",
      "summary": "The organization's storage (members; the access key only for admins)",
      "auth": "session",
      "params": [
        {
          "name": "oid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 Profiles",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/orgs/$OID/storage\""
      }
    },
    {
      "id": "POST /v1/orgs/{oid}/storage",
      "method": "POST",
      "path": "/v1/orgs/{oid}/storage",
      "tag": "storage",
      "summary": "Add a bucket to the organization (admins); checked like a personal one. Change or remove it at /v1/orgs/{oid}/storage/{id} or /v1/storage/{id}.",
      "auth": "session",
      "params": [
        {
          "name": "oid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "access_key",
          "type": "string"
        },
        {
          "name": "addressing",
          "type": "string",
          "about": "Override the provider's"
        },
        {
          "name": "bucket",
          "type": "string"
        },
        {
          "name": "endpoint",
          "type": "string",
          "about": "https URL of an S3-compatible service; empty for AWS S3. For r2 the account ID is enough; for oss, cos, b2 and wasabi the region is."
        },
        {
          "name": "kind",
          "type": "string"
        },
        {
          "name": "name",
          "type": "string"
        },
        {
          "name": "prefix",
          "type": "string"
        },
        {
          "name": "provider",
          "type": "StorageProvider",
          "about": "Fills in endpoint, region and addressing; guessed from the endpoint when absent"
        },
        {
          "name": "region",
          "type": "string",
          "about": "For AWS, asked from AWS when empty or wrong; us-east-1 for others when empty"
        },
        {
          "name": "secret_key",
          "type": "string",
          "about": "Stored sealed; never returned. Required with access_key: the gateway never lends its own credentials."
        }
      ],
      "returns": "201 StorageProfile",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{}' \"$SIDESPACE_URL/v1/orgs/$OID/storage\""
      }
    },
    {
      "id": "GET /v1/orgs/{oid}/storage/moves",
      "method": "GET",
      "path": "/v1/orgs/{oid}/storage/moves",
      "tag": "storage",
      "summary": "Moves of the organization's spaces, those under way first (admins)",
      "auth": "session",
      "params": [
        {
          "name": "oid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 Moves",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/orgs/$OID/storage/moves\""
      }
    },
    {
      "id": "POST /v1/orgs/{oid}/storage/moves",
      "method": "POST",
      "path": "/v1/orgs/{oid}/storage/moves",
      "tag": "storage",
      "summary": "Move every space whose files are not in the organization's storage to its default storage (admins). Empty spaces switch at once.",
      "auth": "session",
      "params": [
        {
          "name": "oid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "remove_source",
          "type": "boolean"
        }
      ],
      "returns": "201 Moves started",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{}' \"$SIDESPACE_URL/v1/orgs/$OID/storage/moves\""
      }
    },
    {
      "id": "GET /v1/orgs/{oid}/storage/policy",
      "method": "GET",
      "path": "/v1/orgs/{oid}/storage/policy",
      "tag": "storage",
      "summary": "Where the organization's spaces keep their files",
      "auth": "session",
      "params": [
        {
          "name": "oid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 OrgStoragePolicy",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/orgs/$OID/storage/policy\""
      }
    },
    {
      "id": "PATCH /v1/orgs/{oid}/storage/policy",
      "method": "PATCH",
      "path": "/v1/orgs/{oid}/storage/policy",
      "tag": "storage",
      "summary": "Set the default storage for new spaces and whether every space must use the organization's storage (admins). Requiring needs a default.",
      "auth": "session",
      "params": [
        {
          "name": "oid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "default_storage_id",
          "type": "string",
          "about": "One of the organization's storage, or empty for the server's own"
        },
        {
          "name": "required",
          "type": "boolean"
        }
      ],
      "returns": "200 OrgStoragePolicy",
      "examples": {
        "curl": "curl -X PATCH -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{}' \"$SIDESPACE_URL/v1/orgs/$OID/storage/policy\""
      }
    },
    {
      "id": "GET /v1/plans",
      "method": "GET",
      "path": "/v1/plans",
      "tag": "billing",
      "summary": "The server's public plans (no auth)",
      "auth": "none",
      "returns": "200 Plans",
      "examples": {
        "curl": "curl \"$SIDESPACE_URL/v1/plans\""
      }
    },
    {
      "id": "POST /v1/plugin-runs/claim",
      "method": "POST",
      "path": "/v1/plugin-runs/claim",
      "tag": "developer",
      "summary": "A runner claims the oldest waiting job of a runner plugin (ADR 0022). Authorization: Bearer \u003cplugin id\u003e:\u003csigning secret\u003e. The job is a PluginJob with a fresh callback token and input URL; complete it with the /v1/plugin-runs/{rid}/… calls.",
      "auth": "none",
      "params": [
        {
          "name": "wait",
          "in": "query",
          "type": "integer",
          "about": "Seconds to wait for a job (long poll)"
        }
      ],
      "returns": "200 A job",
      "examples": {
        "curl": "curl -X POST \"$SIDESPACE_URL/v1/plugin-runs/claim\""
      }
    },
    {
      "id": "POST /v1/plugin-runs/{rid}/complete",
      "method": "POST",
      "path": "/v1/plugin-runs/{rid}/complete",
      "tag": "developer",
      "summary": "Finish a run the plugin answered with 202 (or a device claimed), with its result or an error. A device may write only the sidecars its action writes; {\"error\", \"retry\": true} puts a device's run back to waiting.",
      "auth": "scope",
      "scopes": [
        "admin"
      ],
      "params": [
        {
          "name": "rid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "error",
          "type": "string",
          "about": "On complete: the run failed"
        },
        {
          "name": "files",
          "type": "object[]"
        },
        {
          "name": "retry",
          "type": "boolean",
          "about": "With error: try another attempt"
        },
        {
          "name": "sidecars",
          "type": "object",
          "about": "namespace → document, only namespaces the action declares"
        }
      ],
      "returns": "200 Run",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{}' \"$SIDESPACE_URL/v1/plugin-runs/$RID/complete\""
      }
    },
    {
      "id": "POST /v1/plugin-runs/{rid}/progress",
      "method": "POST",
      "path": "/v1/plugin-runs/{rid}/progress",
      "tag": "developer",
      "summary": "A plugin (or a device, ADR 0059) reports how far a run has got. For a device's run it also renews the hold.",
      "auth": "scope",
      "scopes": [
        "admin"
      ],
      "params": [
        {
          "name": "rid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "progress",
          "type": "number",
          "required": true
        },
        {
          "name": "eta_s",
          "type": "number",
          "about": "Seconds it expects to need still; shown on the run as eta_at"
        },
        {
          "name": "stage",
          "type": "string",
          "about": "The step it is at, e.g. transcribe, describe; shown on the run as stage"
        }
      ],
      "returns": "204 Recorded",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"progress\":0}' \"$SIDESPACE_URL/v1/plugin-runs/$RID/progress\""
      }
    },
    {
      "id": "POST /v1/plugin-runs/{rid}/upload",
      "method": "POST",
      "path": "/v1/plugin-runs/{rid}/upload",
      "tag": "developer",
      "summary": "A ticket to upload a new file's bytes into the run's space (POST them to the gateway's /stream-upload, which answers with the manifest)",
      "auth": "scope",
      "scopes": [
        "admin"
      ],
      "params": [
        {
          "name": "rid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 UploadSession",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/plugin-runs/$RID/upload\""
      }
    },
    {
      "id": "GET /v1/public/shares/{token}",
      "method": "GET",
      "path": "/v1/public/shares/{token}",
      "tag": "shares",
      "summary": "A share link as its visitor sees it (a bearer token, when sent, says who is looking)",
      "auth": "none",
      "params": [
        {
          "name": "token",
          "in": "path",
          "required": true,
          "type": "string",
          "about": "The token at the end of a share link"
        },
        {
          "name": "X-Share-Key",
          "in": "header",
          "type": "string",
          "about": "A password-protected link's key, from /unlock"
        },
        {
          "name": "open",
          "in": "query",
          "type": "string"
        }
      ],
      "returns": "200 PublicShare",
      "examples": {
        "curl": "curl \"$SIDESPACE_URL/v1/public/shares/$TOKEN\""
      }
    },
    {
      "id": "POST /v1/public/shares/{token}/files",
      "method": "POST",
      "path": "/v1/public/shares/{token}/files",
      "tag": "shares",
      "summary": "Finish sending a file - the gateway's manifest becomes a new file (a request puts it in a folder named after the sender)",
      "auth": "none",
      "params": [
        {
          "name": "token",
          "in": "path",
          "required": true,
          "type": "string",
          "about": "The token at the end of a share link"
        },
        {
          "name": "X-Share-Key",
          "in": "header",
          "type": "string",
          "about": "A password-protected link's key, from /unlock"
        }
      ],
      "body": [
        {
          "name": "manifest",
          "type": "Manifest",
          "required": true
        },
        {
          "name": "name",
          "type": "string",
          "required": true
        },
        {
          "name": "client_mtime",
          "type": "Timestamp"
        },
        {
          "name": "mime",
          "type": "string"
        },
        {
          "name": "parent_id",
          "type": "string"
        }
      ],
      "returns": "201 The new file",
      "examples": {
        "curl": "curl -X POST -H \"Content-Type: application/json\" -d '{\"manifest\":{},\"name\":\"…\"}' \"$SIDESPACE_URL/v1/public/shares/$TOKEN/files\""
      }
    },
    {
      "id": "GET /v1/public/shares/{token}/nodes/{nid}",
      "method": "GET",
      "path": "/v1/public/shares/{token}/nodes/{nid}",
      "tag": "shares",
      "summary": "A file or folder under the link, with a folder's contents or a review link's comments",
      "auth": "none",
      "params": [
        {
          "name": "token",
          "in": "path",
          "required": true,
          "type": "string",
          "about": "The token at the end of a share link"
        },
        {
          "name": "nid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "X-Share-Key",
          "in": "header",
          "type": "string",
          "about": "A password-protected link's key, from /unlock"
        }
      ],
      "returns": "200 PublicShareNode",
      "examples": {
        "curl": "curl \"$SIDESPACE_URL/v1/public/shares/$TOKEN/nodes/$NID\""
      }
    },
    {
      "id": "POST /v1/public/shares/{token}/nodes/{nid}/comments",
      "method": "POST",
      "path": "/v1/public/shares/{token}/nodes/{nid}/comments",
      "tag": "shares",
      "summary": "Comment on a file of a review link, as the signed-in visitor (401 login_required without a token)",
      "auth": "none",
      "params": [
        {
          "name": "token",
          "in": "path",
          "required": true,
          "type": "string",
          "about": "The token at the end of a share link"
        },
        {
          "name": "nid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "X-Share-Key",
          "in": "header",
          "type": "string",
          "about": "A password-protected link's key, from /unlock"
        }
      ],
      "body": [
        {
          "name": "body",
          "type": "string",
          "required": true
        },
        {
          "name": "at_ms",
          "type": "integer"
        },
        {
          "name": "parent_id",
          "type": "string",
          "about": "Reply to this comment (a reply to a reply joins the same thread)"
        },
        {
          "name": "region",
          "type": "Region"
        },
        {
          "name": "until_ms",
          "type": "integer",
          "about": "Needs at_ms; not before it"
        },
        {
          "name": "version_id",
          "type": "string",
          "about": "The version being looked at (default: the current one)"
        }
      ],
      "returns": "201 Comment",
      "examples": {
        "curl": "curl -X POST -H \"Content-Type: application/json\" -d '{\"body\":\"…\"}' \"$SIDESPACE_URL/v1/public/shares/$TOKEN/nodes/$NID/comments\""
      }
    },
    {
      "id": "GET /v1/public/shares/{token}/nodes/{nid}/media",
      "method": "GET",
      "path": "/v1/public/shares/{token}/nodes/{nid}/media",
      "tag": "shares",
      "summary": "Where to stream or download a file's bytes (a block gateway address with a ticket)",
      "auth": "none",
      "params": [
        {
          "name": "token",
          "in": "path",
          "required": true,
          "type": "string",
          "about": "The token at the end of a share link"
        },
        {
          "name": "nid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "X-Share-Key",
          "in": "header",
          "type": "string",
          "about": "A password-protected link's key, from /unlock"
        },
        {
          "name": "r",
          "in": "query",
          "type": "string",
          "about": "The poster, or the streaming proxy (the original when there is none)"
        },
        {
          "name": "download",
          "in": "query",
          "type": "string",
          "about": "The original"
        }
      ],
      "returns": "200 The address",
      "examples": {
        "curl": "curl \"$SIDESPACE_URL/v1/public/shares/$TOKEN/nodes/$NID/media\""
      }
    },
    {
      "id": "GET /v1/public/shares/{token}/nodes/{nid}/zip",
      "method": "GET",
      "path": "/v1/public/shares/{token}/nodes/{nid}/zip",
      "tag": "shares",
      "summary": "Where to download a shared folder as one zip (ADR 0044) — a signed address good for 10 minutes; counted as a download",
      "auth": "none",
      "params": [
        {
          "name": "token",
          "in": "path",
          "required": true,
          "type": "string",
          "about": "The token at the end of a share link"
        },
        {
          "name": "nid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "X-Share-Key",
          "in": "header",
          "type": "string",
          "about": "A password-protected link's key, from /unlock"
        }
      ],
      "returns": "200 The address",
      "examples": {
        "curl": "curl \"$SIDESPACE_URL/v1/public/shares/$TOKEN/nodes/$NID/zip\""
      }
    },
    {
      "id": "POST /v1/public/shares/{token}/save",
      "method": "POST",
      "path": "/v1/public/shares/{token}/save",
      "tag": "shares",
      "summary": "Save what a link shares into a space of the signed-in visitor's own",
      "auth": "none",
      "params": [
        {
          "name": "token",
          "in": "path",
          "required": true,
          "type": "string",
          "about": "The token at the end of a share link"
        },
        {
          "name": "X-Share-Key",
          "in": "header",
          "type": "string",
          "about": "A password-protected link's key, from /unlock"
        }
      ],
      "body": [
        {
          "name": "node_id",
          "type": "string",
          "about": "A file or folder under the link (default: what it shares)"
        },
        {
          "name": "space_id",
          "type": "string",
          "about": "Where it goes (default: the caller's first space)"
        }
      ],
      "returns": "202 The copy has started",
      "examples": {
        "curl": "curl -X POST -H \"Content-Type: application/json\" -d '{}' \"$SIDESPACE_URL/v1/public/shares/$TOKEN/save\""
      }
    },
    {
      "id": "POST /v1/public/shares/{token}/unlock",
      "method": "POST",
      "path": "/v1/public/shares/{token}/unlock",
      "tag": "shares",
      "summary": "Trade a link's password for its key (send it as X-Share-Key)",
      "auth": "none",
      "params": [
        {
          "name": "token",
          "in": "path",
          "required": true,
          "type": "string",
          "about": "The token at the end of a share link"
        }
      ],
      "body": [
        {
          "name": "password",
          "type": "string",
          "required": true
        }
      ],
      "returns": "200 The key",
      "examples": {
        "curl": "curl -X POST -H \"Content-Type: application/json\" -d '{\"password\":\"…\"}' \"$SIDESPACE_URL/v1/public/shares/$TOKEN/unlock\""
      }
    },
    {
      "id": "POST /v1/public/shares/{token}/uploads",
      "method": "POST",
      "path": "/v1/public/shares/{token}/uploads",
      "tag": "shares",
      "summary": "Start sending a file through an upload link or request (signed in) — a ticket for the block gateway (pieces to POST /chunks, ADR 0042; or the whole file to /stream-upload)",
      "auth": "none",
      "params": [
        {
          "name": "token",
          "in": "path",
          "required": true,
          "type": "string",
          "about": "The token at the end of a share link"
        },
        {
          "name": "X-Share-Key",
          "in": "header",
          "type": "string",
          "about": "A password-protected link's key, from /unlock"
        }
      ],
      "body": [
        {
          "name": "hashes",
          "type": "string[]",
          "about": "Pieces an earlier try sent; the answer's missing lists those the gateway no longer has."
        },
        {
          "name": "parent_id",
          "type": "string",
          "about": "Upload links: the folder (default the shared one). Requests always use their own."
        }
      ],
      "returns": "200 UploadSession",
      "examples": {
        "curl": "curl -X POST -H \"Content-Type: application/json\" -d '{}' \"$SIDESPACE_URL/v1/public/shares/$TOKEN/uploads\""
      }
    },
    {
      "id": "GET /v1/public/zips/{ticket}",
      "method": "GET",
      "path": "/v1/public/zips/{ticket}",
      "tag": "shares",
      "summary": "A shared folder as a zip, streamed (from the address the zip endpoint gave)",
      "auth": "none",
      "params": [
        {
          "name": "ticket",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 string",
      "examples": {
        "curl": "curl \"$SIDESPACE_URL/v1/public/zips/$TICKET\""
      }
    },
    {
      "id": "GET /v1/releases/{platform}",
      "method": "GET",
      "path": "/v1/releases/{platform}",
      "tag": "auth",
      "summary": "The newest desktop build for a platform, for the apps' update check (no auth)",
      "auth": "none",
      "params": [
        {
          "name": "platform",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "current",
          "in": "query",
          "type": "string",
          "about": "The asking app's version, e.g. 0.1.0"
        }
      ],
      "returns": "200 Release",
      "examples": {
        "curl": "curl \"$SIDESPACE_URL/v1/releases/$PLATFORM\""
      }
    },
    {
      "id": "GET /v1/releases/{platform}/appcast.xml",
      "method": "GET",
      "path": "/v1/releases/{platform}/appcast.xml",
      "tag": "auth",
      "summary": "The Mac app's Sparkle update feed (no auth)",
      "auth": "none",
      "params": [
        {
          "name": "platform",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 string",
      "examples": {
        "curl": "curl \"$SIDESPACE_URL/v1/releases/$PLATFORM/appcast.xml\""
      }
    },
    {
      "id": "GET /v1/releases/{platform}/latest.json",
      "method": "GET",
      "path": "/v1/releases/{platform}/latest.json",
      "tag": "auth",
      "summary": "The desktop shell's update list, Tauri's static latest.json (no auth)",
      "auth": "none",
      "params": [
        {
          "name": "platform",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 DesktopUpdateList",
      "examples": {
        "curl": "curl \"$SIDESPACE_URL/v1/releases/$PLATFORM/latest.json\""
      }
    },
    {
      "id": "POST /v1/releases/{platform}/latest.json",
      "method": "POST",
      "path": "/v1/releases/{platform}/latest.json",
      "tag": "auth",
      "summary": "Send a desktop shell version as a draft (a build machine, with a release token)",
      "auth": "none",
      "params": [
        {
          "name": "platform",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "platforms",
          "type": "object",
          "required": true,
          "about": "By Tauri target, e.g. darwin-aarch64-app"
        },
        {
          "name": "version",
          "type": "string",
          "required": true
        },
        {
          "name": "min_version",
          "type": "string",
          "about": "Apps older than this must update (not part of Tauri's format; the updater ignores it)"
        },
        {
          "name": "notes",
          "type": "string"
        },
        {
          "name": "pub_date",
          "type": "string"
        }
      ],
      "returns": "201 The draft (the back office's release record)",
      "examples": {
        "curl": "curl -X POST -H \"Content-Type: application/json\" -d '{\"platforms\":{},\"version\":\"…\"}' \"$SIDESPACE_URL/v1/releases/$PLATFORM/latest.json\""
      }
    },
    {
      "id": "POST /v1/runs/claim",
      "method": "POST",
      "path": "/v1/runs/claim",
      "tag": "developer",
      "summary": "A member's device claims one file's waiting first-party runs (ADR 0059): a signed-in device, or a token with runs:execute naming itself in `device`. It gets runs of drives where its person is an editor (folder rules apply), in the drives it chose, whose workspace lets members' devices work and whose drive is not set to \"server\", for the actions and backends it lists, in the classes it takes now. Best first: someone waiting, then batches, then automatic; light before heavy; drives in turn. The other waiting runs of the same file come along, so the file is read and decoded once. First, the runs this device still held are taken back (it asks again only after a restart); that counts as an attempt, and after 3 the run fails. Report on each run with its callback, as runner plugins do: /v1/plugin-runs/{rid}/progress (at least every lease_seconds; it keeps the hold), /upload, /complete.",
      "auth": "scope",
      "scopes": [
        "runs:execute"
      ],
      "params": [
        {
          "name": "wait",
          "in": "query",
          "type": "integer",
          "about": "Seconds to wait for work (long poll)"
        }
      ],
      "body": [
        {
          "name": "can",
          "type": "DeviceCapability[]",
          "required": true,
          "about": "Best first. Actions devices do (GET /v1/runs/device-actions); others are left out and named in ignored / X-Ignored-Can, and only a can with none known is refused. A run with no backend named (on it, or the workspace's default) waits with backend \"\" and the device that claims it fixes it"
        },
        {
          "name": "classes",
          "type": "string[]",
          "about": "Default both; on battery, light"
        },
        {
          "name": "device",
          "type": "string",
          "about": "A token runner's name (letters, digits, . _ -), so its runs come back to it after a restart; a signed-in device leaves it out"
        },
        {
          "name": "max",
          "type": "integer",
          "about": "Runs of one file in a claim"
        },
        {
          "name": "name",
          "type": "string",
          "about": "Shown to people (\"Alice's MacBook Pro\")"
        },
        {
          "name": "priorities",
          "type": "string[]",
          "about": "Only runs of these priorities; empty = all. \"Only when I ask\" is [now]"
        },
        {
          "name": "spaces",
          "type": "string[]",
          "about": "Only these drives (the device's settings); empty = all"
        }
      ],
      "returns": "200 DeviceBundle",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"can\":[]}' \"$SIDESPACE_URL/v1/runs/claim\""
      }
    },
    {
      "id": "GET /v1/runs/device-actions",
      "method": "GET",
      "path": "/v1/runs/device-actions",
      "tag": "developer",
      "summary": "The actions devices may do, with how they do them, so a device need not learn them from a refusal",
      "auth": "scope",
      "scopes": [
        "runs:execute"
      ],
      "returns": "200 Actions",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/runs/device-actions\""
      }
    },
    {
      "id": "POST /v1/runs/waiting",
      "method": "POST",
      "path": "/v1/runs/waiting",
      "tag": "developer",
      "summary": "How many runs wait that a claim with this request would find, without claiming (ADR 0060)",
      "auth": "scope",
      "scopes": [
        "runs:execute"
      ],
      "body": [
        {
          "name": "can",
          "type": "DeviceCapability[]",
          "required": true,
          "about": "Best first. Actions devices do (GET /v1/runs/device-actions); others are left out and named in ignored / X-Ignored-Can, and only a can with none known is refused. A run with no backend named (on it, or the workspace's default) waits with backend \"\" and the device that claims it fixes it"
        },
        {
          "name": "classes",
          "type": "string[]",
          "about": "Default both; on battery, light"
        },
        {
          "name": "device",
          "type": "string",
          "about": "A token runner's name (letters, digits, . _ -), so its runs come back to it after a restart; a signed-in device leaves it out"
        },
        {
          "name": "max",
          "type": "integer",
          "about": "Runs of one file in a claim"
        },
        {
          "name": "name",
          "type": "string",
          "about": "Shown to people (\"Alice's MacBook Pro\")"
        },
        {
          "name": "priorities",
          "type": "string[]",
          "about": "Only runs of these priorities; empty = all. \"Only when I ask\" is [now]"
        },
        {
          "name": "spaces",
          "type": "string[]",
          "about": "Only these drives (the device's settings); empty = all"
        }
      ],
      "returns": "200 Counts",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"can\":[]}' \"$SIDESPACE_URL/v1/runs/waiting\""
      }
    },
    {
      "id": "POST /v1/runs/{rid}/release",
      "method": "POST",
      "path": "/v1/runs/{rid}/release",
      "tag": "developer",
      "summary": "The device holding a run gives it back (going to sleep, quitting, on battery); it waits again and the attempt does not count. Token runners name their device.",
      "auth": "scope",
      "scopes": [
        "runs:execute"
      ],
      "params": [
        {
          "name": "rid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "device",
          "type": "string",
          "about": "The name a token runner claimed with"
        }
      ],
      "returns": "200 Run",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{}' \"$SIDESPACE_URL/v1/runs/$RID/release\""
      }
    },
    {
      "id": "GET /v1/search",
      "method": "GET",
      "path": "/v1/search",
      "tag": "search",
      "summary": "Find live files and folders across the caller's spaces by name, by what their sidecars and comments say, and by meaning",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "q",
          "in": "query",
          "required": true,
          "type": "string",
          "about": "Words (up to 8 are matched), or a description"
        },
        {
          "name": "space",
          "in": "query",
          "type": "string",
          "about": "One space (member only); default every space"
        },
        {
          "name": "type",
          "in": "query",
          "type": "string"
        },
        {
          "name": "mode",
          "in": "query",
          "type": "string",
          "about": "auto: words, then meaning when the server can; keyword: words only; meaning: meaning only (400 when the server has no model)"
        },
        {
          "name": "limit",
          "in": "query",
          "type": "integer"
        }
      ],
      "returns": "200 Hits",
      "examples": {
        "cli": "side search \"harbor night\"",
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/search\"",
        "mcp": "search {\"query\":\"harbor night\"}",
        "python": "side.space(\"Film A\").search(\"harbor night\")",
        "typescript": "await side.space(\"Film A\").search(\"harbor night\")"
      }
    },
    {
      "id": "POST /v1/search",
      "method": "POST",
      "path": "/v1/search",
      "tag": "search",
      "summary": "Search with filters, grouping by moment, sorting, pages, counts and coverage",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "body": [
        {
          "name": "counts",
          "type": "string[]",
          "about": "Fields to count over the hits (each filter but the field's own applies). Keyword fields by value; number and date fields by range: value is {gte, lt} (either may be missing). Durations: under 1 min, 1–5, 5–20, 20–60, over 60; dates: older than a year, the last year, month, week, day; other numbers by each whole value when few, else five equal steps. Every range is listed"
        },
        {
          "name": "cursor",
          "type": "string"
        },
        {
          "name": "filters",
          "type": "SearchFilter[]",
          "about": "A filter on a field the server does not know is left out and named in ignored"
        },
        {
          "name": "group",
          "type": "string"
        },
        {
          "name": "limit",
          "type": "integer"
        },
        {
          "name": "mode",
          "type": "string"
        },
        {
          "name": "order",
          "type": "string",
          "about": "Turns the sort (not relevance). Default: the sort's own"
        },
        {
          "name": "q",
          "type": "string",
          "about": "Words (up to 8). Empty: list what the filters let through"
        },
        {
          "name": "scope",
          "type": "object"
        },
        {
          "name": "sort",
          "type": "string",
          "about": "Default relevance with q, saved_at without. saved_at, captured_at, size, duration, width, height: largest first; name, kind, language: A to Z; or a field's key (GET /v1/facets): a keyword field by its first value, A to Z; a number or date, largest first. Empty values last. An unknown field is left out (ignored)"
        },
        {
          "name": "vectors",
          "type": "object",
          "about": "Query vectors by model id, computed by the client (the Mac's Search by Meaning), the query prefix of the model's contract applied: base64 of little-endian float32 or float16, the model's whole output or its first dim numbers (ADR 0061). Each space is searched with its workspace's model: with this vector, or else the server's own encoding of q (SIDESPACE_EMBED_URL with that model), or by words only (meaning says why). Word hits come first, then files (or, with group moment, moments) found by meaning alone, with score; filters apply to them and total and counts include them"
        }
      ],
      "returns": "200 SearchResult",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{}' \"$SIDESPACE_URL/v1/search\""
      }
    },
    {
      "id": "GET /v1/shared",
      "method": "GET",
      "path": "/v1/shared",
      "tag": "shares",
      "summary": "What was shared with the signed-in person by email (direct shares), newest first",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "returns": "200 Shared with me",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/shared\""
      }
    },
    {
      "id": "GET /v1/shared/{id}",
      "method": "GET",
      "path": "/v1/shared/{id}",
      "tag": "shares",
      "summary": "A direct share as the person it was shared with sees it",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "open",
          "in": "query",
          "type": "string"
        }
      ],
      "returns": "200 PublicShare",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/shared/$ID\""
      }
    },
    {
      "id": "DELETE /v1/shared/{id}",
      "method": "DELETE",
      "path": "/v1/shared/{id}",
      "tag": "shares",
      "summary": "Take something shared with you off your list (it is revoked; audit share.left)",
      "auth": "scope",
      "scopes": [
        "files:write"
      ],
      "params": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "204 Removed",
      "examples": {
        "curl": "curl -X DELETE -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/shared/$ID\""
      }
    },
    {
      "id": "GET /v1/shared/{id}/nodes/{nid}",
      "method": "GET",
      "path": "/v1/shared/{id}/nodes/{nid}",
      "tag": "shares",
      "summary": "A file or folder under a direct share (as /v1/public/shares/{token}/nodes/{nid})",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "nid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 PublicShareNode",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/shared/$ID/nodes/$NID\""
      }
    },
    {
      "id": "GET /v1/space",
      "method": "GET",
      "path": "/v1/space",
      "tag": "spaces",
      "summary": "The calling token's own space (a token made for one space)",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "returns": "200 Space",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/space\""
      }
    },
    {
      "id": "GET /v1/spaces",
      "method": "GET",
      "path": "/v1/spaces",
      "tag": "spaces",
      "summary": "Every drive I reach: each space I am a member of and its forks, with my role in the space",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "returns": "200 Spaces",
      "examples": {
        "cli": "side spaces",
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces\"",
        "mcp": "list_spaces {}",
        "python": "side.spaces()",
        "typescript": "await side.spaces()"
      }
    },
    {
      "id": "POST /v1/spaces",
      "method": "POST",
      "path": "/v1/spaces",
      "tag": "spaces",
      "summary": "Create a space (the caller becomes its manager)",
      "auth": "scope",
      "scopes": [
        "admin"
      ],
      "body": [
        {
          "name": "name",
          "type": "string",
          "required": true
        },
        {
          "name": "org_id",
          "type": "string",
          "about": "Make it in this organization (an admin there); it goes to the organization's default storage"
        },
        {
          "name": "storage_id",
          "type": "string",
          "about": "A storage profile to keep its files in: mine, or the organization's. While the server takes payments, a bucket of mine needs a paid plan (403 plan_required): make the space, then send the bucket with its Checkout."
        }
      ],
      "returns": "201 Space",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"name\":\"…\"}' \"$SIDESPACE_URL/v1/spaces\""
      }
    },
    {
      "id": "GET /v1/spaces/{sid}",
      "method": "GET",
      "path": "/v1/spaces/{sid}",
      "tag": "spaces",
      "summary": "",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 Space",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID\""
      }
    },
    {
      "id": "PATCH /v1/spaces/{sid}",
      "method": "PATCH",
      "path": "/v1/spaces/{sid}",
      "tag": "spaces",
      "summary": "Rename, or choose where its files are while it has none (manager)",
      "auth": "scope",
      "scopes": [
        "admin"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "name",
          "type": "string"
        },
        {
          "name": "storage_id",
          "type": "string",
          "about": "A storage profile the caller may use, or empty for the server's own storage. Only while the space has no files (409: move them with POST /v1/spaces/{sid}/storage/moves). While the server takes payments, a person's own bucket needs a paid plan (403 plan_required)."
        }
      ],
      "returns": "200 Space",
      "examples": {
        "curl": "curl -X PATCH -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{}' \"$SIDESPACE_URL/v1/spaces/$SID\""
      }
    },
    {
      "id": "DELETE /v1/spaces/{sid}",
      "method": "DELETE",
      "path": "/v1/spaces/{sid}",
      "tag": "spaces",
      "summary": "Delete a drive that never held anything (no files, history or forks; 409 otherwise), as S3 DeleteBucket does. An admin of its workspace, or whoever made it if it is a fork.",
      "auth": "scope",
      "scopes": [
        "admin"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "204 Deleted",
      "examples": {
        "curl": "curl -X DELETE -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID\""
      }
    },
    {
      "id": "GET /v1/spaces/{sid}/actions",
      "method": "GET",
      "path": "/v1/spaces/{sid}/actions",
      "tag": "developer",
      "summary": "What can be done to files here, with a JSON Schema of each action's params and whether this server can run it",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 Actions",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/actions\"",
        "mcp": "list_actions {\"space\":\"Film A\"}",
        "python": "side.actions()",
        "typescript": "await side.actions()"
      }
    },
    {
      "id": "GET /v1/spaces/{sid}/ai",
      "method": "GET",
      "path": "/v1/spaces/{sid}/ai",
      "tag": "developer",
      "summary": "Where the drive's AI work is done, its workspace's AI settings, the devices around that may do it, and how many runs wait for one (any member; ADR 0059)",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 DriveAI",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/ai\""
      }
    },
    {
      "id": "PATCH /v1/spaces/{sid}/ai",
      "method": "PATCH",
      "path": "/v1/spaces/{sid}/ai",
      "tag": "developer",
      "summary": "Say where the drive's AI work is done (workspace admin; tokens need admin). Runs already waiting follow: on \"server\" they move to the server.",
      "auth": "scope",
      "scopes": [
        "admin"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "where",
          "type": "AIWhere",
          "required": true
        }
      ],
      "returns": "200 DriveAI",
      "examples": {
        "curl": "curl -X PATCH -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"where\":{}}' \"$SIDESPACE_URL/v1/spaces/$SID/ai\""
      }
    },
    {
      "id": "GET /v1/spaces/{sid}/ai/missing",
      "method": "GET",
      "path": "/v1/spaces/{sid}/ai/missing",
      "tag": "developer",
      "summary": "Files a device can pull into its queue, newest first (any member; only files the caller may edit are listed)",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "actions",
          "in": "query",
          "type": "string",
          "about": "Comma-separated actions, e.g. side.ocr,side.capture: those this device can do. Ones the workspace has off are left out; leave it out for all it has on. 400 for one devices do not do"
        },
        {
          "name": "version_ids",
          "in": "query",
          "type": "string",
          "about": "Comma-separated versions (at most 200): only those, e.g. the ones this device uploaded, to do them first"
        },
        {
          "name": "limit",
          "in": "query",
          "type": "integer"
        },
        {
          "name": "cursor",
          "in": "query",
          "type": "string",
          "about": "next_cursor of the page before"
        }
      ],
      "returns": "200 MissingPage",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/ai/missing\""
      }
    },
    {
      "id": "GET /v1/spaces/{sid}/comments/{cid}",
      "method": "GET",
      "path": "/v1/spaces/{sid}/comments/{cid}",
      "tag": "comments",
      "summary": "",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "cid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 Comment",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/comments/$CID\""
      }
    },
    {
      "id": "PATCH /v1/spaces/{sid}/comments/{cid}",
      "method": "PATCH",
      "path": "/v1/spaces/{sid}/comments/{cid}",
      "tag": "comments",
      "summary": "Edit the text (its author), or resolve or reopen a thread (its author, or an editor)",
      "auth": "scope",
      "scopes": [
        "comments:write"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "cid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "body",
          "type": "string"
        },
        {
          "name": "resolved",
          "type": "boolean"
        }
      ],
      "returns": "200 Comment",
      "examples": {
        "curl": "curl -X PATCH -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{}' \"$SIDESPACE_URL/v1/spaces/$SID/comments/$CID\""
      }
    },
    {
      "id": "DELETE /v1/spaces/{sid}/comments/{cid}",
      "method": "DELETE",
      "path": "/v1/spaces/{sid}/comments/{cid}",
      "tag": "comments",
      "summary": "Delete (its author, or a manager); a thread's replies go with it",
      "auth": "scope",
      "scopes": [
        "comments:write"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "cid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "204 Deleted",
      "examples": {
        "curl": "curl -X DELETE -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/comments/$CID\""
      }
    },
    {
      "id": "POST /v1/spaces/{sid}/download-tickets",
      "method": "POST",
      "path": "/v1/spaces/{sid}/download-tickets",
      "tag": "versions",
      "summary": "Get a get-ticket (and, unless manifest is false, the manifest) for a version or one of its renditions",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "version_id",
          "type": "string",
          "required": true
        },
        {
          "name": "manifest",
          "type": "boolean",
          "about": "false leaves the manifest out of the answer: reading through the gateway (GET /files, ranges) does not need it, and a big file's is long"
        },
        {
          "name": "rendition",
          "type": "string",
          "about": "e.g. thumb, or proxy (the server-made 720p H.264 stream of a video)"
        },
        {
          "name": "stream",
          "type": "boolean",
          "about": "A ticket for a player: lasts a viewing session (6 h) instead of minutes"
        }
      ],
      "returns": "200 DownloadTicket",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"version_id\":\"…\"}' \"$SIDESPACE_URL/v1/spaces/$SID/download-tickets\""
      }
    },
    {
      "id": "GET /v1/spaces/{sid}/folder-access",
      "method": "GET",
      "path": "/v1/spaces/{sid}/folder-access",
      "tag": "orgs",
      "summary": "Folders with access rules",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 Folders",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/folder-access\""
      }
    },
    {
      "id": "POST /v1/spaces/{sid}/fork/apply",
      "method": "POST",
      "path": "/v1/spaces/{sid}/fork/apply",
      "tag": "forks",
      "summary": "Bring a fork's changes back (editor and up)",
      "auth": "scope",
      "scopes": [
        "files:write"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string",
          "about": "The fork"
        }
      ],
      "body": [
        {
          "name": "dry_run",
          "type": "boolean"
        },
        {
          "name": "force",
          "type": "boolean",
          "about": "Also replace the original's newer versions"
        },
        {
          "name": "paths",
          "type": "string[]",
          "about": "Only changes at or under these paths (fork or original paths)"
        }
      ],
      "returns": "200 What happened to each change",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{}' \"$SIDESPACE_URL/v1/spaces/$SID/fork/apply\"",
        "mcp": "apply_fork {\"fork\":\"Film A (agent)\",\"dry_run\":true}",
        "python": "side.space(\"Film A (agent)\").apply_fork(dry_run=True)",
        "typescript": "await side.space(\"Film A (agent)\").applyFork({ dryRun: true })"
      }
    },
    {
      "id": "GET /v1/spaces/{sid}/fork/changes",
      "method": "GET",
      "path": "/v1/spaces/{sid}/fork/changes",
      "tag": "forks",
      "summary": "How a fork differs from the space it came from",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string",
          "about": "The fork"
        }
      ],
      "returns": "200 Changes in path order",
      "examples": {
        "cli": "side fork changes \"Film A (agent)\"",
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/fork/changes\"",
        "mcp": "fork_changes {\"fork\":\"Film A (agent)\"}",
        "python": "side.space(\"Film A (agent)\").fork_changes()",
        "typescript": "await side.space(\"Film A (agent)\").forkChanges()"
      }
    },
    {
      "id": "POST /v1/spaces/{sid}/fork/copy/retry",
      "method": "POST",
      "path": "/v1/spaces/{sid}/fork/copy/retry",
      "tag": "forks",
      "summary": "Try a failed copy again (a manager of the space, or whoever made the fork)",
      "auth": "scope",
      "scopes": [
        "files:write"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string",
          "about": "The fork"
        }
      ],
      "returns": "204 Copying again",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/fork/copy/retry\""
      }
    },
    {
      "id": "GET /v1/spaces/{sid}/forks",
      "method": "GET",
      "path": "/v1/spaces/{sid}/forks",
      "tag": "forks",
      "summary": "The forks of a space (any member of it)",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 Forks",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/forks\""
      }
    },
    {
      "id": "POST /v1/spaces/{sid}/forks",
      "method": "POST",
      "path": "/v1/spaces/{sid}/forks",
      "tag": "forks",
      "summary": "Fork the space (editor and up); the fork is a further drive of the same space, with its members and plan",
      "auth": "scope",
      "scopes": [
        "files:write"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "name",
          "type": "string",
          "required": true
        },
        {
          "name": "copy",
          "type": "boolean",
          "about": "Take an own copy of the files in the background, so the fork stops depending on the original. It is usable at once and shares the files until the copy is done (see fork.copy)"
        },
        {
          "name": "path",
          "type": "string",
          "about": "Only this folder of the space (default all of it)"
        },
        {
          "name": "storage_id",
          "type": "string",
          "about": "With copy: where the fork keeps its files, a storage profile id or \"server\" for the server's own storage. Omitted: the original's storage"
        }
      ],
      "returns": "201 Space",
      "examples": {
        "cli": "side fork create \"Film A (agent)\" --path /cuts",
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"name\":\"…\"}' \"$SIDESPACE_URL/v1/spaces/$SID/forks\"",
        "mcp": "fork_space {\"space\":\"Film A\",\"name\":\"Film A (agent)\",\"path\":\"/cuts\"}",
        "python": "side.fork(\"Film A (agent)\", path=\"/cuts\")",
        "typescript": "await side.fork(\"Film A (agent)\", { path: \"/cuts\" })"
      }
    },
    {
      "id": "GET /v1/spaces/{sid}/grants",
      "method": "GET",
      "path": "/v1/spaces/{sid}/grants",
      "tag": "shares",
      "summary": "Direct shares of the drive, or of one file or folder (editor)",
      "auth": "scope",
      "scopes": [
        "shares:manage"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "node_id",
          "in": "query",
          "type": "string",
          "about": "Only this file or folder's"
        }
      ],
      "returns": "200 Live direct shares",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/grants\""
      }
    },
    {
      "id": "POST /v1/spaces/{sid}/grants",
      "method": "POST",
      "path": "/v1/spaces/{sid}/grants",
      "tag": "shares",
      "summary": "Share a file, folder or the whole drive with people by email (editor; folder rules apply)",
      "auth": "scope",
      "scopes": [
        "shares:manage"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "emails",
          "type": "string[]",
          "required": true
        },
        {
          "name": "role",
          "type": "GrantRole",
          "required": true
        },
        {
          "name": "expires_at",
          "type": "Timestamp"
        },
        {
          "name": "message",
          "type": "string",
          "about": "A note for the mail"
        },
        {
          "name": "no_mail",
          "type": "boolean",
          "about": "Send no mail (an account is still notified)"
        },
        {
          "name": "node_id",
          "type": "string",
          "about": "The file or folder; leave out to share the whole drive"
        }
      ],
      "returns": "201 The direct shares, one per address",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"emails\":[],\"role\":{}}' \"$SIDESPACE_URL/v1/spaces/$SID/grants\""
      }
    },
    {
      "id": "PATCH /v1/spaces/{sid}/grants/{id}",
      "method": "PATCH",
      "path": "/v1/spaces/{sid}/grants/{id}",
      "tag": "shares",
      "summary": "Change a direct share's role (editor; audit share.role_changed)",
      "auth": "scope",
      "scopes": [
        "shares:manage"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "id",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "role",
          "type": "GrantRole",
          "required": true
        }
      ],
      "returns": "200 Grant",
      "examples": {
        "curl": "curl -X PATCH -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"role\":{}}' \"$SIDESPACE_URL/v1/spaces/$SID/grants/$ID\""
      }
    },
    {
      "id": "DELETE /v1/spaces/{sid}/grants/{id}",
      "method": "DELETE",
      "path": "/v1/spaces/{sid}/grants/{id}",
      "tag": "shares",
      "summary": "Revoke a direct share (editor; audit share.revoked). The person's next request is refused.",
      "auth": "scope",
      "scopes": [
        "shares:manage"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "id",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "204 Revoked",
      "examples": {
        "curl": "curl -X DELETE -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/grants/$ID\""
      }
    },
    {
      "id": "GET /v1/spaces/{sid}/journal",
      "method": "GET",
      "path": "/v1/spaces/{sid}/journal",
      "tag": "sync",
      "summary": "Changes after a seq, strictly ordered and gap-free",
      "auth": "scope",
      "scopes": [
        "files:read",
        "events:read"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "after",
          "in": "query",
          "required": true,
          "type": "integer"
        },
        {
          "name": "limit",
          "in": "query",
          "type": "integer"
        }
      ],
      "returns": "200 JournalPage",
      "examples": {
        "cli": "side events tail",
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/journal\"",
        "mcp": "recent_changes {\"space\":\"Film A\"}",
        "python": "side.journal(after_seq)",
        "typescript": "await side.journal(afterSeq)"
      }
    },
    {
      "id": "GET /v1/spaces/{sid}/members",
      "method": "GET",
      "path": "/v1/spaces/{sid}/members",
      "tag": "spaces",
      "summary": "",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 Members",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/members\""
      }
    },
    {
      "id": "POST /v1/spaces/{sid}/members",
      "method": "POST",
      "path": "/v1/spaces/{sid}/members",
      "tag": "spaces",
      "summary": "Invite by email (manager). Creates the user record if needed and sends a space.invited notification.",
      "auth": "scope",
      "scopes": [
        "members:manage"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "email",
          "type": "string",
          "required": true
        },
        {
          "name": "role",
          "type": "Role",
          "required": true
        }
      ],
      "returns": "201 Member",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"email\":\"…\",\"role\":{}}' \"$SIDESPACE_URL/v1/spaces/$SID/members\""
      }
    },
    {
      "id": "PATCH /v1/spaces/{sid}/members/{uid}",
      "method": "PATCH",
      "path": "/v1/spaces/{sid}/members/{uid}",
      "tag": "spaces",
      "summary": "Change role (manager). The last manager cannot be demoted.",
      "auth": "scope",
      "scopes": [
        "members:manage"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "uid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "role",
          "type": "Role",
          "required": true
        }
      ],
      "returns": "200 Member",
      "examples": {
        "curl": "curl -X PATCH -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"role\":{}}' \"$SIDESPACE_URL/v1/spaces/$SID/members/$UID\""
      }
    },
    {
      "id": "DELETE /v1/spaces/{sid}/members/{uid}",
      "method": "DELETE",
      "path": "/v1/spaces/{sid}/members/{uid}",
      "tag": "spaces",
      "summary": "Remove a member (manager, or the member themself)",
      "auth": "scope",
      "scopes": [
        "members:manage"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "uid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "204 Removed",
      "examples": {
        "curl": "curl -X DELETE -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/members/$UID\""
      }
    },
    {
      "id": "GET /v1/spaces/{sid}/namespaces",
      "method": "GET",
      "path": "/v1/spaces/{sid}/namespaces",
      "tag": "sidecars",
      "summary": "Sidecar namespaces that one member alone writes in this space",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 Owned namespaces",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/namespaces\""
      }
    },
    {
      "id": "PUT /v1/spaces/{sid}/namespaces/{ns}",
      "method": "PUT",
      "path": "/v1/spaces/{sid}/namespaces/{ns}",
      "tag": "sidecars",
      "summary": "Let only this member write the namespace here (manager). ai.generation or a custom x-… namespace.",
      "auth": "scope",
      "scopes": [
        "admin"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "ns",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "owner_id",
          "type": "string",
          "required": true
        }
      ],
      "returns": "200 NamespaceOwner",
      "examples": {
        "curl": "curl -X PUT -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"owner_id\":\"…\"}' \"$SIDESPACE_URL/v1/spaces/$SID/namespaces/$NS\""
      }
    },
    {
      "id": "DELETE /v1/spaces/{sid}/namespaces/{ns}",
      "method": "DELETE",
      "path": "/v1/spaces/{sid}/namespaces/{ns}",
      "tag": "sidecars",
      "summary": "Let every editor write the namespace again (manager)",
      "auth": "scope",
      "scopes": [
        "admin"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "ns",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "204 Released",
      "examples": {
        "curl": "curl -X DELETE -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/namespaces/$NS\""
      }
    },
    {
      "id": "POST /v1/spaces/{sid}/nodes",
      "method": "POST",
      "path": "/v1/spaces/{sid}/nodes",
      "tag": "nodes",
      "summary": "Create a folder or an empty file (editor). A clashing name gets a \" (2)\" suffix; the response has the final name.",
      "auth": "scope",
      "scopes": [
        "files:write"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "If-None-Match",
          "in": "header",
          "type": "string",
          "about": "\"*\": write only if nothing is there yet (no file at the name, or a file with no version); else 412 `precondition_failed`"
        }
      ],
      "body": [
        {
          "name": "kind",
          "type": "NodeKind",
          "required": true
        },
        {
          "name": "name",
          "type": "string",
          "required": true
        },
        {
          "name": "parent_id",
          "type": "string",
          "required": true
        },
        {
          "name": "if_exists",
          "type": "string",
          "about": "When a live sibling has the same name (case-insensitive): `rename` creates \"name (2).ext\"; `reuse` returns the existing node of the same kind; `fail` (or `If-None-Match: *`) answers 412 `precondition_failed` with the existing `node_id`. Sync clients use `reuse` so concurrent creates of one path converge on one file (last save wins, both saves in its history)."
        }
      ],
      "returns": "201 NodeInfo",
      "examples": {
        "cli": "side mkdir /cuts/v2",
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"kind\":{},\"name\":\"…\",\"parent_id\":\"…\"}' \"$SIDESPACE_URL/v1/spaces/$SID/nodes\"",
        "mcp": "make_folder {\"space\":\"Film A\",\"path\":\"/cuts/v2\"}",
        "python": "side.mkdir(\"/cuts/v2\")",
        "typescript": "await side.mkdir(\"/cuts/v2\")"
      }
    },
    {
      "id": "GET /v1/spaces/{sid}/nodes/{nid}",
      "method": "GET",
      "path": "/v1/spaces/{sid}/nodes/{nid}",
      "tag": "nodes",
      "summary": "A node now, or with as_of as it was then",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "nid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "as_of",
          "in": "query",
          "type": "string",
          "about": "Read the space as it was: an RFC 3339 time, a duration ago (\"-2h\", \"-90m\"), or a journal seq. The answer's Sidespace-As-Of-Seq header names the last change included. Versions are kept until a file is deleted for good, so a past head_version_id can be downloaded as usual."
        }
      ],
      "returns": "200 NodeInfo",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/nodes/$NID\""
      }
    },
    {
      "id": "PATCH /v1/spaces/{sid}/nodes/{nid}",
      "method": "PATCH",
      "path": "/v1/spaces/{sid}/nodes/{nid}",
      "tag": "nodes",
      "summary": "Rename and/or move (editor)",
      "auth": "scope",
      "scopes": [
        "files:write"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "nid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "If-Match",
          "in": "header",
          "type": "string",
          "about": "Expected meta_rev, or a version id (\"ver_…\") the file must still be at; 412 `precondition_failed` when it differs"
        }
      ],
      "body": [
        {
          "name": "if_version_id",
          "type": "string",
          "about": "Rename or move only if the file is still at this version"
        },
        {
          "name": "name",
          "type": "string"
        },
        {
          "name": "parent_id",
          "type": "string"
        }
      ],
      "returns": "200 NodeInfo",
      "examples": {
        "cli": "side mv /cuts/a.mov /selects/a.mov",
        "curl": "curl -X PATCH -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{}' \"$SIDESPACE_URL/v1/spaces/$SID/nodes/$NID\"",
        "mcp": "move {\"space\":\"Film A\",\"path\":\"/cuts/a.mov\",\"to\":\"/selects/a.mov\"}"
      }
    },
    {
      "id": "DELETE /v1/spaces/{sid}/nodes/{nid}",
      "method": "DELETE",
      "path": "/v1/spaces/{sid}/nodes/{nid}",
      "tag": "nodes",
      "summary": "Soft-delete a node and everything under it (editor); restorable for 30 days",
      "auth": "scope",
      "scopes": [
        "files:write"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "nid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "If-Match",
          "in": "header",
          "type": "string",
          "about": "Write only if the file is still at this version (\"ver_…\"); else 412 `precondition_failed` with `details.current_version_id`"
        }
      ],
      "returns": "200 NodeInfo",
      "examples": {
        "cli": "side rm /old.md",
        "curl": "curl -X DELETE -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/nodes/$NID\"",
        "mcp": "delete {\"space\":\"Film A\",\"path\":\"/old.md\"}",
        "python": "side.remove(\"/old.md\", if_version_id=\"ver_…\")",
        "typescript": "await side.remove(\"/old.md\", { ifVersionId: \"ver_…\" })"
      }
    },
    {
      "id": "GET /v1/spaces/{sid}/nodes/{nid}/access",
      "method": "GET",
      "path": "/v1/spaces/{sid}/nodes/{nid}/access",
      "tag": "orgs",
      "summary": "Your role at a file or folder, and the folder whose rules decide it",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "nid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 Access",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/nodes/$NID/access\""
      }
    },
    {
      "id": "PUT /v1/spaces/{sid}/nodes/{nid}/access",
      "method": "PUT",
      "path": "/v1/spaces/{sid}/nodes/{nid}/access",
      "tag": "orgs",
      "summary": "Set a folder's rules (a manager; tokens need members:manage). Replaces them.",
      "auth": "scope",
      "scopes": [
        "members:manage"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "nid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "grants",
          "type": "FolderGrant[]",
          "required": true
        },
        {
          "name": "default_role",
          "type": "Role|null"
        }
      ],
      "returns": "200 FolderAccess",
      "examples": {
        "curl": "curl -X PUT -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"grants\":[]}' \"$SIDESPACE_URL/v1/spaces/$SID/nodes/$NID/access\""
      }
    },
    {
      "id": "DELETE /v1/spaces/{sid}/nodes/{nid}/access",
      "method": "DELETE",
      "path": "/v1/spaces/{sid}/nodes/{nid}/access",
      "tag": "orgs",
      "summary": "Remove a folder's rules (a manager)",
      "auth": "scope",
      "scopes": [
        "members:manage"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "nid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "204 Done",
      "examples": {
        "curl": "curl -X DELETE -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/nodes/$NID/access\""
      }
    },
    {
      "id": "GET /v1/spaces/{sid}/nodes/{nid}/children",
      "method": "GET",
      "path": "/v1/spaces/{sid}/nodes/{nid}/children",
      "tag": "nodes",
      "summary": "Live children ordered by name; with as_of, the children it had then (all of them, one page)",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "nid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "cursor",
          "in": "query",
          "type": "string"
        },
        {
          "name": "limit",
          "in": "query",
          "type": "integer"
        },
        {
          "name": "as_of",
          "in": "query",
          "type": "string",
          "about": "Read the space as it was: an RFC 3339 time, a duration ago (\"-2h\", \"-90m\"), or a journal seq. The answer's Sidespace-As-Of-Seq header names the last change included. Versions are kept until a file is deleted for good, so a past head_version_id can be downloaded as usual."
        }
      ],
      "returns": "200 NodePage",
      "examples": {
        "cli": "side ls /cuts",
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/nodes/$NID/children\"",
        "mcp": "list_folder {\"space\":\"Film A\",\"path\":\"/cuts\"}",
        "python": "side.list(\"/cuts\")",
        "typescript": "await side.list(\"/cuts\")"
      }
    },
    {
      "id": "GET /v1/spaces/{sid}/nodes/{nid}/comments",
      "method": "GET",
      "path": "/v1/spaces/{sid}/nodes/{nid}/comments",
      "tag": "comments",
      "summary": "A file's comment threads, in timecode order, each with its replies",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "nid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "resolved",
          "in": "query",
          "type": "string",
          "about": "Include resolved threads"
        }
      ],
      "returns": "200 Threads",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/nodes/$NID/comments\"",
        "mcp": "list_comments {\"space\":\"Film A\",\"path\":\"/cuts/a.mov\"}",
        "python": "side.comments(\"/cuts/a.mov\")",
        "typescript": "await side.comments(\"/cuts/a.mov\")"
      }
    },
    {
      "id": "POST /v1/spaces/{sid}/nodes/{nid}/comments",
      "method": "POST",
      "path": "/v1/spaces/{sid}/nodes/{nid}/comments",
      "tag": "comments",
      "summary": "Comment (commenter and up; tokens need comments:write). The person who saved the version, and the author of a comment replied to, are notified.",
      "auth": "scope",
      "scopes": [
        "comments:write"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "nid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "body",
          "type": "string",
          "required": true
        },
        {
          "name": "at_ms",
          "type": "integer"
        },
        {
          "name": "parent_id",
          "type": "string",
          "about": "Reply to this comment (a reply to a reply joins the same thread)"
        },
        {
          "name": "region",
          "type": "Region"
        },
        {
          "name": "until_ms",
          "type": "integer",
          "about": "Needs at_ms; not before it"
        },
        {
          "name": "version_id",
          "type": "string",
          "about": "The version being looked at (default: the current one)"
        }
      ],
      "returns": "201 Comment",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"body\":\"…\"}' \"$SIDESPACE_URL/v1/spaces/$SID/nodes/$NID/comments\"",
        "mcp": "add_comment {\"space\":\"Film A\",\"path\":\"/cuts/a.mov\",\"body\":\"too dark\",\"at_ms\":1500}",
        "python": "side.add_comment(\"/cuts/a.mov\", \"too dark\", at_ms=1500)",
        "typescript": "await side.addComment(\"/cuts/a.mov\", { body: \"too dark\", at_ms: 1500 })"
      }
    },
    {
      "id": "POST /v1/spaces/{sid}/nodes/{nid}/edits",
      "method": "POST",
      "path": "/v1/spaces/{sid}/nodes/{nid}/edits",
      "tag": "versions",
      "summary": "Change byte ranges of a file and save it as a new version (editor)",
      "auth": "scope",
      "scopes": [
        "files:write"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "nid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "If-Match",
          "in": "header",
          "type": "string",
          "about": "Write only if the file is still at this version (\"ver_…\"); else 412 `precondition_failed` with `details.current_version_id`"
        },
        {
          "name": "truncate",
          "in": "query",
          "type": "integer",
          "about": "With the binary body"
        },
        {
          "name": "if_version_id",
          "in": "query",
          "type": "string",
          "about": "With the binary body"
        }
      ],
      "body": [
        {
          "name": "if_version_id",
          "type": "string",
          "about": "The version the offsets are in; must still be the head"
        },
        {
          "name": "ops",
          "type": "EditOp[]"
        },
        {
          "name": "truncate",
          "type": "integer",
          "about": "Cut the result to this many bytes"
        }
      ],
      "returns": "201 CommitVersionResponse",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{}' \"$SIDESPACE_URL/v1/spaces/$SID/nodes/$NID/edits\"",
        "mcp": "edit_text {\"space\":\"Film A\",\"path\":\"/script.md\",\"old_text\":\"dusk\",\"new_text\":\"night\"}",
        "python": "side.edit(\"/script.md\", [{\"at\": 120, \"delete\": 5, \"text\": \"night\"}], if_version_id=\"ver_…\")",
        "typescript": "await side.edit(\"/script.md\", [{ at: 120, delete: 5, text: \"night\" }], { ifVersionId: \"ver_…\" })"
      }
    },
    {
      "id": "POST /v1/spaces/{sid}/nodes/{nid}/restore",
      "method": "POST",
      "path": "/v1/spaces/{sid}/nodes/{nid}/restore",
      "tag": "nodes",
      "summary": "Undo a soft delete (editor)",
      "auth": "scope",
      "scopes": [
        "files:write"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "nid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 NodeInfo",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/nodes/$NID/restore\""
      }
    },
    {
      "id": "POST /v1/spaces/{sid}/nodes/{nid}/rewind",
      "method": "POST",
      "path": "/v1/spaces/{sid}/nodes/{nid}/rewind",
      "tag": "nodes",
      "summary": "Put a folder back the way it was at a moment (editor)",
      "auth": "scope",
      "scopes": [
        "files:write"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "nid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "as_of",
          "type": "string",
          "required": true,
          "about": "An RFC 3339 time, a duration ago (\"-2h\") or a journal seq"
        },
        {
          "name": "dry_run",
          "type": "boolean"
        }
      ],
      "returns": "200 RewindResult",
      "examples": {
        "cli": "side rewind /Ep01 --to -2h --dry-run",
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"as_of\":\"…\"}' \"$SIDESPACE_URL/v1/spaces/$SID/nodes/$NID/rewind\"",
        "mcp": "rewind_folder {\"space\":\"Film A\",\"path\":\"/Ep01\",\"as_of\":\"-2h\",\"dry_run\":true}",
        "python": "side.rewind(\"/Ep01\", \"-2h\", dry_run=True)",
        "typescript": "await side.rewind(\"/Ep01\", \"-2h\", { dryRun: true })"
      }
    },
    {
      "id": "GET /v1/spaces/{sid}/nodes/{nid}/size",
      "method": "GET",
      "path": "/v1/spaces/{sid}/nodes/{nid}/size",
      "tag": "nodes",
      "summary": "What a folder (or file) weighs, originals and video proxies, for an offline estimate",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "nid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 FolderSize",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/nodes/$NID/size\""
      }
    },
    {
      "id": "GET /v1/spaces/{sid}/nodes/{nid}/versions",
      "method": "GET",
      "path": "/v1/spaces/{sid}/nodes/{nid}/versions",
      "tag": "versions",
      "summary": "Version history, newest first",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "nid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 Versions",
      "examples": {
        "cli": "side versions /cuts/a.mov",
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/nodes/$NID/versions\"",
        "mcp": "list_versions {\"space\":\"Film A\",\"path\":\"/cuts/a.mov\"}",
        "python": "side.versions(\"/cuts/a.mov\")",
        "typescript": "await side.versions(\"/cuts/a.mov\")"
      }
    },
    {
      "id": "POST /v1/spaces/{sid}/nodes/{nid}/versions",
      "method": "POST",
      "path": "/v1/spaces/{sid}/nodes/{nid}/versions",
      "tag": "versions",
      "summary": "Commit a new version (editor). Last save wins.",
      "auth": "scope",
      "scopes": [
        "files:write"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "nid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "If-Match",
          "in": "header",
          "type": "string",
          "about": "Write only if the file is still at this version (\"ver_…\"); else 412 `precondition_failed` with `details.current_version_id`"
        },
        {
          "name": "If-None-Match",
          "in": "header",
          "type": "string",
          "about": "\"*\": write only if nothing is there yet (no file at the name, or a file with no version); else 412 `precondition_failed`"
        }
      ],
      "body": [
        {
          "name": "base_version_id",
          "type": "string|null",
          "required": true
        },
        {
          "name": "manifest",
          "type": "Manifest",
          "required": true
        },
        {
          "name": "client_mtime",
          "type": "Timestamp"
        },
        {
          "name": "if_new",
          "type": "boolean",
          "about": "Save only if the file has no version yet (same as If-None-Match: *)"
        },
        {
          "name": "if_version_id",
          "type": "string",
          "about": "Save only if the file is still at this version (same as If-Match); else 412 `precondition_failed`"
        },
        {
          "name": "mime",
          "type": "string"
        }
      ],
      "returns": "201 CommitVersionResponse",
      "examples": {
        "cli": "side put ./notes.md /notes.md --if-version ver_…",
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"base_version_id\":\"…\",\"manifest\":{}}' \"$SIDESPACE_URL/v1/spaces/$SID/nodes/$NID/versions\"",
        "mcp": "write_text {\"space\":\"Film A\",\"path\":\"/notes.md\",\"content\":\"# Notes\\n\",\"if_version_id\":\"ver_…\"}",
        "python": "side.upload(\"/notes.md\", b\"# Notes\\n\", if_version_id=\"ver_…\")",
        "typescript": "await side.upload(\"/notes.md\", \"# Notes\\n\", { ifVersionId: \"ver_…\" })"
      }
    },
    {
      "id": "PUT /v1/spaces/{sid}/org",
      "method": "PUT",
      "path": "/v1/spaces/{sid}/org",
      "tag": "orgs",
      "summary": "Put the space in an organization, or take it out with an empty org_id (a space manager who is an admin there)",
      "auth": "scope",
      "scopes": [
        "admin"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "org_id",
          "type": "string",
          "required": true
        }
      ],
      "returns": "200 Space",
      "examples": {
        "curl": "curl -X PUT -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"org_id\":\"…\"}' \"$SIDESPACE_URL/v1/spaces/$SID/org\""
      }
    },
    {
      "id": "GET /v1/spaces/{sid}/paths/{path}",
      "method": "GET",
      "path": "/v1/spaces/{sid}/paths/{path}",
      "tag": "nodes",
      "summary": "The live file or folder at a path, or with as_of what was there then",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "path",
          "in": "path",
          "required": true,
          "type": "string",
          "about": "e.g. Ep01/Shots/a.mov (slashes kept); empty = the root"
        },
        {
          "name": "as_of",
          "in": "query",
          "type": "string",
          "about": "Read the space as it was: an RFC 3339 time, a duration ago (\"-2h\", \"-90m\"), or a journal seq. The answer's Sidespace-As-Of-Seq header names the last change included. Versions are kept until a file is deleted for good, so a past head_version_id can be downloaded as usual."
        }
      ],
      "returns": "200 NodeInfo",
      "examples": {
        "cli": "side ls /cuts/a.mov",
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/paths/cuts/a.mov\"",
        "python": "side.node(\"/cuts/a.mov\")",
        "typescript": "await side.node(\"/cuts/a.mov\")"
      }
    },
    {
      "id": "GET /v1/spaces/{sid}/pipeline-templates",
      "method": "GET",
      "path": "/v1/spaces/{sid}/pipeline-templates",
      "tag": "developer",
      "summary": "Ready-made rule sets (any member)",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 Templates",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/pipeline-templates\""
      }
    },
    {
      "id": "POST /v1/spaces/{sid}/pipeline-templates/{tid}",
      "method": "POST",
      "path": "/v1/spaces/{sid}/pipeline-templates/{tid}",
      "tag": "developer",
      "summary": "Create a template's pipelines in the space (manager; tokens need pipelines:manage)",
      "auth": "scope",
      "scopes": [
        "pipelines:manage"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "tid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "backfill",
          "type": "boolean",
          "about": "Also run them on the matching files already there"
        },
        {
          "name": "path_glob",
          "type": "string",
          "about": "Limit them to these paths"
        }
      ],
      "returns": "201 Created",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{}' \"$SIDESPACE_URL/v1/spaces/$SID/pipeline-templates/$TID\""
      }
    },
    {
      "id": "GET /v1/spaces/{sid}/pipelines",
      "method": "GET",
      "path": "/v1/spaces/{sid}/pipelines",
      "tag": "developer",
      "summary": "The space's pipelines (any member)",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 Pipelines",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/pipelines\""
      }
    },
    {
      "id": "POST /v1/spaces/{sid}/pipelines",
      "method": "POST",
      "path": "/v1/spaces/{sid}/pipelines",
      "tag": "developer",
      "summary": "Run an action on every new file that matches (manager; tokens need pipelines:manage). Starts with files saved from now on; backfill for the ones already there.",
      "auth": "scope",
      "scopes": [
        "pipelines:manage"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "action",
          "type": "string"
        },
        {
          "name": "active",
          "type": "boolean"
        },
        {
          "name": "after",
          "type": "string",
          "about": "An action name; \"\" clears it"
        },
        {
          "name": "conditions",
          "type": "PipelineConditions"
        },
        {
          "name": "mime_prefix",
          "type": "string"
        },
        {
          "name": "name",
          "type": "string"
        },
        {
          "name": "params",
          "type": "object"
        },
        {
          "name": "path_glob",
          "type": "string"
        }
      ],
      "returns": "201 Pipeline",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{}' \"$SIDESPACE_URL/v1/spaces/$SID/pipelines\""
      }
    },
    {
      "id": "PATCH /v1/spaces/{sid}/pipelines/{pid}",
      "method": "PATCH",
      "path": "/v1/spaces/{sid}/pipelines/{pid}",
      "tag": "developer",
      "summary": "Change it, or turn it off or back on (manager)",
      "auth": "scope",
      "scopes": [
        "pipelines:manage"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "pid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "action",
          "type": "string"
        },
        {
          "name": "active",
          "type": "boolean"
        },
        {
          "name": "after",
          "type": "string",
          "about": "An action name; \"\" clears it"
        },
        {
          "name": "conditions",
          "type": "PipelineConditions"
        },
        {
          "name": "mime_prefix",
          "type": "string"
        },
        {
          "name": "name",
          "type": "string"
        },
        {
          "name": "params",
          "type": "object"
        },
        {
          "name": "path_glob",
          "type": "string"
        }
      ],
      "returns": "200 Pipeline",
      "examples": {
        "curl": "curl -X PATCH -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{}' \"$SIDESPACE_URL/v1/spaces/$SID/pipelines/$PID\""
      }
    },
    {
      "id": "DELETE /v1/spaces/{sid}/pipelines/{pid}",
      "method": "DELETE",
      "path": "/v1/spaces/{sid}/pipelines/{pid}",
      "tag": "developer",
      "summary": "Remove it (its runs stay)",
      "auth": "scope",
      "scopes": [
        "pipelines:manage"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "pid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "204 Removed",
      "examples": {
        "curl": "curl -X DELETE -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/pipelines/$PID\""
      }
    },
    {
      "id": "POST /v1/spaces/{sid}/pipelines/{pid}/backfill",
      "method": "POST",
      "path": "/v1/spaces/{sid}/pipelines/{pid}/backfill",
      "tag": "developer",
      "summary": "Queue the action on the matching files already in the space (manager)",
      "auth": "scope",
      "scopes": [
        "pipelines:manage"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "pid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 How many runs started",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/pipelines/$PID/backfill\""
      }
    },
    {
      "id": "GET /v1/spaces/{sid}/plan",
      "method": "GET",
      "path": "/v1/spaces/{sid}/plan",
      "tag": "billing",
      "summary": "The space's plan, its limits after any overrides, and what the space used this month (any member)",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 Account",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/plan\""
      }
    },
    {
      "id": "POST /v1/spaces/{sid}/plan/checkout",
      "method": "POST",
      "path": "/v1/spaces/{sid}/plan/checkout",
      "tag": "billing",
      "summary": "Buy a plan for the space through Stripe Checkout (the space's owner)",
      "auth": "scope",
      "scopes": [
        "files:write"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "plan_id",
          "type": "string",
          "required": true
        },
        {
          "name": "interval",
          "type": "string"
        },
        {
          "name": "storage_id",
          "type": "string",
          "about": "One of the caller's buckets the space moves to once the payment lands (at once while it holds no files, else by a move). Without it, a bucket an earlier Checkout left waiting is dropped."
        }
      ],
      "returns": "200 The page to open",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"plan_id\":\"…\"}' \"$SIDESPACE_URL/v1/spaces/$SID/plan/checkout\""
      }
    },
    {
      "id": "POST /v1/spaces/{sid}/plan/portal",
      "method": "POST",
      "path": "/v1/spaces/{sid}/plan/portal",
      "tag": "billing",
      "summary": "Open Stripe's billing portal for the space (its owner; the space has paid before)",
      "auth": "scope",
      "scopes": [
        "files:write"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "interval",
          "type": "string",
          "about": "Billing interval for plan_id (default month)"
        },
        {
          "name": "plan_id",
          "type": "string",
          "about": "A plan to switch to; the portal opens on confirming it"
        }
      ],
      "returns": "200 The page to open",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{}' \"$SIDESPACE_URL/v1/spaces/$SID/plan/portal\""
      }
    },
    {
      "id": "GET /v1/spaces/{sid}/plugins",
      "method": "GET",
      "path": "/v1/spaces/{sid}/plugins",
      "tag": "developer",
      "summary": "The space's plugins (any member)",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 Plugins",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/plugins\""
      }
    },
    {
      "id": "POST /v1/spaces/{sid}/plugins",
      "method": "POST",
      "path": "/v1/spaces/{sid}/plugins",
      "tag": "developer",
      "summary": "Install a plugin from its manifest (manager; tokens need plugins:manage). The signing secret is shown once.",
      "auth": "scope",
      "scopes": [
        "plugins:manage"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "active",
          "type": "boolean"
        },
        {
          "name": "manifest",
          "type": "PluginManifest"
        },
        {
          "name": "manifest_url",
          "type": "string"
        }
      ],
      "returns": "201 Installed",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{}' \"$SIDESPACE_URL/v1/spaces/$SID/plugins\""
      }
    },
    {
      "id": "PATCH /v1/spaces/{sid}/plugins/{pid}",
      "method": "PATCH",
      "path": "/v1/spaces/{sid}/plugins/{pid}",
      "tag": "developer",
      "summary": "Take a new manifest (same name), or turn it off or on (manager)",
      "auth": "scope",
      "scopes": [
        "plugins:manage"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "pid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "active",
          "type": "boolean"
        },
        {
          "name": "manifest",
          "type": "PluginManifest"
        },
        {
          "name": "manifest_url",
          "type": "string"
        }
      ],
      "returns": "200 Plugin",
      "examples": {
        "curl": "curl -X PATCH -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{}' \"$SIDESPACE_URL/v1/spaces/$SID/plugins/$PID\""
      }
    },
    {
      "id": "DELETE /v1/spaces/{sid}/plugins/{pid}",
      "method": "DELETE",
      "path": "/v1/spaces/{sid}/plugins/{pid}",
      "tag": "developer",
      "summary": "Uninstall (manager). Runs still waiting on it fail; what it wrote stays.",
      "auth": "scope",
      "scopes": [
        "plugins:manage"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "pid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "204 Removed",
      "examples": {
        "curl": "curl -X DELETE -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/plugins/$PID\""
      }
    },
    {
      "id": "GET /v1/spaces/{sid}/presence",
      "method": "GET",
      "path": "/v1/spaces/{sid}/presence",
      "tag": "realtime",
      "summary": "Who is viewing or editing which file in the space now (also pushed over /v1/ws as type \"presence\")",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 Live reports",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/presence\""
      }
    },
    {
      "id": "POST /v1/spaces/{sid}/presence",
      "method": "POST",
      "path": "/v1/spaces/{sid}/presence",
      "tag": "realtime",
      "summary": "Report this device's activity on a file (member). A report lasts 90 s unless renewed; \"none\" ends it.",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "node_id",
          "type": "string",
          "required": true
        },
        {
          "name": "state",
          "type": "string",
          "required": true
        }
      ],
      "returns": "200 Presence",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"node_id\":\"…\",\"state\":\"…\"}' \"$SIDESPACE_URL/v1/spaces/$SID/presence\""
      }
    },
    {
      "id": "GET /v1/spaces/{sid}/runs",
      "method": "GET",
      "path": "/v1/spaces/{sid}/runs",
      "tag": "developer",
      "summary": "Recent runs, newest first (any member)",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "version_id",
          "in": "query",
          "type": "string"
        },
        {
          "name": "node_id",
          "in": "query",
          "type": "string"
        },
        {
          "name": "state",
          "in": "query",
          "type": "RunState"
        },
        {
          "name": "action",
          "in": "query",
          "type": "string"
        },
        {
          "name": "pipeline_id",
          "in": "query",
          "type": "string"
        },
        {
          "name": "limit",
          "in": "query",
          "type": "integer"
        }
      ],
      "returns": "200 Runs",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/runs\""
      }
    },
    {
      "id": "POST /v1/spaces/{sid}/runs",
      "method": "POST",
      "path": "/v1/spaces/{sid}/runs",
      "tag": "developer",
      "summary": "Run an action on a file (editor; tokens need runs:write). Answers the queued, waiting or running run, or 200 with a done run when the same bytes were done before. Where it is done is decided now (ADR 0059): the drive's setting (GET /v1/spaces/{sid}/ai), the workspace's, and whether a member's device that can do it asked for work lately. A run for a device is \"waiting\" (target device) until one claims it.",
      "auth": "scope",
      "scopes": [
        "runs:write"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "action",
          "type": "string",
          "required": true
        },
        {
          "name": "backend",
          "type": "string",
          "about": "Another backend than the workspace's default; the run then never moves to another (no fallback to the server unless it has this one)"
        },
        {
          "name": "device",
          "type": "string",
          "about": "With here and a token: the runner's name, as it claims with"
        },
        {
          "name": "fresh",
          "type": "boolean",
          "about": "Run again even if these bytes were done before"
        },
        {
          "name": "here",
          "type": "boolean",
          "about": "Bind the run to the calling device (a signed-in device, or a token runner named in device): only it claims it, it never moves to the server or another device, and released it stays bound. 409 when that device has not asked for this action lately, the drive works on the server, or the workspace keeps members' devices out. A live run of the same work that still waits is bound to the caller instead. Bound runs still waiting are canceled when their device stops asking for work for 30 minutes."
        },
        {
          "name": "node_id",
          "type": "string"
        },
        {
          "name": "params",
          "type": "object",
          "about": "Checked against the action's params_schema"
        },
        {
          "name": "path",
          "type": "string"
        },
        {
          "name": "priority",
          "type": "string",
          "about": "now: someone is waiting; batch: one of many a person started; auto: a device pulling missing work for itself. Pipelines' runs are auto."
        },
        {
          "name": "version_id",
          "type": "string"
        }
      ],
      "returns": "200 Run",
      "examples": {
        "cli": "side run /cuts/a.mov side.transcribe --param language=en",
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"action\":\"…\"}' \"$SIDESPACE_URL/v1/spaces/$SID/runs\"",
        "mcp": "run_action {\"space\":\"Film A\",\"action\":\"side.transcribe\",\"path\":\"/cuts/a.mov\",\"params\":{\"language\":\"en\"}}",
        "python": "side.run(\"/cuts/a.mov\", \"side.transcribe\", {\"language\": \"en\"})",
        "typescript": "await side.run(\"/cuts/a.mov\", \"side.transcribe\", { language: \"en\" })"
      }
    },
    {
      "id": "GET /v1/spaces/{sid}/runs/{rid}",
      "method": "GET",
      "path": "/v1/spaces/{sid}/runs/{rid}",
      "tag": "developer",
      "summary": "One run, with progress while running and the result when done",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "rid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 Run",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/runs/$RID\""
      }
    },
    {
      "id": "POST /v1/spaces/{sid}/runs/{rid}/cancel",
      "method": "POST",
      "path": "/v1/spaces/{sid}/runs/{rid}/cancel",
      "tag": "developer",
      "summary": "Stop a queued, waiting or running run (editor)",
      "auth": "scope",
      "scopes": [
        "runs:write"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "rid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 Run",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/runs/$RID/cancel\""
      }
    },
    {
      "id": "GET /v1/spaces/{sid}/shares",
      "method": "GET",
      "path": "/v1/spaces/{sid}/shares",
      "tag": "shares",
      "summary": "",
      "auth": "scope",
      "scopes": [
        "shares:manage"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 Shares",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/shares\""
      }
    },
    {
      "id": "POST /v1/spaces/{sid}/shares",
      "method": "POST",
      "path": "/v1/spaces/{sid}/shares",
      "tag": "shares",
      "summary": "Create a link (editor). The token is returned only once.",
      "auth": "scope",
      "scopes": [
        "shares:manage"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "mode",
          "type": "ShareMode",
          "required": true
        },
        {
          "name": "node_id",
          "type": "string",
          "required": true
        },
        {
          "name": "can_comment",
          "type": "boolean",
          "about": "A review link: people with it can comment once signed in"
        },
        {
          "name": "expires_at",
          "type": "Timestamp"
        },
        {
          "name": "message",
          "type": "string",
          "about": "Mode request: details for the senders"
        },
        {
          "name": "no_download",
          "type": "boolean",
          "about": "Watch-only: no downloads; videos play their streaming proxy, and originals the browser cannot show are not served"
        },
        {
          "name": "password",
          "type": "string"
        },
        {
          "name": "require_login",
          "type": "boolean",
          "about": "People sign in before they see anything"
        },
        {
          "name": "title",
          "type": "string",
          "about": "Mode request (required there): what files you are asking for"
        }
      ],
      "returns": "201 CreateShareResponse",
      "examples": {
        "cli": "side share /selects",
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"mode\":{},\"node_id\":\"…\"}' \"$SIDESPACE_URL/v1/spaces/$SID/shares\"",
        "mcp": "share_link {\"space\":\"Film A\",\"path\":\"/selects\",\"can_comment\":true}"
      }
    },
    {
      "id": "DELETE /v1/spaces/{sid}/shares/{id}",
      "method": "DELETE",
      "path": "/v1/spaces/{sid}/shares/{id}",
      "tag": "shares",
      "summary": "Revoke a link (editor)",
      "auth": "scope",
      "scopes": [
        "shares:manage"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "id",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "204 Revoked",
      "examples": {
        "curl": "curl -X DELETE -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/shares/$ID\""
      }
    },
    {
      "id": "POST /v1/spaces/{sid}/shares/{id}/mail",
      "method": "POST",
      "path": "/v1/spaces/{sid}/shares/{id}/mail",
      "tag": "shares",
      "summary": "Send the link by mail (editor) — up to 20 addresses at a time and 100 a day per account; links made before tokens were kept cannot be mailed (409 link_unavailable); 503 mail_unavailable when the server sends no mail",
      "auth": "scope",
      "scopes": [
        "shares:manage"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "id",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "emails",
          "type": "string[]",
          "required": true,
          "about": "Addresses; an entry may hold several separated by commas or spaces"
        },
        {
          "name": "message",
          "type": "string",
          "about": "A note shown above the link"
        }
      ],
      "returns": "200 Sent",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"emails\":[]}' \"$SIDESPACE_URL/v1/spaces/$SID/shares/$ID/mail\""
      }
    },
    {
      "id": "GET /v1/spaces/{sid}/shares/{id}/people",
      "method": "GET",
      "path": "/v1/spaces/{sid}/shares/{id}/people",
      "tag": "shares",
      "summary": "Who the link reached (editor) — signed-in visitors who commented, sent files or saved a copy, and accounts made from it, with their email, to invite (ADR 0043)",
      "auth": "scope",
      "scopes": [
        "shares:manage"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "id",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 People",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/shares/$ID/people\""
      }
    },
    {
      "id": "GET /v1/spaces/{sid}/shelf",
      "method": "GET",
      "path": "/v1/spaces/{sid}/shelf",
      "tag": "realtime",
      "summary": "The team shelf, newest first (items fade after a week; changes are pushed over /v1/ws as type \"shelf\")",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 Items",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/shelf\""
      }
    },
    {
      "id": "POST /v1/spaces/{sid}/shelf",
      "method": "POST",
      "path": "/v1/spaces/{sid}/shelf",
      "tag": "realtime",
      "summary": "Put a note, a link (commenter) or a file or folder of the space (editor) on the shelf",
      "auth": "scope",
      "scopes": [
        "files:write"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "node_id",
          "type": "string"
        },
        {
          "name": "text",
          "type": "string"
        }
      ],
      "returns": "201 ShelfItem",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{}' \"$SIDESPACE_URL/v1/spaces/$SID/shelf\""
      }
    },
    {
      "id": "DELETE /v1/spaces/{sid}/shelf/{iid}",
      "method": "DELETE",
      "path": "/v1/spaces/{sid}/shelf/{iid}",
      "tag": "realtime",
      "summary": "Take an item off the shelf (who put it there, or a manager); a file stays in the space",
      "auth": "scope",
      "scopes": [
        "files:write"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "iid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "204 Removed",
      "examples": {
        "curl": "curl -X DELETE -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/shelf/$IID\""
      }
    },
    {
      "id": "GET /v1/spaces/{sid}/snapshot",
      "method": "GET",
      "path": "/v1/spaces/{sid}/snapshot",
      "tag": "sync",
      "summary": "Full listing of live nodes for the first sync; read the journal after the first page's at_seq",
      "auth": "scope",
      "scopes": [
        "files:read",
        "events:read"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "cursor",
          "in": "query",
          "type": "string"
        },
        {
          "name": "limit",
          "in": "query",
          "type": "integer"
        }
      ],
      "returns": "200 SnapshotPage",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/snapshot\""
      }
    },
    {
      "id": "GET /v1/spaces/{sid}/storage",
      "method": "GET",
      "path": "/v1/spaces/{sid}/storage",
      "tag": "storage",
      "summary": "Where the space keeps its files, the storage a manager could move it to, and its last move",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 SpaceStorage",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/storage\""
      }
    },
    {
      "id": "GET /v1/spaces/{sid}/storage/moves",
      "method": "GET",
      "path": "/v1/spaces/{sid}/storage/moves",
      "tag": "storage",
      "summary": "The space's moves, newest first (managers)",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 Moves",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/storage/moves\""
      }
    },
    {
      "id": "POST /v1/spaces/{sid}/storage/moves",
      "method": "POST",
      "path": "/v1/spaces/{sid}/storage/moves",
      "tag": "storage",
      "summary": "Move the space's files (and its forks') to other storage (a manager who may use it). Copies everything, switches the space over, keeps reading the old storage while older tickets last, then (remove_source) deletes the old copies. The space keeps working throughout. 409 for a fork (move its origin) or when a move is under way.",
      "auth": "scope",
      "scopes": [
        "admin"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "remove_source",
          "type": "boolean",
          "about": "Delete the old copies once the move is over"
        },
        {
          "name": "storage_id",
          "type": "string",
          "about": "Where to; empty for the server's own storage"
        }
      ],
      "returns": "201 StorageMove",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{}' \"$SIDESPACE_URL/v1/spaces/$SID/storage/moves\""
      }
    },
    {
      "id": "GET /v1/spaces/{sid}/storage/moves/{mid}",
      "method": "GET",
      "path": "/v1/spaces/{sid}/storage/moves/{mid}",
      "tag": "storage",
      "summary": "",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "mid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 StorageMove",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/storage/moves/$MID\""
      }
    },
    {
      "id": "POST /v1/spaces/{sid}/storage/moves/{mid}/cancel",
      "method": "POST",
      "path": "/v1/spaces/{sid}/storage/moves/{mid}/cancel",
      "tag": "storage",
      "summary": "Stop a move before the switch and delete what it copied (409 after the switch)",
      "auth": "scope",
      "scopes": [
        "admin"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "mid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 StorageMove",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/storage/moves/$MID/cancel\""
      }
    },
    {
      "id": "POST /v1/spaces/{sid}/storage/moves/{mid}/retry",
      "method": "POST",
      "path": "/v1/spaces/{sid}/storage/moves/{mid}/retry",
      "tag": "storage",
      "summary": "Pick a failed move up where it stopped",
      "auth": "scope",
      "scopes": [
        "admin"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "mid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 StorageMove",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/storage/moves/$MID/retry\""
      }
    },
    {
      "id": "POST /v1/spaces/{sid}/upload-sessions",
      "method": "POST",
      "path": "/v1/spaces/{sid}/upload-sessions",
      "tag": "versions",
      "summary": "Ask which chunks the block gateway is missing and get a put ticket (editor)",
      "auth": "scope",
      "scopes": [
        "files:write",
        "renditions:write"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "hashes",
          "type": "Hash[]",
          "required": true
        }
      ],
      "returns": "200 UploadSession",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"hashes\":[]}' \"$SIDESPACE_URL/v1/spaces/$SID/upload-sessions\""
      }
    },
    {
      "id": "GET /v1/spaces/{sid}/versions/{vid}/compare/{other}",
      "method": "GET",
      "path": "/v1/spaces/{sid}/versions/{vid}/compare/{other}",
      "tag": "versions",
      "summary": "What differs from one version to another (of one file or two files in the space)",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "vid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "other",
          "in": "path",
          "required": true,
          "type": "string",
          "about": "The version to compare with (B); vid is A"
        }
      ],
      "returns": "200 VersionCompare",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/versions/$VID/compare/$OTHER\""
      }
    },
    {
      "id": "PUT /v1/spaces/{sid}/versions/{vid}/label",
      "method": "PUT",
      "path": "/v1/spaces/{sid}/versions/{vid}/label",
      "tag": "versions",
      "summary": "Name a version (\"Client cut\"), or clear its name with \"\" (editor)",
      "auth": "scope",
      "scopes": [
        "files:write"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "vid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "label",
          "type": "string",
          "required": true
        }
      ],
      "returns": "200 VersionInfo",
      "examples": {
        "curl": "curl -X PUT -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"label\":\"…\"}' \"$SIDESPACE_URL/v1/spaces/$SID/versions/$VID/label\""
      }
    },
    {
      "id": "GET /v1/spaces/{sid}/versions/{vid}/media",
      "method": "GET",
      "path": "/v1/spaces/{sid}/versions/{vid}/media",
      "tag": "sidecars",
      "summary": "Where the server is with a version's previews (proxy, poster, filmstrip, waveform), with time left",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "vid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 MediaStatus",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/versions/$VID/media\""
      }
    },
    {
      "id": "GET /v1/spaces/{sid}/versions/{vid}/renditions/{kind}",
      "method": "GET",
      "path": "/v1/spaces/{sid}/versions/{vid}/renditions/{kind}",
      "tag": "sidecars",
      "summary": "",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "vid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "kind",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 Rendition",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/versions/$VID/renditions/$KIND\""
      }
    },
    {
      "id": "PUT /v1/spaces/{sid}/versions/{vid}/renditions/{kind}",
      "method": "PUT",
      "path": "/v1/spaces/{sid}/versions/{vid}/renditions/{kind}",
      "tag": "sidecars",
      "summary": "Attach a derived file (chunks uploaded through an upload session first)",
      "auth": "scope",
      "scopes": [
        "renditions:write"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "vid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "kind",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "manifest",
          "type": "Manifest",
          "required": true
        },
        {
          "name": "mime",
          "type": "string",
          "required": true
        }
      ],
      "returns": "200 Rendition",
      "examples": {
        "curl": "curl -X PUT -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"manifest\":{},\"mime\":\"…\"}' \"$SIDESPACE_URL/v1/spaces/$SID/versions/$VID/renditions/$KIND\""
      }
    },
    {
      "id": "POST /v1/spaces/{sid}/versions/{vid}/restore",
      "method": "POST",
      "path": "/v1/spaces/{sid}/versions/{vid}/restore",
      "tag": "versions",
      "summary": "Copy an old version as the new head (editor)",
      "auth": "scope",
      "scopes": [
        "files:write"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "vid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "If-Match",
          "in": "header",
          "type": "string",
          "about": "Write only if the file is still at this version (\"ver_…\"); else 412 `precondition_failed` with `details.current_version_id`"
        }
      ],
      "returns": "201 CommitVersionResponse",
      "examples": {
        "cli": "side restore ver_…",
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/versions/$VID/restore\"",
        "mcp": "restore_version {\"space\":\"Film A\",\"version_id\":\"ver_…\"}",
        "python": "side.restore_version(\"ver_…\")",
        "typescript": "await side.restoreVersion(\"ver_…\")"
      }
    },
    {
      "id": "GET /v1/spaces/{sid}/versions/{vid}/sidecars",
      "method": "GET",
      "path": "/v1/spaces/{sid}/versions/{vid}/sidecars",
      "tag": "sidecars",
      "summary": "",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "vid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 Sidecars",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/versions/$VID/sidecars\"",
        "mcp": "get_sidecar {\"space\":\"Film A\",\"path\":\"/cuts/a.mov\",\"namespace\":\"ai.tags\"}",
        "python": "side.sidecars(\"/cuts/a.mov\")",
        "typescript": "await side.sidecars(\"/cuts/a.mov\")"
      }
    },
    {
      "id": "GET /v1/spaces/{sid}/versions/{vid}/sidecars/{ns}",
      "method": "GET",
      "path": "/v1/spaces/{sid}/versions/{vid}/sidecars/{ns}",
      "tag": "sidecars",
      "summary": "",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "vid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "ns",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 Sidecar",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/versions/$VID/sidecars/$NS\""
      }
    },
    {
      "id": "PUT /v1/spaces/{sid}/versions/{vid}/sidecars/{ns}",
      "method": "PUT",
      "path": "/v1/spaces/{sid}/versions/{vid}/sidecars/{ns}",
      "tag": "sidecars",
      "summary": "Write a whole sidecar (editor)",
      "auth": "scope",
      "scopes": [
        "sidecars:write:ns"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "vid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "ns",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "If-Match",
          "in": "header",
          "type": "string",
          "about": "The rev read, e.g. \"3\" (instead of rev in the body)"
        }
      ],
      "body": [
        {
          "name": "doc",
          "type": "object",
          "required": true
        },
        {
          "name": "producer",
          "type": "object"
        },
        {
          "name": "rev",
          "type": "integer",
          "about": "The rev read (0: none yet); a stale one is refused with 409 stale_rev"
        },
        {
          "name": "schema_version",
          "type": "integer"
        }
      ],
      "returns": "200 Sidecar",
      "examples": {
        "curl": "curl -X PUT -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"doc\":{}}' \"$SIDESPACE_URL/v1/spaces/$SID/versions/$VID/sidecars/$NS\"",
        "mcp": "put_sidecar {\"space\":\"Film A\",\"path\":\"/cuts/a.mov\",\"namespace\":\"x-acme.qc\",\"doc\":{\"passed\":true}}",
        "python": "side.put_sidecar(\"/cuts/a.mov\", \"x-acme.qc\", {\"passed\": True})",
        "typescript": "await side.putSidecar(\"/cuts/a.mov\", \"x-acme.qc\", { passed: true })"
      }
    },
    {
      "id": "PATCH /v1/spaces/{sid}/versions/{vid}/sidecars/{ns}",
      "method": "PATCH",
      "path": "/v1/spaces/{sid}/versions/{vid}/sidecars/{ns}",
      "tag": "sidecars",
      "summary": "Change fields of a sidecar (editor)",
      "auth": "scope",
      "scopes": [
        "sidecars:write:ns"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "vid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "ns",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "If-Match",
          "in": "header",
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "ops",
          "type": "object[]",
          "required": true
        },
        {
          "name": "producer",
          "type": "object"
        },
        {
          "name": "rev",
          "type": "integer"
        },
        {
          "name": "schema_version",
          "type": "integer"
        }
      ],
      "returns": "200 Sidecar",
      "examples": {
        "curl": "curl -X PATCH -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"ops\":[]}' \"$SIDESPACE_URL/v1/spaces/$SID/versions/$VID/sidecars/$NS\""
      }
    },
    {
      "id": "DELETE /v1/spaces/{sid}/versions/{vid}/sidecars/{ns}",
      "method": "DELETE",
      "path": "/v1/spaces/{sid}/versions/{vid}/sidecars/{ns}",
      "tag": "sidecars",
      "summary": "Remove a sidecar, with its revisions (editor)",
      "auth": "scope",
      "scopes": [
        "sidecars:write:ns"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "vid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "ns",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "204 Deleted",
      "examples": {
        "curl": "curl -X DELETE -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/versions/$VID/sidecars/$NS\""
      }
    },
    {
      "id": "PUT /v1/spaces/{sid}/versions/{vid}/sidecars/{ns}/current",
      "method": "PUT",
      "path": "/v1/spaces/{sid}/versions/{vid}/sidecars/{ns}/current",
      "tag": "sidecars",
      "summary": "Make a revision the current one (editor), e.g. take the new AI transcript over a person's; the index follows",
      "auth": "scope",
      "scopes": [
        "sidecars:write:ns"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "vid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "ns",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "If-Match",
          "in": "header",
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "revision_id",
          "type": "string",
          "required": true
        },
        {
          "name": "rev",
          "type": "integer",
          "about": "The sidecar rev read; 409 stale_rev when it changed"
        }
      ],
      "returns": "200 Sidecar",
      "examples": {
        "curl": "curl -X PUT -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"revision_id\":\"…\"}' \"$SIDESPACE_URL/v1/spaces/$SID/versions/$VID/sidecars/$NS/current\""
      }
    },
    {
      "id": "GET /v1/spaces/{sid}/versions/{vid}/sidecars/{ns}/revisions",
      "method": "GET",
      "path": "/v1/spaces/{sid}/versions/{vid}/sidecars/{ns}/revisions",
      "tag": "sidecars",
      "summary": "The revisions of a sidecar people correct (transcript), newest first (ADR 0060)",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "vid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "ns",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 Revisions",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/versions/$VID/sidecars/$NS/revisions\""
      }
    },
    {
      "id": "GET /v1/spaces/{sid}/versions/{vid}/sidecars/{ns}/revisions/{rid}",
      "method": "GET",
      "path": "/v1/spaces/{sid}/versions/{vid}/sidecars/{ns}/revisions/{rid}",
      "tag": "sidecars",
      "summary": "One revision, with its document",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "vid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "ns",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "rid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 SidecarRevision",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/versions/$VID/sidecars/$NS/revisions/$RID\""
      }
    },
    {
      "id": "GET /v1/spaces/{sid}/webhooks",
      "method": "GET",
      "path": "/v1/spaces/{sid}/webhooks",
      "tag": "developer",
      "summary": "The space's webhook subscriptions (manager; tokens need webhooks:manage)",
      "auth": "scope",
      "scopes": [
        "webhooks:manage"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 Subscriptions",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/webhooks\""
      }
    },
    {
      "id": "POST /v1/spaces/{sid}/webhooks",
      "method": "POST",
      "path": "/v1/spaces/{sid}/webhooks",
      "tag": "developer",
      "summary": "Subscribe a URL to the space's events (manager). The secret is shown once.",
      "auth": "scope",
      "scopes": [
        "webhooks:manage"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "active",
          "type": "boolean"
        },
        {
          "name": "description",
          "type": "string"
        },
        {
          "name": "events",
          "type": "string[]"
        },
        {
          "name": "from_seq",
          "type": "integer",
          "about": "Create only: start after this seq instead of with new events"
        },
        {
          "name": "mime_prefix",
          "type": "string"
        },
        {
          "name": "path_glob",
          "type": "string"
        },
        {
          "name": "url",
          "type": "string"
        }
      ],
      "returns": "201 Created",
      "examples": {
        "cli": "side webhook create https://example.com/hook --event version.created",
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{}' \"$SIDESPACE_URL/v1/spaces/$SID/webhooks\"",
        "python": "side.create_webhook(\"https://example.com/hook\", events=[\"version.created\"])",
        "typescript": "await side.createWebhook({ url: \"https://example.com/hook\", events: [\"version.created\"] })"
      }
    },
    {
      "id": "PATCH /v1/spaces/{sid}/webhooks/{wid}",
      "method": "PATCH",
      "path": "/v1/spaces/{sid}/webhooks/{wid}",
      "tag": "developer",
      "summary": "Change filters or URL, or turn it off or back on (on clears its failures)",
      "auth": "scope",
      "scopes": [
        "webhooks:manage"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "wid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "active",
          "type": "boolean"
        },
        {
          "name": "description",
          "type": "string"
        },
        {
          "name": "events",
          "type": "string[]"
        },
        {
          "name": "from_seq",
          "type": "integer",
          "about": "Create only: start after this seq instead of with new events"
        },
        {
          "name": "mime_prefix",
          "type": "string"
        },
        {
          "name": "path_glob",
          "type": "string"
        },
        {
          "name": "url",
          "type": "string"
        }
      ],
      "returns": "200 Webhook",
      "examples": {
        "curl": "curl -X PATCH -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{}' \"$SIDESPACE_URL/v1/spaces/$SID/webhooks/$WID\""
      }
    },
    {
      "id": "DELETE /v1/spaces/{sid}/webhooks/{wid}",
      "method": "DELETE",
      "path": "/v1/spaces/{sid}/webhooks/{wid}",
      "tag": "developer",
      "summary": "Remove the subscription and its delivery log",
      "auth": "scope",
      "scopes": [
        "webhooks:manage"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "wid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "204 Removed",
      "examples": {
        "curl": "curl -X DELETE -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/webhooks/$WID\""
      }
    },
    {
      "id": "GET /v1/spaces/{sid}/webhooks/{wid}/deliveries",
      "method": "GET",
      "path": "/v1/spaces/{sid}/webhooks/{wid}/deliveries",
      "tag": "developer",
      "summary": "Latest delivery attempts, newest first (kept 7 days)",
      "auth": "scope",
      "scopes": [
        "webhooks:manage"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "wid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "limit",
          "in": "query",
          "type": "integer"
        }
      ],
      "returns": "200 Deliveries",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/webhooks/$WID/deliveries\""
      }
    },
    {
      "id": "POST /v1/spaces/{sid}/webhooks/{wid}/ping",
      "method": "POST",
      "path": "/v1/spaces/{sid}/webhooks/{wid}/ping",
      "tag": "developer",
      "summary": "Send a test event of type ping now; the answer is the delivery (status, error, time)",
      "auth": "scope",
      "scopes": [
        "webhooks:manage"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "wid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 WebhookDelivery",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/spaces/$SID/webhooks/$WID/ping\""
      }
    },
    {
      "id": "POST /v1/spaces/{sid}/webhooks/{wid}/replay",
      "method": "POST",
      "path": "/v1/spaces/{sid}/webhooks/{wid}/replay",
      "tag": "developer",
      "summary": "Send every event after from_seq again (and turn the subscription on)",
      "auth": "scope",
      "scopes": [
        "webhooks:manage"
      ],
      "params": [
        {
          "name": "sid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "wid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "from_seq",
          "type": "integer",
          "required": true
        }
      ],
      "returns": "200 Webhook",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"from_seq\":0}' \"$SIDESPACE_URL/v1/spaces/$SID/webhooks/$WID/replay\""
      }
    },
    {
      "id": "GET /v1/storage",
      "method": "GET",
      "path": "/v1/storage",
      "tag": "storage",
      "summary": "My storage profiles (never the secret key)",
      "auth": "session",
      "returns": "200 Profiles",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/storage\""
      }
    },
    {
      "id": "POST /v1/storage",
      "method": "POST",
      "path": "/v1/storage",
      "tag": "storage",
      "summary": "Add a bucket. The gateway first writes, reads, lists and deletes a test object in it; 400 says what failed.",
      "auth": "session",
      "body": [
        {
          "name": "access_key",
          "type": "string"
        },
        {
          "name": "addressing",
          "type": "string",
          "about": "Override the provider's"
        },
        {
          "name": "bucket",
          "type": "string"
        },
        {
          "name": "endpoint",
          "type": "string",
          "about": "https URL of an S3-compatible service; empty for AWS S3. For r2 the account ID is enough; for oss, cos, b2 and wasabi the region is."
        },
        {
          "name": "kind",
          "type": "string"
        },
        {
          "name": "name",
          "type": "string"
        },
        {
          "name": "prefix",
          "type": "string"
        },
        {
          "name": "provider",
          "type": "StorageProvider",
          "about": "Fills in endpoint, region and addressing; guessed from the endpoint when absent"
        },
        {
          "name": "region",
          "type": "string",
          "about": "For AWS, asked from AWS when empty or wrong; us-east-1 for others when empty"
        },
        {
          "name": "secret_key",
          "type": "string",
          "about": "Stored sealed; never returned. Required with access_key: the gateway never lends its own credentials."
        }
      ],
      "returns": "201 StorageProfile",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{}' \"$SIDESPACE_URL/v1/storage\""
      }
    },
    {
      "id": "GET /v1/storage/providers",
      "method": "GET",
      "path": "/v1/storage/providers",
      "tag": "storage",
      "summary": "The providers the server has presets for",
      "auth": "session",
      "returns": "200 Providers",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/storage/providers\""
      }
    },
    {
      "id": "GET /v1/storage/{id}",
      "method": "GET",
      "path": "/v1/storage/{id}",
      "tag": "storage",
      "summary": "",
      "auth": "session",
      "params": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 StorageProfile",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/storage/$ID\""
      }
    },
    {
      "id": "PATCH /v1/storage/{id}",
      "method": "PATCH",
      "path": "/v1/storage/{id}",
      "tag": "storage",
      "summary": "Rename, or change credentials or region (checked like an add). Kind, endpoint, bucket and prefix are fixed while spaces use it (409).",
      "auth": "session",
      "params": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "access_key",
          "type": "string"
        },
        {
          "name": "addressing",
          "type": "string",
          "about": "Override the provider's"
        },
        {
          "name": "bucket",
          "type": "string"
        },
        {
          "name": "endpoint",
          "type": "string",
          "about": "https URL of an S3-compatible service; empty for AWS S3. For r2 the account ID is enough; for oss, cos, b2 and wasabi the region is."
        },
        {
          "name": "kind",
          "type": "string"
        },
        {
          "name": "name",
          "type": "string"
        },
        {
          "name": "prefix",
          "type": "string"
        },
        {
          "name": "provider",
          "type": "StorageProvider",
          "about": "Fills in endpoint, region and addressing; guessed from the endpoint when absent"
        },
        {
          "name": "region",
          "type": "string",
          "about": "For AWS, asked from AWS when empty or wrong; us-east-1 for others when empty"
        },
        {
          "name": "secret_key",
          "type": "string",
          "about": "Stored sealed; never returned. Required with access_key: the gateway never lends its own credentials."
        }
      ],
      "returns": "200 StorageProfile",
      "examples": {
        "curl": "curl -X PATCH -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{}' \"$SIDESPACE_URL/v1/storage/$ID\""
      }
    },
    {
      "id": "DELETE /v1/storage/{id}",
      "method": "DELETE",
      "path": "/v1/storage/{id}",
      "tag": "storage",
      "summary": "Remove a profile no space uses (409 otherwise)",
      "auth": "session",
      "params": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "204 Removed",
      "examples": {
        "curl": "curl -X DELETE -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/storage/$ID\""
      }
    },
    {
      "id": "GET /v1/token",
      "method": "GET",
      "path": "/v1/token",
      "tag": "developer",
      "summary": "The calling access token itself (who it acts as, scopes, spaces, expiry). Any token may call it.",
      "auth": "token",
      "returns": "200 TokenInfo",
      "examples": {
        "cli": "side token whoami",
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/token\"",
        "python": "side.token_info()",
        "typescript": "await side.tokenInfo()"
      }
    },
    {
      "id": "POST /v1/token/derive",
      "method": "POST",
      "path": "/v1/token/derive",
      "tag": "developer",
      "summary": "Make a narrower token from the calling one, e.g. for a subagent: scopes and spaces only shrink, it expires no later, and it is switched off when the calling token (or any token above it) is revoked or expires. At most 8 levels. A signed-in app may call it too, to hand an agent a short-lived token: scopes are then required, it lasts an hour unless expires_in_seconds says otherwise (at most a day), and it has no parent.",
      "auth": "token",
      "body": [
        {
          "name": "name",
          "type": "string",
          "required": true
        },
        {
          "name": "drive_ids",
          "type": "string[]",
          "about": "Only these drives, each one the calling token reaches. A calling token with drive_ids passes them on: the new one reaches no drive outside them"
        },
        {
          "name": "expires_in_seconds",
          "type": "integer",
          "about": "Omitted means when the calling token expires; never later than that"
        },
        {
          "name": "s3",
          "type": "boolean"
        },
        {
          "name": "scopes",
          "type": "string[]",
          "about": "Each must be granted by the calling token; omitted means the same scopes"
        },
        {
          "name": "space_ids",
          "type": "string[]",
          "about": "Each must be reachable by the calling token; omitted (with drive_ids) means the same spaces and drives"
        }
      ],
      "returns": "201 The token (shown once) and its details",
      "examples": {
        "cli": "side token derive subagent --scope files:read --expires 1h",
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"name\":\"…\"}' \"$SIDESPACE_URL/v1/token/derive\"",
        "python": "side.derive_token(\"subagent\", scopes=[\"files:read\"], expires_in_seconds=3600)",
        "typescript": "await side.deriveToken({ name: \"subagent\", scopes: [\"files:read\"], expiresInSeconds: 3600 })"
      }
    },
    {
      "id": "GET /v1/token/derived",
      "method": "GET",
      "path": "/v1/token/derived",
      "tag": "developer",
      "summary": "Tokens derived from the calling one, at any depth, newest first",
      "auth": "token",
      "returns": "200 Tokens",
      "examples": {
        "cli": "side token derived",
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/token/derived\"",
        "python": "side.derived_tokens()",
        "typescript": "await side.derivedTokens()"
      }
    },
    {
      "id": "DELETE /v1/token/derived/{id}",
      "method": "DELETE",
      "path": "/v1/token/derived/{id}",
      "tag": "developer",
      "summary": "Revoke a token derived from the calling one, and every token below it. The id \"self\" revokes the calling token.",
      "auth": "token",
      "params": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "204 Revoked",
      "examples": {
        "cli": "side token revoke tok_…",
        "curl": "curl -X DELETE -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/token/derived/$ID\"",
        "python": "side.revoke_token(\"tok_…\")",
        "typescript": "await side.revokeToken(\"tok_…\")"
      }
    },
    {
      "id": "GET /v1/tokens",
      "method": "GET",
      "path": "/v1/tokens",
      "tag": "developer",
      "summary": "Personal access tokens the caller made (for themselves and their agents), revoked ones included",
      "auth": "session",
      "returns": "200 Tokens",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/tokens\""
      }
    },
    {
      "id": "POST /v1/tokens",
      "method": "POST",
      "path": "/v1/tokens",
      "tag": "developer",
      "summary": "Make a personal access token; the secret is returned once",
      "auth": "session",
      "body": [
        {
          "name": "name",
          "type": "string",
          "required": true
        },
        {
          "name": "scopes",
          "type": "string[]",
          "required": true
        },
        {
          "name": "agent_id",
          "type": "string",
          "about": "Act as this agent (one the caller made) instead of the caller"
        },
        {
          "name": "drive_ids",
          "type": "string[]",
          "about": "Only these drives (a space's id, or a fork's) of those spaces; omitted means every drive of them, forks made later included"
        },
        {
          "name": "expires_in_days",
          "type": "integer",
          "about": "0 means never"
        },
        {
          "name": "s3",
          "type": "boolean",
          "about": "Also make it an S3 key for the S3-compatible gateway: s3_access_key_id is returned and the token is the secret access key"
        },
        {
          "name": "space_ids",
          "type": "string[]",
          "about": "Limit to these workspaces (the caller must be a member); omitted means every workspace. A drive's id here means that drive only"
        }
      ],
      "returns": "201 The token (shown once) and its details",
      "examples": {
        "cli": "side token create NAME --scope files:read --space \"Film A\"",
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"name\":\"…\",\"scopes\":[]}' \"$SIDESPACE_URL/v1/tokens\""
      }
    },
    {
      "id": "DELETE /v1/tokens/{id}",
      "method": "DELETE",
      "path": "/v1/tokens/{id}",
      "tag": "developer",
      "summary": "Revoke a token at once",
      "auth": "session",
      "params": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "204 Revoked",
      "examples": {
        "curl": "curl -X DELETE -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/tokens/$ID\""
      }
    },
    {
      "id": "GET /v1/workspaces",
      "method": "GET",
      "path": "/v1/workspaces",
      "tag": "workspaces",
      "summary": "Your workspaces, the default one first",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "returns": "200 Workspaces",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/workspaces\""
      }
    },
    {
      "id": "POST /v1/workspaces",
      "method": "POST",
      "path": "/v1/workspaces",
      "tag": "workspaces",
      "summary": "Make a workspace with you as its owner, on the free plan and the server's default storage (people only)",
      "auth": "scope",
      "scopes": [
        "admin"
      ],
      "body": [
        {
          "name": "name",
          "type": "string",
          "required": true
        },
        {
          "name": "description",
          "type": "string"
        },
        {
          "name": "storage_id",
          "type": "string",
          "about": "A bucket of yours (refused while the server takes payments: a new workspace is on the free plan)"
        }
      ],
      "returns": "201 Workspace",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"name\":\"…\"}' \"$SIDESPACE_URL/v1/workspaces\""
      }
    },
    {
      "id": "GET /v1/workspaces/{wid}",
      "method": "GET",
      "path": "/v1/workspaces/{wid}",
      "tag": "workspaces",
      "summary": "A workspace (also while locked)",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "wid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 Workspace",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/workspaces/$WID\""
      }
    },
    {
      "id": "PATCH /v1/workspaces/{wid}",
      "method": "PATCH",
      "path": "/v1/workspaces/{wid}",
      "tag": "workspaces",
      "summary": "Rename or describe it (an admin; also while locked)",
      "auth": "scope",
      "scopes": [
        "admin"
      ],
      "params": [
        {
          "name": "wid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "description",
          "type": "string"
        },
        {
          "name": "name",
          "type": "string"
        }
      ],
      "returns": "200 Workspace",
      "examples": {
        "curl": "curl -X PATCH -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{}' \"$SIDESPACE_URL/v1/workspaces/$WID\""
      }
    },
    {
      "id": "GET /v1/workspaces/{wid}/ai",
      "method": "GET",
      "path": "/v1/workspaces/{wid}/ai",
      "tag": "developer",
      "summary": "Whether members' devices may do the workspace's AI work, and each action's default backend (any member)",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "wid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 WorkspaceAI",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/workspaces/$WID/ai\""
      }
    },
    {
      "id": "PATCH /v1/workspaces/{wid}/ai",
      "method": "PATCH",
      "path": "/v1/workspaces/{wid}/ai",
      "tag": "developer",
      "summary": "Change them (admin). A backend of \"\" clears the action's default.",
      "auth": "scope",
      "scopes": [
        "admin"
      ],
      "params": [
        {
          "name": "wid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "backends",
          "type": "object",
          "about": "action → backend, e.g. {\"side.transcribe\": \"whisper-large-v3-turbo\"}"
        },
        {
          "name": "embed_model",
          "type": "string",
          "about": "Move the workspace to another vector model (ADR 0061): its files are embedded again in the background; search keeps the old model until that is done. The current id again calls a move off. Not through backends"
        },
        {
          "name": "member_devices",
          "type": "boolean"
        }
      ],
      "returns": "200 WorkspaceAI",
      "examples": {
        "curl": "curl -X PATCH -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{}' \"$SIDESPACE_URL/v1/workspaces/$WID/ai\""
      }
    },
    {
      "id": "GET /v1/workspaces/{wid}/audit",
      "method": "GET",
      "path": "/v1/workspaces/{wid}/audit",
      "tag": "workspaces",
      "summary": "Audit export (an admin), as under /v1/orgs/{oid}/audit",
      "auth": "scope",
      "scopes": [
        "admin"
      ],
      "params": [
        {
          "name": "wid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "since",
          "in": "query",
          "type": "string",
          "about": "RFC 3339 or YYYY-MM-DD; default 30 days before until"
        },
        {
          "name": "until",
          "in": "query",
          "type": "string",
          "about": "Default now"
        },
        {
          "name": "format",
          "in": "query",
          "type": "string"
        }
      ],
      "returns": "200 AuditRecord",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/workspaces/$WID/audit\""
      }
    },
    {
      "id": "GET /v1/workspaces/{wid}/automation",
      "method": "GET",
      "path": "/v1/workspaces/{wid}/automation",
      "tag": "developer",
      "summary": "AI Automation, which recognitions the workspace wants done to its files (any member)",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "wid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 Automation",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/workspaces/$WID/automation\""
      }
    },
    {
      "id": "PATCH /v1/workspaces/{wid}/automation",
      "method": "PATCH",
      "path": "/v1/workspaces/{wid}/automation",
      "tag": "developer",
      "summary": "Turn actions on or off (admin); actions left out stay as they are",
      "auth": "scope",
      "scopes": [
        "admin"
      ],
      "params": [
        {
          "name": "wid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "items",
          "type": "object[]",
          "required": true
        }
      ],
      "returns": "200 Automation",
      "examples": {
        "curl": "curl -X PATCH -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"items\":[]}' \"$SIDESPACE_URL/v1/workspaces/$WID/automation\""
      }
    },
    {
      "id": "POST /v1/workspaces/{wid}/checkout",
      "method": "POST",
      "path": "/v1/workspaces/{wid}/checkout",
      "tag": "workspaces",
      "summary": "Buy a plan through Stripe Checkout (an owner or admin; also while locked). Answers the page to open.",
      "auth": "scope",
      "scopes": [
        "files:write"
      ],
      "params": [
        {
          "name": "wid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "plan_id",
          "type": "string",
          "required": true
        },
        {
          "name": "interval",
          "type": "string"
        }
      ],
      "returns": "200 Checkout page",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"plan_id\":\"…\"}' \"$SIDESPACE_URL/v1/workspaces/$WID/checkout\""
      }
    },
    {
      "id": "GET /v1/workspaces/{wid}/drives",
      "method": "GET",
      "path": "/v1/workspaces/{wid}/drives",
      "tag": "workspaces",
      "summary": "Its drives you reach",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "wid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 Drives",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/workspaces/$WID/drives\""
      }
    },
    {
      "id": "POST /v1/workspaces/{wid}/drives",
      "method": "POST",
      "path": "/v1/workspaces/{wid}/drives",
      "tag": "workspaces",
      "summary": "Make a drive (an admin), on the workspace's storage",
      "auth": "scope",
      "scopes": [
        "admin"
      ],
      "params": [
        {
          "name": "wid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "name",
          "type": "string",
          "required": true
        }
      ],
      "returns": "201 Space",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"name\":\"…\"}' \"$SIDESPACE_URL/v1/workspaces/$WID/drives\""
      }
    },
    {
      "id": "GET /v1/workspaces/{wid}/events",
      "method": "GET",
      "path": "/v1/workspaces/{wid}/events",
      "tag": "workspaces",
      "summary": "Its audit log, newest first (an admin)",
      "auth": "scope",
      "scopes": [
        "admin"
      ],
      "params": [
        {
          "name": "wid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "before",
          "in": "query",
          "type": "integer"
        },
        {
          "name": "limit",
          "in": "query",
          "type": "integer"
        }
      ],
      "returns": "200 Events",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/workspaces/$WID/events\""
      }
    },
    {
      "id": "GET /v1/workspaces/{wid}/fields",
      "method": "GET",
      "path": "/v1/workspaces/{wid}/fields",
      "tag": "developer",
      "summary": "The fields of a workspace that can be filtered, listed and counted (any member)",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "wid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 Fields",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/workspaces/$WID/fields\""
      }
    },
    {
      "id": "POST /v1/workspaces/{wid}/fields",
      "method": "POST",
      "path": "/v1/workspaces/{wid}/fields",
      "tag": "developer",
      "summary": "Add a field of the workspace's own (admin); the index of its drives is rebuilt",
      "auth": "scope",
      "scopes": [
        "admin"
      ],
      "params": [
        {
          "name": "wid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "key",
          "type": "string",
          "about": "Lowercase letters, digits and _ (client); filtered as f.client. Fixed once made"
        },
        {
          "name": "label",
          "type": "object"
        },
        {
          "name": "options",
          "type": "object"
        },
        {
          "name": "position",
          "type": "integer"
        },
        {
          "name": "type",
          "type": "string",
          "about": "Fixed once made"
        }
      ],
      "returns": "201 FacetDef",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{}' \"$SIDESPACE_URL/v1/workspaces/$WID/fields\""
      }
    },
    {
      "id": "PATCH /v1/workspaces/{wid}/fields/{key}",
      "method": "PATCH",
      "path": "/v1/workspaces/{wid}/fields/{key}",
      "tag": "developer",
      "summary": "Change a field's label, enum values or position (admin); key and type stay. 403 for a built-in or plugin field",
      "auth": "scope",
      "scopes": [
        "admin"
      ],
      "params": [
        {
          "name": "wid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "key",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "key",
          "type": "string",
          "about": "Lowercase letters, digits and _ (client); filtered as f.client. Fixed once made"
        },
        {
          "name": "label",
          "type": "object"
        },
        {
          "name": "options",
          "type": "object"
        },
        {
          "name": "position",
          "type": "integer"
        },
        {
          "name": "type",
          "type": "string",
          "about": "Fixed once made"
        }
      ],
      "returns": "200 FacetDef",
      "examples": {
        "curl": "curl -X PATCH -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{}' \"$SIDESPACE_URL/v1/workspaces/$WID/fields/$KEY\""
      }
    },
    {
      "id": "DELETE /v1/workspaces/{wid}/fields/{key}",
      "method": "DELETE",
      "path": "/v1/workspaces/{wid}/fields/{key}",
      "tag": "developer",
      "summary": "Remove a field of the workspace's own (admin); the values stay in the files' fields sidecars",
      "auth": "scope",
      "scopes": [
        "admin"
      ],
      "params": [
        {
          "name": "wid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "key",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "204 Removed",
      "examples": {
        "curl": "curl -X DELETE -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/workspaces/$WID/fields/$KEY\""
      }
    },
    {
      "id": "GET /v1/workspaces/{wid}/members",
      "method": "GET",
      "path": "/v1/workspaces/{wid}/members",
      "tag": "workspaces",
      "summary": "",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "wid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 People",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/workspaces/$WID/members\""
      }
    },
    {
      "id": "POST /v1/workspaces/{wid}/members",
      "method": "POST",
      "path": "/v1/workspaces/{wid}/members",
      "tag": "workspaces",
      "summary": "Invite by email (an admin; only an owner adds owners). The plan's member limit applies; Individual is one person (402 quota_exceeded).",
      "auth": "scope",
      "scopes": [
        "members:manage"
      ],
      "params": [
        {
          "name": "wid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "email",
          "type": "string",
          "required": true
        },
        {
          "name": "role",
          "type": "WorkspaceRole"
        }
      ],
      "returns": "201 Member",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"email\":\"…\"}' \"$SIDESPACE_URL/v1/workspaces/$WID/members\""
      }
    },
    {
      "id": "PATCH /v1/workspaces/{wid}/members/{uid}",
      "method": "PATCH",
      "path": "/v1/workspaces/{wid}/members/{uid}",
      "tag": "workspaces",
      "summary": "Change someone's own role (an admin; owners by an owner). A workspace keeps an owner.",
      "auth": "scope",
      "scopes": [
        "members:manage"
      ],
      "params": [
        {
          "name": "wid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "uid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "role",
          "type": "WorkspaceRole",
          "required": true
        }
      ],
      "returns": "200 Member",
      "examples": {
        "curl": "curl -X PATCH -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"role\":{}}' \"$SIDESPACE_URL/v1/workspaces/$WID/members/$UID\""
      }
    },
    {
      "id": "DELETE /v1/workspaces/{wid}/members/{uid}",
      "method": "DELETE",
      "path": "/v1/workspaces/{wid}/members/{uid}",
      "tag": "workspaces",
      "summary": "Remove someone (an admin; an owner for an owner), or leave (me).",
      "auth": "scope",
      "scopes": [
        "members:manage"
      ],
      "params": [
        {
          "name": "wid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "uid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "204 Done",
      "examples": {
        "curl": "curl -X DELETE -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/workspaces/$WID/members/$UID\""
      }
    },
    {
      "id": "GET /v1/workspaces/{wid}/plan",
      "method": "GET",
      "path": "/v1/workspaces/{wid}/plan",
      "tag": "workspaces",
      "summary": "Its plan, limits and usage (any member; also while locked)",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "wid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 Account",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/workspaces/$WID/plan\""
      }
    },
    {
      "id": "POST /v1/workspaces/{wid}/portal",
      "method": "POST",
      "path": "/v1/workspaces/{wid}/portal",
      "tag": "workspaces",
      "summary": "Open Stripe's billing portal (an owner or admin; also while locked); with plan_id, straight to switching to it",
      "auth": "scope",
      "scopes": [
        "files:write"
      ],
      "params": [
        {
          "name": "wid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "interval",
          "type": "string"
        },
        {
          "name": "plan_id",
          "type": "string"
        }
      ],
      "returns": "200 Portal page",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{}' \"$SIDESPACE_URL/v1/workspaces/$WID/portal\""
      }
    },
    {
      "id": "GET /v1/workspaces/{wid}/retention",
      "method": "GET",
      "path": "/v1/workspaces/{wid}/retention",
      "tag": "workspaces",
      "summary": "How long versions and the trash are kept (an admin)",
      "auth": "scope",
      "scopes": [
        "admin"
      ],
      "params": [
        {
          "name": "wid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 Retention",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/workspaces/$WID/retention\""
      }
    },
    {
      "id": "PUT /v1/workspaces/{wid}/retention",
      "method": "PUT",
      "path": "/v1/workspaces/{wid}/retention",
      "tag": "workspaces",
      "summary": "Change how long versions and the trash are kept (an owner)",
      "auth": "scope",
      "scopes": [
        "admin"
      ],
      "params": [
        {
          "name": "wid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "versions",
          "type": "string",
          "required": true,
          "about": "all: keep every version; days: keep versions saved in the last keep_days days; count: keep each file's newest keep_last"
        },
        {
          "name": "keep_days",
          "type": "integer"
        },
        {
          "name": "keep_last",
          "type": "integer"
        },
        {
          "name": "trash_days",
          "type": "integer",
          "about": "Days deleted files stay restorable"
        }
      ],
      "returns": "200 Retention",
      "examples": {
        "curl": "curl -X PUT -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"versions\":\"…\"}' \"$SIDESPACE_URL/v1/workspaces/$WID/retention\""
      }
    },
    {
      "id": "GET /v1/workspaces/{wid}/sso",
      "method": "GET",
      "path": "/v1/workspaces/{wid}/sso",
      "tag": "workspaces",
      "summary": "Single sign-on settings (an admin), as under /v1/orgs/{oid}/sso. A 404 still names the redirect URI and the DNS proof.",
      "auth": "scope",
      "scopes": [
        "admin"
      ],
      "params": [
        {
          "name": "wid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 SSOConfig",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/workspaces/$WID/sso\""
      }
    },
    {
      "id": "PUT /v1/workspaces/{wid}/sso",
      "method": "PUT",
      "path": "/v1/workspaces/{wid}/sso",
      "tag": "workspaces",
      "summary": "Connect an OpenID Connect or SAML 2.0 identity provider for email domains (an owner), as under /v1/orgs/{oid}/sso",
      "auth": "scope",
      "scopes": [
        "admin"
      ],
      "params": [
        {
          "name": "wid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "domains",
          "type": "string[]",
          "required": true
        },
        {
          "name": "client_id",
          "type": "string"
        },
        {
          "name": "client_secret",
          "type": "string"
        },
        {
          "name": "domain_proof",
          "type": "string",
          "about": "Value of the DNS TXT record _sidespace.\u003cdomain\u003e"
        },
        {
          "name": "idp_certificate_expires_at",
          "about": "SAML: when the soonest signing certificate in the metadata expires"
        },
        {
          "name": "idp_metadata",
          "type": "string",
          "about": "SAML: the identity provider's metadata XML"
        },
        {
          "name": "idp_metadata_url",
          "type": "string",
          "about": "SAML: where to fetch the metadata (https; fetched again daily)"
        },
        {
          "name": "idp_sso_url",
          "type": "string",
          "about": "SAML: the sign-in URL the metadata names (HTTP-Redirect)"
        },
        {
          "name": "issuer",
          "type": "string",
          "about": "OpenID Connect: the issuer URL. SAML: the identity provider's entity ID, read from its metadata"
        },
        {
          "name": "protocol",
          "type": "string"
        },
        {
          "name": "redirect_uri",
          "type": "string",
          "about": "Register it with the provider"
        },
        {
          "name": "required",
          "type": "boolean",
          "about": "Email codes stop working for these domains"
        },
        {
          "name": "saml_acs_url",
          "type": "string",
          "about": "SAML: the assertion consumer service URL (HTTP-POST) to register"
        },
        {
          "name": "saml_entity_id",
          "type": "string",
          "about": "SAML: the service provider entity ID (and metadata URL) to register"
        },
        {
          "name": "updated_at",
          "type": "Timestamp"
        }
      ],
      "returns": "200 SSOConfig",
      "examples": {
        "curl": "curl -X PUT -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"domains\":[]}' \"$SIDESPACE_URL/v1/workspaces/$WID/sso\""
      }
    },
    {
      "id": "DELETE /v1/workspaces/{wid}/sso",
      "method": "DELETE",
      "path": "/v1/workspaces/{wid}/sso",
      "tag": "workspaces",
      "summary": "Turn single sign-on off (an owner)",
      "auth": "scope",
      "scopes": [
        "admin"
      ],
      "params": [
        {
          "name": "wid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "204 Done",
      "examples": {
        "curl": "curl -X DELETE -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/workspaces/$WID/sso\""
      }
    },
    {
      "id": "GET /v1/workspaces/{wid}/storage",
      "method": "GET",
      "path": "/v1/workspaces/{wid}/storage",
      "tag": "workspaces",
      "summary": "Its backend and its own buckets (any member; admins see access keys)",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "wid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 Storage",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/workspaces/$WID/storage\""
      }
    },
    {
      "id": "PUT /v1/workspaces/{wid}/storage",
      "method": "PUT",
      "path": "/v1/workspaces/{wid}/storage",
      "tag": "workspaces",
      "summary": "Make one of its own buckets its backend for new drives (an admin; a paid plan while the server takes payments)",
      "auth": "session",
      "params": [
        {
          "name": "wid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "storage_id",
          "type": "string",
          "required": true
        }
      ],
      "returns": "200 Storage",
      "examples": {
        "curl": "curl -X PUT -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"storage_id\":\"…\"}' \"$SIDESPACE_URL/v1/workspaces/$WID/storage\""
      }
    },
    {
      "id": "POST /v1/workspaces/{wid}/storage/buckets",
      "method": "POST",
      "path": "/v1/workspaces/{wid}/storage/buckets",
      "tag": "workspaces",
      "summary": "Add a bucket of the workspace's own (an admin), checked through the block gateway",
      "auth": "session",
      "params": [
        {
          "name": "wid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "access_key",
          "type": "string"
        },
        {
          "name": "addressing",
          "type": "string",
          "about": "Override the provider's"
        },
        {
          "name": "bucket",
          "type": "string"
        },
        {
          "name": "endpoint",
          "type": "string",
          "about": "https URL of an S3-compatible service; empty for AWS S3. For r2 the account ID is enough; for oss, cos, b2 and wasabi the region is."
        },
        {
          "name": "kind",
          "type": "string"
        },
        {
          "name": "name",
          "type": "string"
        },
        {
          "name": "prefix",
          "type": "string"
        },
        {
          "name": "provider",
          "type": "StorageProvider",
          "about": "Fills in endpoint, region and addressing; guessed from the endpoint when absent"
        },
        {
          "name": "region",
          "type": "string",
          "about": "For AWS, asked from AWS when empty or wrong; us-east-1 for others when empty"
        },
        {
          "name": "secret_key",
          "type": "string",
          "about": "Stored sealed; never returned. Required with access_key: the gateway never lends its own credentials."
        }
      ],
      "returns": "201 StorageProfile",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{}' \"$SIDESPACE_URL/v1/workspaces/$WID/storage/buckets\""
      }
    },
    {
      "id": "GET /v1/workspaces/{wid}/tags",
      "method": "GET",
      "path": "/v1/workspaces/{wid}/tags",
      "tag": "developer",
      "summary": "The tag vocabulary (any member)",
      "auth": "scope",
      "scopes": [
        "files:read"
      ],
      "params": [
        {
          "name": "wid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 Tags",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/workspaces/$WID/tags\""
      }
    },
    {
      "id": "POST /v1/workspaces/{wid}/tags/merge",
      "method": "POST",
      "path": "/v1/workspaces/{wid}/tags/merge",
      "tag": "developer",
      "summary": "Fold tags into one spelling (admin); each, with its own others, becomes one of its aliases",
      "auth": "scope",
      "scopes": [
        "admin"
      ],
      "params": [
        {
          "name": "wid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "from",
          "type": "string[]",
          "required": true
        },
        {
          "name": "into",
          "type": "string",
          "required": true
        }
      ],
      "returns": "200 TagTerm",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"from\":[],\"into\":\"…\"}' \"$SIDESPACE_URL/v1/workspaces/$WID/tags/merge\""
      }
    },
    {
      "id": "POST /v1/workspaces/{wid}/tags/rename",
      "method": "POST",
      "path": "/v1/workspaces/{wid}/tags/rename",
      "tag": "developer",
      "summary": "Rename a tag (admin); the old spelling and its others fold into the new one",
      "auth": "scope",
      "scopes": [
        "admin"
      ],
      "params": [
        {
          "name": "wid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "from",
          "type": "string",
          "required": true
        },
        {
          "name": "to",
          "type": "string",
          "required": true
        }
      ],
      "returns": "200 TagTerm",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"from\":\"…\",\"to\":\"…\"}' \"$SIDESPACE_URL/v1/workspaces/$WID/tags/rename\""
      }
    },
    {
      "id": "POST /v1/workspaces/{wid}/tags/restore",
      "method": "POST",
      "path": "/v1/workspaces/{wid}/tags/restore",
      "tag": "developer",
      "summary": "Undo taking a tag off every file (admin); only that tag's spellings, only on the workspace's drives",
      "auth": "scope",
      "scopes": [
        "admin"
      ],
      "params": [
        {
          "name": "wid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "aliases",
          "type": "string[]",
          "required": true
        },
        {
          "name": "failed",
          "type": "integer",
          "required": true,
          "about": "Files the caller could not change, left as they were"
        },
        {
          "name": "files",
          "type": "object[]",
          "required": true
        },
        {
          "name": "kept",
          "type": "boolean",
          "required": true,
          "about": "The workspace kept the tag (it is kept again on restore)"
        },
        {
          "name": "term",
          "type": "string",
          "required": true
        },
        {
          "name": "color",
          "type": "string"
        }
      ],
      "returns": "204 Put back",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"aliases\":[],\"failed\":0,\"files\":[],\"kept\":false,\"term\":\"…\"}' \"$SIDESPACE_URL/v1/workspaces/$WID/tags/restore\""
      }
    },
    {
      "id": "PUT /v1/workspaces/{wid}/tags/{term}",
      "method": "PUT",
      "path": "/v1/workspaces/{wid}/tags/{term}",
      "tag": "developer",
      "summary": "Keep a spelling with exactly these others folded into it (admin); a spelling belongs to one tag",
      "auth": "scope",
      "scopes": [
        "admin"
      ],
      "params": [
        {
          "name": "wid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "term",
          "in": "path",
          "required": true,
          "type": "string",
          "about": "The spelling kept, path-escaped"
        }
      ],
      "body": [
        {
          "name": "aliases",
          "type": "string[]"
        }
      ],
      "returns": "200 TagTerm",
      "examples": {
        "curl": "curl -X PUT -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{}' \"$SIDESPACE_URL/v1/workspaces/$WID/tags/$TERM\""
      }
    },
    {
      "id": "PATCH /v1/workspaces/{wid}/tags/{term}",
      "method": "PATCH",
      "path": "/v1/workspaces/{wid}/tags/{term}",
      "tag": "developer",
      "summary": "Make a tag, or change its colour (editor); a spelling folded into another tag is that tag's (409)",
      "auth": "scope",
      "scopes": [
        "admin"
      ],
      "params": [
        {
          "name": "wid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "term",
          "in": "path",
          "required": true,
          "type": "string",
          "about": "The spelling kept, path-escaped"
        }
      ],
      "body": [
        {
          "name": "color",
          "type": "string",
          "about": "'#rrggbb', or empty for none"
        }
      ],
      "returns": "200 TagTerm",
      "examples": {
        "curl": "curl -X PATCH -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{}' \"$SIDESPACE_URL/v1/workspaces/$WID/tags/$TERM\""
      }
    },
    {
      "id": "DELETE /v1/workspaces/{wid}/tags/{term}",
      "method": "DELETE",
      "path": "/v1/workspaces/{wid}/tags/{term}",
      "tag": "developer",
      "summary": "Stop keeping a spelling (admin); files keep their tags",
      "auth": "scope",
      "scopes": [
        "admin"
      ],
      "params": [
        {
          "name": "wid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "term",
          "in": "path",
          "required": true,
          "type": "string",
          "about": "The spelling kept, path-escaped"
        }
      ],
      "returns": "204 Removed",
      "examples": {
        "curl": "curl -X DELETE -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/workspaces/$WID/tags/$TERM\""
      }
    },
    {
      "id": "POST /v1/workspaces/{wid}/tags/{term}/remove",
      "method": "POST",
      "path": "/v1/workspaces/{wid}/tags/{term}/remove",
      "tag": "developer",
      "summary": "Take a tag off every file of the workspace (admin)",
      "auth": "scope",
      "scopes": [
        "admin"
      ],
      "params": [
        {
          "name": "wid",
          "in": "path",
          "required": true,
          "type": "string"
        },
        {
          "name": "term",
          "in": "path",
          "required": true,
          "type": "string",
          "about": "The tag, path-escaped"
        }
      ],
      "returns": "200 TagRemoval",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/workspaces/$WID/tags/$TERM/remove\""
      }
    },
    {
      "id": "GET /v1/workspaces/{wid}/tokens",
      "method": "GET",
      "path": "/v1/workspaces/{wid}/tokens",
      "tag": "workspaces",
      "summary": "Your tokens limited to this workspace (signed-in apps only)",
      "auth": "session",
      "params": [
        {
          "name": "wid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "returns": "200 Tokens",
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/workspaces/$WID/tokens\""
      }
    },
    {
      "id": "POST /v1/workspaces/{wid}/tokens",
      "method": "POST",
      "path": "/v1/workspaces/{wid}/tokens",
      "tag": "workspaces",
      "summary": "Make a token for this workspace (optionally only some drives, drive_ids); body as POST /v1/tokens without space_ids",
      "auth": "session",
      "params": [
        {
          "name": "wid",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "body": [
        {
          "name": "name",
          "type": "string",
          "required": true
        },
        {
          "name": "scopes",
          "type": "string[]",
          "required": true
        },
        {
          "name": "agent_id",
          "type": "string"
        },
        {
          "name": "drive_ids",
          "type": "string[]"
        },
        {
          "name": "expires_in_days",
          "type": "integer"
        },
        {
          "name": "s3",
          "type": "boolean"
        }
      ],
      "returns": "201 The token (shown once)",
      "examples": {
        "curl": "curl -X POST -H \"Authorization: Bearer $SIDESPACE_TOKEN\" -H \"Content-Type: application/json\" -d '{\"name\":\"…\",\"scopes\":[]}' \"$SIDESPACE_URL/v1/workspaces/$WID/tokens\""
      }
    },
    {
      "id": "GET /v1/ws",
      "method": "GET",
      "path": "/v1/ws",
      "tag": "sync",
      "summary": "WebSocket for realtime signals (see proto/ws.md). Auth by bearer header or `?access_token=`.",
      "auth": "scope",
      "scopes": [
        "events:read",
        "files:read"
      ],
      "examples": {
        "curl": "curl -H \"Authorization: Bearer $SIDESPACE_TOKEN\" \"$SIDESPACE_URL/v1/ws\""
      }
    }
  ]
}
