---
title: User Unsubscribe
slug: user-unsubscribe
docTags: 
createdAt: 2022-12-01T15:58:57.000Z
---

This API notifies the Pathfix Automation's webhook module to stop listening for webhooks for the given user\_id.

:::hint{type="warning"}
The API will always return a success message but will only really work if the user\_id is connected via Pathfix OAuth and the webhook is in an active state.
:::





:::ApiMethodV2
```json
{
  "tab": "examples",
  "url": "https://labs.pathfix.com/api/webhook/{{provider}}/user_unsubscribe",
  "name": "User Unsubscribe API",
  "method": "POST",
  "request": {
    "pathParameters": [],
    "queryParameters": [
      {
        "kind": "required",
        "name": "user_id",
        "type": "string",
        "description": "Identifier of your currently logged in user"
      },
      {
        "kind": "required",
        "name": "public_key",
        "type": "string",
        "description": "Your Pathfix Application's Public Key"
      },
      {
        "kind": "required",
        "name": "private_key",
        "type": "string",
        "description": "Your Pathfix Application's Private Key"
      }
    ],
    "headerParameters": [],
    "bodyDataParameters": [],
    "formDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "_bhhPSILcjvcku-umegEK",
        "code": "{\n    \"rows\": [\n        {\n            \"pincStatus\": \"success\",\n            \"callId\": \"00dd76ab-f623-48ae-9448-8b3f665ceef5\",\n            \"data\": \"Webhook Subscription Notification sent to Pathfix Automation for user_id: {{user_id}} and provider: {{provider}} \"\n        }\n    ]\n}",
        "language": "200"
      },
      {
        "id": "5utnllITBeFzUN5uRh12M",
        "code": "Unauthorized",
        "language": "403",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "5utnllITBeFzUN5uRh12M"
  },
  "examples": {
    "languages": [
      {
        "id": "mrPkXrNjpLn-WchjnXhkS",
        "code": "curl --request GET\n  --url https://labs.pathfix.com/api/webhook/{{provider}}/user_unsubscribe\n  -d  user_id={{user_id}}\n  -d  public_key={{public_key}}\n  -d  private_key={{private_key}}\n  --header 'Accept: application/json'",
        "language": "curl",
        "customLabel": ""
      },
      {
        "id": "wxFfUDrtSwJ50kkFGJR7g",
        "code": "const fetch = require('node-fetch');\n\nlet url = 'https://labs.pathfix.com/api/connection';\nlet options = {\n  method: 'GET', \nheaders: {\n    Accept: 'application/json',\n  }\n};\nfetch(url, options)\n  .then(res => res.json())\n  .then(json => console.log(json))\n  .catch(err => console.error('error:' + err));",
        "language": "nodejs"
      },
      {
        "id": "O22uMSCxnzDNLhqoR1Eqv",
        "code": "import requests\n\nurl = \"https://labs.pathfix.com/api/connection\"\nheaders = {\"Accept\": \"application/json\"}\nresponse = requests.request(\"GET\", url, headers=headers)\nprint(response.text)",
        "language": "python"
      },
      {
        "id": "vyB1pSi4iBaoeNIwgTyH4",
        "code": "const fetch = require('node-fetch');\n\nlet url = 'https://labs.pathfix.com/api/connection';\nlet options = {method: 'GET', headers: {Accept: 'application/json'}};\nfetch(url, options)\n  .then(res => res.json())\n  .then(json => console.log(json))\n  .catch(err => console.error('error:' + err));",
        "language": "ruby"
      }
    ],
    "selectedLanguageId": "mrPkXrNjpLn-WchjnXhkS"
  },
  "description": "Call this API to unsubscribe a user from an active webhook. \n",
  "currentNewParameter": {
    "label": "Query Parameter",
    "value": "queryParameters"
  },
  "autoGeneratedAnchorSlug": "user-unsubscribe-api",
  "legacyHash": "96KxciHkn3EKl2AWBVfLV"
}
```
:::

