GET /api/job_templates
List job templates

GET /api/locations/:location_id/job_templates
List job templates per location

GET /api/organizations/:organization_id/job_templates
List job templates per organization

Examples

GET /api/job_templates
200
{
  "total": 1,
  "subtotal": 1,
  "page": 1,
  "per_page": 20,
  "search": null,
  "sort": {
    "by": null,
    "order": null
  },
  "results": [
    {
      "id": 1007981703,
      "name": "Job template 29",
      "job_category": "Job name 27",
      "provider_type": "SSH",
      "snippet": false,
      "description_format": null,
      "created_at": "2025-05-15 15:22:48 UTC",
      "updated_at": "2025-05-15 15:22:48 UTC"
    }
  ]
}

Params

Param name Description
location_id
optional

Scope by locations

Validations:

  • Integer

organization_id
optional

Scope by organizations

Validations:

  • Integer

search
optional

filter results

Validations:

  • String

order
optional

Sort and order by a searchable field, e.g. '<field> DESC'

Validations:

  • String

page
optional

Page number, starting at 1

Validations:

  • Must be a number.

per_page
optional

Number of results per page to return, 'all' to return all results

Validations:

  • Must match regular expression /\A([1-9]\d*|all)\Z$/.


POST /api/job_templates/import
Import a job template from ERB

Examples

POST /api/job_templates/import
{
  "template": "<%#\nname: Job template 37_renamed\nsnippet: false\nmodel: JobTemplate\njob_category: Job name 35\nprovider_type: SSH\nkind: job_template\norganizations:\n- Organization 1\nlocations:\n- Location 1\n%>\n\nid",
  "job_template": {
    "template": "<%#\nname: Job template 37_renamed\nsnippet: false\nmodel: JobTemplate\njob_category: Job name 35\nprovider_type: SSH\nkind: job_template\norganizations:\n- Organization 1\nlocations:\n- Location 1\n%>\n\nid"
  }
}
201
{
  "id": 1007981713,
  "name": "Job template 37_renamed",
  "template": "id",
  "snippet": false,
  "template_kind_id": null,
  "created_at": "2025-05-15T15:22:49.192Z",
  "updated_at": "2025-05-15T15:22:49.192Z",
  "locked": false,
  "default": false,
  "vendor": null,
  "os_family": null,
  "job_category": "Job name 35",
  "provider_type": "SSH",
  "description_format": null,
  "execution_timeout_interval": null,
  "description": null,
  "ansible_callback_enabled": false,
  "cloned_from_id": null,
  "ansible_check_mode": false
}

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Integer

options
optional

Validations:

  • Hash

options[force]
optional , nil allowed

use if you want update locked templates

Validations:

  • Must be one of: true, false, 1, 0.

options[associate]
optional , nil allowed

determines when the template should associate objects based on metadata, new means only when new template is being created, always means both for new and existing template which is only being updated, never ignores metadata

Validations:

  • Must be one of: new, always, never.

options[lock]
optional , nil allowed

lock imported templates (false by default)

Validations:

  • Must be one of: true, false, 1, 0.

options[default]
optional , nil allowed

makes the template default meaning it will be automatically associated with newly created organizations and locations (false by default)

Validations:

  • Must be one of: true, false, 1, 0.

template
required

Template ERB

Validations:

  • String

overwrite
optional

Overwrite template if it already exists

Validations:

  • Must be one of: true, false, 1, 0.


GET /api/job_templates/:id/export
Export a job template to ERB

Examples

GET /api/job_templates/1007981710-Job%20template%2035/export
200
<%#
name: Job template 35
snippet: false
model: JobTemplate
job_category: Job name 33
provider_type: SSH
kind: job_template
organizations:
- Organization 1
locations:
- Location 1
%>

id

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Integer

id
required

Validations:

  • string from 2 to 128 characters containing only alphanumeric characters, space, '_', '-' with no leading or trailing space..


GET /api/job_templates/:id
Show job template details

Examples

