Automations

Create automation

Create an automation for the API key's organization. Modem assigns the organization's earliest owner.

Provide a complete automation definition. Event schedules accept canonical registered event names only. GitHub PR event schedules can include targetBranches with exact names or * wildcards; omit it to match every target branch. A target-branch filter is only valid when every configured event is a GitHub PR event. To send output to Slack or Discord, provide sourceName and sourceChannelId together. Otherwise Modem uses the organization's saved default output destination. Requests fail when no valid destination is available.

This operation supports Idempotency-Key and accepts organization API keys only; service JWTs are rejected.

post/automations

Request

  • Base URL: https://api.modem.dev/v1
  • URL: https://api.modem.dev/v1/automations
  • Auth: HTTP bearer

Headers

Idempotency-Keystring

Replays a successful mutating request for 24 hours. Reuse with a different payload returns 409.

Request body

OR

Response

OK

allowedCapabilitiesstring[] nullable required

Explicit capability keys when capabilityMode is custom. Null means all.

capabilityMode'all' | 'custom' required

Whether this task uses all visible capabilities or a custom subset.

createdAtstring date-time

Timestamp when the task was created.

enabledboolean required

Whether the task is actively being scheduled.

idstring uuid required
lastAttemptAtstring date-time nullable

Timestamp when the most recent execution attempt started, including manual runs.

lastErrorMessagestring nullable required

Most recent error message if status is error.

lastRunAtstring date-time nullable

Timestamp of the most recent scheduler-managed execution, used to calculate the next run.

modelLevel'high' | 'low' | 'med' required

Persisted model level for automation execution.

namestring required

Human-readable name for the automation.

nextRunAtstring date-time nullable

Timestamp of the next scheduled execution.

promptstring required

AI prompt or instructions executed when the task runs.

status'completed' | 'error' | 'healthy' | 'paused' required

Current health status of the automation.

templateSlugstring nullable required
timezonestring required

IANA timezone identifier for schedule evaluation.

updatedAtstring date-time

Timestamp when the task was last updated.

Changes

No recorded changes to this operation across all 1 revision of this API.