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.
/automationsAuthorizationBearer token · headerrequiredOrganization API key (modem_…).
Idempotency-KeystringReplays a successful mutating request for 24 hours. Reuse with a different payload returns 409.
application/jsonallowedCapabilitiesstring[] | nullExplicit capability keys when capabilityMode is custom. Null means all.
Show propertiesHide properties
stringstringnullcapabilityModestringWhether this task uses all visible capabilities or a custom subset.
allcustomenabledbooleanmodelLevelstringPersisted model level for automation execution.
highlowmednamestringrequiredpromptstringrequiredscheduleobjectrequiredShow propertiesHide properties
exprstringrequiredtypeanyrequiredrrulestringrequiredtypeanyrequiredatstring<date-time>requiredtypeanyrequirednintegerrequiredtypeanyrequiredunitstringrequiredhoursminutesdelaySecondsintegereventsstring[]requiredtargetBranchesstring[]typeanyrequiredtemplateSlugstringtimezonestringrequiredallowedCapabilitiesstring[] | nullExplicit capability keys when capabilityMode is custom. Null means all.
Show propertiesHide properties
stringstringnullcapabilityModestringWhether this task uses all visible capabilities or a custom subset.
allcustomenabledbooleanmodelLevelstringPersisted model level for automation execution.
highlowmednamestringrequiredpromptstringrequiredscheduleobjectrequiredShow propertiesHide properties
exprstringrequiredtypeanyrequiredrrulestringrequiredtypeanyrequiredatstring<date-time>requiredtypeanyrequirednintegerrequiredtypeanyrequiredunitstringrequiredhoursminutesdelaySecondsintegereventsstring[]requiredtargetBranchesstring[]typeanyrequiredsourceChannelIdstringrequiredsourceNamestringrequireddiscordslacktemplateSlugstringtimezonestringrequiredOK
allowedCapabilitiesstring[] | nullrequiredExplicit capability keys when capabilityMode is custom. Null means all.
Show propertiesHide properties
stringstringnullcapabilityModestringrequiredWhether this task uses all visible capabilities or a custom subset.
allcustomcreatedAtstring<date-time>Timestamp when the task was created.
enabledbooleanrequiredWhether the task is actively being scheduled.
idstring<uuid>requiredlastAttemptAtstring<date-time> | nullTimestamp when the most recent execution attempt started, including manual runs.
Show propertiesHide properties
string<date-time>nulllastErrorMessagestring | nullrequiredMost recent error message if status is error.
Show propertiesHide properties
stringnulllastRunAtstring<date-time> | nullTimestamp of the most recent scheduler-managed execution, used to calculate the next run.
Show propertiesHide properties
string<date-time>nullmodelLevelstringrequiredPersisted model level for automation execution.
highlowmednamestringrequiredHuman-readable name for the automation.
nextRunAtstring<date-time> | nullTimestamp of the next scheduled execution.
Show propertiesHide properties
string<date-time>nulloutputChannelsobject[]requiredShow propertiesHide properties
objectchannelstringrequireddiscordemailmsteamsslackdestinationsstring[] | nullrequiredShow propertiesHide properties
stringstringnullmodestringrequiredany-internalanyspecificpromptstringrequiredAI prompt or instructions executed when the task runs.
scheduleobjectrequiredShow propertiesHide properties
exprstringrequiredtypeanyrequiredrrulestringrequiredtypeanyrequiredatstring<date-time>requiredtypeanyrequirednintegerrequiredtypeanyrequiredunitstringrequiredhoursminutesdelaySecondsintegereventsstring[]requiredtargetBranchesstring[]typeanyrequiredstatusstringrequiredCurrent health status of the automation.
completederrorhealthypausedtemplateSlugstring | nullrequiredShow propertiesHide properties
stringnulltimezonestringrequiredIANA timezone identifier for schedule evaluation.
updatedAtstring<date-time>Timestamp when the task was last updated.
Invalid request (validation failed).
codestringrequiredMachine-readable error code, e.g. NOT_FOUND.
dataanyOptional structured error details.
definedbooleanrequiredTrue if the error was declared in the procedure contract.
messagestringrequiredHuman-readable error message.
statusintegerrequiredHTTP status code.
Missing or invalid API key.
codestringrequiredMachine-readable error code, e.g. NOT_FOUND.
dataanyOptional structured error details.
definedbooleanrequiredTrue if the error was declared in the procedure contract.
messagestringrequiredHuman-readable error message.
statusintegerrequiredHTTP status code.
The API key does not have access to this resource.
codestringrequiredMachine-readable error code, e.g. NOT_FOUND.
dataanyOptional structured error details.
definedbooleanrequiredTrue if the error was declared in the procedure contract.
messagestringrequiredHuman-readable error message.
statusintegerrequiredHTTP status code.
The requested resource was not found.
codestringrequiredMachine-readable error code, e.g. NOT_FOUND.
dataanyOptional structured error details.
definedbooleanrequiredTrue if the error was declared in the procedure contract.
messagestringrequiredHuman-readable error message.
statusintegerrequiredHTTP status code.
The request conflicts with an existing resource or idempotency operation.
codestringrequiredMachine-readable error code, e.g. NOT_FOUND.
dataanyOptional structured error details.
definedbooleanrequiredTrue if the error was declared in the procedure contract.
messagestringrequiredHuman-readable error message.
statusintegerrequiredHTTP status code.
Rate limit exceeded.
codestringrequiredMachine-readable error code, e.g. NOT_FOUND.
dataanyOptional structured error details.
definedbooleanrequiredTrue if the error was declared in the procedure contract.
messagestringrequiredHuman-readable error message.
statusintegerrequiredHTTP status code.
Internal server error.
codestringrequiredMachine-readable error code, e.g. NOT_FOUND.
dataanyOptional structured error details.
definedbooleanrequiredTrue if the error was declared in the procedure contract.
messagestringrequiredHuman-readable error message.
statusintegerrequiredHTTP status code.