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.

5 个接口 · 概览

GET/v1/spaces/{sid}/forks

The forks of a space (any member of it)
Bearer 令牌

参数 · 路径

  • sidstring必填

响应

  • 200
    Forks
    object
    › 展开字段
    • itemsSpace[]必填
      › 13 个字段
      • 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
        › 4 个字段
        • 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
        • copyobject
          Set for a fork made with copy: while copying it still shares the original's files; once done it keeps its own
          › 4 个字段
          • statestring必填
            copyingdonefailed
          • copiedinteger必填
            Chunks copied so far
          • copied_bytesinteger必填
          • errorstring
            Why it failed; POST …/fork/copy/retry tries again
      • workspace_idstring必填
        The workspace this drive belongs to (ADR 0049): its members, roles, plan and storage. Opaque; a fork has its original's
      • workspace_namestring
      • workspace_roleWorkspaceRole
        viewercommentereditoradminowner
      • lockedstring
        Set when the workspace is on the free plan of a server that takes payments: everything in the drive answers 402 until it pays
        plan_required
  • 4xx/5xx
    Error
    Error
请求示例
curl "https://side.space/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": {},
      "workspace_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S",
      "workspace_name": "workspace_name",
      "workspace_role": "viewer",
      "locked": "plan_required"
    }
  ]
}

POST/v1/spaces/{sid}/forks

Fork the space (editor and up); the fork is a further drive of the same space, with its members and plan
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 for the space reaches the fork as it is; a token with drive_ids gets the fork added to them. A manager of the space, or whoever made the fork, may rename or delete it. With copy, the fork then copies the bytes its files use into its own storage (storage_id, or the original's) in the background and stops depending on the original; fork.copy shows how far it is.

参数 · 路径

  • sidstring必填

请求体ForkRequest application/json

  • namestring必填
  • pathstring
    Only this folder of the space (default all of it)
  • copyboolean
    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)
    default false
  • storage_idstring
    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

响应

请求示例
curl -X POST "https://side.space/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,
    "copy": {
      "state": "copying",
      "copied": 1,
      "copied_bytes": 1,
      "error": "error"
    }
  },
  "workspace_id": "nod_01JD7Q3A5C7E9G1J3K5M7P9R2S",
  "workspace_name": "workspace_name",
  "workspace_role": "viewer",
  "locked": "plan_required"
}

POST/v1/spaces/{sid}/fork/copy/retry

Try a failed copy again (a manager of the space, or whoever made the fork)
Bearer 令牌

参数 · 路径

  • sidstring必填
    The fork

响应

  • 204
    Copying again
  • 4xx/5xx
    Error
    Error
请求示例
curl -X POST "https://side.space/v1/spaces/spc_01JD7Q2M8X4V6N0R3T5W9Y1B2C/fork/copy/retry" \
  -H "Authorization: Bearer $SIDESPACE_TOKEN"

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.space/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 and up)
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.space/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"
    }
  ]
}