Skip to content

Jobs API Reference

POST /resources/jobs

Creates a new job

Body Parameters
reactorIdstring

ID of the reactor

methodstring

The method of the reactor to invoke

argumentany

The argument to pass to the method

scheduleAtISO-8641 timestamp

Optional future timestamp of when to run the job. If timestamp is omitted, now or in the past, the job will run immediately.

Request Sample
Request
POST https://<hantera-hostname>/resources/jobs
Authorization: Bearer <YOUR TOKEN>
Content-Type: application/json
{
"reactorId": "myReactorComponent",
"method": "myMethod",
"argument": {
"param1": "'a text value'"
},
"scheduleAt": "2025-02-15T14:25Z"
}
Response

The response contains the Job ID that can be use to fetch the Job status and result.

Status: 200
Content-Type: application/json
"ec591982-6cd8-4a31-b53c-5ab62852bb68"

GET /resources/jobs/<jobId>

Gets the status and result (if available) of a Job.

URI Parameters
jobIduuid
Request Sample
Request
GET https://<hantera-hostname>/resources/jobs/eaf3d619-0393-4229-b302-da5afb5fc705
Authorization: Bearer <YOUR TOKEN>
Response
Status: 200
Content-Type: application/json
{
"jobId": "eaf3d619-0393-4229-b302-da5afb5fc705",
"state": "pending",
"scheduledAt": "2025-02-15T14:25Z",
"startedAt": null,
"finishedAt": null,
"result": null
}

DELETE /resources/jobs/<jobId>

Deletes a Job. Only Jobs that are not started or finished can be deleted. Attempting to delete a running Job will result in an error.

URI Parameters
jobIduuid
Request Sample
Request
DELETE https://<hantera-hostname>/resources/jobs/eaf3d619-0393-4229-b302-da5afb5fc705
Authorization: Bearer <YOUR TOKEN>
Response
Status: 200