Skip to content
Utilerio
All endpoints

JWT Encoder

POST/api/v1/tools/jwt-encoder

Build and sign a JSON Web Token with HS256, HS384 or HS512 using your own secret.

Authentication

Requires an API key in the X-API-Key header.

Try it

POST/api/v1/tools/jwt-encoder

Parameters

algorithmstringoptional

HMAC algorithm. Default HS256.

HS256HS384HS512
payloadstringrequired

JWT payload as a JSON string.

secretstringrequired

HMAC signing secret.

Request body

{
  "algorithm": "HS256",
  "payload": "{\"sub\":\"1234567890\",\"name\":\"Ada Lovelace\"}",
  "secret": "my-secret"
}

Response codes

  • 200Success.
  • 400Invalid request — check your body or parameters.
  • 401Missing or invalid API key.
  • 403The API key is not scoped to this endpoint.
  • 429Rate limit exceeded — retry after a short wait.

Language

cURL

Request

curl -X POST https://utilerio.com/api/v1/tools/jwt-encoder \
  -H "X-API-Key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"algorithm":"HS256","payload":"{\"sub\":\"1234567890\",\"name\":\"Ada Lovelace\"}","secret":"my-secret"}'

Response

{ "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkFkYSBMb3ZlbGFjZSJ9....", "header": { "alg": "HS256", "typ": "JWT" } }