Skip to content
Navigation

Comment on a work session, waking any agent it mentions

Starts one turn per mentioned agent, then appends the caller’s comment entry to the timeline — in that order, so turn_started holds the lower seq. The comment is appended WHATEVER the turns answer: a human’s message is always an entry (spec §5.4). An agent that refuses is named in refused with its reason, and a system entry below the comment says so on the timeline; the call still answers 201, with turns carrying only the turns that started ([] when none did). A refused agent still joins the session’s roster, so it shows in the right rail. A turn is scoped to the SESSION’s working set plus whatever this comment attaches in fileIds, so a caller never re-sends the session’s own files. An attachment JOINS that working set for good — it appears in the session’s files, in the right rail and in every later turn’s scope, instead of living for one turn and vanishing (R9-05). A session file that was deleted is left out of the turn’s scope but stays in the session’s files; a system entry names the agents that work without it. The appended comment carries startedTurnIds naming every turn it started, because those turns are written first and therefore hold a LOWER seq — that field is the causal link a timeline reader orders by. Every id in fileIds must exist and be readable by the caller (space:read on the space it lives in), otherwise 404. A mention of an agent that is still working steers its live turn when the scope is unchanged, and starts a SECOND turn (its own frozen snapshot) when it adds a file. 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. mentions mixes agent ids, agent handles and member user ids, and each is RESOLVED: a member (confirmed against the org directory) gets an inbox row, a published agent takes a turn whose capability belt (space type, creatable space types, delegable agents, resolved connectors) is resolved HERE as the caller and frozen into that turn’s run snapshot — one grant per turn. A mention that is neither is dropped and returned in unresolvedMentions so the composer can flag an unknown @name; a mention of a real but unpublished or archived agent is 422 agent_not_published. Responds 201 { data: { entry, turns, unresolvedMentions, refused } }.

POST
https://api.cloudraker.com/workspace/sessions/{sessionId}/entries
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

  • text
    string
    required
    maxLength: 4000 · minLength: 1
  • requestId
    optional
    string
    format: uuid · pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
  • threadId
    optional
    string
    maxLength: 128 · minLength: 1
  • mentions
    optional
    array of
    string
    maxLength: 128 · minLength: 1 · default: []
  • fileIds
    optional
    array of
    string

    Files this comment ATTACHES. The turn runs on the session’s working set plus these, so re-sending the session’s own files is never necessary; a file that is new to the session widens the scope and starts a successor turn instead of steering the live one.

    maxLength: 128 · minLength: 1

Returns

201

The appended entry and the turns it started.

JSON
  • data
    object
    required
    • entry
      object
      required
      • seq
        integer
        required
        maximum: 9007199254740991 · minimum: -9007199254740991
      • id
        string
        required
      • kind
        comment
        or
        system
        or
        turn_started
        or
        turn_finished
        or
        turn_message
        or
        approval
        +6 more
        required
      • at
        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))$
      • role
        user
        or
        assistant
        or
        system
        required
      • author
        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
      • threadId
        string | null
        required
      • turnId
        string | null
        required
      • parts
        array of
        map<unknown>
        required
      • startedTurnIds
        array of
        string
        required
      • updatedSeq
        required

        Any of the following:

        • integer
        • null
    • turns
      array of
      object
      required
      • id
        string
        required
      • sessionId
        string
        required
        maxLength: 128 · minLength: 1
      • agentId
        string
        required
      • agentVersionId
        string
        required
      • harness
        native
        or
        sandbox
        required
      • status
        running
        or
        waiting_approval
        or
        waiting_action
        or
        waiting_user
        or
        paused
        or
        completed
        +2 more
        required
      • startedBy
        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
      • reason
        mention
        or
        trigger
        or
        handoff
        or
        steer
        or
        assistant
        required
      • threadId
        string | null
        required
      • parentTurnId
        string | null
        required
      • nativeRunId
        string | null
        required
      • nativeSpaceId
        string | null
        required
      • sandboxId
        string | null
        required
      • startedAt
        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))$
      • finishedAt
        string | null
        required
      • summary
        string | null
        required
      • error
        string | null
        required
      • outcome
        optional

        Any of the following:

        • string
        • null
      • waitingReason
        optional

        Any of the following:

        • string
          sandbox_capacity
          or
          sandbox_provisioning
          or
          budget_exceeded
        • null
      • fileIds
        optional
        array of
        string
    • unresolvedMentions
      array of
      string
      required
    • refused
      array of
      object
      required
      • agentId
        string
        required
      • handle
        string
        required
      • reason
        string
        required

400

cannot_share_desk — a desk session is private by identity, so a human mention on one cannot take effect. Relink it to a shared space first.

404

No such session, the caller may not write it, or an attached file does not exist or cannot be read by the caller.

409

session_has_no_space — the session is linked to no space, so a mentioned agent has nowhere to run; relink it first. session_archived — the session is archived, so it takes no new work; reopen it with PATCH { archive: false } first.

422

agent_not_published — a mentioned agent is unpublished or archived.

Type to search…

↑↓ navigate↵ selectEsc close