About this endpoint
What it does
Signs a JSON payload into a JWT using the provided secret and returns the generated token. The request body includes the payload to encode, the signing secret, and an optional algorithm.
Request Body
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| payload | Object | Yes | JSON payload to encode into the JWT. |
| secret | String | Yes | Secret key used to sign the token. |
| algorithm | String | No | Signing algorithm to use. Default: HS256. |
Response
Returns a JSON object with a token string field containing the signed JWT.
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| token | String | No | The generated JWT string. |