API Documentation
Schedule and manage background jobs with the Timelix Pulse API. All endpoints except health checks require authentication.
Authentication
Include the secret token in the Authorization header for all protected endpoints.
Authorization: Bearer YOUR_INITIATOR_SECRET
POST
/schedule
Schedule a new job
Request Body
| Parameter | Type | Description |
|---|---|---|
| name | string required | Job identifier name |
| data | object | Payload data for the job |
| delay | number | Delay in milliseconds before execution |
| cron | string | Cron expression for recurring jobs |
| repeat | object | Repeat options (pattern, limit, etc.) |
Example Request
curl
curl -X POST https://pulse.timelix.ru/schedule \ -H "Authorization: Bearer YOUR_SECRET" \ -H "Content-Type: application/json" \ -d '{ "name": "send-notification", "data": { "userId": 123 }, "delay": 60000 }'
Response
json
{
"success": true,
"jobId": "job_abc123xyz",
"scheduledAt": "2024-01-15T10:30:00.000Z"
}
GET
/jobs
List all pending jobs
Query Parameters
| Parameter | Type | Description |
|---|---|---|
| status | string | Filter by status: waiting, active, delayed |
| limit | number | Max number of jobs to return (default: 100) |
Example Response
json
{
"jobs": [
{
"id": "job_abc123",
"name": "send-notification",
"data": { "userId": 123 },
"status": "delayed",
"processAt": "2024-01-15T10:31:00.000Z"
}
],
"total": 1
}
DELETE
/jobs/:id
Cancel a scheduled job
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| id | string required | The job ID to cancel |
Example Request
curl
curl -X DELETE https://pulse.timelix.ru/jobs/job_abc123 \
-H "Authorization: Bearer YOUR_SECRET"
Response
json
{
"success": true,
"message": "Job cancelled"
}
GET
/health
Health check (no auth required)
Response
json
{
"status": "ok",
"timestamp": "2024-01-15T10:30:00.000Z",
"version": "0.1.0"
}