When updating a Custom Auth credential using the PATCH method via API. When you visit the credential in UI it shows that it was updated “Just now”, but doesn’t have the JSON box anymore (see picture).
It’s a data type mismatch. The json field in the Custom Auth credential expects a String (text) that contains JSON, but you are sending a raw JSON Object. The API saves the object successfully, but the UI text editor breaks because it tries to load an object instead of a string.
To fix it, you need to stringify the content of the json field.
In your HTTP Request node body, change it to use an expression like this:
{
“data”: {
“json”: {{ JSON.stringify({
“body”: {
“client_id”: “1”,
“client_secret”: “2”
}
}) }}
}
}
This didn’t make any difference. This updates the custom credential (which already was the case), but in the credential itself (in the UI) it doesn’t show the JSON block and the credential also doesn’t work (so it isn’t correctly updated).
To test whether it was correctly updated I used a Github pat. The JSON Body I used: