Skip to content

Commands Platform

Endpoints públicos para ejecución programada de comandos, almacenamiento, suscripción a eventos, registro de actividad y obtención de exchange token. Todos requieren cabecera X-API-KEY. Muchos requieren un exchange token (del contexto del comando o POST /v1/auth/fetch-command-exchange-token/).

Info

Usa POST /v1/auth/fetch-command-exchange-token/ (scope AUTH_FETCH_EXCHANGE_TOKEN) para obtener un exchange token para un usuario. Body: user_uuid (requerido), include_user_context (opcional).
Método Endpoint Descripción
POST /v1/platform/scheduling/ Crear una ejecución programada
GET /v1/platform/scheduling/{scheduled-execution-uuid}/ Obtener una ejecución programada
PUT /v1/platform/scheduling/{scheduled-execution-uuid}/ Actualizar una ejecución programada
DELETE /v1/platform/scheduling/{scheduled-execution-uuid}/ Eliminar una ejecución programada
POST /v1/platform/storage/ Ejecutar operación de almacenamiento (get/set/delete)
POST /v1/platform/event-subscription/ Registrar hook de comando para suscripciones a eventos
DELETE /v1/platform/event-subscription/ Anular registro del command hook
GET /v1/platform/activity/ Listar registros de actividad del comando
POST /v1/platform/activity/ Crear un registro de actividad
POST /v1/auth/fetch-command-exchange-token/ Obtener un exchange token para un usuario

Scheduling

POST /v1/platform/scheduling/

Crea una ejecución programada. Requiere exchange token (del contexto del comando) o command_uuid válido en el body.

Body: name (string, requerido), command_uuid (UUID, opcional*), execution_frequency, cron, repeats, payload, timezone_type, is_owned_by_user. *command_uuid requerido si no hay exchange token.

Petición
curl -X POST "https://api.dailybot.com/v1/platform/scheduling/" -H "X-API-KEY: tu_api_key" -H "X-EXCHANGE-TOKEN: exchange_token" -H "Content-Type: application/json" -d '{"name": "Daily sync", "cron": "0 9 * * 1-5", "payload": {}}'
Response: 200 OK
200 OK
{
  "uuid": "scheduled-execution-uuid"
}
Response: 400 Bad Request
json
{
  "detail": "You should specify an exchange token or valid command",
  "code": "missing_token_or_command"
}
json
{
  "detail": "Command is not valid. It must be owned by the same API Key organization owner",
  "code": "invalid_command_specified"
}
GET /v1/platform/scheduling/{scheduled-execution-uuid}/

Devuelve una ejecución programada por UUID. Requiere exchange token.

Response: 200 OK
json
{
  "uuid": "scheduled-execution-uuid",
  "name": "Daily sync",
  "timezone_type": "organization_timezone",
  "is_active": true,
  "cron": "0 9 * * 1-5",
  "execution_frequency": 0,
  "repeats": -1,
  "payload": {},
  "callback_url": "https://..."
}
Response: 404 Not Found
json
{
  "detail": "Not found.",
  "code": "not_found"
}
PUT /v1/platform/scheduling/{scheduled-execution-uuid}/

Actualiza una ejecución programada. Requiere exchange token.

Body: name, timezone_type, is_active, cron, execution_frequency, repeats, payload, callback_url (todos opcionales).

Response: 200 OK

Objeto actualizado (misma forma que GET).

DELETE /v1/platform/scheduling/{scheduled-execution-uuid}/

Elimina una ejecución programada. Requiere exchange token.

Response: 204 No Content

Éxito. Sin body.

Storage

POST /v1/platform/storage/

Ejecuta una operación de almacenamiento (get/set/delete). Requiere exchange token o namespace en el body.

Body: op (requerido), params (requerido), namespace (opcional si hay exchange token).

Petición
curl -X POST "https://api.dailybot.com/v1/platform/storage/" -H "X-API-KEY: tu_api_key" -H "X-EXCHANGE-TOKEN: exchange_token" -H "Content-Type: application/json" -d '{"op": "get", "params": {"key": "user_preferences"}}'
Response: 200 OK
json
{
  "key": "value"
}
Response: 400 Bad Request
json
{
  "detail": "You must provide either a valid exchange token or a namespace parameter",
  "code": "missing_context"
}
json
{
  "details": "Validation error message"
}

Suscripción a eventos

POST /v1/platform/event-subscription/

Registra un command hook para suscripciones a eventos. Requiere exchange token.

Body: subscriptions (array, requerido), subscribed_objects (array, opcional).

Response: 200 OK
json
{
  "hook_uuid": 123
}
Response: 400 Bad Request
json
{
  "details": "Validation error message"
}
DELETE /v1/platform/event-subscription/

Anula el registro del command hook. Requiere exchange token. Sin body.

Response: 200 OK

Sin body.

Response: 400 Bad Request
json
{
  "detail": "You should specify a valid exchange token",
  "code": "missing_token"
}

Activity

GET /v1/platform/activity/

Devuelve registros de actividad del comando. Requiere exchange token.

Response: 200 OK
json
[
  {
    "command": "command-uuid",
    "organization": "org-uuid",
    "user": "user-uuid",
    "category": "usage",
    "action": "triggered",
    "label": null,
    "metadata": {},
    "created_at": "2026-02-25T12:00:00Z"
  }
]
POST /v1/platform/activity/

Crea un registro de actividad. Requiere exchange token.

Body: category, action (requeridos), label, metadata, user_uuid (opcionales).

Response: 201 Created
json
{
  "command": "command-uuid",
  "organization": "org-uuid",
  "user": "user-uuid",
  "category": "usage",
  "action": "triggered",
  "label": null,
  "metadata": {},
  "created_at": "2026-02-25T12:00:00Z"
}

POST /v1/auth/fetch-command-exchange-token/

POST /v1/auth/fetch-command-exchange-token/

Devuelve un exchange token para un usuario. Requiere API key con scope para auth fetch exchange token.

Body: user_uuid (UUID, requerido), include_user_context (boolean, opcional).

Response: 200 OK
json
{
  "token": "exchange-token-string"
}
Response: 406 Not Acceptable
json
{
  "detail": "Could not find the user related to "user_uuid""
}
json
{
  "detail": "Command is not Public and cannot request exchange tokens of non-same-org users"
}