Skip to main content
POST
Create automation

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

agent_id
string
required

The ID of the agent to create the automation for.

Body

application/json
name
string
required

Human-readable name for the automation.

Maximum string length: 255
cron
string
required

Five-field cron expression (minute hour day month day-of-week) controlling when the automation fires. Seconds are not supported. The schedule must fire at most once every 15 minutes — finer-grained expressions are rejected with a 400 error.

Maximum string length: 255
Example:

"0 9 * * 1"

prompt
string
required

The instruction text sent to the agent each time the automation fires. Supports Markdown. This is the agent's task for the run. Must not be empty or whitespace-only.

Maximum string length: 20000
description
string | null

Optional free-text description of what this automation does.

Maximum string length: 600
enabled
boolean | null

Whether the automation should be active immediately after creation. Defaults to true when omitted or null. Set to false to create the automation in a paused state — it will not fire until explicitly enabled via the Update automation endpoint.

timezone
string | null

IANA timezone identifier in which cron is interpreted. Defaults to "UTC" when omitted.

Example:

"America/New_York"

thread_mode
enum<string> | null

Controls whether each scheduled run creates a fresh conversation thread or continues in the same persistent conversation.

  • new_thread — (default) Each run starts a new conversation. Results are isolated; the agent has no memory of prior runs unless it uses agent memory tools.
  • same_conversation — Every run appends to the same conversation thread. The agent sees the full history of prior runs, which is useful for incremental summaries or stateful workflows.
Available options:
new_thread,
same_conversation
destination_type
enum<string> | null

Where the automation's conversation runs and results are delivered.

  • agent_dm — (default) Results are posted in the agent's own DM space. No destination_id is required.
  • channel — Results are posted in a specific Datagrid channel. Provide the channel ID in destination_id.
  • user_dm — Results are sent as a direct message to a specific user. Provide the user ID in destination_id.
Available options:
agent_dm,
channel,
user_dm
destination_id
string | null

The channel ID or user ID for the conversation destination. Required when destination_type is channel or user_dm; omit for agent_dm.

Maximum string length: 255
output_channel_id
string | null

ID of an additional delivery channel (Slack, Teams, email, etc.) where the agent's output is also delivered after each run. Must be provided together with output_channel_type — supplying one without the other is rejected with a 400 error. This is an external transport address, not a Datagrid-owned resource — it's validated against the caller's own connected integrations at delivery time.

Maximum string length: 255
output_channel_type
enum<string> | null

Transport type of output_channel_id. One of "email", "slack", "teams", "sms". Must be provided together with output_channel_id.

Available options:
email,
slack,
teams,
sms
notification_preference
enum<string> | null

Controls when users are notified about automation run outcomes.

  • always — Notify after every run regardless of success or failure. - on_failure — (default) Notify only when a run fails or produces an error.
  • never — Do not send notifications for this automation.
Available options:
always,
on_failure,
never
prompt_file_ids
string[] | null

IDs of files to attach as context for every run of this automation. Each file must exist and belong to the caller's teamspace, or the request is rejected with a 404 error. Limited to 20 IDs per request.

Maximum array length: 20

Response

Created automation

object
enum<string>
required

The object type, always 'automation'.

Available options:
automation
id
string
required

Unique identifier for the automation.

name
string
required

Human-readable name of the automation.

description
string | null
required

Optional free-text description of what this automation does.

enabled
boolean
required

Whether the automation is active. When false the cron trigger is paused and no runs are scheduled until it is re-enabled.

created_at
string<date-time>
required

ISO 8601 timestamp of when the automation was created.

cron
string | null
required

Five-field cron expression controlling when the automation fires (e.g. "0 9 * * 1" = every Monday at 09:00). Seconds are not supported. Must have a minimum inter-fire interval of 15 minutes.

Example:

"0 9 * * 1"

timezone
string | null
required

IANA timezone identifier in which cron is interpreted (e.g. "America/New_York", "UTC"). Defaults to "UTC" when not provided on create.

Example:

"America/New_York"

prompt
string | null
required

The instruction text sent to the agent each time the automation fires. Supports Markdown.

thread_mode
enum<string> | null
required

Controls whether each scheduled run creates a fresh conversation thread or continues in the same persistent conversation.

  • new_thread — (default) Each run starts a new conversation. Results are isolated; the agent has no memory of prior runs unless it uses agent memory tools.
  • same_conversation — Every run appends to the same conversation thread. The agent sees the full history of prior runs, which is useful for incremental summaries or stateful workflows.
Available options:
new_thread,
same_conversation
updated_at
string<date-time> | null

ISO 8601 timestamp of the last modification.

destination_type
enum<string> | null

Where the automation's conversation runs and results are delivered.

  • agent_dm — (default) Results are posted in the agent's own DM space. No destination_id is required.
  • channel — Results are posted in a specific Datagrid channel. Provide the channel ID in destination_id.
  • user_dm — Results are sent as a direct message to a specific user. Provide the user ID in destination_id.
Available options:
agent_dm,
channel,
user_dm
destination_id
string | null

The channel ID or user ID that identifies the destination. Required when destination_type is channel or user_dm; omit for agent_dm.

output_channel_id
string | null

ID of an additional delivery channel (Slack channel, Teams channel, email address, etc.) where automation results are also posted.

output_channel_type
string | null

The transport type of the output channel. One of "email", "slack", "teams", "sms".

notification_preference
enum<string> | null

Controls when users are notified about automation run outcomes.

  • always — Notify after every run regardless of success or failure. - on_failure — (default) Notify only when a run fails or produces an error.
  • never — Do not send notifications for this automation.
Available options:
always,
on_failure,
never
prompt_file_ids
string[] | null

IDs of files attached to the automation prompt. These files are provided as context to the agent on every run.