Create an ordinary Automation
curl --request POST \
--url https://api.coderabbit.ai/v1/automations \
--header 'Content-Type: application/json' \
--header 'x-coderabbitai-api-key: <api-key>' \
--data '
{
"definition": {
"title": "<string>",
"taskPrompt": "<string>",
"trigger": {
"kind": "recurring",
"schedule": {
"interval": 1,
"timezone": "UTC",
"hour": 11,
"minute": 29,
"dayOfMonth": 16,
"weekdays": []
}
},
"summary": "<string>",
"messagePlatformPostingPrompt": "<string>",
"status": "active",
"destinations": [
{
"kind": "message_platform",
"channelId": "<string>",
"channelName": "<string>"
}
],
"deliveryMode": "fresh_thread",
"messagePlatformTargetEnabled": true,
"subscribeToThreadUpdates": true,
"threadUpdateMatch": {
"mode": "all_messages"
},
"homePresentation": {},
"channelId": "<string>",
"channelName": "<string>",
"slackDmPolicy": {
"mode": "creator",
"allowFiles": true
},
"botChannelSecondaryDestination": {
"channelId": "<string>",
"channelName": "<string>"
},
"actions": [
{
"type": "prompt_run",
"actionId": "<string>",
"label": "<string>",
"prompt": "<string>"
}
],
"finalReplyActionPropagation": "every_reply",
"execution": {
"kind": "single_prompt"
}
},
"org_id": "<string>",
"org_name": "<string>",
"message_platform_provider": "slack"
}
'import requests
url = "https://api.coderabbit.ai/v1/automations"
payload = {
"definition": {
"title": "<string>",
"taskPrompt": "<string>",
"trigger": {
"kind": "recurring",
"schedule": {
"interval": 1,
"timezone": "UTC",
"hour": 11,
"minute": 29,
"dayOfMonth": 16,
"weekdays": []
}
},
"summary": "<string>",
"messagePlatformPostingPrompt": "<string>",
"status": "active",
"destinations": [
{
"kind": "message_platform",
"channelId": "<string>",
"channelName": "<string>"
}
],
"deliveryMode": "fresh_thread",
"messagePlatformTargetEnabled": True,
"subscribeToThreadUpdates": True,
"threadUpdateMatch": { "mode": "all_messages" },
"homePresentation": {},
"channelId": "<string>",
"channelName": "<string>",
"slackDmPolicy": {
"mode": "creator",
"allowFiles": True
},
"botChannelSecondaryDestination": {
"channelId": "<string>",
"channelName": "<string>"
},
"actions": [
{
"type": "prompt_run",
"actionId": "<string>",
"label": "<string>",
"prompt": "<string>"
}
],
"finalReplyActionPropagation": "every_reply",
"execution": { "kind": "single_prompt" }
},
"org_id": "<string>",
"org_name": "<string>",
"message_platform_provider": "slack"
}
headers = {
"x-coderabbitai-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-coderabbitai-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
definition: {
title: '<string>',
taskPrompt: '<string>',
trigger: {
kind: 'recurring',
schedule: {
interval: 1,
timezone: 'UTC',
hour: 11,
minute: 29,
dayOfMonth: 16,
weekdays: []
}
},
summary: '<string>',
messagePlatformPostingPrompt: '<string>',
status: 'active',
destinations: [{kind: 'message_platform', channelId: '<string>', channelName: '<string>'}],
deliveryMode: 'fresh_thread',
messagePlatformTargetEnabled: true,
subscribeToThreadUpdates: true,
threadUpdateMatch: {mode: 'all_messages'},
homePresentation: {},
channelId: '<string>',
channelName: '<string>',
slackDmPolicy: {mode: 'creator', allowFiles: true},
botChannelSecondaryDestination: {channelId: '<string>', channelName: '<string>'},
actions: [
{
type: 'prompt_run',
actionId: '<string>',
label: '<string>',
prompt: '<string>'
}
],
finalReplyActionPropagation: 'every_reply',
execution: {kind: 'single_prompt'}
},
org_id: '<string>',
org_name: '<string>',
message_platform_provider: 'slack'
})
};
fetch('https://api.coderabbit.ai/v1/automations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"automation_id": "<string>",
"revision": 1
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"retry_after": 1
}
}{
"error": {
"code": "unauthenticated",
"message": "<string>",
"retry_after": 1
}
}{
"error": {
"code": "forbidden",
"message": "<string>",
"retry_after": 1
}
}{
"error": {
"code": "not_found",
"message": "<string>",
"retry_after": 1
}
}{
"error": {
"code": "head_changed",
"message": "<string>",
"retry_after": 1
}
}{
"error": {
"code": "precondition_failed",
"message": "<string>",
"retry_after": 1
}
}{
"error": {
"code": "payload_too_large",
"message": "<string>",
"retry_after": 1
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "<string>",
"retry_after": 1
}
}{
"error": {
"code": "internal_error",
"message": "<string>",
"retry_after": 1
}
}{
"error": {
"code": "unavailable",
"message": "<string>",
"retry_after": 1
}
}Create an ordinary Automation
Saves an ordinary Automation through native authoring and admission. The returned revision identifies the saved configuration, not completion of a scheduled run.
POST
/
v1
/
automations
Create an ordinary Automation
curl --request POST \
--url https://api.coderabbit.ai/v1/automations \
--header 'Content-Type: application/json' \
--header 'x-coderabbitai-api-key: <api-key>' \
--data '
{
"definition": {
"title": "<string>",
"taskPrompt": "<string>",
"trigger": {
"kind": "recurring",
"schedule": {
"interval": 1,
"timezone": "UTC",
"hour": 11,
"minute": 29,
"dayOfMonth": 16,
"weekdays": []
}
},
"summary": "<string>",
"messagePlatformPostingPrompt": "<string>",
"status": "active",
"destinations": [
{
"kind": "message_platform",
"channelId": "<string>",
"channelName": "<string>"
}
],
"deliveryMode": "fresh_thread",
"messagePlatformTargetEnabled": true,
"subscribeToThreadUpdates": true,
"threadUpdateMatch": {
"mode": "all_messages"
},
"homePresentation": {},
"channelId": "<string>",
"channelName": "<string>",
"slackDmPolicy": {
"mode": "creator",
"allowFiles": true
},
"botChannelSecondaryDestination": {
"channelId": "<string>",
"channelName": "<string>"
},
"actions": [
{
"type": "prompt_run",
"actionId": "<string>",
"label": "<string>",
"prompt": "<string>"
}
],
"finalReplyActionPropagation": "every_reply",
"execution": {
"kind": "single_prompt"
}
},
"org_id": "<string>",
"org_name": "<string>",
"message_platform_provider": "slack"
}
'import requests
url = "https://api.coderabbit.ai/v1/automations"
payload = {
"definition": {
"title": "<string>",
"taskPrompt": "<string>",
"trigger": {
"kind": "recurring",
"schedule": {
"interval": 1,
"timezone": "UTC",
"hour": 11,
"minute": 29,
"dayOfMonth": 16,
"weekdays": []
}
},
"summary": "<string>",
"messagePlatformPostingPrompt": "<string>",
"status": "active",
"destinations": [
{
"kind": "message_platform",
"channelId": "<string>",
"channelName": "<string>"
}
],
"deliveryMode": "fresh_thread",
"messagePlatformTargetEnabled": True,
"subscribeToThreadUpdates": True,
"threadUpdateMatch": { "mode": "all_messages" },
"homePresentation": {},
"channelId": "<string>",
"channelName": "<string>",
"slackDmPolicy": {
"mode": "creator",
"allowFiles": True
},
"botChannelSecondaryDestination": {
"channelId": "<string>",
"channelName": "<string>"
},
"actions": [
{
"type": "prompt_run",
"actionId": "<string>",
"label": "<string>",
"prompt": "<string>"
}
],
"finalReplyActionPropagation": "every_reply",
"execution": { "kind": "single_prompt" }
},
"org_id": "<string>",
"org_name": "<string>",
"message_platform_provider": "slack"
}
headers = {
"x-coderabbitai-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-coderabbitai-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
definition: {
title: '<string>',
taskPrompt: '<string>',
trigger: {
kind: 'recurring',
schedule: {
interval: 1,
timezone: 'UTC',
hour: 11,
minute: 29,
dayOfMonth: 16,
weekdays: []
}
},
summary: '<string>',
messagePlatformPostingPrompt: '<string>',
status: 'active',
destinations: [{kind: 'message_platform', channelId: '<string>', channelName: '<string>'}],
deliveryMode: 'fresh_thread',
messagePlatformTargetEnabled: true,
subscribeToThreadUpdates: true,
threadUpdateMatch: {mode: 'all_messages'},
homePresentation: {},
channelId: '<string>',
channelName: '<string>',
slackDmPolicy: {mode: 'creator', allowFiles: true},
botChannelSecondaryDestination: {channelId: '<string>', channelName: '<string>'},
actions: [
{
type: 'prompt_run',
actionId: '<string>',
label: '<string>',
prompt: '<string>'
}
],
finalReplyActionPropagation: 'every_reply',
execution: {kind: 'single_prompt'}
},
org_id: '<string>',
org_name: '<string>',
message_platform_provider: 'slack'
})
};
fetch('https://api.coderabbit.ai/v1/automations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"automation_id": "<string>",
"revision": 1
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"retry_after": 1
}
}{
"error": {
"code": "unauthenticated",
"message": "<string>",
"retry_after": 1
}
}{
"error": {
"code": "forbidden",
"message": "<string>",
"retry_after": 1
}
}{
"error": {
"code": "not_found",
"message": "<string>",
"retry_after": 1
}
}{
"error": {
"code": "head_changed",
"message": "<string>",
"retry_after": 1
}
}{
"error": {
"code": "precondition_failed",
"message": "<string>",
"retry_after": 1
}
}{
"error": {
"code": "payload_too_large",
"message": "<string>",
"retry_after": 1
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "<string>",
"retry_after": 1
}
}{
"error": {
"code": "internal_error",
"message": "<string>",
"retry_after": 1
}
}{
"error": {
"code": "unavailable",
"message": "<string>",
"retry_after": 1
}
}- CLI Tool
- MCP Server
coderabbit api request /automations --input request.json
An agent connected to the CodeRabbit MCP server runs this operation as the
create_automation tool. The connection selects the organization, so the arguments have no org_id or org_name.{
"method": "tools/call",
"params": {
"name": "create_automation",
"arguments": {
"definition": {}
}
}
}
Authorizations
See Authentication for the key types and where to create a key.
Body
application/json
Organization for a workspace key: the Git-provider organization ID (scope.provider_organization_id) or the CodeRabbit organization ID (scope.id, or id from list organizations). Supply either org_id or org_name, never both. Omit for organization keys and MCP connections.
Minimum string length:
1Was this page helpful?