---
updatedAt: 2026-09-17T14:41:04.000Z
agentTools:
  projectIndex: https://partner-docs.gupshup.io/llms.txt
---

# Mint Universal App Token (UAT)

Issues a new Universal App Token scoped to a single app.

# Description

1. When expiry is omitted the token expires 24 hours from mint time.
2. When expiry is supplied it is an absolute epoch-millisecond timestamp, and must satisfy now + 1h <= expiry <= now + 24h.
3. The raw JWT is returned only once, in this response.UT bearer only - portal login, legacy partner token, static app token, or external JWT are rejected.
4. Max 3 active UATs per app by default.
5. Name uniqueness is among active tokens for that app; after revoke or natural expiry the name can be reused.
6. No email is sent on UAT mint.

<br />

# Rate limit

10 requests / 60 seconds

<br />

# API Request

## Default Expiry (24 hours)

```curl
curl --location --request POST 'https://partner.gupshup.io/partner/app/{{APP_ID}}/token' \
--header 'Authorization: Bearer {{UNIVERSAL_TOKEN}}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'name=webhook-service'
```

## Custom Expiry

```curl
curl --location --request POST 'https://partner.gupshup.io/partner/app/{{APP_ID}}/token' \
--header 'Authorization: Bearer {{UNIVERSAL_TOKEN}}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'name=webhook-service-2h' \
--data-urlencode 'expiry=1783075200000'
```

Replace 1783075200000 with an epoch-ms timestamp that is within 1 hour … 24 hours from the request time.

<br />

# Response

| Status Code | Response                                                                                                                                        | Comments                                                                          |
| ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| 200         | `{ "status": "success", "token": "eyJhbGciOiJSUzI1NiJ9...", "id": "6f2c9e1a-..." }`                                                             | Success. Raw JWT returned once. Default TTL = 24h when `expiry` omitted.          |
| 400         | `{ "status": "error", "message": "name is required and must be 1..128 characters" }`                                                            | `name` blank or longer than 128 characters.                                       |
| 400         | `{ "status": "error", "message": "expiry must be in the future (at least 1 hour from now)" }`                                                   | Custom expiry is in the past or less than 1 hour ahead.                           |
| 400         | `{ "status": "error", "message": "expiry cannot exceed 24 hours from now" }`                                                                    | Custom expiry is beyond the 24-hour maximum.                                      |
| 400         | `{ "status": "error", "message": "Partner is not authorized" }`                                                                                 | App is not linked to the authenticated partner (InvalidParameterException → 400). |
| 401         | `{ "status": "error", "message": "Unauthorised access to the resource. Please review request parameters and headers and retry" }`               | Missing/invalid authentication (JwtAuthenticationEntryPoint).                     |
| 409         | `{ "status": "error", "message": "Maximum of 3 active UAT tokens reached for this app; revoke one and retry" }`                                 | Active UAT cap reached (default 3 per app).                                       |
| 409         | `{ "status": "error", "message": "A token with this name already exists; revoke or rename it first" }`                                          | Duplicate active name for this app.                                               |
| 429         | `{ "status": "error", "message": "Too Many Requests" }`                                                                                         | More than 10 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 Parameters

| Key           | Description              | Values                              | Data Type | Required / Optional | Constraints                                                 |
| ------------- | ------------------------ | ----------------------------------- | --------- | ------------------- | ----------------------------------------------------------- |
| **Headers**   |                          |                                     |           |                     |                                                             |
| Authorization | UT Bearer token          | `Bearer {{UNIVERSAL_TOKEN}}`        | String    | Required            | Must be a verified UT.                                      |
| Content-Type  | Form encoding            | `application/x-www-form-urlencoded` | String    | Required            | Form body.                                                  |
| **Path**      |                          |                                     |           |                     |                                                             |
| appId         | App ID                   | UUID                                | String    | Required            | Must be linked to the caller's partner.                     |
| **Form body** |                          |                                     |           |                     |                                                             |
| name          | Token label              | webhook-service                     | String    | Required            | 1–128 chars. Unique among this app's currently active UATs. |
| expiry        | Absolute expiry epoch ms | e.g. 1783075200000                  | Long      | Optional            | Omit → 24h default. If set: now + 1h ≤ expiry ≤ now + 24h.  |

