Versions

8 个接口 · 概览

POST/v1/spaces/{sid}/nodes/{nid}/edits

Change byte ranges of a file and save it as a new version (editor)
Bearer 令牌

Partial writes (ADR 0033). Each op replaces delete bytes at at with text (or base64 bytes): a write in place, an insert (delete 0), a removal (no data), or an append (at = the file's size). Offsets are in the version the edits are made against: the head, or if_version_id / If-Match, which must still be the head (else 412 precondition_failed). Ranges may not overlap; at most 10,000 ops and 4 MiB of new data at a time. truncate then cuts the result. Only the chunks around an edit are new; the rest of the file is reused.

Larger edits go as the binary body, application/vnd.sidespace.patch: no base64, up to 64 MiB of new data. It is SSP1, then for each edit at, delete and the data's length as unsigned 64-bit big-endian integers, then the data. truncate and if_version_id move to the query (or If-Match).

参数 · 路径

  • sidstring必填
    ^spc_[0-9A-HJKMNP-TV-Z]{26}$
  • nidstring必填
    ^nod_[0-9A-HJKMNP-TV-Z]{26}$

参数 · 查询

  • truncateinteger (int64)
    With the binary body
    ≥ 0
  • if_version_idstring
    With the binary body

参数 · 请求头

  • If-Matchstring
    Write only if the file is still at this version ("ver_…"); else 412 precondition_failed with details.current_version_id

请求体EditRequest application/json

  • if_version_idstring
    The version the offsets are in; must still be the head
  • opsEditOp[]
    ≤ 10000 items
    › 4 个字段
    • atinteger (int64)必填
      Byte offset in the old version
      ≥ 0
    • deleteinteger (int64)
      Bytes removed there
      default 0 · ≥ 0
    • textstring
      Inserted there, as UTF-8
    • base64string
      Inserted there, as bytes (instead of text)
  • truncateinteger (int64)
    Cut the result to this many bytes
    ≥ 0

响应

请求示例
curl -X POST "https://side.space/v1/spaces/spc_01JD7Q2M8X4V6N0R3T5W9Y1B2C/nodes/nod_01JD7Q3A5C7E9G1J3K5M7P9R2S/edits" \
  -H "Authorization: Bearer $SIDESPACE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"if_version_id":"nod_01JD7Q3A5C7E9G1J3K5M7P9R2S","ops":[{}],"truncate":1}'
响应示例 · 201
{
  "version": {
    "id": "id",
    "node_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S",
    "seq": 3,
    "size": 734003200,
    "mime": "video/quicktime",
    "manifest_hash": "manifest_hash",
    "author": {},
    "device_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S",
    "base_version_id": "ver_01JD7Q4B6D8F0H2J4L6N8Q0S3T",
    "superseded_version_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S",
    "client_mtime": "2026-11-14T09:30:00Z",
    "created_at": "2026-11-14T09:30:00Z",
    "label": "Client cut",
    "labeled_by": "labeled_by",
    "labeled_at": "2026-11-14T09:30:00Z",
    "origin": "put",
    "source_version_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S",
    "restored_from": "restored_from",
    "copied_from": "copied_from"
  },
  "node": {
    "id": "id",
    "space_id": "spc_01JD7Q2M8X4V6N0R3T5W9Y1B2C",
    "parent_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S",
    "name": "A001_C003.mov",
    "kind": "file",
    "head_version_id": "ver_01JD7Q4B6D8F0H2J4L6N8Q0S3T",
    "size": 734003200,
    "mime": "video/quicktime",
    "meta_rev": 1,
    "deleted": false,
    "mtime": "2026-11-14T09:30:00Z"
  },
  "superseded": {
    "version_id": "ver_01JD7Q4B6D8F0H2J4L6N8Q0S3T",
    "author": {}
  }
}

POST/v1/spaces/{sid}/upload-sessions

Ask which chunks the block gateway is missing and get a put ticket (editor)
Bearer 令牌

参数 · 路径

  • sidstring必填
    ^spc_[0-9A-HJKMNP-TV-Z]{26}$

请求体UploadSessionRequest application/json

  • hashesHash[]必填
    ≤ 20000 items

响应

请求示例
curl -X POST "https://side.space/v1/spaces/spc_01JD7Q2M8X4V6N0R3T5W9Y1B2C/upload-sessions" \
  -H "Authorization: Bearer $SIDESPACE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"hashes":["9f2c4e6a8b0d2f4a6c8e0b2d4f6a8c0e2b4d6f8a0c2e4b6d8f0a2c4e6b8d0f2a"]}'
响应示例 · 200
{
  "missing": [
    "missing"
  ],
  "ticket": "ticket",
  "blockgw_url": "blockgw_url",
  "expires_at": "2026-11-14T09:30:00Z"
}

GET/v1/spaces/{sid}/nodes/{nid}/versions

Version history, newest first
Bearer 令牌

参数 · 路径

  • sidstring必填
    ^spc_[0-9A-HJKMNP-TV-Z]{26}$
  • nidstring必填
    ^nod_[0-9A-HJKMNP-TV-Z]{26}$

响应

  • 200
    Versions
    object
    › 展开字段
    • itemsVersionInfo[]
      › 19 个字段
      • idstring必填
      • node_idstring必填
      • seqinteger必填
        1-based per node
      • sizeinteger必填
      • mimestring | null必填
        必填
      • manifest_hashHash必填
        ^[0-9a-f]{64}$
      • authorUser必填
        › 4 个字段
        • idstring必填
        • emailstring必填
          Agents have an address at agents.invalid: it finds them for invites, no mail goes there
        • display_namestring必填
        • kindstring必填
          humanagent
      • device_idstring | null必填
        必填
      • base_version_idstring | null必填
        必填
      • superseded_version_idstring | null必填
        Head this save replaced although it was not its base
        必填
      • client_mtimeTimestamp | any必填
      • created_atTimestamp必填
      • labelstring
        The name someone gave this version ("Client cut"), unique per file; absent if none
      • labeled_bystring
      • labeled_atTimestamp
      • originstring必填
        How the version came to be: a whole-file save, a partial write, a copy, a restore (from the app, the API, a rewind or an S3 copy of an old version over its key), copied into a fork when it was made, or applied from a fork
        puteditcopyrestoreforkmerge
      • source_version_idstring
        The version it was copied, restored, forked or merged from
      • restored_fromstring
        For a restore: the version brought back
      • copied_fromstring
        For a copy: the version copied
  • 4xx/5xx
    Error
    Error
请求示例
curl "https://side.space/v1/spaces/spc_01JD7Q2M8X4V6N0R3T5W9Y1B2C/nodes/nod_01JD7Q3A5C7E9G1J3K5M7P9R2S/versions" \
  -H "Authorization: Bearer $SIDESPACE_TOKEN"
响应示例 · 200
{
  "items": [
    {
      "id": "id",
      "node_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S",
      "seq": 3,
      "size": 734003200,
      "mime": "video/quicktime",
      "manifest_hash": "manifest_hash",
      "author": {},
      "device_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S",
      "base_version_id": "ver_01JD7Q4B6D8F0H2J4L6N8Q0S3T",
      "superseded_version_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S",
      "client_mtime": "2026-11-14T09:30:00Z",
      "created_at": "2026-11-14T09:30:00Z",
      "label": "Client cut",
      "labeled_by": "labeled_by",
      "labeled_at": "2026-11-14T09:30:00Z",
      "origin": "put",
      "source_version_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S",
      "restored_from": "restored_from",
      "copied_from": "copied_from"
    }
  ]
}

POST/v1/spaces/{sid}/nodes/{nid}/versions

Commit a new version (editor). Last save wins.
Bearer 令牌

Always accepted when every chunk exists. When base_version_id is not the current head, the new version still becomes head, superseded names the replaced head, and that version's author is notified (version.superseded). Committing to a deleted node restores it. Missing chunks answer 409 missing_chunks.

To save only if nobody saved in between, send If-Match: "ver_…" (or if_version_id) with the version you read; to save only into a file that has no version yet, send If-None-Match: * (or if_new: true). Either answers 412 precondition_failed with details.current_version_id when it does not hold, and nothing is saved.

参数 · 路径

  • sidstring必填
    ^spc_[0-9A-HJKMNP-TV-Z]{26}$
  • nidstring必填
    ^nod_[0-9A-HJKMNP-TV-Z]{26}$

参数 · 请求头

  • If-Matchstring
    Write only if the file is still at this version ("ver_…"); else 412 precondition_failed with details.current_version_id
  • If-None-Matchstring
    "*": write only if nothing is there yet (no file at the name, or a file with no version); else 412 precondition_failed
    *

请求体CommitVersionRequest application/json

  • base_version_idstring | null必填
    必填
  • manifestManifest必填
    › 3 个字段
    • algostring必填
      fastcdc-v1 (content-defined, 512 KiB to 8 MiB) or fixed-4m-v1 (4 MiB pieces, the last shorter; what browsers send, ADR 0042)
      fastcdc-v1fixed-4m-v1
    • sizeinteger必填
    • chunksChunkRef[]必填
      › 3 个字段
      • hashHash必填
        ^[0-9a-f]{64}$
      • offsetinteger必填
      • leninteger必填
  • mimestring
  • client_mtimeTimestamp
  • if_version_idstring
    Save only if the file is still at this version (same as If-Match); else 412 precondition_failed
  • if_newboolean
    Save only if the file has no version yet (same as If-None-Match: *)

响应

请求示例
curl -X POST "https://side.space/v1/spaces/spc_01JD7Q2M8X4V6N0R3T5W9Y1B2C/nodes/nod_01JD7Q3A5C7E9G1J3K5M7P9R2S/versions" \
  -H "Authorization: Bearer $SIDESPACE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"base_version_id":"ver_01JD7Q4B6D8F0H2J4L6N8Q0S3T","manifest":{"algo":"fastcdc-v1","size":734003200,"chunks":[]}}'
响应示例 · 201
{
  "version": {
    "id": "id",
    "node_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S",
    "seq": 3,
    "size": 734003200,
    "mime": "video/quicktime",
    "manifest_hash": "manifest_hash",
    "author": {},
    "device_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S",
    "base_version_id": "ver_01JD7Q4B6D8F0H2J4L6N8Q0S3T",
    "superseded_version_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S",
    "client_mtime": "2026-11-14T09:30:00Z",
    "created_at": "2026-11-14T09:30:00Z",
    "label": "Client cut",
    "labeled_by": "labeled_by",
    "labeled_at": "2026-11-14T09:30:00Z",
    "origin": "put",
    "source_version_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S",
    "restored_from": "restored_from",
    "copied_from": "copied_from"
  },
  "node": {
    "id": "id",
    "space_id": "spc_01JD7Q2M8X4V6N0R3T5W9Y1B2C",
    "parent_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S",
    "name": "A001_C003.mov",
    "kind": "file",
    "head_version_id": "ver_01JD7Q4B6D8F0H2J4L6N8Q0S3T",
    "size": 734003200,
    "mime": "video/quicktime",
    "meta_rev": 1,
    "deleted": false,
    "mtime": "2026-11-14T09:30:00Z"
  },
  "superseded": {
    "version_id": "ver_01JD7Q4B6D8F0H2J4L6N8Q0S3T",
    "author": {}
  }
}

POST/v1/spaces/{sid}/versions/{vid}/restore

Copy an old version as the new head (editor)
Bearer 令牌

参数 · 路径

  • sidstring必填
    ^spc_[0-9A-HJKMNP-TV-Z]{26}$
  • vidstring必填
    ^ver_[0-9A-HJKMNP-TV-Z]{26}$

参数 · 请求头

  • If-Matchstring
    Write only if the file is still at this version ("ver_…"); else 412 precondition_failed with details.current_version_id

响应

请求示例
curl -X POST "https://side.space/v1/spaces/spc_01JD7Q2M8X4V6N0R3T5W9Y1B2C/versions/ver_01JD7Q4B6D8F0H2J4L6N8Q0S3T/restore" \
  -H "Authorization: Bearer $SIDESPACE_TOKEN"
响应示例 · 201
{
  "version": {
    "id": "id",
    "node_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S",
    "seq": 3,
    "size": 734003200,
    "mime": "video/quicktime",
    "manifest_hash": "manifest_hash",
    "author": {},
    "device_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S",
    "base_version_id": "ver_01JD7Q4B6D8F0H2J4L6N8Q0S3T",
    "superseded_version_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S",
    "client_mtime": "2026-11-14T09:30:00Z",
    "created_at": "2026-11-14T09:30:00Z",
    "label": "Client cut",
    "labeled_by": "labeled_by",
    "labeled_at": "2026-11-14T09:30:00Z",
    "origin": "put",
    "source_version_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S",
    "restored_from": "restored_from",
    "copied_from": "copied_from"
  },
  "node": {
    "id": "id",
    "space_id": "spc_01JD7Q2M8X4V6N0R3T5W9Y1B2C",
    "parent_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S",
    "name": "A001_C003.mov",
    "kind": "file",
    "head_version_id": "ver_01JD7Q4B6D8F0H2J4L6N8Q0S3T",
    "size": 734003200,
    "mime": "video/quicktime",
    "meta_rev": 1,
    "deleted": false,
    "mtime": "2026-11-14T09:30:00Z"
  },
  "superseded": {
    "version_id": "ver_01JD7Q4B6D8F0H2J4L6N8Q0S3T",
    "author": {}
  }
}

PUT/v1/spaces/{sid}/versions/{vid}/label

Name a version ("Client cut"), or clear its name with "" (editor)
Bearer 令牌

A name belongs to one version of a file at a time (case does not matter), so naming another version moves it. Journals version.labeled.

参数 · 路径

  • sidstring必填
    ^spc_[0-9A-HJKMNP-TV-Z]{26}$
  • vidstring必填
    ^ver_[0-9A-HJKMNP-TV-Z]{26}$

请求体 application/json

  • labelstring必填
    ≤ 60 chars

响应

请求示例
curl -X PUT "https://side.space/v1/spaces/spc_01JD7Q2M8X4V6N0R3T5W9Y1B2C/versions/ver_01JD7Q4B6D8F0H2J4L6N8Q0S3T/label" \
  -H "Authorization: Bearer $SIDESPACE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"label":"Client cut"}'
响应示例 · 200
{
  "id": "id",
  "node_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S",
  "seq": 3,
  "size": 734003200,
  "mime": "video/quicktime",
  "manifest_hash": "manifest_hash",
  "author": {
    "id": "id",
    "email": "mei@studio.example",
    "display_name": "display_name",
    "kind": "human"
  },
  "device_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S",
  "base_version_id": "ver_01JD7Q4B6D8F0H2J4L6N8Q0S3T",
  "superseded_version_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S",
  "client_mtime": "2026-11-14T09:30:00Z",
  "created_at": "2026-11-14T09:30:00Z",
  "label": "Client cut",
  "labeled_by": "labeled_by",
  "labeled_at": "2026-11-14T09:30:00Z",
  "origin": "put",
  "source_version_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S",
  "restored_from": "restored_from",
  "copied_from": "copied_from"
}

GET/v1/spaces/{sid}/versions/{vid}/compare/{other}

What differs from one version to another (of one file or two files in the space)
Bearer 令牌

参数 · 路径

  • sidstring必填
    ^spc_[0-9A-HJKMNP-TV-Z]{26}$
  • vidstring必填
    ^ver_[0-9A-HJKMNP-TV-Z]{26}$
  • otherstring必填
    The version to compare with (B); vid is A

响应

请求示例
curl "https://side.space/v1/spaces/spc_01JD7Q2M8X4V6N0R3T5W9Y1B2C/versions/ver_01JD7Q4B6D8F0H2J4L6N8Q0S3T/compare/other" \
  -H "Authorization: Bearer $SIDESPACE_TOKEN"
响应示例 · 200
{
  "a": {
    "id": "id",
    "node_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S",
    "seq": 3,
    "size": 734003200,
    "mime": "video/quicktime",
    "manifest_hash": "manifest_hash",
    "author": {},
    "device_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S",
    "base_version_id": "ver_01JD7Q4B6D8F0H2J4L6N8Q0S3T",
    "superseded_version_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S",
    "client_mtime": "2026-11-14T09:30:00Z",
    "created_at": "2026-11-14T09:30:00Z",
    "label": "Client cut",
    "labeled_by": "labeled_by",
    "labeled_at": "2026-11-14T09:30:00Z",
    "origin": "put",
    "source_version_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S",
    "restored_from": "restored_from",
    "copied_from": "copied_from"
  },
  "b": {
    "id": "id",
    "node_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S",
    "seq": 3,
    "size": 734003200,
    "mime": "video/quicktime",
    "manifest_hash": "manifest_hash",
    "author": {},
    "device_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S",
    "base_version_id": "ver_01JD7Q4B6D8F0H2J4L6N8Q0S3T",
    "superseded_version_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S",
    "client_mtime": "2026-11-14T09:30:00Z",
    "created_at": "2026-11-14T09:30:00Z",
    "label": "Client cut",
    "labeled_by": "labeled_by",
    "labeled_at": "2026-11-14T09:30:00Z",
    "origin": "put",
    "source_version_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S",
    "restored_from": "restored_from",
    "copied_from": "copied_from"
  },
  "same_content": false,
  "size_delta": 1,
  "bytes": {
    "shared": 1,
    "only_a": 1,
    "only_b": 1,
    "shared_ratio": 0.5
  },
  "media": [
    {
      "field": "field",
      "a": "a",
      "b": "b"
    }
  ],
  "sidecars": [
    {
      "namespace": "x-acme.qc",
      "change": "added",
      "fields": []
    }
  ],
  "renditions": {
    "key": [
      "string"
    ]
  }
}

POST/v1/spaces/{sid}/download-tickets

Get a get-ticket (and, unless manifest is false, the manifest) for a version or one of its renditions
Bearer 令牌

参数 · 路径

  • sidstring必填
    ^spc_[0-9A-HJKMNP-TV-Z]{26}$

请求体DownloadTicketRequest application/json

  • version_idstring必填
  • renditionstring
    e.g. thumb, or proxy (the server-made 720p H.264 stream of a video)
  • streamboolean
    A ticket for a player: lasts a viewing session (6 h) instead of minutes
  • manifestboolean
    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
    default true

响应

请求示例
curl -X POST "https://side.space/v1/spaces/spc_01JD7Q2M8X4V6N0R3T5W9Y1B2C/download-tickets" \
  -H "Authorization: Bearer $SIDESPACE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"version_id":"ver_01JD7Q4B6D8F0H2J4L6N8Q0S3T"}'
响应示例 · 200
{
  "ticket": "ticket",
  "manifest": {
    "algo": "fastcdc-v1",
    "size": 734003200,
    "chunks": []
  },
  "blockgw_url": "blockgw_url",
  "expires_at": "2026-11-14T09:30:00Z"
}