Skip to content
Navigation

Open a work session

Opens a work session — one durable timeline that humans and named paperwork agents share.

Name the agents in agents (a handle such as mike, or an agt_ id); each must have a published version. They are mentioned with your description and their turns start before this call returns — startedTurnIds names them, and failedMentions names any agent whose turn could not be started. Open with an empty agents to invite nobody, then post to /entries when you are ready.

Give the session its working set in fileIds: every turn it runs is scoped to those files, so you never re-send them. With no spaceIds the session lives in your organization's API workspace.

Set webhookUrl to receive this session's events at one https endpoint, signed exactly like every other delivery. Your saved /v1/webhooks subscriptions receive them too.

Access is scoped to the API key that opened the session: another key of the same organization gets 404 on every route here. Set apiVisible: true to let every key of your organization read and write it.

Learn more: Work sessions

POST
https://api.cloudraker.com/v1/work-sessions
Try it
Request body
Live API request

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

Authorization

  • bearerAuth
    HTTP
    required

Request body JSON required

  • description
    string
    required
    maxLength: 8000 · minLength: 1
  • title
    optional
    string
    maxLength: 200
  • agents
    optional
    array of
    string
    maxLength: 128 · minLength: 1 · default: []
  • spaceIds
    optional
    array of
    string
    maxLength: 128 · minLength: 1 · default: []
  • fileIds
    optional
    array of
    string
    maxLength: 128 · minLength: 1 · default: []
  • webhookUrl
    optional
    string
    format: uri · maxLength: 2048
  • apiVisible
    optional
    boolean
    default: false
  • metadata
    optional
    map of
    unknown

Returns

201

The opened work session and the turns it started.

JSON
  • data
    object
    required
    • object
      string
      required
    • id
      string
      required
    • status
      open
      or
      working
      or
      waiting
      or
      done
      or
      archived
      required
    • title
      string
      required
    • description
      string
      required
    • agents
      array of
      object
      required
      • id
        string
        required
      • handle
        string
        required
      • name
        string
        required
      • role
        string
        required
    • spaceIds
      array of
      string
      required
    • fileIds
      array of
      string
      required
    • counts
      object
      required
      • turns
        integer
        required
        maximum: 9007199254740991 · minimum: -9007199254740991
      • approvalsPending
        integer
        required
        maximum: 9007199254740991 · minimum: -9007199254740991
      • tasksPending
        integer
        required
        maximum: 9007199254740991 · minimum: -9007199254740991
    • apiVisible
      boolean
      required
    • createdAt
      string
      required
    • lastActivityAt
      string
      required
    • closedAt
      string | null
      required
    • entriesUrl
      string
      required
    • streamUrl
      string
      required
    • artifactsUrl
      string
      required
    • startedTurnIds
      array of
      string
      required
    • failedMentions
      array of
      string
      required
    • webhookUrl
      optional
      string

400

Validation Error
JSON
  • success
    false
    required
  • error
    array of
    unknown
    required
  • data
    unknown
    required

401

Missing or invalid credential.

403

The credential may not use the /v1 API.

404

A named space or file does not exist, or you may not use it.

422

agent_not_published — a named agent has no published version.

429

Rate limited. The /v1 API allows at least 67 requests per minute per organization (about 1,000 requests per 15 minutes) — a guaranteed floor, enforced per edge location, so a geographically spread caller may get more. Wait for the Retry-After interval and retry — the error is retryable.
JSON
  • code
    rate_limited
    required
  • message
    string
    required
  • retryable
    true
    required
  • requestId
    string
    required
  • docUrl
    optional
    string

503

turn_start_failed — no invited agent could be started. Retry.

Type to search…

↑↓ navigate↵ selectEsc close