Cron Groups API
Cron groups organize cron jobs into logical collections for easier management.
Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /api/cron-groups | List cron groups |
| POST | /api/cron-groups | Create cron group |
| GET | /api/cron-groups/{id} | Get cron group |
| PATCH | /api/cron-groups/{id} | Update cron group |
| DELETE | /api/cron-groups/{id} | Delete cron group |
| POST | /api/cron-groups/reorder | Reorder groups |
Cron Group Object
json
{
"id": "cgrp_abc123",
"name": "Health Checks",
"description": "Periodic health check webhooks",
"order": 1,
"jobCount": 5,
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}List Cron Groups
http
GET /api/cron-groupsExample
bash
curl https://api.hookbase.app/api/cron-groups \
-H "Authorization: Bearer whr_your_api_key"Response
json
{
"data": [
{
"id": "cgrp_abc123",
"name": "Health Checks",
"order": 1,
"jobCount": 5
},
{
"id": "cgrp_def456",
"name": "Sync Jobs",
"order": 2,
"jobCount": 3
}
]
}Create Cron Group
http
POST /api/cron-groupsRequest Body
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Group name |
| description | string | No | Optional description |
Example
bash
curl -X POST https://api.hookbase.app/api/cron-groups \
-H "Authorization: Bearer whr_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Data Sync",
"description": "Periodic data synchronization jobs"
}'Response
json
{
"id": "cgrp_new123",
"name": "Data Sync",
"description": "Periodic data synchronization jobs",
"order": 3,
"jobCount": 0,
"createdAt": "2024-01-15T10:30:00Z"
}Get Cron Group
http
GET /api/cron-groups/{id}Returns the full cron group object with its associated cron jobs.
Response
json
{
"id": "cgrp_abc123",
"name": "Health Checks",
"description": "Periodic health check webhooks",
"order": 1,
"jobs": [
{
"id": "cron_111",
"name": "API Health Check",
"schedule": "*/5 * * * *",
"enabled": true,
"lastRunAt": "2024-01-15T10:30:00Z"
}
],
"jobCount": 5,
"createdAt": "2024-01-01T00:00:00Z"
}Update Cron Group
http
PATCH /api/cron-groups/{id}Request Body
| Field | Type | Description |
|---|---|---|
| name | string | Group name |
| description | string | Optional description |
Delete Cron Group
http
DELETE /api/cron-groups/{id}WARNING
Deleting a group does not delete the cron jobs within it. Jobs are moved to the "Ungrouped" category.
Response
204 No ContentReorder Groups
http
POST /api/cron-groups/reorderRequest Body
| Field | Type | Required | Description |
|---|---|---|---|
| groupIds | string[] | Yes | Array of group IDs in desired order |
Example
bash
curl -X POST https://api.hookbase.app/api/cron-groups/reorder \
-H "Authorization: Bearer whr_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"groupIds": ["cgrp_def456", "cgrp_abc123", "cgrp_new123"]
}'Response
json
{
"message": "Groups reordered successfully",
"groups": [
{ "id": "cgrp_def456", "name": "Sync Jobs", "order": 1 },
{ "id": "cgrp_abc123", "name": "Health Checks", "order": 2 },
{ "id": "cgrp_new123", "name": "Data Sync", "order": 3 }
]
}Related
- Cron Jobs API — Manage individual cron jobs
- Cron Guide — Cron scheduling concepts