Skip to content
Navigation

Retitle, relink, invite into, set the work status of or archive a work session

Changes the title, description, linked spaces, participants or work status, or archives the session. workStatus (active, ready_for_review, done) needs only work_session:comment, but done must come from a person: an org API key, a trigger delivery is 403 work_status_needs_person, and so is archive: true from any of them, since archiving marks the work done. Archiving sets done, a reopen active, and a new agent turn moves it back to active. Authorization: work_session:comment on the session, OR space:contribute on one of its linked spaces; a desk session is writable only by its owner. Any denial is 404. spaces, removeHumans and archive need MORE than that: they are the owner’s (work_session:manage, spec §8.1), so a participant or a space contributor gets 403 forbidden on those three fields and keeps title, description and addHumans. Every id in spaces is re-checked as the caller exactly as POST /workspace/sessions checks spaceIds: a me:* desk the session is not ALREADY on is 400 cannot_target_desk (moving a session onto a desk would hide it from its own opener) and a space that does not exist or the caller cannot contribute to is 404, so a relay can never move a session somewhere its owner loses it. Each entry is { spaceId, access } (access defaults to commit) or a bare id string, and spaces replaces the whole set, so it needs at least one entry — a session with no space cannot host a turn, and an empty array left it un-mentionable with no way back. fileIds replaces the working set the same way — every id is resolved as the caller (404 for an unknown or unreadable one) and [] empties it, so a session whose set carries a file nobody can read is repairable instead of permanently un-mentionable. A relink is checked against the working set it MOVES: every file the session already runs on must live in the new turn space, so a spaces patch that would leave the session un-mentionable is 404 — send fileIds in the same call ([] empties the set) to move and refill at once. The body is STRICT: an unknown key is 400 validation_failed, never a 200 that changed nothing. Every id in addHumans must be an active member of the caller’s organization: an id from another organization, or one that names nobody, is 404, so the roster never lists a person who could not open the session. addHumans also grants each member the work-session-participant FGA role, and removeHumans revokes it — agents are never FGA subjects (a turn runs as the human who mentioned it). A DESK session cannot be shared: the gate authorizes it by identity alone, so addHumans on one is 400 cannot_share_desk — relink it to a real space first. (A session opened with no spaceIds lands on the desk, so this is the default create path’s sharing story.)

PATCH
https://api.cloudraker.com/workspace/sessions/{sessionId}
Try it
Path parameters
Request body
Live API request

This request can change data or incur charges for the selected organization.

Authorization

  • bearerAuth
    HTTP
    required

Path parameters

  • sessionId
    string
    required

Request body JSON required

  • title
    optional
    string
    maxLength: 200 · minLength: 1
  • description
    optional
    string
    maxLength: 8000
  • spaces
    optional
    array of
    WorkspaceSpaceLink

    Any of the following:

    • string
    • object
      • spaceId
        string
        required
        maxLength: 128 · minLength: 1
      • access
        optional
        read
        or
        commit
        default: "commit"
  • addHumans
    optional
    array of
    string
    maxLength: 128 · minLength: 1
  • removeHumans
    optional
    array of
    string
    maxLength: 128 · minLength: 1
  • fileIds
    optional
    array of
    string

    The session’s working set, replaced wholesale. Every id must exist and be readable by the caller; [] empties the set.

    maxLength: 128 · minLength: 1
  • archive
    optional
    boolean
  • workStatus
    optional
    active
    or
    ready_for_review
    or
    done

    Whether the WORK is done, which only people decide. status stays the derived state of the turns.

Returns

200

The updated work session.

JSON
  • data
    object
    required
    • id
      string
      required
      maxLength: 128 · minLength: 1
    • title
      string
      required
      maxLength: 200
    • description
      string
      required
      maxLength: 8000
    • status
      open
      or
      working
      or
      waiting
      or
      done
      or
      archived
      required
    • workStatus
      active
      or
      ready_for_review
      or
      done
      required

      Whether the WORK is done, which only people decide. status stays the derived state of the turns.

    • openedBy
      object
      required
      • kind
        user
        or
        agent
        or
        api_key
        or
        trigger
        or
        external
        required
      • id
        string
        required
        maxLength: 128 · minLength: 1
      • name
        string
        required
        maxLength: 120 · minLength: 1
      • avatarUrl
        optional
        string
        maxLength: 2048
      • source
        optional
        web
        or
        desktop
        or
        api
        or
        email
        or
        webhook
        or
        schedule
        +4 more
    • openedVia
      web
      or
      desktop
      or
      api
      or
      email
      or
      webhook
      or
      schedule
      +2 more
      required
    • participants
      object
      required
      • humans
        array of
        string
        required
      • agents
        array of
        object
        required
        • agentId
          string
          required
        • versionId
          string
          required
        • handle
          string
          required
        • name
          string
          required
        • role
          string
          required
        • joinedAt
          string
          required
          format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
    • spaces
      array of
      object
      required
      • spaceId
        string
        required
      • access
        read
        or
        commit
        required
    • files
      array of
      object
      required
      • fileId
        string
        required
      • role
        input
        or
        artifact
        required
    • triggerId
      string | null
      required
    • parentSessionId
      string | null
      required
    • counts
      object
      required
      • turns
        number
        required
      • approvalsPending
        number
        required
      • tasksPending
        number
        required
      • unread
        number
        required
    • lastActivityAt
      string
      required
      format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
    • createdAt
      string
      required
      format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
    • closedAt
      string | null
      required

400

cannot_target_desk — a me:* id the session is not already linked to; cannot_share_desk — addHumans on a desk session; validation_failed — an unknown key in the body.

403

forbidden — spaces, removeHumans or archive without work_session:manage. work_status_needs_person — workStatus: done or archive: true from anything but a person.

404

No such session, the caller may not write it, no such space, a file in the working set that does not exist, the caller cannot read, or that does not live in the turn space this patch leaves the session in, or an addHumans id that is not a member of this organization.

409

session_has_live_turn — a turn is still running, so the session cannot be archived. Cancel it first. session_archived — the title, description or work status of archived work cannot change; reopen it (archive: false) in the same or an earlier call.

Type to search…

↑↓ navigate↵ selectEsc close