Update App Subscription

Use this API to update a specific subscription of an app

Request Parameters

Key

Description

Value

Data type

Required/Optional

Constraints

Authorization

Access Token for the application

{{PARTNER_APP_TOKEN}}

String

Required

Should be a valid Partner App Access Token

appId

App ID to fetch the access token

{{APP_ID}}

String

Required

- The Id should be a valid app Id of Gupshup. - The App must be associated with the account that owns the PARTNER_APP_TOKEN being used

SUBSCRIPTION_ID

2xxxx

String

Required

The identifier for the subscription to updated.

modes

Stages in subscription processing

<MODES>

String

- Should be one of the following : NONE, READ, DELIVERED, SENT, DELETED, OTHERS - for version 3 TEMPLATE, ACCOUNT, COPY are not supported

tag

Name tag for URL

<name_tag_for_url>

String

Optional

tag must be unique for each app

url

Callback URL

<callback_url>

String

Optional

Should be valid URL

version

Version

<version>

Integer

Optional

Should be one of the following : 0,1,2,3

doCheck

For bypassing URL check

<for_bypassing_url_check>

Boolean

Optional

Should be a boolean value : true/false

active

active status of subscription

<true/false>

Boolean

Optional

Should be a boolean value : true/false

Sample Request

curl --location --request PUT 'https://partner.gupshup.io/partner/app/{{APP_ID}}/subscription/{{SUBSCRIPTION_ID}}' \
--header 'Authorization: {{PARTNER_APP_TOKEN}}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'url=<callback_url>' \
--data-urlencode 'tag=<name_tag_for_url>' \
--data-urlencode 'version=<Version>' \
--data-urlencode 'modes=<MODES>' \
--data-urlencode 'doCheck=<for_bypassing_url_check>' \
--data-urlencode 'active=<true/false>'

Sample Response

{
  "status" : "success",
  "subscription" : {
    "active" : true,
    "appId" : "657c0203-0b4d-4ba1-bbf5-a679cfa35a16",
    "createdOn" : 1739862125507,
    "id" : "32595",
    "latencyBucket" : "lt_1_s",
    "mode" : 1025,
    "modes" : [ "SENT", "ENQUEUED" ],
    "modifiedOn" : 1739870558358,
    "showOnUI" : false,
    "tag" : "V33i4",
    "url" : "https://01hqjda5pbywgv7xw5e9ckd5e800-51132d4cc32709e9078d.requestinspector.com",
    "version" : 2
  }
}

Status Codes


Status Code

Response

Comments

Success

200

{

"status" : "success","subscription" :{"active" : true, "appId" : "657c0203-0b4d-4ba1-bbf5-a679cfa35a16", "createdOn" : 1739862125507, "id" : "32595", "latencyBucket" : "lt_1_s", "mode" : 1025, "modes" : ["SENT", "ENQUEUED"], "modifiedOn" : 1739870558358, "showOnUI" : false, "tag" : "V33i4", "url" : "https://01hqjda5pbywgv7xw5e9ckd5e800-51132d4cc32709e9078d.requestinspector.com", "version" : 2 } }

Error

400

{

"status": "error","message": "API key is not associated with partner"}

when API key not found on partner DB

400

{

"status": "error","message": "Subscription Does Not Exist"}

When a subscription does not exist with the provided subcriptionId

401

{

"status": "error","message": "Authentication Failed"}

When authentication fails

403

{

"status": "error","message": "Not Subscription Owner"}

When the requested subscription is not associated with the provided appId

429

{

"status": "error","message": "Too Many Requests"}

Language
Click Try It! to start a request and see the response here!