# AWX Launch Template REST API ( extra\_vars ) param not working

**URL:** <https://forum.ansible.com/t/awx-launch-template-rest-api-extra-vars-param-not-working/38015>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [May 22, 2023, 9:34am UTC](https://forum.ansible.com/t/awx-launch-template-rest-api-extra-vars-param-not-working/38015 "2023-05-22T09:34:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![RAHUL\_ANAND\_SAHU](https://avatars.discourse-cdn.com/v4/letter/r/ee59a6/32.png) [@RAHUL\_ANAND\_SAHU](https://forum.ansible.com/u/RAHUL_ANAND_SAHU)\
**Post date:** [May 22, 2023, 9:34am UTC](https://forum.ansible.com/t/awx-launch-template-rest-api-extra-vars-param-not-working/38015/1 "2023-05-22T09:34:26Z")

</div>

I am trying to execute launch\_template API through Python and send extra\_vars as JSON payload as per API documentation. But extra\_vars are not working and template execution gets failed.

AWX\_API = “[http://tul-itawxd-l01.tul.tivo.com:31709/api/v2/job\_templates/15/launch/](http://tul-itawxd-l01.tul.tivo.com:31709/api/v2/job_templates/15/launch/)”  
response = requests.post(AWX\_API, json={“extra\_vars”: payload},  
auth=HTTPBasicAuth(‘USER’, ‘PASS’))

How can i resolve this ? I following official Ansible Tower docs to perform POST request for the REST API - [[/api/v2/job\_templates/{id}/launch/](https://docs.ansible.com/ansible-tower/latest/html/towerapi/api_ref.html#/operations/Job%20Templates/Job_Templates_job_templates_launch_create) ]

 ![Screenshot 2023-05-22 at 3.02.22 PM.png](https://us1.discourse-cdn.com/ansible/original/2X/e/e78617a01f2911967e8445afccf65d9bf10f6235.png)

---

<div class="post-metadata">

**Author:** ![akira6592](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/akira6592/32/222_2.png) [@akira6592](https://forum.ansible.com/u/akira6592)\
**Post date:** [May 24, 2023, 12:46am UTC](https://forum.ansible.com/t/awx-launch-template-rest-api-extra-vars-param-not-working/38015/2 "2023-05-24T00:46:12Z")

</div>

Hello RAHUL ANAND SAHU

Cloud you try select “Prompt on launch” on job template?

2023年5月22日月曜日 18:34:26 UTC+9 RAHUL ANAND SAHU:

---

<div class="post-metadata">

**Author:** ![AWX\_Project](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@AWX\_Project](https://forum.ansible.com/u/AWX_Project)\
**Post date:** [May 24, 2023, 6:53pm UTC](https://forum.ansible.com/t/awx-launch-template-rest-api-extra-vars-param-not-working/38015/3 "2023-05-24T18:53:44Z")

</div>

as mentioned above, make sure prompt on launch is enabled for extra variables on that job template

another thing to test, does it work if you add them directly to the extra variables form on the job template?

for more info about the “prompt on launch” option, check out this official documentation [https://docs.ansible.com/automation-controller/latest/html/userguide/job\_templates.html#create-a-job-template](https://docs.ansible.com/automation-controller/latest/html/userguide/job_templates.html#create-a-job-template)

AWX Team
