Skip to content

Listing Job Templates

List job templates available in your workspace.

The list job templates endpoint allows you to retrieve a paginated list of the job templates in your workspace. We also support filtering by id and time ranges.

Endpoint

MethodUrl
GET/v1.0/job-templates

Request Parameters

filter
string

The filter string. See the Filtering section for details on member filtering. Additionally, check the filtering documentation for more information.

page_size
number

The page size for search result pagination. If not provided, the service will default to 50 items.

page_token
string

The page to fetch. This would be the next_page_token value returned from the previous request if any.

Sample Request

Copied
1curl -X GET 'https://api.worklayer.com/v1.0/job-templates' \
2-H 'Authorization: Bearer {token}'

Response

data
list

The job templates belonging to that workspace. See the job template reference page.

next_page_token
string

The pagination token to retrieve the next page of results. If the value is "", it means no further results for the request.

Sample Response

Copied
1{
2 "data": [
3 {
4 "id": "1c05a279-a8f5-4dd2-ad4f-52ba88ecdfb3",
5 "name": "Job Template 1",
6 "create_time": "2022-10-20T15:15:44.776867Z",
7 "modified_time": "2022-10-20T15:15:44.776867Z",
8 "supported_service_packages": []
9 },
10 {
11 "id": "11f197aa-3066-4827-b998-e467d1bc5713",
12 "name": "Job Template 2",
13 "create_time": "2022-10-20T02:21:35.012015Z",
14 "modified_time": "2022-10-20T02:21:35.012015Z",
15 "supported_service_packages": [
16 "c1d08beb-6846-4275-b7f7-674d0569e782"
17 ]
18 }
19 ],
20 "next_page_token": "MTFmMTk3YWEtMzA2Ni00ODI3LWI5OTgtZTQ2N2QxYmM1NzEzLDIwMjItMTAtMTlUMjIlM2EyMSUzYTM1LjAxMjAxNTAtMDQlM2EwMA"
21}

Filtering

The following fields are supported:

FieldComparatorsDescriptionExample
id=The id of a job template.id = "1c05a279-a8f5-4dd2-ad4f-52ba88ecdfb3"
create_time=, !=, >, >=, <, <=The creation time of a job template.create_time >= "2022-01-01T12:00:00Z"
modified_time=, !=, >, >=, <, <=The modified time of a job template.modified_time =< "2022-12-31T23:59:59Z"

AND and OR are allowed when combining filters.

Sample Request with Filters

Copied
1curl -X GET 'https://api.worklayer.com/v1.0/job-templates?filter=id="1c05a279-a8f5-4dd2-ad4f-52ba88ecdfb3" OR id="11f197aa-3066-4827-b998-e467d1bc5713" \
2-H 'Authorization: Bearer {token}'

Errors

  1. Forbidden: API Client does not have permission to list job templates.
  2. Unauthorized: API Client does not have valid credentials.
  3. BadRequest: Either the filter that was provided is in an incorrect format, or there was a malformed request.

Last updated on November 22, 2022