API ReferencePlatform

Scheduler

Scheduler tasks: background work that runs on a cron interval, or once at a set time.

Prefix /cdna-api/scheduler ReferenceTask model GuideScheduled work

About scheduler

Everything that runs on the clock is a task: a five-field cron interval, evaluated in the client’s timezone, what to put on which queue when it comes due (queueKey and parameters), and the dates it waits for (pauseUntil) and stops at (recurringUntil). A task with no interval runs once, at pauseUntil. Only a published task runs.

Most tasks are the platform’s own, marked predefined, which cannot be deleted; giving a job a schedule makes another. Through the API a task is usually paused, re-timed or unpublished. A new task needs a queue the platform has and parameters its worker understands.

Interval Cron, client time

Five fields, minute to day of week, evaluated in the client’s timezone.

Scheduled work
Predefined Cannot be deleted

The platform’s own tasks can be paused or re-timed, not removed.

Scheduler
Runs When published

An unpublished task never runs; publishing is how to switch one off and on.

Scheduler
Access Admin users

Members are refused: a 404 by default, a 403 where the site’s access-denied setting says so. Call it from a server with an admin user’s OAuth token or API key.

Authentication and authorisation

List tasks#

GET /cdna-api/scheduler/tasks

Lists tasks. Without limit every match comes back.

Access
Admin users and integrations, with an OAuth access token or an API key.
Model
Task, in the Reference

Parameters

propertiesquery
selector
The fields and relations to return, such as {id,name,text,interval,queueKey,published}.
filtersquery
name=value
Any stored field, or a relation with a dot, such as parent.id=12. Prefix the name with !, >, <, % or |. Use stored field names exactly as in the model, and compare totalCount with the unfiltered list's to confirm a filter applied.
orderByquery
string
field:ASC or field:DESC, comma-separated. Stored fields only.
limitquery
integer
Records per response. There is no default.
offsetquery
integer
Records to skip.

Example

List tasks
GET /cdna-api/scheduler/tasks?limit=2&properties={id,name,text,interval,queueKey,published} HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Response 200 OK
{
  "result": "success",
  "totalCount": 30,
  "data": [
    {
      "id": 3,
      "name": "purgeUnusedVirtualFiles",
      "text": "Purge unused virtual files",
      "interval": "10 3 * * *",
      "queueKey": "Common.CleanUp",
      "published": null
    },
    {
      "id": 4,
      "name": "removeOldBookPDFs",
      "text": "Remove old book PDF inactive revisions",
      "interval": "40 2 * * *",
      "queueKey": "Common.CleanUp",
      "published": null
    }
  ]
}
Real response from this documentation site

Show a task#

GET /cdna-api/scheduler/task/{id}

Reads one task by its id.

Access
Admin users and integrations, with an OAuth access token or an API key.
Model
Task, in the Reference

Parameters

idpathrequired
integer
The task id.
propertiesquery
selector
The fields and relations to return, such as {id,name,text,interval,queueKey,published}.

Example

Show a task
GET /cdna-api/scheduler/task/3?properties={id,name,text,interval,queueKey,published} HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Response 200 OK
{
  "result": "success",
  "data": {
    "id": 3,
    "name": "purgeUnusedVirtualFiles",
    "text": "Purge unused virtual files",
    "interval": "10 3 * * *",
    "queueKey": "Common.CleanUp",
    "published": null
  }
}
Real response from this documentation site

Create a task#

POST /cdna-api/scheduler/task

Creates a task.

Access
Admin users and integrations, with an OAuth access token or an API key.
Returns
The new task under data.task, and a message.

Parameters

namebodyrequired
string
A unique identifier.
textbody
string
A description.
queueKeybodyrequired
string
The queue the task puts its work on; it must be one of the platform’s.
parametersbody
object
What the worker on that queue needs.
intervalbody
string
Five cron fields: minute, hour, day, month, day of week. Left out, the task runs once.
pauseUntilbody
datetime
Not before this; for a one-off task, when it runs.
recurringUntilbody
datetime
Not after this.
publishedbody
datetime
true lets it run.

Example

Create a task
POST /cdna-api/scheduler/task HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Content-Type: application/json

{
  "name": "generateSitemap",
  "text": "Generate the sitemap",
  "queueKey": "Common.Prepare",
  "parameters": {
    "workerClass": "Common\\Workers\\GenerateSitemap",
    "timeToRun": 600
  },
  "interval": "0 * * * *"
}

Edit a task#

PUT /cdna-api/scheduler/task/{id}

Changes a task. Fields left out keep their values. The example pauses a task until a date.

Access
Admin users and integrations, with an OAuth access token or an API key.
Returns
The saved task under data.task, and a message.

Parameters

idpathrequired
integer
The task id.
interval, pauseUntil, recurringUntil, parameters, publishedbody
As for Create a task.

Example

Edit a task
PUT /cdna-api/scheduler/task/3 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Content-Type: application/json

{
  "pauseUntil": "2026-11-01T00:00:00+11:00"
}

Delete a task#

DELETE /cdna-api/scheduler/task/{id}

Deletes a task. A predefined task is refused.

Access
Admin users and integrations, with an OAuth access token or an API key.

Parameters

idpathrequired
integer
The task id.

Example

Delete a task
DELETE /cdna-api/scheduler/task/31 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json