# Self-host : Webhook response format

**URL:** <https://community.nocodb.com/t/self-host-webhook-response-format/1299>\
**Category:** Webhooks\
**Created:** [July 30, 2024, 5:54am UTC](https://community.nocodb.com/t/self-host-webhook-response-format/1299 "2024-07-30T05:54:16Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Krish1015](https://avatars.discourse-cdn.com/v4/letter/k/87869e/32.png) [@Krish1015](https://community.nocodb.com/u/Krish1015)\
**Post date:** [July 30, 2024, 5:54am UTC](https://community.nocodb.com/t/self-host-webhook-response-format/1299/1 "2024-07-30T05:54:16Z")

</div>

The format of the response from the webhook is different from the sample payload, not in the proper json format:  
Expected :  
{  
“type”: “records.after.update”,  
“id”: “0dfaf789-af0d-4308-a6eb-4b469e3be8ca”,  
“data”: {  
“table\_id”: “m2z1nlvrokw36p4”,  
“table\_name”: “Expenses - Approval”,  
“view\_id”: “vwixnh0wkrshtxlo”,  
“view\_name”: “Expenses - Approval”,  
“previous\_rows”: [  
{  
“Id”: 1,  
“Company”: “Simplability”,  
“CreatedAt”: “2024-07-30T05:29:50.678Z”,  
“UpdatedAt”: “2024-07-30T05:29:50.678Z”,  
“Amount”: “$123”,  
“Approver”: “Sikander”,  
“Receipt”: [  
{  
“url”: “[https://nocodb.com/dummy.png](https://nocodb.com/dummy.png)”,  
“title”: “image.png”,  
“mimetype”: “image/png”,  
“size”: 0  
}  
],

Response payload :  
{  
‘table\_id’: ‘m2z1nlvrokw36p4’,  
‘table\_name’: ‘Expenses - Approval’,  
‘previous\_rows’: [  
{  
‘Id’: 232,  
‘Company’: ‘Beyond Zero’,  
‘Amount’: 1477,  
‘Approver’: ‘Saurabh’,  
‘Receipt’: [  
{  
‘title’: ‘Wed Jul 24 2024.png’,  
‘mimetype’: ‘image/png’,  
‘size’: 471258  
}  
]

Issue : The expected one has a “data” wrapper but the response payload has no data wrapper,  
Expected json’s keys are in “Key” : “Value” while the response in coming in single inverted comma ‘Key’ : ‘Value’.

---

<div class="post-metadata">

**Author:** ![dstala](https://avatars.discourse-cdn.com/v4/letter/d/f04885/32.png) [@dstala](https://community.nocodb.com/u/dstala)\
**Post date:** [July 30, 2024, 6:22am UTC](https://community.nocodb.com/t/self-host-webhook-response-format/1299/2 "2024-07-30T06:22:18Z")

</div>

@Krish1015

- Are you trying it out in Cloud? Or in self hosted?
- If Self hosted, please provide base information for us to look into the issue.

I tried in [app.nocodb.com](http://app.nocodb.com) & the response received in webhook.site was the following

```json
{
  "type": "records.after.update",
  "id": "48a358ef-1a47-491c-8275-ceadc68eb30c",
  "data": {
    "table_id": "mbvv6c7gs74rr0k",
    "table_name": "Sample Views",
    "previous_rows": [
      {
        "Id": 6,
        "Album": "Light Switch",
        "Status": "Research",
        "Length (minutes)": 520,
        "Budget": 26000,
        "Platform": null,
        "Release": "2023-06-29 06:10:00+00:00",
        "CreatedAt": "2023-10-09 06:57:38+00:00",
        "UpdatedAt": "2024-07-30 06:19:42+00:00",
        "Sample Views1": null
      }
    ],
    "rows": [
      {
        "Id": 6,
        "Album": "Light Switch",
        "Status": "Research",
        "Length (minutes)": 520,
        "Budget": 26000,
        "Platform": "Spotify",
        "Release": "2023-06-29 06:10:00+00:00",
        "CreatedAt": "2023-10-09 06:57:38+00:00",
        "UpdatedAt": "2024-07-30 06:20:14+00:00",
        "Sample Views1": null
      }
    ]
  }
}

```

---

<div class="post-metadata">

**Author:** ![Krish1015](https://avatars.discourse-cdn.com/v4/letter/k/87869e/32.png) [@Krish1015](https://community.nocodb.com/u/Krish1015)\
**Post date:** [July 30, 2024, 6:31am UTC](https://community.nocodb.com/t/self-host-webhook-response-format/1299/3 "2024-07-30T06:31:40Z")

</div>

The server receiving the payload is hosted on AWS, but the trigger is being done from the [app.nocodb.com](http://app.nocodb.com) the base info of my laptop is :

NocoDB version details:  
Node: **Latest**  
Arch: **x64**  
Platform: **windows**  
Docker: **false**  
RootDB: **pg**  
Please help.

---

<div class="post-metadata">

**Author:** ![dstala](https://avatars.discourse-cdn.com/v4/letter/d/f04885/32.png) [@dstala](https://community.nocodb.com/u/dstala)\
**Post date:** [July 30, 2024, 6:39am UTC](https://community.nocodb.com/t/self-host-webhook-response-format/1299/4 "2024-07-30T06:39:19Z")

</div>

What is your trigger for webhook? Have you configured Body explicitly? Please check what is present in the Webhook BODY configuration. Should be `{{ json event }}`

 ![Screenshot 2024-07-30 at 12.07.54 PM](https://canada1.discourse-cdn.com/flex011/uploads/nocodb/original/1X/6c7bb5a6d938ff9846219a401ca82106a2e1996f.png)

---

<div class="post-metadata">

**Author:** ![Krish1015](https://avatars.discourse-cdn.com/v4/letter/k/87869e/32.png) [@Krish1015](https://community.nocodb.com/u/Krish1015)\
**Post date:** [July 30, 2024, 6:42am UTC](https://community.nocodb.com/t/self-host-webhook-response-format/1299/5 "2024-07-30T06:42:58Z")

</div>

> [@dstala](#):
>
> {{ json event }}

the body is same as **{{ json event }}** sir, I checked it several time.

---

<div class="post-metadata">

**Author:** ![Krish1015](https://avatars.discourse-cdn.com/v4/letter/k/87869e/32.png) [@Krish1015](https://community.nocodb.com/u/Krish1015)\
**Post date:** [July 30, 2024, 6:45am UTC](https://community.nocodb.com/t/self-host-webhook-response-format/1299/6 "2024-07-30T06:45:31Z")

</div>

> [@dstala](#):
>
> you configured Body explicitly?

 ![image](https://canada1.discourse-cdn.com/flex011/uploads/nocodb/original/1X/0a93934f2d85fb09857ff55cc5c0f6391f0419d2.png)

---

<div class="post-metadata">

**Author:** ![dstala](https://avatars.discourse-cdn.com/v4/letter/d/f04885/32.png) [@dstala](https://community.nocodb.com/u/dstala)\
**Post date:** [July 30, 2024, 6:49am UTC](https://community.nocodb.com/t/self-host-webhook-response-format/1299/7 "2024-07-30T06:49:25Z")

</div>

@Krish1015 Update trigger with a condition, I tried again. I did get proper payload. Can you confirm if payload is incorrect still even if you change Webhook link to the one from webhook.site?

---

<div class="post-metadata">

**Author:** ![Krish1015](https://avatars.discourse-cdn.com/v4/letter/k/87869e/32.png) [@Krish1015](https://community.nocodb.com/u/Krish1015)\
**Post date:** [July 30, 2024, 6:56am UTC](https://community.nocodb.com/t/self-host-webhook-response-format/1299/8 "2024-07-30T06:56:03Z")

</div>

with **webhook.site** I am also getting proper payload,  
While for my custom API endpoint , the format is not proper, while It was working fine 2 days back.

---

<div class="post-metadata">

**Author:** ![Krish1015](https://avatars.discourse-cdn.com/v4/letter/k/87869e/32.png) [@Krish1015](https://community.nocodb.com/u/Krish1015)\
**Post date:** [July 30, 2024, 6:57am UTC](https://community.nocodb.com/t/self-host-webhook-response-format/1299/9 "2024-07-30T06:57:29Z")

</div>

Is it a bug from nocodb side, or should it be from our end?

---

<div class="post-metadata">

**Author:** ![dstala](https://avatars.discourse-cdn.com/v4/letter/d/f04885/32.png) [@dstala](https://community.nocodb.com/u/dstala)\
**Post date:** [July 30, 2024, 7:00am UTC](https://community.nocodb.com/t/self-host-webhook-response-format/1299/10 "2024-07-30T07:00:52Z")

</div>

> [@Krish1015](#):
>
> with **webhook.site** I am also getting proper payload,  
> While for my custom API endpoint , the format is not proper, while It was working fine 2 days back.

Something that you need to investigate on the receiving end. Please check your code at the receiving end if you are accessing `response.data` instead of `response`.

---

<div class="post-metadata">

**Author:** ![Krish1015](https://avatars.discourse-cdn.com/v4/letter/k/87869e/32.png) [@Krish1015](https://community.nocodb.com/u/Krish1015)\
**Post date:** [July 30, 2024, 7:12am UTC](https://community.nocodb.com/t/self-host-webhook-response-format/1299/11 "2024-07-30T07:12:08Z")

</div>

> [@dstala](#):
>
> ead of `response`.

But what about the single quote and boule quote?  
For the single quote the URLs are vanishing after 'https: (last after that “//” is taking as a comment while I am using request.get\_data())

---

<div class="post-metadata">

**Author:** ![Krish1015](https://avatars.discourse-cdn.com/v4/letter/k/87869e/32.png) [@Krish1015](https://community.nocodb.com/u/Krish1015)\
**Post date:** [July 30, 2024, 7:32am UTC](https://community.nocodb.com/t/self-host-webhook-response-format/1299/12 "2024-07-30T07:32:55Z")

</div>

Please help, Sir. Do You need any more information?

---

<div class="post-metadata">

**Author:** ![dstala](https://avatars.discourse-cdn.com/v4/letter/d/f04885/32.png) [@dstala](https://community.nocodb.com/u/dstala)\
**Post date:** [July 30, 2024, 7:35am UTC](https://community.nocodb.com/t/self-host-webhook-response-format/1299/13 "2024-07-30T07:35:15Z")

</div>

Google it out @Krish1015. The webhook payload sent from NocoDB is same irrespective of webhook URL destination. The processing at your receiving end will depend on the packages & libraries that you are using for post processing.

---

<div class="post-metadata">

**Author:** ![Krish1015](https://avatars.discourse-cdn.com/v4/letter/k/87869e/32.png) [@Krish1015](https://community.nocodb.com/u/Krish1015)\
**Post date:** [July 30, 2024, 12:22pm UTC](https://community.nocodb.com/t/self-host-webhook-response-format/1299/14 "2024-07-30T12:22:18Z")

</div>

Thanks, its solved, The payload was in byte format, so I had to decode it with “utf-8” and then it was fine,
