post
https://partner.gupshup.io/partner//app-link/partner-link-token
Returns the current partner linking token, minting a new one when missing, expired, or regenerate=true.
Recent Requests
Log in to see full request history
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Loading…
Returns the partner's current linking token JWT, minting a fresh one only when none exists or the current row is expired. When regenerate=true, a new token is always minted and every previously shared JWT is invalidated immediately. The JWT is returned once at mint time — subsequent GET metadata calls never return the token value.
API Request — Get or auto-mint (regenerate=false)
curl --location --request POST 'https://partner.gupshup.io/partner/{{PARTNER_ID}}/app-link/partner-link-token' \
--header 'token: {{PARTNER_TOKEN}}' \
--header 'Content-Type: application/json' \
--data '{}'API Request — Force regenerate (regenerate=true)
curl --location --request POST 'https://partner.gupshup.io/partner/{{PARTNER_ID}}/app-link/partner-link-token' \
--header 'token: {{PARTNER_TOKEN}}' \
--header 'Content-Type: application/json' \
--data '{"regenerate": true, "expiryDays": 15}'Response
| Status Code | Response | Comment |
|---|---|---|
| 200 | {"partnerId": 8814, "partnerLinkingToken": "eyJhbGciOiJSUzI1NiJ9...", "issuedAt": 1783053048000, "expiresAt": 1785645048000} | Success. issuedAt / expiresAt are epoch milliseconds. When an existing valid row is reused (regenerate=false), timestamps reflect the stored row (TTL is not extended). |
| 400 | {"status": "error", "message": "expiryDays must be between 1 and 30 inclusive"} | expiryDays below min or above max (min/max from config; example uses code defaults 1–30). |
| 401 | {"status": "error", "message": "Unauthorised access to the resource. Please review request parameters and headers and retry"} | Missing/invalid authentication (JwtAuthenticationEntryPoint). |
| 429 | {"status": "error", "message": "Too Many Requests"} | More than 30 requests / 60 seconds. |
| 500 | {"status": "error", "message": "Internal server error. Please try again later and If Issue still persist then contact Gupshup Dev Support"} | Unexpected server failure. |
Request paramters:
| Key | Description | Values | Data Type | Required / Optional | Constraints |
|---|---|---|---|---|---|
| Headers | |||||
| token | Partner token credential | {{PARTNER_TOKEN}} | String | One of auth types required | Partner token or UT token |
| Content-Type | Request body type | application/json | String | Required when body sent | JSON body is optional ({} or omit). |
| Path | |||||
| partnerId | Partner ID | e.g. 8814 | Integer | Required | Must match authenticated partner context. |
| JSON body | |||||
| regenerate | Force rotate token | true / false | Boolean | Optional (default false) | true → always mint new static token; invalidates all previously issued JWTs immediately. |
| expiryDays | Custom expiry in days | e.g. 15 | Integer | Optional | Only consulted when a fresh token is minted. Must be between configured min and max inclusive (defaults 1–30). Omitted → configured default (default 30 days). |
