web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Deleting/Updating a webhook subscription using v2 API

(2) ShareShare
ReportReport
Posted on by 4
Hi,
 
I am using Business Central v2.0 API to create/delete/renew webhook subscriptions for a custom app in our organization. Although create works fine and I can see my subscriptions in GET subscriptions API response, DELETE and PATCH(renew subscriptions) fail with HTTP 404 error with /Bad Request - Error in query syntax/ as seen below:
 
//
 
I'm following this doc and setting the subscriptionId in DELETE API from the output of GET API response. Also I've copied the @odata.etag value from output of GET API response and used that in the value of `If-Match` header in DELETE and PATCH API requests.
I have used the value of the @odata.etag value as is, unescaped the quotes  as documented in a similar post for v1 API and tried various other combinations as well but the error persists.
 
This is the output of my GET subscriptions response:
 
//
//
 
Parts of the docs are inconsistent as here they ask to use the v2.0 API for PATCH/DELETE but here they suggest using v1.0 API even though both are v2 reference docs. 
 
Has anyone been able to get this working? Appreciate any pointers on this! 
 
Thanks
Nitesh
 
I have the same question (0)
  • Suggested answer
    CT-12061724-0 Profile Picture
    6 on at
    The subscription PATCH request to renew needs to have single apostrophes in the URL, which is not consistent:
     
    BAD = api/v2.0/subscriptions(d2fc1f47490b4124afaf53523931dcf9)
    GOOD = api/v2.0/subscriptions('d2fc1f47490b4124afaf53523931dcf9')

    The header needs a valid If-Match, which can either be the latest etag or simply *, so If-Match="*"
     
    The payload must include the clientState (if you provided one when creating the subscription) and the resource, so for the generalLedgerEntries subscription:
     
    {
      "clientState": "theClientStateYouSet",
      "resource": "api/v2.0/companies(company_id)/generalLedgerEntries"
    }
  • Suggested answer
    Sohail Ahmed Profile Picture
    11,136 Super User 2025 Season 2 on at

    The HTTP 404 / Bad Request error when deleting/patching webhook subscriptions via BC v2.0 API, despite successful creation, often points to:

    1. Incorrect @odata.etag format in If-Match header: Ensure it's exact, including quotes (e.g., "W/\"...").
    2. subscriptionId formatting in URL: Verify no extra characters or incorrect encoding.
    3. API Version Inconsistency/Bug: Consider trying the v1.0 webhook endpoint for DELETE/PATCH if v2.0 fails consistently, as there are known inconsistencies.
     

    The "Error in query syntax" strongly suggests a formatting issue with the ID or ETag.

    ✅ Mark this answer as verified if it helps you.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,229

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,867 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,153 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans