Create an app-event agentic automation
import requests
url = "https://api.datagrid.com/v1/agentic-automations/event"
payload = {
"agent_id": "<string>",
"name": "<string>",
"application_id": "connector.procore",
"trigger_event": "RFIs:create",
"description": "<string>",
"enabled": True,
"run_conditions": "<string>",
"output_channel_type": "<string>",
"output_channel_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agent_id: '<string>',
name: '<string>',
application_id: 'connector.procore',
trigger_event: 'RFIs:create',
description: '<string>',
enabled: true,
run_conditions: '<string>',
output_channel_type: '<string>',
output_channel_id: '<string>'
})
};
fetch('https://api.datagrid.com/v1/agentic-automations/event', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.datagrid.com/v1/agentic-automations/event \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent_id": "<string>",
"name": "<string>",
"application_id": "connector.procore",
"trigger_event": "RFIs:create",
"description": "<string>",
"enabled": true,
"run_conditions": "<string>",
"output_channel_type": "<string>",
"output_channel_id": "<string>"
}
'{
"object": "agentic_automation",
"id": "<string>",
"kind": "app_event",
"agent_id": "<string>",
"name": "<string>",
"description": "<string>",
"enabled": true,
"output_channel_type": "<string>",
"output_channel_id": "<string>",
"creator_user_id": "<string>",
"last_updated_by_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"app_event": {
"application_id": "connector.procore",
"trigger_event": "RFIs:create",
"source_scope": "<string>",
"source_metadata": {},
"run_conditions": "<string>",
"external_subscription_id": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
}{
"status_code": 123,
"error": "rate_limit_exceeded",
"message": "<string>",
"retryable": true,
"statusCode": 123,
"mitigation": "<string>",
"details": {
"reason": "<string>"
}
}Agentic Automations
Create an app-event agentic automation
Create an automation that runs an agent when an event happens in a connected app. When enabled is true, the webhook for the app is registered before the automation is saved. If the save fails, the webhook is removed again. agent_id is the ID of the agent and is in the body. The caller needs the manage automations permission.
POST
/
agentic-automations
/
event
Create an app-event agentic automation
import requests
url = "https://api.datagrid.com/v1/agentic-automations/event"
payload = {
"agent_id": "<string>",
"name": "<string>",
"application_id": "connector.procore",
"trigger_event": "RFIs:create",
"description": "<string>",
"enabled": True,
"run_conditions": "<string>",
"output_channel_type": "<string>",
"output_channel_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agent_id: '<string>',
name: '<string>',
application_id: 'connector.procore',
trigger_event: 'RFIs:create',
description: '<string>',
enabled: true,
run_conditions: '<string>',
output_channel_type: '<string>',
output_channel_id: '<string>'
})
};
fetch('https://api.datagrid.com/v1/agentic-automations/event', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.datagrid.com/v1/agentic-automations/event \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent_id": "<string>",
"name": "<string>",
"application_id": "connector.procore",
"trigger_event": "RFIs:create",
"description": "<string>",
"enabled": true,
"run_conditions": "<string>",
"output_channel_type": "<string>",
"output_channel_id": "<string>"
}
'{
"object": "agentic_automation",
"id": "<string>",
"kind": "app_event",
"agent_id": "<string>",
"name": "<string>",
"description": "<string>",
"enabled": true,
"output_channel_type": "<string>",
"output_channel_id": "<string>",
"creator_user_id": "<string>",
"last_updated_by_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"app_event": {
"application_id": "connector.procore",
"trigger_event": "RFIs:create",
"source_scope": "<string>",
"source_metadata": {},
"run_conditions": "<string>",
"external_subscription_id": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
}{
"status_code": 123,
"error": "rate_limit_exceeded",
"message": "<string>",
"retryable": true,
"statusCode": 123,
"mitigation": "<string>",
"details": {
"reason": "<string>"
}
}Authorizations
Body
application/json
Response
Created automation