---
title: Encode and Decode JWT API
slug: jwt-encode-decode
url: https://apyhub.com/dosvak/service/jwt-encode-decode
provider: Dosvak LLC
categories: [Developer Tools, "Security & Privacy"]
tags: [jwt, token-signing, token-verification, authentication, security, developer-tools]
auth: api_key
---

# Encode and Decode JWT API

Encode JSON payloads into JWTs and verify tokens with a shared secret. Returns a signed token, or validity plus decoded payload.

## Endpoints

| Method | Path | Description | Atoms |
| --- | --- | --- | --- |
| POST | `/encode` | What it does Signs a JSON payload into a JWT using the provided secret and returns the generated to… | 10 |
| POST | `/decode` | What it does Verifies the signature of a JWT using the provided secret and returns whether the toke… | 10 |

## About

## What it does
JWT Tools lets you encode a JSON payload into a JWT and decode or verify an existing token with a shared secret. Send a payload and secret to `/encode`, or send a token and secret to `/decode`; both endpoints accept an optional `algorithm` field, with `HS256` as the default.

Use JWT Tools when you need to issue signed tokens for sessions, API access, or short-lived claims, and when you need to check that an incoming token is valid before trusting its contents. The encode endpoint returns a `token` string.

The decode endpoint returns a `valid` boolean and a decoded `payload` object. That makes it useful for authentication flows, internal debugging, and any service that needs to inspect JWT claims without guessing at the signature logic.

If your application already stores claims as JSON, JWT Tools gives you a straightforward way to sign them and verify them with the same shared secret.

## Usage

Authenticate with an ApyHub API key in the `apy-token` header.
Full docs and a live playground: https://apyhub.com/dosvak/service/jwt-encode-decode
