Skip to content
Navigation

Create an automation

RETIRED — always answers 409 legacy_create_retired. Create a trigger (POST /triggers) instead. Creates an agent task: a stored prompt plus a cadence (cron with an IANA timezone, a once instant, or manual for trigger-only). When it fires it drops a message into a real thread you can join, nudge and correct — not a hidden pipeline. Omit spaceId for your own desk; a named space needs space:contribute for you AND for the owner the automation runs as. The inbound trigger secret is returned ONCE, here. Authorization: organization admin.

POST
https://api.cloudraker.com/organization/automations
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

  • name
    string
    required
    maxLength: 80 · minLength: 1
  • prompt
    string
    required

    The user message injected into the thread when the automation fires.

    maxLength: 4000 · minLength: 1
  • schedule
    required

    One of the following:

    • object
      • kind
        string
        required
      • expression
        string
        required
      • timezone
        string
        required
    • object
      • kind
        string
        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))$
    • object
      • kind
        string
        required
  • description
    optional
    string
    maxLength: 400
  • playbookId
    optional
    string
    maxLength: 128 · minLength: 1
  • fileIds
    optional
    array of
    string
    minLength: 1
  • spaceId
    optional
    string
    maxLength: 128 · minLength: 1
  • threadPolicy
    optional
    reuse
    or
    new
    default: "reuse"
  • enabled
    optional
    boolean
    default: true
  • triggerEnabled
    optional
    boolean
    default: false
  • originThreadId
    optional
    string
    maxLength: 128 · minLength: 1

Returns

201

The automation and its one-time trigger secret.

JSON
  • automation
    object
    required
    • _id
      string
      required
    • name
      string
      required
    • kind
      agent_task
      required
    • enabled
      boolean
      required
    • playbookId
      string
      required
    • prompt
      string
      required
    • spaceId
      string
      required
    • threadPolicy
      reuse
      or
      new
      required
    • runAs
      string
      required
    • createdBy
      string
      required
    • organizationId
      string
      required
    • schedule
      required

      One of the following:

      • object
        • kind
          string
          required
        • expression
          string
          required
        • timezone
          string
          required
      • object
        • kind
          string
          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))$
      • object
        • kind
          string
          required
    • nextRunAt
      string | null
      required
    • trigger
      object
      required
      • enabled
        boolean
        required
      • secretPreview
        string
        required
      • secretRotatedAt
        optional
        string
    • createdAt
      string
      required
    • updatedAt
      string
      required
    • runtimeStatus
      idle
      or
      disabled
      or
      needs_input
      or
      blocked
      or
      error
      required
    • cadence
      string
      required
    • triggerRef
      string
      required
    • description
      optional
      string
    • fileIds
      optional
      array of
      string
    • threadId
      optional
      string
    • lastFiredAt
      optional
      string
    • lastRunStatus
      optional
      started
      or
      success
      or
      busy
      or
      needs_input
      or
      blocked
      or
      error
    • lastRunId
      optional
      string
    • originThreadId
      optional
      string
  • secret
    string
    required

400

cannot_target_desk — a desk is never another member’s target.

403

run_as_forbidden — the owner cannot contribute to that space.

404

Agents disabled, or the space is not contributable.

409

legacy_create_retired — automations have moved to triggers.

Type to search…

↑↓ navigate↵ selectEsc close