# Http POST node error: 422 - Failed to deserialize the JSON body into the target type: missing field

**URL:** <https://community.n8n.io/t/http-post-node-error-422-failed-to-deserialize-the-json-body-into-the-target-type-missing-field/149990>\
**Category:** Questions\
**Created:** [July 15, 2025, 1:55pm UTC](https://community.n8n.io/t/http-post-node-error-422-failed-to-deserialize-the-json-body-into-the-target-type-missing-field/149990 "2025-07-15T13:55:32Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![pausen-t](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/pausen-t/32/100327_2.png) [@pausen-t](https://community.n8n.io/u/pausen-t)\
**Post date:** [July 15, 2025, 1:55pm UTC](https://community.n8n.io/t/http-post-node-error-422-failed-to-deserialize-the-json-body-into-the-target-type-missing-field/149990/1 "2025-07-15T13:55:32Z")

</div>

## Describe the problem/error/question

I am trying to hand over a vector to a POST http request node.  
The vector is actually coming from an ebbeding model that I run to turn my query into a vector to then retrieve the answer from my chromadb.  
But I simplified it here replicating the same error with a much simpler setup.  
I always get the error immediately after executing the http request.  
In the end I made a very simple simulation with only two nodes: a Set or Code node and the POST node. This would replicate the error.

My input data looks like this:  
[{  
“query\_embeddings”: [[1,2,3,4]],  
“n\_results”: 5,  
“include”: [  
“metadatas”,  
“documents”  
]  
}]

I tried a lot to change specific format bits as gemini and chatgpt told me to:  
making distinctions between array and top-level object and that subtle difference — `[]` wrapping the object — causes the 422. Nothing helped.

In the expression editor eveything looks good:  
expression  
{{ $json }}  
result  
[Object: {“query\_embeddings”: [[1,2,3,4]], “n\_results”: 5, “include”: [“metadatas”, “documents”]}]

## The error message: 422

```json
"{
    "error":"ChromaError",
    "message":"Failed to deserialize the JSON body into the target type: missing field `query_embeddings` at line 1 column 7"
}"

```

Request:

```json
{ "body": { "": "" }, 
  "headers": { 
    "accept": "application/json,text/html,application/xhtml+xml,application/xml,text/*;q=0.9, image/*;q=0.8, */*;q=0.7" 
  }, 
  "method": "POST", 
  "uri": "http://192.168.10.123:8060/api/v2/tenants/default_tenant/databases/default_database/collections/<mycollectionid>/query", 
  "gzip": true, 
  "rejectUnauthorized": true, 
  "followRedirect": true, "resolveWithFullResponse": true, 
  "followAllRedirects": true, 
  "timeout": 300000, 
  "encoding": null, 
  "json": false, 
  "useStream": true
}

```

## My two nodes

## n8n setup

- **n8n version:** 1.101.2
- **Database (default: SQLite):**
- **n8n EXECUTIONS\_PROCESS setting (default: own, main):**
- **Running n8n via (Docker, npm, n8n cloud, desktop app):** Self hosted npm
- **Operating system:** Debian Bookworm

---

<div class="post-metadata">

**Author:** ![withabdul](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/withabdul/32/179439_2.png) [@withabdul](https://community.n8n.io/u/withabdul)\
**Post date:** [July 15, 2025, 2:33pm UTC](https://community.n8n.io/t/http-post-node-error-422-failed-to-deserialize-the-json-body-into-the-target-type-missing-field/149990/2 "2025-07-15T14:33:18Z")

</div>

I don’t know what you are working with, but I think you missed some parameters in your `query_embeddings` fields. You can check the documentation if you have it

---

<div class="post-metadata">

**Author:** ![pausen-t](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/pausen-t/32/100327_2.png) [@pausen-t](https://community.n8n.io/u/pausen-t)\
**Post date:** [July 15, 2025, 3:10pm UTC](https://community.n8n.io/t/http-post-node-error-422-failed-to-deserialize-the-json-body-into-the-target-type-missing-field/149990/3 "2025-07-15T15:10:30Z")

</div>

‘Working with’ ? Where ? What do you mean. The database? I filled the database myself. It’s a RAG system.  
The error says

```auto
missing field `query_embeddings`

```

But there clearly is a field query\_embeddings which contains a vector. So the database isn’t questioned at all.

---

<div class="post-metadata">

**Author:** ![pausen-t](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/pausen-t/32/100327_2.png) [@pausen-t](https://community.n8n.io/u/pausen-t)\
**Post date:** [July 17, 2025, 3:19pm UTC](https://community.n8n.io/t/http-post-node-error-422-failed-to-deserialize-the-json-body-into-the-target-type-missing-field/149990/4 "2025-07-17T15:19:12Z")

</div>

I have no problem doing it with curl

```auto
curl -X POST \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "query_embeddings": [[-0.00018215518502984196, 0.03714984655380249, ... , -0.01177421398460865, -0.005926981568336487]],
    "n_results": 5,
    "include": [
      "metadatas",
      "documents"
    ]
  }' \
  http://192.168.10.123:8060/api/v2/tenants/default_tenant/databases/default_database/collections/MY_ID/query

```

But the request node doesn’t work at all.

---

<div class="post-metadata">

**Author:** ![jabbson](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jabbson/32/87328_2.png) [@jabbson](https://community.n8n.io/u/jabbson)\
**Post date:** [July 17, 2025, 4:04pm UTC](https://community.n8n.io/t/http-post-node-error-422-failed-to-deserialize-the-json-body-into-the-target-type-missing-field/149990/5 "2025-07-17T16:04:47Z")

</div>

And this http request doesn’t? Results in the error from the original message?

---

<div class="post-metadata">

**Author:** ![pausen-t](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/pausen-t/32/100327_2.png) [@pausen-t](https://community.n8n.io/u/pausen-t)\
**Post date:** [July 17, 2025, 4:25pm UTC](https://community.n8n.io/t/http-post-node-error-422-failed-to-deserialize-the-json-body-into-the-target-type-missing-field/149990/6 "2025-07-17T16:25:42Z")

</div>

> [@pausen-t](#):
>
> `application/json`

No this one doesnt. I was just able to solve the puzzle myself.  
The way I did it first was ending up with “contentType”: “={{ $json }}”, and that doesnt work.  
You have to choose Specify Body → Using json and then put {{ $json }} in there, then it works and the code looks like this then:  
“specifyBody”: “json”,  
“jsonBody”: “={{ $json }}”,

I don’t know how to learn that. IIt took me hours to figure that out.  
Thanks for jumping in.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [July 24, 2025, 4:26pm UTC](https://community.n8n.io/t/http-post-node-error-422-failed-to-deserialize-the-json-body-into-the-target-type-missing-field/149990/7 "2025-07-24T16:26:27Z")

</div>

Closed on July 24, 2025, 4:26pm UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