GET /api/job_templates/1007981711-Job%20template%2036
200
{
  "description": null,
  "description_format": null,
  "created_at": "2025-05-15 15:22:49 UTC",
  "updated_at": "2025-05-15 15:22:49 UTC",
  "template": "id",
  "locked": false,
  "id": 1007981711,
  "name": "Job template 36",
  "job_category": "Job name 34",
  "provider_type": "SSH",
  "snippet": false,
  "template_inputs": [],
  "effective_user": {
    "value": null,
    "current_user": false,
    "overridable": true
  },
  "locations": [
    {
      "id": 255093256,
      "name": "Location 1",
      "title": "Location 1",
      "description": null
    }
  ],
  "organizations": [
    {
      "id": 447626438,
      "name": "Organization 1",
      "title": "Organization 1",
      "description": null
    }
  ]
}

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Integer

id
required

Validations:

  • string from 2 to 128 characters containing only alphanumeric characters, space, '_', '-' with no leading or trailing space..


POST /api/job_templates
Create a job template

Examples

POST /api/job_templates
{
  "job_template": {
    "template": "This is a test template",
    "name": "RandomName",
    "provider_type": "ssh"
  }
}
201
{
  "description": null,
  "description_format": null,
  "created_at": "2025-05-15 15:22:48 UTC",
  "updated_at": "2025-05-15 15:22:48 UTC",
  "template": "This is a test template",
  "locked": false,
  "id": 1007981708,
  "name": "RandomName",
  "job_category": "Miscellaneous",
  "provider_type": "ssh",
  "snippet": false,
  "template_inputs": [],
  "effective_user": {
    "value": null,
    "current_user": false,
    "overridable": true
  },
  "locations": [],
  "organizations": []
}

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Integer

job_template
required

Validations:

  • Hash

job_template[name]
required

Template name

Validations:

  • String

job_template[description]
optional , nil allowed

Validations:

  • String

job_template[job_category]
required

Job category

Validations:

  • String

job_template[description_format]
optional , nil allowed

This template is used to generate the description. Input values can be used using the syntax %{package}. You may also include the job category and template name using %{job_category} and %{template_name}.

Validations:

  • String

job_template[template]
required

Validations:

  • String

job_template[provider_type]
required

Provider type

Validations:

  • Must be one of: SSH, script.

job_template[snippet]
optional , nil allowed

Validations:

  • Must be one of: true, false, 1, 0.

job_template[audit_comment]
optional , nil allowed

Validations:

  • String

job_template[locked]
optional , nil allowed

Whether or not the template is locked for editing

Validations:

  • Must be one of: true, false, 1, 0.

job_template[effective_user_attributes]
optional , nil allowed

Effective user options

Validations:

  • Hash

job_template[effective_user_attributes][value]
optional , nil allowed

What user should be used to run the script (using sudo-like mechanisms)

Validations:

  • String

job_template[effective_user_attributes][overridable]
optional , nil allowed

Whether it should be allowed to override the effective user from the invocation form.

Validations:

  • Must be one of: true, false, 1, 0.

job_template[effective_user_attributes][current_user]
optional , nil allowed

Whether the current user login should be used as the effective user

Validations:

  • Must be one of: true, false, 1, 0.

job_template[location_ids]
optional , nil allowed

REPLACE locations with given ids

Validations:

  • Must be an array of any type

job_template[organization_ids]
optional , nil allowed

REPLACE organizations with given ids.

Validations:

  • Must be an array of any type


PUT /api/job_templates/:id
Update a job template

Examples

PUT /api/job_templates/1007981702-Job%20template%2028
{
  "job_template": {
    "name": "Job template 28",
    "job_category": "Job name 26",
    "template": "id",
    "provider_type": "SSH",
    "effective_user_attributes": {
      "value": "nobody",
      "overridable": true,
      "current_user": false
    }
  }
}
200
{
  "description": null,
  "description_format": null,
  "created_at": "2025-05-15 15:22:48 UTC",
  "updated_at": "2025-05-15 15:22:48 UTC",
  "template": "id",
  "locked": false,
  "id": 1007981702,
  "name": "Job template 28",
  "job_category": "Job name 26",
  "provider_type": "SSH",
  "snippet": false,
  "template_inputs": [],
  "effective_user": {
    "value": "nobody",
    "current_user": false,
    "overridable": true
  },
  "locations": [
    {
      "id": 255093256,
      "name": "Location 1",
      "title": "Location 1",
      "description": null
    }
  ],
  "organizations": [
    {
      "id": 447626438,
      "name": "Organization 1",
      "title": "Organization 1",
      "description": null
    }
  ]
}

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Integer

