Showing results for 
Search instead for 
Did you mean: 
New Member

Custom API webhook trigger - Delete calls not being made

Hello All -


I followed the guide here, and got triggers working via webhooks - apart from the webhook delete calls. What exact criteria need to be met for delete to work? I have defined the delete call in the swagger doc, and have made sure to return a Location header in the 201 create request - and that request matches the pattern of the delete call I've defined. However, the delete call is not being made correctly. Can anyone help?


Advocate I
Advocate I

I'm having the same issue 😄

Community Support
Community Support

Hi @MattDendle1,


Would you please share your OpenAPI here so that we could check if there is anything wrong?




Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello @v-monli-msft!


Thanks for your reply.


Here is a link to the swagger document I used to create the webhooks (along with some API calls of o...


Again, the webhooks work fine - they get created, I return a 201 with a location header pointing at the location to be used with the delete verb. 


Thanks for looking,


New Member

Any updates on this? I have the same issue. I return 201 with the Location Header set, delete method is defined in swagger.
Does it need a specific name? or tag? Help is much appreciated.


I was struggling with this for a while but then I read the following text again: 


The webhook creation response is required to specify a "Location" header, the value of which will be used to delete the webhook registration. You must define the path of the delete webhook request as an internal action.


I then created an internal (hidden to end users) 'action' as part of the same custom connector. The idea is that the connector cannot make a call to an endpoint (the endpoint to delete/unsubscribe from the webhook) that is not registered. Once I created a DELETE action with the right URL structure, delete calls started to happen. 


Hope this helps some folks.. 

Regular Visitor



This is still not working for me. The webhook is being subscribed without a problem, but never unsubscribes itself.

I have a delete action on my REST controller and I tested it directly with the URL I add to the header when subscribing and the Rest call works. I add the following to the subscribe action: responseMessage.Headers.Add("Location", $"{host}/api/web-hook/delete/{id}");


I also tried to add an internal action to my swagger file but still nothing (I also tried without the id as parameter but hardcoded to an old subsciption, still nothing):


"/api/web-hook/delete/{id}": {
    "delete": {
        "responses": {
            "200": {
                "description": "OK"
        "summary": "Delete WebHook",
        "description": "Delete the WebHook",
        "operationId": "DeleteWebHook",
        "x-ms-visibility": "internal",
        "parameters": [
                "name": "id",
                "in": "path",
                "required": true,
                "type": "string",
                "x-ms-visibility": "important",
                "x-ms-url-encoding": "single",
                "x-ms-summary": "ID",
                "description": "Specify the ID of the WebHook"



I changed it so that the ID is also hardcoded an not needed in the delete call (removed it from the response header and swagger) and I made the delete call on the REST API open for everyone and still nothing. Added logging on the first line of the method and the method doesn't even get called.


Thanks in advanced!


Hi folks,

It looks like there is one missing requirements for webhook unsubscribe operations which must be authorized as other operation in a connector. Besides having DELETE operation in the connector swagger, Location header value must start with the registered backend service Url. So, if you have delete operation template in swagger:

"/api/web-hook/delete/{id}" {"delete": {...}}

and your connector's host is '' and your Base Url is '/restapi/v2', Location header must have the following value: '<some id>'

Best regards,


Hello Dmity,


My location header value is exactly the same as my swagger delete operation URL, so this is not the problem.


location header: 


swagger host:

swagger basePath: /

swagger scheme: https

swagger path: /api/web-hook/delete/{id}


All the best,


Hi MatthijsB,

I think I found logs related to your connector and it looks like there is no Location header in a create webhook response.

One such subscription request that was sent from the connector (2020-12-09): POST https://<yourhost> The response was successful, but there was no Location header based on logs.

I can also see few DELETE request, perhaps, it was a testing with direct action calls (webhookId=20). All of them failed with 415 status code, it looks like there is some payload passed along with those requests and Content-Type=text/plain.


Best regards,


Hello Dmitry,


Yes I tried a few delete webhooks via the test section. All my deletes have a 415 error code in the test section of a custom connector. Even my delete document, while the flow action for this works perfectly (and is also already certified). as you can see in the provided delete action in the swagger I don't have any body parameters. I do have consumes and produces "application/json" on top level of my swagger file.


My create webhook response does give a Location header as far as I can see:

    "version": "1.1",
    "content": null,
    "statusCode": 200,
    "reasonPhrase": "OK",
    "headers": [
            "key": "Location",
            "value": [
    "trailingHeaders": [],
    "requestMessage": null,
    "isSuccessStatusCode": true


All the best,


Regular Visitor



I found my issue. I upgraded my project from .NET framework to .NET Core. However the create webhook method was still returning a HttpResponseMessage which is no longer supported as a response type in a Controller in the .NET Core WebApi. So my whole response (including my location header) was begin returned in the body. I changed this to IActionResult and now it is working correctly.


So indeed it works by having the Location header in the create webhook response and the path of the location header as an internal delete action.


All the best,


Just to be sure. Does this mean that the owner of the API of the webhook should add a location header to the API? I'm not the owner, so I will need to ask for it then.

@JOAS_Niels  Yes.


In order for Logic Apps or Power Automate to delete a webhook, the API must include a Location HTTP header in the 201 response at the time the webhook is created. The Location header should contain the path to the webhook that is used with the HTTP DELETE. For example, the Location included with GitHub's response follows this format:<user name>/<repo name>/hooks/<hook ID>.

Advocate I
Advocate I

Thanks @murshed ! I will need to submit a feature request then, that's a pity.

Helpful resources

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (4,726)