Skip to content

Commands Platform

Endpoints públicos para execução agendada de comandos, armazenamento, assinatura a eventos, registro de atividade y obtención de exchange token. Todos requerem header X-API-KEY. Muchos requerem 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 obter un exchange token para un usuário. Body: user_uuid (obrigatório), include_user_context (opcional).
Método Endpoint Descrição
POST /v1/platform/scheduling/ Criar una execução agendada
GET /v1/platform/scheduling/{scheduled-execution-uuid}/ Obter una execução agendada
PUT /v1/platform/scheduling/{scheduled-execution-uuid}/ Atualizar una execução agendada
DELETE /v1/platform/scheduling/{scheduled-execution-uuid}/ Excluir una execução agendada
POST /v1/platform/storage/ Ejecutar operación de armazenamento (get/set/delete)
POST /v1/platform/event-subscription/ Registrar hook de comando para assinaturas a eventos
DELETE /v1/platform/event-subscription/ Cancelar registro del command hook
GET /v1/platform/activity/ Listar registros de atividade del comando
POST /v1/platform/activity/ Criar un registro de atividade
POST /v1/auth/fetch-command-exchange-token/ Obter un exchange token para un usuário

Scheduling

POST /v1/platform/scheduling/

Cria una execução agendada. Requer exchange token (del contexto del comando) o command_uuid válido en el body.

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

Requisição
curl -X POST "https://api.dailybot.com/v1/platform/scheduling/" -H "X-API-KEY: sua_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}/

Retorna una execução agendada por UUID. Requer 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}/

Atualiza una execução agendada. Requer exchange token.

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

Response: 200 OK

Objeto atualizado (mesma forma que GET).

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

Exclui una execução agendada. Requer exchange token.

Response: 204 Não Content

Sucesso. Sem body.

Storage

POST /v1/platform/storage/

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

Body: op (obrigatório), params (obrigatório), namespace (opcional si hay exchange token).

Requisição
curl -X POST "https://api.dailybot.com/v1/platform/storage/" -H "X-API-KEY: sua_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"
}

Assinatura a eventos

POST /v1/platform/event-subscription/

Registra un command hook para assinaturas a eventos. Requer exchange token.

Body: subscriptions (array, obrigatório), 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. Requer exchange token. Sem body.

Response: 200 OK

Sem body.

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

Activity

GET /v1/platform/activity/

Retorna registros de atividade del comando. Requer 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/

Cria un registro de atividade. Requer 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/

Retorna un exchange token para un usuário. Requer API key con scope para auth fetch exchange token.

Body: user_uuid (UUID, obrigatório), 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"
}