---
title: "Converts a JWT (JSON Web Token) to an API token."
method: POST
path: "/user/jwt_to_api_token/{jwt}"
tags: ["account"]
---

# Converts a JWT (JSON Web Token) to an API token.

`POST /user/jwt_to_api_token/{jwt}`

JWTs are commonly used for authentication in web applications. They contain
encoded information about the user and are typically short-lived for security reasons.

This endpoint exists to allow clients who have authenticated via JWT (e.g., through
Supabase) to obtain a long-lived API token. The API token can then be used
for subsequent requests to the API without requiring frequent re-authentication.

This conversion process enhances security by separating the authentication mechanism
(JWT) from the API access mechanism (API token), while providing a seamless experience
for users transitioning from web-based authentication to API usage.

## Path parameters

- `jwt` string, required

## Request body

- JwtToApiTokenRequest
  - `full_name` string, nullable
  - `invitation_token` string, uuid, nullable

## Response `200`

Converted JWT to API token

- TokenResponse
  - `permissions` Permission[], required
  - `refresh_token` string, required
  - `session_expires_at` string, required
  - `session_token` string, required

---

[API](https://skmtc.dev/structifyai/apis/structify.md) · [All operations](https://skmtc.dev/structifyai/apis/structify/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/structifyai/structify/revisions/1364930b6980/schema)
