post
https://partner.gupshup.io/partner//app-link/app-token
Link an app using an SS-issued app link token (Flow B). No PENDING request is created.
Recent Requests
Log in to see full request history
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Loading…
Verifies an SS-issued app link JWT with Self Serve, then links the app immediately .
API Request:
curl --location --request POST 'https://partner.gupshup.io/partner/{{PARTNER_ID}}/app-link/app-token' \
--header 'token: {{PARTNER_TOKEN}}' \
--header 'Content-Type: application/json' \
--data '{"token": "eyJhbGciOiJSUzI1NiJ9..."}'Response:
| Status Code | Response | Comments |
|---|---|---|
| 200 | { "status": "success", "linked": true, "appId": "app_xyz123", "appName": "My App", "customerId": "cust_1", "partnerId": 8814, "tokenStatus": "ACTIVE" } | Success. App linked in this call. |
| 400 | { "status": "error", "message": "token is required" } | Request body null or token blank (controller validation). |
| 400 | { "status": "error", "message": "Invalid token format" } | JWT cannot be decoded. |
| 400 | { "status": "error", "message": "Invalid token: appId claim is missing" } | JWT decode succeeded but no appId, app_id, or usable sub claim. |
| 400 | { "status": "error", "message": "SS app link token is not valid (status={status}, tokenStatus={tokenStatus})" } | SS verify response not status=success + tokenStatus=ACTIVE. |
| 400 | { "status": "error", "message": "App details not found for appId: {appId}" } | SS app details lookup failed after verify. |
| 400 | { "status": "error", "message": "App is already linked to Partner" } | Cross-partner guard — app mapped to another partner in partner_apps. |
| 400 | { "status": "error", "message": "This app has been previously mapped to a different partner ID, kindly use the correct Partner ID" } | Prior APP_LINK history indicates a different partner. |
| 400 | { "status": "error", "message": "The partner you are trying to add may not be an approved partner by Gupshup" } | Partner not approved. |
| 400 | { "status": "error", "message": "Re-linking of application is not allowed. App was created by partner." } | App already linked elsewhere and partner-created. |
| 400 | { "status": "error", "message": "Re-linking of application to same partner is not allowed." } | App already linked to this partner. |
| 401 | { "status": "error", "message": "Unauthorised access to the resource. Please review request parameters and headers and retry" } | Missing/invalid authentication. |
| 403 | { "status": "error", "message": "Forbidden Access" } | Path partnerId mismatch or not PARTNER_ADMIN. |
Request parameters:
| Key | Description | Values | Data Type | Required / Optional | Constraints |
|---|---|---|---|---|---|
| token | Partner token credential | {{PARTNER_TOKEN}} | String | Required | See §1. |
| partnerId | Partner ID (path) | e.g. 8814 | Integer | Required | Must match authenticated partner context. |
| token | SS app link JWT | JWT string | String | Required | Trimmed before verify. SS is the authorization decision. |
