Programmatically remove / update credentials in a template by API in AWX

We use the API to codify our templates and things I noticed that when changing the credentials on a job the API errors:

{'error': 'Cannot assign multiple Machine credentials.'}

going by the documentation:
10. Tower API Reference Guide — Ansible Tower API Guide v3.8.6

and included a json payload in a post:

{ "id": credential['id'],'dissasociate': True}

but the error is the same. The documentation is a bit confusing and does not provide an example of what that looks like. How does one remove a credential from the template via the API?

You need a 2 step approach:

POST /api/v2/job_templates/ID/credentials/ with body { ‘id’: oldid, “disassociate”: true }
POST /api/v2/job_templates/ID/credentials/ with body { ‘id’: newid }