Skip to content
Navigation

Publish the agent draft

Publishes the current draft as the agents live version and opens a fresh draft at the next version number. Publishing writes the engine-compat shadow playbook document whose id IS the new agv_version id, soPOST /spaces/:spaceId/playbook-runscan start the agent withplaybookId: "<publishedVersionId>"unchanged. The previous version stops starting runs (its id answers 409playbook_not_active). Authorization: organization administrators only. A privateagent is visible only to its owner; every other caller gets 404. 409agent_archivedwhen the agent is archived — unarchive it first, publishing must never re-activate a hidden agent. 422 when the draft cannot run:harness_not_available, instructions_too_long_for_native, too_many_skills_for_native, sandbox_tool_on_native_harness, platform_tool_not_available_on_sandbox(a sandbox version may hold thefilesandspacesplatform tools only — the rest resolve in the run engine),tool_grants_nothing_on_sandbox(a sandbox version may not holdcode, a connector or delegation — none of them expands to a tool inside a container), unknown_model_policy, space_scope_not_supported_on_native, or engine_rejected_versionwhen the run engine's own validator refuses the version (that one carriesissues[], each with the failing path). Branch on error_code, never on the sentence. Response: { data: { agent, draft, published } }—agent.publishedVersionIdis theagv_` id.

POST
https://api.cloudraker.com/agents/{agentRef}/publish
Try it
Path parameters
Live API request

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

Authorization

  • bearerAuth
    HTTP
    required

Path parameters

  • agentRef
    string
    required

Returns

200

The published agent and its fresh draft.

