API 参考

Forks

A fork is a new space made from another space (or one folder of it) without copying bytes: it shares the original's files, data key and bucket. Work in it like any space, list what changed, and apply changes back. Making or applying a fork needs files:write.

4 个接口 · 概览

GET/v1/spaces/{sid}/forks

The forks of a space that the caller is a member of
Bearer 令牌

参数 · 路径

  • sidstring必填

响应

  • 200
    Forks
    object
    › 展开字段
    • itemsSpace[]必填
      › 10 个字段
      • idstring必填
      • namestring必填
      • roleRole必填
        viewercommentereditormanager
      • owner_idstring必填
      • root_node_idstring必填
      • journal_seqinteger必填
      • created_atTimestamp必填
      • storage_idstring
        The storage profile its files are in; absent for the server's own storage
      • forkobject
        Set when the space is a fork
        › 3 个字段
        • from_space_idstring必填
        • pathstring必填
          The folder of the original it copies ("/" for all of it)
        • at_seqinteger必填
          The original's journal position when it was forked
      • org_idstring
        The organization it belongs to
  • 4xx/5xx
    Error
    Error
请求示例
curl "https://side.example.com/v1/spaces/spc_01JD7Q2M8X4V6N0R3T5W9Y1B2C/forks" \
  -H "Authorization: Bearer $SIDESPACE_TOKEN"
响应示例 · 200
{
  "items": [
    {
      "id": "id",
      "name": "A001_C003.mov",
      "role": "viewer",
      "owner_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S",
      "root_node_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S",
      "journal_seq": 1,
      "created_at": "2026-11-14T09:30:00Z",
      "storage_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S",
      "fork": {},
      "org_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S"
    }
  ]
}

POST/v1/spaces/{sid}/forks

Fork the space (any member); the caller manages the fork
Bearer 令牌

Copies every live file and folder (or those under path) as rows that point at the same content; head versions only, with their sidecars and renditions. A token limited to some spaces may also reach the forks it makes.

参数 · 路径

  • sidstring必填

请求体ForkRequest application/json

  • namestring必填
  • pathstring
    Only this folder of the space (default all of it)

响应

请求示例
curl -X POST "https://side.example.com/v1/spaces/spc_01JD7Q2M8X4V6N0R3T5W9Y1B2C/forks" \
  -H "Authorization: Bearer $SIDESPACE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"A001_C003.mov"}'
响应示例 · 201
{
  "id": "id",
  "name": "A001_C003.mov",
  "role": "viewer",
  "owner_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S",
  "root_node_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S",
  "journal_seq": 1,
  "created_at": "2026-11-14T09:30:00Z",
  "storage_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S",
  "fork": {
    "from_space_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S",
    "path": "Ep01/Shots/A001_C003.mov",
    "at_seq": 1
  },
  "org_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S"
}

GET/v1/spaces/{sid}/fork/changes

How a fork differs from the space it came from
Bearer 令牌

参数 · 路径

  • sidstring必填
    The fork

响应

  • 200
    Changes in path order
    object
    › 展开字段
    • itemsForkChange[]必填
      › 9 个字段
      • kindstring必填
        addedmodifiedmetadatamoveddeleted
      • node_kindstring必填
        filedir
      • pathstring必填
        In the fork ("" for a deleted node)
      • node_idstring必填
        In the fork
      • origin_pathstring
        Where it is (or goes) in the original
      • origin_node_idstring
      • sidecarsstring[]
        Namespaces whose documents differ
      • conflictboolean
        The original changed it too since the fork: apply needs force
      • whystring
  • 4xx/5xx
    Error
    Error
请求示例
curl "https://side.example.com/v1/spaces/spc_01JD7Q2M8X4V6N0R3T5W9Y1B2C/fork/changes" \
  -H "Authorization: Bearer $SIDESPACE_TOKEN"
响应示例 · 200
{
  "items": [
    {
      "kind": "added",
      "node_kind": "file",
      "path": "Ep01/Shots/A001_C003.mov",
      "node_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S",
      "origin_path": "origin_path",
      "origin_node_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S",
      "sidecars": [],
      "conflict": false,
      "why": "why"
    }
  ]
}

POST/v1/spaces/{sid}/fork/apply

Bring a fork's changes back (editor in the original)
Bearer 令牌

Deletes, then moves, then new folders and files, then edited files and metadata, each on its own. A conflict (the original changed the file since the fork) is skipped unless force, which replaces it; its author is notified as for any save.

参数 · 路径

  • sidstring必填
    The fork

请求体ApplyForkRequest application/json

  • pathsstring[]
    Only changes at or under these paths (fork or original paths)
  • forceboolean
    Also replace the original's newer versions
  • dry_runboolean

响应

  • 200
    What happened to each change
    object
    › 展开字段
    • itemsForkApplied[]必填
      › 11 个字段
      • kindstring必填
        addedmodifiedmetadatamoveddeleted
      • node_kindstring必填
        filedir
      • pathstring必填
        In the fork ("" for a deleted node)
      • node_idstring必填
        In the fork
      • origin_pathstring
        Where it is (or goes) in the original
      • origin_node_idstring
      • sidecarsstring[]
        Namespaces whose documents differ
      • conflictboolean
        The original changed it too since the fork: apply needs force
      • whystring
      • resultstring必填
        appliedskippedwould applyfailed
      • errorstring
  • 4xx/5xx
    Error
    Error
请求示例
curl -X POST "https://side.example.com/v1/spaces/spc_01JD7Q2M8X4V6N0R3T5W9Y1B2C/fork/apply" \
  -H "Authorization: Bearer $SIDESPACE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"paths":["Ep01/Shots/A001_C003.mov"],"force":false,"dry_run":false}'
响应示例 · 200
{
  "items": [
    {
      "result": "applied",
      "error": "error"
    }
  ]
}