Complete API documentation for integrating with Cronium programmatically.
Cronium uses API tokens for authentication. All API requests must include a valid API token in the Authorization header.
Generate API tokens to access the Cronium API programmatically.
Go to your account settings and select the "API Tokens" tab.
Click "Create New Token" and provide a descriptive name for your token.
Choose the appropriate permissions for your use case:
Copy the generated token immediately. For security reasons, you won't be able to view it again.
Include your API token in the Authorization header of every request:
import requests
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json'
}
response = requests.get(
'https://your-cronium-instance.com/api/events',
headers=headers
)The Events API allows you to manage and execute automated scripts and events.
The Workflows API allows you to create and manage complex automation workflows with multiple events and conditional logic.
The Variables API allows you to manage user-scoped key-value pairs that can be accessed in your scripts using the cronium.getVariable() and cronium.setVariable() runtime helpers. Variables are encrypted at rest and scoped to the authenticated user.
Variables created via the API can be accessed in your scripts using runtime helpers:
// Node.js
const dbUrl = cronium.getVariable('DATABASE_URL');
cronium.setVariable('LAST_RUN', new Date().toISOString());# Python
db_url = cronium.getVariable('DATABASE_URL')
cronium.setVariable('LAST_RUN', datetime.now().isoformat())# Bash
DB_URL=$(cronium.getVariable "DATABASE_URL")
cronium.setVariable "LAST_RUN" "$(date -Iseconds)"All API responses follow a consistent format:
{
"success": true,
"data": {
// Response data here
},
"message": "Operation completed successfully",
"timestamp": "2024-01-20T16:00:00Z"
}Error responses include detailed information to help with debugging:
{
"error": "Validation Error",
"message": "Invalid request data",
"code": 400,
"details": [
{
"field": "name",
"message": "Name is required"
},
{
"field": "type",
"message": "Type must be one of: BASH, PYTHON, NODEJS, HTTP_REQUEST"
}
],
"timestamp": "2024-01-20T16:15:00Z"
}