id
required

Validations:

  • string from 2 to 128 characters containing only alphanumeric characters, space, '_', '-' with no leading or trailing space..

job_template
required

Validations:

  • Hash

job_template[name]
optional

Template name

Validations:

  • String

job_template[description]
optional , nil allowed

Validations:

  • String

job_template[job_category]
optional

Job category

Validations:

  • String

job_template[description_format]
optional , nil allowed

This template is used to generate the description. Input values can be used using the syntax %{package}. You may also include the job category and template name using %{job_category} and %{template_name}.

Validations:

  • String

job_template[template]
optional

Validations:

  • String

job_template[provider_type]
optional

Provider type

Validations:

  • Must be one of: SSH, script.

job_template[snippet]
optional , nil allowed

Validations:

  • Must be one of: true, false, 1, 0.

job_template[audit_comment]
optional , nil allowed

Validations:

  • String

job_template[locked]
optional , nil allowed

Whether or not the template is locked for editing

Validations:

  • Must be one of: true, false, 1, 0.

job_template[effective_user_attributes]
optional , nil allowed

Effective user options

Validations:

  • Hash

job_template[effective_user_attributes][value]
optional , nil allowed

What user should be used to run the script (using sudo-like mechanisms)

Validations:

  • String

job_template[effective_user_attributes][overridable]
optional , nil allowed

Whether it should be allowed to override the effective user from the invocation form.

Validations:

  • Must be one of: true, false, 1, 0.

job_template[effective_user_attributes][current_user]
optional , nil allowed

Whether the current user login should be used as the effective user

Validations:

  • Must be one of: true, false, 1, 0.

job_template[location_ids]
optional , nil allowed

REPLACE locations with given ids

Validations:

  • Must be an array of any type

job_template[organization_ids]
optional , nil allowed

REPLACE organizations with given ids.

Validations:

  • Must be an array of any type


GET /api/job_templates/revision

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Integer

version
optional

Template version

Validations:

  • String


DELETE /api/job_templates/:id
Delete a job template

Examples

DELETE /api/job_templates/1007981706-Job%20template%2032
{
  "job_template": {}
}
200
{
  "id": 1007981706,
  "name": "Job template 32",
  "template": "id",
  "snippet": false,
  "template_kind_id": null,
  "created_at": "2025-05-15T15:22:48.683Z",
  "updated_at": "2025-05-15T15:22:48.683Z",
  "locked": false,
  "default": false,
  "vendor": null,
  "os_family": null,
  "job_category": "Job name 30",
  "provider_type": "SSH",
  "description_format": null,
  "execution_timeout_interval": null,
  "description": null,
  "ansible_callback_enabled": false,
  "cloned_from_id": null,
  "ansible_check_mode": false
}

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Integer

id
required

Validations:

  • string from 2 to 128 characters containing only alphanumeric characters, space, '_', '-' with no leading or trailing space..


POST /api/job_templates/:id/clone
Clone a provision template

Examples

POST /api/job_templates/1007981709-Job%20template%2034/clone
{
  "job_template": {
    "name": ""
  }
}
422
{
  "error": {
    "id": 1007981709,
    "errors": {
      "name": [
        "can't be blank"
      ]
    },
    "full_messages": [
      "Name can't be blank"
    ]
  }
}

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Integer

id
required

Validations:

  • string from 2 to 128 characters containing only alphanumeric characters, space, '_', '-' with no leading or trailing space..

job_template
required

Validations:

  • Hash

job_template[name]
required

Template name

Validations:

  • String