<br />

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Universal App Token (UAT) APIs",
    "description": "These APIs provide interfaces for partners to create and manage Universal App Tokens (UAT).\nA UAT can only act on one app, lives 1 to 24 hours (default 24h), and must be minted under an active Universal Token (UT).\nIf a UAT leaks, blast radius is limited to that app and it expires within a day.\nPrerequisite: Mint a UT first (POST /partner/{partnerId}/auth/token), then use that UT as Authorization: Bearer {{UNIVERSAL_TOKEN}} to mint UATs.\n\nComparison - UT vs UAT (quick reference):\nScope: UT covers the whole partner account, UAT covers one app only.\nDefault lifetime: UT 60 days, UAT 24 hours.\nCustom expiry window: UT 60s to 60 days, UAT 1h to 24 hours.\nExpiry parameter: both use expiry (epoch ms).\nMax active: UT 3 per admin user, UAT 3 per app.\nMint auth: UT uses email + clientSecret, UAT requires a Bearer UT.\nEmail on mint: UT yes (best-effort), UAT no.\n",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://partner.gupshup.io"
    }
  ],
  "tags": [
    {
      "name": "Universal App Token",
      "description": "Mint, list, and revoke Universal App Tokens"
    }
  ],
  "paths": {
    "/partner/app/{appId}/token": {
      "post": {
        "tags": [
          "Universal App Token"
        ],
        "summary": "Mint Universal App Token (UAT)",
        "description": "Issues a new Universal App Token scoped to a single app.",
        "operationId": "mintUniversalAppToken",
        "parameters": [
          {
            "$ref": "#/components/parameters/AppIdPath"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/MintAppTokenRequest"
              },
              "examples": {
                "defaultExpiry": {
                  "summary": "Default expiry (24 hours)",
                  "value": {
                    "name": "webhook-service"
                  }
                },
                "customExpiry": {
                  "summary": "Custom absolute expiry (epoch ms)",
                  "value": {
                    "name": "webhook-service-2h",
                    "expiry": 1783075200000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response. Raw JWT returned once.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MintAppTokenSuccessResponse"
                },
                "example": {
                  "status": "success",
                  "token": "eyJhbGciOiJSUzI1NiJ9...",
                  "id": "6f2c9e1a-..."
                }
              }
            }
          },
          "400": {
            "description": "Validation or business error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalidName": {
                    "summary": "name blank or longer than 128 characters",
                    "value": {
                      "status": "error",
                      "message": "name is required and must be 1..128 characters"
                    }
                  },
                  "expiryTooSoon": {
                    "summary": "Custom expiry is in the past or less than 1 hour ahead",
                    "value": {
                      "status": "error",
                      "message": "expiry must be in the future (at least 1 hour from now)"
                    }
                  },
                  "expiryTooFar": {
                    "summary": "Custom expiry is beyond the 24-hour maximum",
                    "value": {
                      "status": "error",
                      "message": "expiry cannot exceed 24 hours from now"
                    }
                  },
                  "partnerNotAuthorized": {
                    "summary": "App is not linked to the authenticated partner (InvalidParameterException)",
                    "value": {
                      "status": "error",
                      "message": "Partner is not authorized"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized access - missing or invalid authentication (JwtAuthenticationEntryPoint)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Unauthorised access to the resource. Please review request parameters and headers and retry"
                }
              }
            }
          },
          "409": {
            "description": "Active token cap reached or duplicate active token name",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "maxActiveTokens": {
                    "summary": "Active UAT cap reached (default 3 per app)",
                    "value": {
                      "status": "error",
                      "message": "Maximum of 3 active UAT tokens reached for this app; revoke one and retry"
                    }
                  },
                  "duplicateName": {
                    "summary": "Duplicate active name for this app",
                    "value": {
                      "status": "error",
                      "message": "A token with this name already exists; revoke or rename it first"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded - more than 10 requests / 60 seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Too Many Requests"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error",
                  "message": "Internal server error. Please try again later and If Issue still persist then contact Gupshup Dev Support"
                }
              }
            }
          }
        },
        "security": [
          {
            "UniversalToken": []
          }
        ]
      }
    }
  },
  "components": {
    "parameters": {
      "AppIdPath": {
        "name": "appId",
        "in": "path",
        "description": "App ID. Must be linked to the caller's partner.",
        "required": true,
        "schema": {
          "type": "string",
          "format": "uuid",
          "example": "6f2c9e1a-1b2c-3d4e-5f60-7a8b9c0d1e2f"
        }
      }
    },
    "schemas": {
      "MintAppTokenRequest": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "Token label. 1 to 128 chars. Unique among this app's currently active UATs.",
            "example": "webhook-service"
          },
          "expiry": {
            "type": "integer",
            "format": "int64",
            "description": "Absolute expiry in epoch milliseconds.\nOmit for the 24h default. If set, must satisfy now + 1h <= expiry <= now + 24h.\n",
            "example": 1783075200000
          }
        }
      },
      "MintAppTokenSuccessResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "example": "success"
          },
          "token": {
            "type": "string",
            "description": "The raw UAT JWT. Returned only once, at mint time.",
            "example": "eyJhbGciOiJSUzI1NiJ9..."
          },
          "id": {
            "type": "string",
            "description": "Token row id, usable with the list and revoke APIs.",
            "example": "6f2c9e1a-..."
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "example": "error"
          },
          "message": {
            "type": "string",
            "example": "Error description"
          }
        }
      }
    },
    "securitySchemes": {
      "UniversalToken": {
        "type": "apiKey",
        "name": "Authorization",
        "in": "header",
        "description": "Universal Token (UT) in the form \"Bearer {{UNIVERSAL_TOKEN}}\".\nMust be a verified UT Bearer - portal login, legacy partner token, static app token, and external JWT are rejected.\n"
      }
    }
  }
}
```