Examples

POST /api/job_templates/import
{
  "template": "<%#\nname: Job template 210_renamed\nsnippet: false\nmodel: JobTemplate\njob_category: Job name 214\nprovider_type: SSH\nkind: job_template\norganizations:\n- Organization 1\nlocations:\n- Location 1\n%>\n\nid",
  "job_template": {
    "template": "<%#\nname: Job template 210_renamed\nsnippet: false\nmodel: JobTemplate\njob_category: Job name 214\nprovider_type: SSH\nkind: job_template\norganizations:\n- Organization 1\nlocations:\n- Location 1\n%>\n\nid"
  }
}
201
{
  "id": 1007981924,
  "name": "Job template 210_renamed",
  "template": "id",
  "snippet": false,
  "template_kind_id": null,
  "created_at": "2025-08-12T18:11:20.253Z",
  "updated_at": "2025-08-12T18:11:20.253Z",
  "locked": false,
  "default": false,
  "vendor": null,
  "os_family": null,
  "job_category": "Job name 214",
  "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.