Tasks
Toggle task
Activar o desactivar una tarea.
POST
/
api
/
tasks
/
{id}
/
toggle
curl -X POST "https://app.horneross.com/api/tasks/trigger_abc123/toggle" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json" \
-d '{"enabled": false}'
curl -X POST "https://app.horneross.com/api/tasks/trigger_abc123/toggle" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json" \
-d '{"enabled": true}'
// Desactivar task
const response = await fetch(
'https://app.horneross.com/api/tasks/trigger_abc123/toggle',
{
method: 'POST',
headers: {
'Authorization': 'Bearer sk_live_xxx',
'Content-Type': 'application/json',
},
body: JSON.stringify({ enabled: false }),
}
);
const { trigger } = await response.json();
console.log('Task estado:', trigger.isEnabled ? 'activa' : 'inactiva');
import requests
# Activar task
response = requests.post(
'https://app.horneross.com/api/tasks/trigger_abc123/toggle',
headers={
'Authorization': 'Bearer sk_live_xxx',
'Content-Type': 'application/json',
},
json={'enabled': True}
)
trigger = response.json()['trigger']
print(f'Task {"activa" if trigger["isEnabled"] else "inactiva"}')
{
"trigger": {
"id": "trigger_abc123",
"agentId": "agent_xyz",
"type": "schedule",
"name": "Resumen diario",
"config": {
"prompt": "...",
"cronExpression": "0 9 * * *"
},
"isEnabled": false,
"createdAt": "2024-01-21T10:00:00Z"
}
}
{
"error": "Task not found"
}
Endpoint
POST /api/tasks/{id}/toggle
Headers
Bearer token con tu API key. Formato:
Bearer sk_live_xxxapplication/jsonPath Parameters
ID de la tarea
Request Body
true para activar, false para desactivarcurl -X POST "https://app.horneross.com/api/tasks/trigger_abc123/toggle" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json" \
-d '{"enabled": false}'
curl -X POST "https://app.horneross.com/api/tasks/trigger_abc123/toggle" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json" \
-d '{"enabled": true}'
// Desactivar task
const response = await fetch(
'https://app.horneross.com/api/tasks/trigger_abc123/toggle',
{
method: 'POST',
headers: {
'Authorization': 'Bearer sk_live_xxx',
'Content-Type': 'application/json',
},
body: JSON.stringify({ enabled: false }),
}
);
const { trigger } = await response.json();
console.log('Task estado:', trigger.isEnabled ? 'activa' : 'inactiva');
import requests
# Activar task
response = requests.post(
'https://app.horneross.com/api/tasks/trigger_abc123/toggle',
headers={
'Authorization': 'Bearer sk_live_xxx',
'Content-Type': 'application/json',
},
json={'enabled': True}
)
trigger = response.json()['trigger']
print(f'Task {"activa" if trigger["isEnabled"] else "inactiva"}')
Response
{
"trigger": {
"id": "trigger_abc123",
"agentId": "agent_xyz",
"type": "schedule",
"name": "Resumen diario",
"config": {
"prompt": "...",
"cronExpression": "0 9 * * *"
},
"isEnabled": false,
"createdAt": "2024-01-21T10:00:00Z"
}
}
{
"error": "Task not found"
}
Para tareas tipo
integration_event, al desactivar también se pausa el trigger en Composio. Al reactivar, se vuelve a habilitar automáticamente.Was this page helpful?
Previous
Datastores APIGestionar bases de conocimiento, agregar documentos y realizar búsquedas semánticas.
Next
⌘I
curl -X POST "https://app.horneross.com/api/tasks/trigger_abc123/toggle" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json" \
-d '{"enabled": false}'
curl -X POST "https://app.horneross.com/api/tasks/trigger_abc123/toggle" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json" \
-d '{"enabled": true}'
// Desactivar task
const response = await fetch(
'https://app.horneross.com/api/tasks/trigger_abc123/toggle',
{
method: 'POST',
headers: {
'Authorization': 'Bearer sk_live_xxx',
'Content-Type': 'application/json',
},
body: JSON.stringify({ enabled: false }),
}
);
const { trigger } = await response.json();
console.log('Task estado:', trigger.isEnabled ? 'activa' : 'inactiva');
import requests
# Activar task
response = requests.post(
'https://app.horneross.com/api/tasks/trigger_abc123/toggle',
headers={
'Authorization': 'Bearer sk_live_xxx',
'Content-Type': 'application/json',
},
json={'enabled': True}
)
trigger = response.json()['trigger']
print(f'Task {"activa" if trigger["isEnabled"] else "inactiva"}')
{
"trigger": {
"id": "trigger_abc123",
"agentId": "agent_xyz",
"type": "schedule",
"name": "Resumen diario",
"config": {
"prompt": "...",
"cronExpression": "0 9 * * *"
},
"isEnabled": false,
"createdAt": "2024-01-21T10:00:00Z"
}
}
{
"error": "Task not found"
}