JSON
  • data
    object
    required
    • agent
      object
      required
      • id
        string
        required
      • handle
        string
        required

        Unique per org, derived from the name when not given (mike, mike-2, …).

      • name
        string
        required
      • role
        string
        required
      • avatar
        object
        required
        • kind
          initials
          or
          generated
          required
        • color
          optional
          string
          pattern: ^#[0-9a-fA-F]{6}$
      • visibility
        org
        or
        private
        required
      • ownerUserId
        string
        required
      • publishedVersionId
        string | null
        required

        The agv_ id a run is started with. Null until the agent is published.

      • draftVersionId
        string
        required
      • emailTriggerId
        string | null
        required
      • sourcePlaybookId
        string | null
        required

        Set on agents created by the playbook migration; null otherwise.

      • 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))$
      • updatedAt
        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))$
      • createdBy
        string
        required
      • archivedAt
        required

        Any of the following:

        • string
        • null
      • documentAgent
        optional
        boolean
    • draft
      object
      required
      • id
        string
        required
      • agentId
        string
        required
      • version
        integer
        required
        maximum: 9007199254740991 · minimum: -9007199254740991
      • publishedAt
        required

        Any of the following:

        • string
        • null
      • 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))$
      • updatedAt
        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))$
      • createdBy
        string
        required
      • documentAgent
        optional
        boolean

        Offer this published agent as a document reviewer. Requires file reading and document editing tools.

      • harness
        optional
        auto
        or
        native
        or
        sandbox

        Automatic execution keeps the agent loop in the platform and starts isolated compute only when a tool needs it. Default: auto. Legacy native and sandbox values remain accepted for existing integrations.

      • instructions
        optional
        string

        The standing instructions the agent runs under. A native version must also fit the engine ceiling (8000 chars) to publish.

        maxLength: 32768
      • model
        optional
        object
        • policy
          optional
          string
          maxLength: 64 · minLength: 1
        • maxSteps
          optional
          integer
          maximum: 100 · minimum: 1
        • budgetCredits
          optional
          integer
          maximum: 9007199254740991 · minimum: 1
      • memory
        optional
        object

        Saved memory the agent reads and updates across sessions. Private agents only: publishing an org agent with memory enabled answers 422 memory_requires_private. Default: on for sandbox, off otherwise.

        • enabled
          boolean
          required
      • skills
        optional
        array of
        string
        maxLength: 64 · minLength: 1
      • tools
        optional
        array of
        ToolGrant

        One of the following:

        • object
          • kind
            string
            required
          • installedActionId
            string
            required
            maxLength: 128 · minLength: 1
          • preApproval
            optional
            boolean
          • postApproval
            optional
            boolean
        • object
          • kind
            string
            required
          • connectionId
            string
            required
            maxLength: 128 · minLength: 1
          • readOnlyTools
            optional
            array of
            string
            maxLength: 64 · minLength: 1
        • object
          • kind
            string
            required
          • name
            files
            or
            artifacts
            or
            spaces
            or
            compose
            or
            sign
            or
            search
            +3 more
            required
        • object
          • kind
            string
            required
          • name
            fs
            or
            shell
            or
            browser
            or
            code
            or
            net
            required
        • object
          • kind
            string
            required
        • object
          • kind
            string
            required
      • spaces
        optional
        object
        • mode
          optional
          session
          or
          fixed
          or
          any
        • spaceIds
          optional
          array of
          string
          maxLength: 128 · minLength: 1
        • spaceTypes
          optional
          array of
          string
          pattern: ^[a-z][a-z0-9-]{0,38}[a-z0-9]$
      • network
        optional
        object
        • policyId
          optional

          Any of the following:

          • string
          • null
      • approvals
        optional
        object
        • defaultForWrite
          optional
          ask
          or
          allow
        • sensitive
          optional
          string
        • approvers
          optional
          array of
          string
          maxLength: 128 · minLength: 1
      • delegation
        optional
        object
        • canInvite
          optional

          Any of the following:

          • array<string>
          • string
            any
            or
            none
      • tasks
        optional
        array of
        object
        • id
          string
          required
          maxLength: 64 · minLength: 1
        • title
          string
          required
          maxLength: 200 · minLength: 1
        • instructions
          optional

          Any of the following:

          • string
          • null
        • dependsOn
          optional
          array of
          string
        • executor
          optional
          agent
          or
          human
        • assignee
          optional

          Any of the following:

          • string
          • null
    • published
      required

      Any of the following:

      • AgentVersion
        • id
          string
          required
        • agentId
          string
          required
        • version
          integer
          required
          maximum: 9007199254740991 · minimum: -9007199254740991
        • publishedAt
          required

          Any of the following:

          • string
          • null
        • 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))$
        • updatedAt
          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))$
        • createdBy
          string
          required
        • documentAgent
          optional
          boolean

          Offer this published agent as a document reviewer. Requires file reading and document editing tools.

        • harness
          optional
          auto
          or
          native
          or
          sandbox

          Automatic execution keeps the agent loop in the platform and starts isolated compute only when a tool needs it. Default: auto. Legacy native and sandbox values remain accepted for existing integrations.

        • instructions
          optional
          string

          The standing instructions the agent runs under. A native version must also fit the engine ceiling (8000 chars) to publish.

          maxLength: 32768
        • model
          optional
          object
          • policy
            optional
            string
            maxLength: 64 · minLength: 1
          • maxSteps
            optional
            integer
            maximum: 100 · minimum: 1
          • budgetCredits
            optional
            integer
            maximum: 9007199254740991 · minimum: 1
        • memory
          optional
          object

          Saved memory the agent reads and updates across sessions. Private agents only: publishing an org agent with memory enabled answers 422 memory_requires_private. Default: on for sandbox, off otherwise.

          • enabled
            boolean
            required
        • skills
          optional
          array of
          string
          maxLength: 64 · minLength: 1
        • tools
          optional
          array of
          ToolGrant

          One of the following:

          • object
            • kind
              string
              required
            • installedActionId
              string
              required
              maxLength: 128 · minLength: 1
            • preApproval
              optional
              boolean
            • postApproval
              optional
              boolean
          • object
            • kind
              string
              required
            • connectionId
              string
              required
              maxLength: 128 · minLength: 1
            • readOnlyTools
              optional
              array of
              string
              maxLength: 64 · minLength: 1
          • object
            • kind
              string
              required
            • name
              files
              or
              artifacts
              or
              spaces
              or
              compose
              or
              sign
              or
              search
              +3 more
              required
          • object
            • kind
              string
              required
            • name
              fs
              or
              shell
              or
              browser
              or
              code
              or
              net
              required
          • object
            • kind
              string
              required
          • object
            • kind
              string
              required
        • spaces
          optional
          object
          • mode
            optional
            session
            or
            fixed
            or
            any
          • spaceIds
            optional
            array of
            string
            maxLength: 128 · minLength: 1
          • spaceTypes
            optional
            array of
            string
            pattern: ^[a-z][a-z0-9-]{0,38}[a-z0-9]$
        • network
          optional
          object
          • policyId
            optional

            Any of the following:

            • string
            • null
        • approvals
          optional
          object
          • defaultForWrite
            optional
            ask
            or
            allow
          • sensitive
            optional
            string
          • approvers
            optional
            array of
            string
            maxLength: 128 · minLength: 1
        • delegation
          optional
          object
          • canInvite
            optional

            Any of the following:

            • array<string>
            • string
              any
              or
              none
        • tasks
          optional
          array of
          object
          • id
            string
            required
            maxLength: 64 · minLength: 1
          • title
            string
            required
            maxLength: 200 · minLength: 1
          • instructions
            optional

            Any of the following:

            • string
            • null
          • dependsOn
            optional
            array of
            string
          • executor
            optional
            agent
            or
            human
          • assignee
            optional

            Any of the following:

            • string
            • null
      • null

404

not_found — no such agent in this organization.

409

agent_archived — unarchive the agent before publishing it.

422

The draft cannot run — error_code is one of the seven publish codes, or engine_rejected_version with per-field issues[].

Type to search…

↑↓ navigate↵ selectEsc close