# Unable to update/add credential field in Job Template using API in Ansible tower

**URL:** <https://forum.ansible.com/t/unable-to-update-add-credential-field-in-job-template-using-api-in-ansible-tower/35366>\
**Category:** AWX Project\
**Created:** [June 17, 2021, 6:50pm UTC](https://forum.ansible.com/t/unable-to-update-add-credential-field-in-job-template-using-api-in-ansible-tower/35366 "2021-06-17T18:50:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kamlendu\_Shekhar](https://avatars.discourse-cdn.com/v4/letter/k/c4cdca/32.png) [@Kamlendu\_Shekhar](https://forum.ansible.com/u/Kamlendu_Shekhar)\
**Post date:** [June 17, 2021, 6:50pm UTC](https://forum.ansible.com/t/unable-to-update-add-credential-field-in-job-template-using-api-in-ansible-tower/35366/1 "2021-06-17T18:50:22Z")

</div>

Hi,

I am trying to create/update a Job template in Ansible tower using API, everything is working great, but it’s not including the credentials what was passed as payload.

even the update is not working(I tried PATCH and PUT). I am trying to add a pre-existing credential to my job template.

Below is the curl command to update.  
curl -X PATCH --user admin:admin123 --insecure -H ‘Content-Type: application/json’ “[https://tower1.xx.example.opentlc.com/api/v2/job\_templates/12/](https://tower1.xx.example.opentlc.com/api/v2/job_templates/12/)” -d “{"credentials":2}”

Any help will be highly appreciated.

Regards,  
Kamlendu
