---
updatedAt: 2025-11-20T08:01:47.000Z
agentTools:
  projectIndex: https://partner-docs.gupshup.io/llms.txt
---

# Disable button click analytics

This API endpoint enables or disables button click analytics for a specific template. Button click tracking allows you to monitor user interactions with buttons in your WhatsApp message templates. This endpoint provides granular control over which templates have button click analytics enabled.

## Request Parameters

| Key           | Description                                      | Value                   | Type    | Required/Optional | Constraints                                |
| :------------ | :----------------------------------------------- | :---------------------- | :------ | :---------------- | :----------------------------------------- |
| Authorization | Access Token for the application                 | `{{PARTNER_APP_TOKEN}}` | String  | Required          | Should be a valid Partner App Access Token |
| APP\_ID       | App ID to fetch the access token                 | `{{APP_ID}}`            | String  | Required          | The ID should be a valid app ID of Gupshup |
| templateId    | gs-template id of template                       | `{{TEMPLATE_ID}}`       | String  | Required          |                                            |
| disable       | flag to disable or enable button click analytics | True/False              | Boolean | Required          |                                            |

## Sample Request

```curl
curl --location --request POST '{{BASE_URL}}/partner/app/{{APP_ID}}/template/analytics/buttonclick' \
--header 'Authorization: {{PARTNER_APP_TOKEN}}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'templateId={{TEMPLATE_ID}}' \
--data-urlencode 'disable=false'
```

## Sample Response

```
{
    "status": "success"
}
```

## Status Codes

| Status Code | Response                                                                                                                                        | Comment             |
| :---------- | :---------------------------------------------------------------------------------------------------------------------------------------------- | :------------------ |
| **Success** |                                                                                                                                                 |                     |
| 200         | `{     "stauts": "sucess"   }`                                                                                                                  | Successful response |
| **Error**   |                                                                                                                                                 |                     |
| 401         | `{       "status": "error",       "message": "Unauthorised access to the resource. Please review request parameters and headers and retry"   }` |                     |

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Partner Release 8.5 Apis",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://partner.gupshup.io"
    }
  ],
  "tags": [
    {
      "name": "Template Analytics"
    }
  ],
  "paths": {
    "/partner/app/{appId}/template/analytics/buttonclick": {
      "post": {
        "tags": [
          "Template Analytics"
        ],
        "summary": "Disable button click analytics",
        "description": "API to disable button click analytics for a template",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "templateId",
                  "disable"
                ],
                "properties": {
                  "templateId": {
                    "type": "string",
                    "description": "gs-template id of template",
                    "example": "{{TEMPLATE_ID}}"
                  },
                  "disable": {
                    "type": "boolean",
                    "description": "flag to disable or enable button click analytics",
                    "example": "false"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "description": "Your app token, please refer [**Get access token api**](https://docs.gupshup.io/reference/get_partner-app-appid-token) to get the token from partner documentation.",
            "example": "sk_61b3021c97214370b341f8baaae0xxxx",
            "required": true
          },
          {
            "name": "appId",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Unique identifier of the app.",
            "example": "9e97650d-xxxx-xxxx-xxxx-4cdf47c3fa68"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "stauts": {
                      "type": "string",
                      "example": "sucess"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Please pass template id"
                    },
                    "status": {
                      "type": "string",
                      "example": "error"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "You do not have the required permissions to access this API"
                    },
                    "status": {
                      "type": "integer",
                      "example": 403
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Internal server error. Please try again later and If Issue still persist than contact Gupshup Dev Support"
                    },
                    "status": {
                      "type": "integer",
                      "example": 500
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```