I used to create HTTP Header Auth credentials via API up until today. Now it shows errors. The payload I send is:
{
“name”: “Test Creds”,
“type”: “httpHeaderAuth”,
“data”: {
“name”: “Authorization”,
“value”: “testtest”
}
}
Describe the problem/error/question
What is the error message (if any)?
Please share your workflow
(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)
Hi @valonn Welcome!
This is strange, have you created credential schema endpoint before and then built your payload from that?? something like GET /api/v1/credentials/schema/httpHeaderAuth so that you could get the exact data structure it needs for that header auth, maybe then you can try sending that POST request POST /api/v1/credentials with your name on it, and type “httpHeaderAuth” , and so your data object matches this schema, although i think you must be following this so if not let me know how this goes…
@alliance got it right. the json wrapper is the thing most people miss. if youre creating multiple credential types programmatically, fetching the schema first via GET /api/v1/credentials/schema/{type} saves you having to guess the structure each time.
@alliance nailed it — the "json" wrapper is the key. n8n internally stores all credential data under a json property, so you need "data": { "json": { "name": "...", "value": "..." } } instead of flat data. One tip: if you’re creating multiple credential types programmatically, always fetch the credential schema first via GET /api/v1/credentials/schema/{type} — saves guessing the exact structure each time.
@alliance nailed it — the "json" wrapper is the key. n8n internally stores all credential data under a json property, so you need "data": { "json": { "name": "...", "value": "..." } } instead of flat data. One tip: if you’re creating multiple credential types programmatically, always fetch the credential schema first via GET /api/v1/credentials/schema/{type} — saves guessing the exact structure each time.