decode tokens, inspect claims
curl -sX POST 'https://api.whittly.dev/v1/jwt/decode' \
-H 'Authorization: Bearer $WHITTLY_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"token":"eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhbGljZSJ9.abc"}'
const res = await fetch('https://api.whittly.dev/v1/jwt/decode', {
method: 'POST',
headers: {
'Authorization': 'Bearer ' + apiKey,
'Content-Type': 'application/json',
},
body: JSON.stringify({ token: "eyJhbGciOiJIUzI1NiJ9..." }),
});
const data = await res.json();
const { data } = await axios.post(
'https://api.whittly.dev/v1/jwt/decode',
{ token: "eyJhbGciOiJIUzI1NiJ9..." },
{ headers: { Authorization: 'Bearer ' + apiKey } }
);
A JWT (JSON Web Token) consists of three Base64URL-encoded parts: a header that specifies the algorithm, a payload that carries claims (user ID, roles, expiration), and a signature that proves the token was issued by a trusted party. This tool decodes all three parts without verifying the signature.