---
title: "Generate JWT token for embedding templates"
method: POST
path: "/generate-template-token"
tags: ["JWT Management"]
---

# Generate JWT token for embedding templates

`POST /generate-template-token`

Creates a JWT token for embedding a template with 24-hour expiration. This is the standard endpoint for JWT generation.

**Note**: The standalone `generate-embedded-template-token` function is deprecated in favor of this router-based endpoint.

## Request body

- GenerateJWTRequest
  - `companies_workspaces_templates_id` string, uuid, required — ID of the template to generate JWT for

## Response `201`

JWT generated successfully

- GenerateTemplateTokenResponse — Generated JWT token for template
  - `token` string, required — The JWT token
  - `expires_at` string, date-time, required — Token expiration timestamp
  - `jwt_record_id` string, uuid — Database record ID for the JWT

## Other responses

- `400` — Bad Request - Validation failed
- `401` — Unauthorized - Invalid or missing API key
- `404` — Not Found - Resource does not exist
- `429` — Too Many Requests - Rate limit exceeded

---

[API](https://skmtc.dev/firma/apis/firma-partner-api.md) · [All operations](https://skmtc.dev/firma/apis/firma-partner-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/firma/firma-partner-api/revisions/5c03d6a9d080/schema)
