Create a Schedule
Parameters
namestring
Name for the schedule
scheduledAtstring
ISO 8601 timestamp when the schedule should execute
endpointstring
URL endpoint that will be called when the schedule executes
datarecord
Optional JSON data to include in the request
tagsstring[]
Optional array of tags to organize schedules
Returns
Returns the created schedule object. Returns error if the schedule fails to create.
POST/schedules
curl -X POST https://api.next-cron.com/schedules \
-H "Authorization: Bearer $YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "My Schedule",
"scheduledAt": "2024-03-20T15:00:00Z",
"endpoint": "https://www.example.com/api/webhook"
}'
Response
{
"id": "49d10214-f4f1-497a-94b7-c0e597ad3fea",
"name": "My Schedule",
"scheduledAt": "2024-03-20T15:00:00Z",
"status": "Pending",
"endpoint": "https://www.example.com/api/webhook",
"data": {
"userId": "123"
},
"tags": [
"tag1",
"tag2"
],
"createdAt": "2024-03-19T10:30:00Z"
}