Retrieve All Asynchronous Jobs or Based on Matching Filters
/r-scripts/v2/jobs
Request
-
commentsPattern: string
Optional regex pattern filter for the job comments column.
-
createdOlderThanSeconds: integer(int64)
Optional age filter. Return jobs created more than this many seconds ago. Must be non-negative.
-
createdWithinSeconds: integer(int64)
Optional duration, in seconds, used to return only jobs created within this window. Allowed range is 1 to 604800 seconds.
-
finishedOlderThanSeconds: integer(int64)
Optional age filter. Return jobs finished more than this many seconds ago. Must be non-negative.
-
status: string
Optional job status filter, for example FINISH, ERROR, CANCELLED, TIMEOUT, or RUNNING.
There's no request body for this operation.
Back to TopResponse
- application/json
200 Response
400 Response
401 Response
500 Response
Examples
Use the asynchronous jobs endpoint to retrieve jobs and filter the results by creation time, completion time, status, or comments. Each example below shows an independent request and a sample response.
Example 1: Retrieve all asynchronous jobs
The following example retrieves all asynchronous jobs.
curl -i -X GET \
--header "Authorization: Bearer ${token}" \
--header 'Accept: application/json' \
"<oml-cloud-service-location-url>/oml/api/r-scripts/v2/jobs"
The response body in JSON format is the following:
{
"result": [
{
"createdDate": "2026-01-14 15:50:13 UTC",
"job_id": "<job_id>",
"status": "ERROR",
"elapsedTime": "00:00:16"
}
]
}
Example 2: Retrieve jobs based on filters
You can filter jobs using one or more of the following criteria:
- Jobs created within the last 30 minutes
- Jobs created more than 1,200 seconds ago
- Jobs finished more than 1,200 seconds ago.
- Jobs with a specified status.
- Jobs whose comments match a pattern.
Each example includes the request and a sample response.
Jobs created within the last 30 minutes
To retrieve list of jobs created within the last 30 minutes, set
createdWithinSeconds to 1800.
curl -i -k -X GET \
--header "Authorization: Bearer ${token}" \
--header 'Accept: application/json' \
"<oml-cloud-service-location-url>/oml/api/r-scripts/v2/jobs?createdWithinSeconds=1800"
The response contains jobs created within the last 1,800 seconds.
{
"result": [
{
"createdDate": "2026-09-10 15:58:18 UTC",
"comments": "Predict IRIS with LinearRegression model and stores it in an OML4R datastore",
"job_id": "<job_id>",
"status": "FINISH",
"elapsedTime": "00:00:07"
},
{
"createdDate": "2026-09-10 16:42:31 UTC",
"comments": "Return the mean of a set of random numbers",
"job_id": "<job_id>",
"status": "FINISH",
"elapsedTime": "00:00:07"
}
]
}
Jobs created more than 1,200 seconds ago.
To retrieve list of jobs created more than 1,200 seconds ago, set
createdOlderThanSeconds to 1200.
curl -i -k -X GET \
--header "Authorization: Bearer ${token}" \
--header 'Accept: application/json' \
"<oml-cloud-service-location-url>/oml/api/r-scripts/v2/jobs?createdOlderThanSeconds=1200"
The response contains jobs created more than 1,200 seconds ago.
{
"result": [
{
"createdDate": "2026-09-10 15:58:18 UTC",
"comments": "Predict IRIS with LinearRegression model and stores it in an OML4R datastore",
"job_id": "<job_id>",
"status": "FINISH",
"elapsedTime": "00:00:07"
},
{
"createdDate": "2026-09-10 16:42:31 UTC",
"comments": "Return the mean of a set of random numbers",
"job_id": "<job_id>",
"status": "FINISH",
"elapsedTime": "00:00:07"
}
]
}
Jobs finished more than 1,200 seconds ago.
To retrieve list of jobs finished more than 1,200 seconds ago, set
finishedOlderThanSeconds to 1200.
curl -i -k -X GET \
--header "Authorization: Bearer ${token}" \
--header 'Accept: application/json' \
"<oml-cloud-service-location-url>/oml/api/r-scripts/v2/jobs?finishedOlderThanSeconds=1200"
The response contains jobs finished more than 1,200 seconds ago.
{
"result": [
{
"createdDate": "2026-09-10 15:58:18 UTC",
"comments": "Predict IRIS with LinearRegression model and stores it in an OML4R datastore",
"job_id": "<job_id>",
"status": "FINISH",
"elapsedTime": "00:00:07"
},
{
"createdDate": "2026-09-10 16:42:31 UTC",
"comments": "Return the mean of a set of random numbers",
"job_id": "<job_id>",
"status": "FINISH",
"elapsedTime": "00:00:07"
}
]
}
List jobs with a specified status
To retrieve list of jobs with a specified status, set status to that
status. The example below uses cancelled.
curl -i -k -X GET \
--header "Authorization: Bearer ${token}" \
--header 'Accept: application/json' \
"<oml-cloud-service-location-url>/oml/api/r-scripts/v2/jobs?status=cancelled"
The response contains jobs with the CANCELLED status.
{
"result": [
{
"createdDate": "2026-09-08 20:27:41 UTC",
"comments": "long running job that sleeps 33mins",
"job_id": "<job_id>",
"status": "CANCELLED",
"elapsedTime": "00:00:42"
}
]
}
Jobs matching a comments pattern
To retrieve jobs whose comments match a text pattern, set commentsPattern
to that pattern. The example below uses random.
curl -i -k -X GET \
--header "Authorization: Bearer ${token}" \
--header 'Accept: application/json' \
"<oml-cloud-service-location-url>/oml/api/r-scripts/v2/jobs?commentsPattern=random"
The response contains jobs whose comments match the random pattern.
{
"result": [
{
"createdDate": "2026-09-10 16:42:31 UTC",
"comments": "Return the mean of a set of random numbers",
"job_id": "<job_id>",
"status": "FINISH",
"elapsedTime": "00:00:07"
}
]
}
List jobs matching two filters: status and comments pattern
To retrieve jobs using both status and comment pattern, send a GET request to the
jobs endpoint with the status and commentsPattern
query parameters. This example retrieves jobs whose status is
finish and whose comments match random.
curl -i -k -X GET \
--header "Authorization: Bearer ${token}" \
--header 'Accept: application/json' \
"<oml-cloud-service-location-url>/oml/api/r-scripts/v2/jobs?status=FINISH&commentsPattern=random"
The response contains matching jobs. For example:
{
"result": [
{
"createdDate": "2026-09-10 16:42:31 UTC",
"comments": "Return the mean of a set of random numbers",
"job_id": "<job_id>",
"status": "FINISH",
"elapsedTime": "00:00:07"
}
]
}