Skip to content

JWT

The /jwt endpoint decodes a JSON Web Token without verifying the signature. Expiration is detected via the exp claim.

Parameters

The request body must be JSON:

ParameterRequiredDescription
tokenYesJWT token to decode

Response Fields

FieldTypeDescription
headerobjectDecoded JWT header (algorithm, type, etc.)
payloadobjectDecoded JWT payload (claims)
signaturestringRaw signature string (not verified)
expiredbooleantrue if exp is in the past — absent if no exp claim

Code Examples

curl -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "token": "eyJ..."
  }' \
  "https://api.sylvain.sh/v5/jwt"

Try It

Error Handling

If parameters are missing or invalid, the API will return an error:

Error MessageDescription
Please provide a token (?token={token})The token parameter is missing
Token cannot exceed 8192 charactersThe token exceeds the maximum length
Invalid JWT format. Expected 3 parts separated by "."The token does not have 3 dot-separated parts
Invalid JWT header: not a valid base64url-encoded JSON objectThe header part is not valid base64url JSON, or decodes to something other than an object (e.g. an array or string)
Invalid JWT payload: not a valid base64url-encoded JSON objectThe payload part is not valid base64url JSON, or decodes to something other than an object