Clerk JWT Templates API

JWT Templates allow you to generate custom authentication tokens tied to authenticated sessions, enabling you to integrate with third-party services.

Operations 10

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /jwt_templates List JWT templates · List All Templates #
Ask an LLM
“What JWT templates are set up in my instance?”
“How do I page through all my session token templates?”
Tell an agent
List all my JWT templates.
Show the first {limit} JWT templates in this instance.
POST /jwt_templates Create a JWT template · Create a JWT Template #
Ask an LLM
“How do I create a JWT template with custom claims for a third-party service?”
“Can I set a custom signing key and algorithm on a new JWT template?”
Tell an agent
Create a JWT template named {name} with claims {claims}.
Create JWT template {name} with claims {claims} and a lifetime of {lifetime} seconds.
GET /jwt_templates/{template_id} Retrieve a JWT template · Retrieve a Template #
Ask an LLM
“How do I view the claims configured on one JWT template?”
“What details are stored on a single JWT template?”
Tell an agent
Get JWT template {template_id}.
Show the claims and lifetime of template {template_id}.
PATCH /jwt_templates/{template_id} Update a JWT template · Update a JWT Template #
Ask an LLM
“How do I change the claims on an existing JWT template?”
“Can I extend the lifetime or clock skew of a JWT template I already have?”
Tell an agent
Update template {template_id} to name {name} with claims {claims}.
Change the claims of existing JWT template {template_id} to {claims}, keeping name {name}.
DELETE /jwt_templates/{template_id} Delete a JWT template · Delete a Template #
Ask an LLM
“How do I delete a JWT template I no longer use?”
“Can I remove a session token template from my instance?”
Tell an agent destructive · confirm first
Delete JWT template {template_id}.
Remove the unused token template {template_id}.
GET /platform/applications/{applicationID}/instances/{envOrInsID}/jwt_templates List an application instance's JWT templates · List JWT Templates #
Ask an LLM
“How do I list JWT templates for one of my applications using the Platform API?”
“Which scope do I need to read JWT templates across applications?”
Tell an agent
List the JWT templates of application {applicationID} in environment {envOrInsID}.
Show the token templates on the {envOrInsID} instance of app {applicationID} via the platform.
POST /platform/applications/{applicationID}/instances/{envOrInsID}/jwt_templates Create a JWT template in an application instance · Create a JWT Template #
Ask an LLM
“How do I add a JWT template to another application's instance through the Platform API?”
“Can I create a JWT template for my production environment from a platform token?”
Tell an agent
Create JWT template {name} with claims {claims} in application {applicationID} instance {envOrInsID}.
Via the platform, add token template {name} to the {envOrInsID} environment of app {applicationID} with claims {claims}.
GET /platform/applications/{applicationID}/instances/{envOrInsID}/jwt_templates/{templateID} Get a JWT template in an application instance · Get a JWT Template #
Ask an LLM
“How do I read one JWT template from a specific application instance via the Platform API?”
“Can a platform token fetch a template's claims in another app's environment?”
Tell an agent
Get JWT template {templateID} from application {applicationID} instance {envOrInsID}.
Via the platform, show template {templateID} in the {envOrInsID} environment of app {applicationID}.
PATCH /platform/applications/{applicationID}/instances/{envOrInsID}/jwt_templates/{templateID} Update a JWT template in an application instance · Update a JWT Template #
Ask an LLM
“How do I edit a JWT template's claims in another application's instance with the Platform API?”
“Can I change a template's signing algorithm through the platform?”
Tell an agent
Update template {templateID} in application {applicationID} instance {envOrInsID} to name {name} and claims {claims}.
Via the platform, set claims {claims} on template {templateID} ({name}) in the {envOrInsID} environment of app {applicationID}.
DELETE /platform/applications/{applicationID}/instances/{envOrInsID}/jwt_templates/{templateID} Delete a JWT template in an application instance · Delete a JWT Template #
Ask an LLM
“How do I delete a JWT template from one of my application instances via the Platform API?”
“Which scope is required to delete JWT templates across applications?”
Tell an agent destructive · confirm first
Delete JWT template {templateID} from application {applicationID} instance {envOrInsID}.
Via the platform, remove template {templateID} from the {envOrInsID} environment of app {applicationID}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/clerk-com-jwt-templates-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

clerk-com-jwt-templates-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Clerk Com JWT Templates API
  contact:
    email: support@clerk.com
    name: Clerk Platform Team
    url: https://clerk.com/support
  license:
    name: MIT
    url: https://github.com/clerk/openapi-specs/blob/main/LICENSE
  termsOfService: https://clerk.com/terms
  x-logo:
    url: https://clerk.com/_next/image?url=%2Fimages%2Fclerk-logo.svg&w=96&q=75
    altText: Clerk docs
    href: https://clerk.com/docs
  version: '1.0'
  description: 'Operations tagged JWT Templates across 2 of this provider''s published API definitions: clerk-backend-api-openapi.yml, clerk-platform-api-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://api.clerk.com/v1
tags:
- name: JWT Templates
  description: 'JWT Templates allow you to generate custom authentication tokens

    tied to authenticated sessions, enabling you to integrate with third-party

    services.'
  externalDocs:
    url: https://clerk.com/docs/request-authentication/jwt-templates
paths:
  /jwt_templates:
    get:
      operationId: ListJWTTemplates
      x-speakeasy-group: jwtTemplates
      x-speakeasy-name-override: list
      summary: List All Templates
      parameters:
      - $ref: '#/components/parameters/Paginated'
      - $ref: '#/components/parameters/LimitParameter'
      - $ref: '#/components/parameters/OffsetParameter'
      tags:
      - JWT Templates
      responses:
        '200':
          $ref: '#/components/responses/JWTTemplate.List'
      security:
      - bearerAuth: []
    post:
      operationId: CreateJWTTemplate
      x-speakeasy-group: jwtTemplates
      x-speakeasy-name-override: create
      summary: Create a JWT Template
      description: Create a new JWT template
      tags:
      - JWT Templates
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: JWT template name
                claims:
                  type: object
                  description: JWT template claims in JSON format
                lifetime:
                  type:
                  - integer
                  - 'null'
                  minimum: 30
                  maximum: 315360000
                  description: JWT lifetime
                allowed_clock_skew:
                  type:
                  - integer
                  - 'null'
                  minimum: 0
                  maximum: 300
                  description: JWT allowed clock skew
                custom_signing_key:
                  type: boolean
                  description: Whether a custom signing key/algorithm is also provided for this template
                signing_algorithm:
                  type:
                  - string
                  - 'null'
                  description: The custom signing algorithm to use when minting JWTs. Required if `custom_signing_key` is `true`.
                signing_key:
                  type:
                  - string
                  - 'null'
                  description: The custom signing private key to use when minting JWTs. Required if `custom_signing_key` is `true`.
              required:
              - name
              - claims
      responses:
        '200':
          $ref: '#/components/responses/JWTTemplate'
        '400':
          $ref: '#/components/responses/ClerkErrors'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
      security:
      - bearerAuth: []
    servers:
    - url: https://api.clerk.com/v1
  /jwt_templates/{template_id}:
    get:
      operationId: GetJWTTemplate
      x-speakeasy-group: jwtTemplates
      x-speakeasy-name-override: get
      summary: Retrieve a Template
      description: Retrieve the details of a given JWT template
      tags:
      - JWT Templates
      parameters:
      - name: template_id
        in: path
        description: JWT Template ID
        required: true
        schema:
          type: string
      responses:
        '200':
          $ref: '#/components/responses/JWTTemplate'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
      security:
      - bearerAuth: []
    patch:
      operationId: UpdateJWTTemplate
      x-speakeasy-group: jwtTemplates
      x-speakeasy-name-override: update
      summary: Update a JWT Template
      description: Updates an existing JWT template
      tags:
      - JWT Templates
      parameters:
      - name: template_id
        in: path
        description: The ID of the JWT template to update
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: JWT template name
                claims:
                  type: object
                  description: JWT template claims in JSON format
                lifetime:
                  type:
                  - integer
                  - 'null'
                  minimum: 30
                  maximum: 315360000
                  description: JWT lifetime
                allowed_clock_skew:
                  type:
                  - integer
                  - 'null'
                  minimum: 0
                  maximum: 300
                  description: JWT allowed clock skew
                custom_signing_key:
                  type: boolean
                  description: Whether a custom signing key/algorithm is also provided for this template
                signing_algorithm:
                  type:
                  - string
                  - 'null'
                  description: The custom signing algorithm to use when minting JWTs. Required if `custom_signing_key` is `true`.
                signing_key:
                  type:
                  - string
                  - 'null'
                  description: The custom signing private key to use when minting JWTs. Required if `custom_signing_key` is `true`.
              required:
              - name
              - claims
      responses:
        '200':
          $ref: '#/components/responses/JWTTemplate'
        '400':
          $ref: '#/components/responses/ClerkErrors'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
      security:
      - bearerAuth: []
    delete:
      operationId: DeleteJWTTemplate
      x-speakeasy-group: jwtTemplates
      x-speakeasy-name-override: delete
      summary: Delete a Template
      description: ''
      tags:
      - JWT Templates
      parameters:
      - name: template_id
        in: path
        description: JWT Template ID
        required: true
        schema:
          type: string
      responses:
        '200':
          $ref: '#/components/responses/DeletedObject'
        '403':
          $ref: '#/components/responses/AuthorizationInvalid'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
      security:
      - bearerAuth: []
    servers:
    - url: https://api.clerk.com/v1
  /platform/applications/{applicationID}/instances/{envOrInsID}/jwt_templates:
    get:
      operationId: PlatformListJWTTemplates
      x-speakeasy-group: platform
      x-speakeasy-name-override: listJWTTemplates
      tags:
      - JWT Templates
      summary: List JWT Templates
      description: 'List all JWT templates for an application instance.


        Requires the `jwt_templates:read` scope.'
      security:
      - platform_api_access_token: []
      parameters:
      - name: applicationID
        in: path
        description: Application ID.
        required: true
        schema:
          type: string
      - name: envOrInsID
        in: path
        description: 'Environment type (e.g., "development", "production") or instance ID.

          '
        required: true
        schema:
          type: string
      responses:
        '200':
          description: JWT templates retrieved successfully.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/JWTTemplate'
        '400':
          $ref: '#/components/responses/ClerkErrors'
        '401':
          $ref: '#/components/responses/AuthenticationInvalid'
        '403':
          $ref: '#/components/responses/AuthorizationInvalid'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
    post:
      operationId: PlatformCreateJWTTemplate
      x-speakeasy-group: platform
      x-speakeasy-name-override: createJWTTemplate
      tags:
      - JWT Templates
      summary: Create a JWT Template
      description: 'Create a new JWT template for an application instance.


        Requires the `jwt_templates:manage` scope.'
      security:
      - platform_api_access_token: []
      parameters:
      - name: applicationID
        in: path
        description: Application ID.
        required: true
        schema:
          type: string
      - name: envOrInsID
        in: path
        description: 'Environment type (e.g., "development", "production") or instance ID.

          '
        required: true
        schema:
          type: string
      requestBody:
        description: JWT template data to create.
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: JWT template name
                claims:
                  type: object
                  description: JWT template claims in JSON format
                lifetime:
                  type:
                  - integer
                  - 'null'
                  minimum: 30
                  maximum: 315360000
                  description: JWT token lifetime in seconds
                allowed_clock_skew:
                  type:
                  - integer
                  - 'null'
                  minimum: 0
                  maximum: 300
                  description: JWT allowed clock skew in seconds
                custom_signing_key:
                  type: boolean
                  description: Whether a custom signing key/algorithm is also provided for this template
                signing_algorithm:
                  type:
                  - string
                  - 'null'
                  description: The custom signing algorithm to use when minting JWTs. Required if `custom_signing_key` is `true`.
                signing_key:
                  type:
                  - string
                  - 'null'
                  description: The custom signing private key to use when minting JWTs. Required if `custom_signing_key` is `true`.
              required:
              - name
              - claims
      responses:
        '200':
          description: JWT template created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JWTTemplate'
        '400':
          $ref: '#/components/responses/ClerkErrors'
        '401':
          $ref: '#/components/responses/AuthenticationInvalid'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/AuthorizationInvalid'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
    servers:
    - url: https://api.clerk.com/v1
  /platform/applications/{applicationID}/instances/{envOrInsID}/jwt_templates/{templateID}:
    get:
      operationId: PlatformGetJWTTemplate
      x-speakeasy-group: platform
      x-speakeasy-name-override: getJWTTemplate
      tags:
      - JWT Templates
      summary: Get a JWT Template
      description: 'Retrieve a specific JWT template for an application instance.


        Requires the `jwt_templates:read` scope.'
      security:
      - platform_api_access_token: []
      parameters:
      - name: applicationID
        in: path
        description: Application ID.
        required: true
        schema:
          type: string
      - name: envOrInsID
        in: path
        description: 'Environment type (e.g., "development", "production") or instance ID.

          '
        required: true
        schema:
          type: string
      - name: templateID
        in: path
        description: JWT Template ID.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: JWT template retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JWTTemplate'
        '400':
          $ref: '#/components/responses/ClerkErrors'
        '401':
          $ref: '#/components/responses/AuthenticationInvalid'
        '403':
          $ref: '#/components/responses/AuthorizationInvalid'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
    patch:
      operationId: PlatformUpdateJWTTemplate
      x-speakeasy-group: platform
      x-speakeasy-name-override: updateJWTTemplate
      tags:
      - JWT Templates
      summary: Update a JWT Template
      description: 'Update an existing JWT template for an application instance.


        Requires the `jwt_templates:manage` scope.'
      security:
      - platform_api_access_token: []
      parameters:
      - name: applicationID
        in: path
        description: Application ID.
        required: true
        schema:
          type: string
      - name: envOrInsID
        in: path
        description: 'Environment type (e.g., "development", "production") or instance ID.

          '
        required: true
        schema:
          type: string
      - name: templateID
        in: path
        description: JWT Template ID.
        required: true
        schema:
          type: string
      requestBody:
        description: JWT template data to update.
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: JWT template name
                claims:
                  type: object
                  description: JWT template claims in JSON format
                lifetime:
                  type:
                  - integer
                  - 'null'
                  minimum: 30
                  maximum: 315360000
                  description: JWT token lifetime in seconds
                allowed_clock_skew:
                  type:
                  - integer
                  - 'null'
                  minimum: 0
                  maximum: 300
                  description: JWT allowed clock skew in seconds
                custom_signing_key:
                  type: boolean
                  description: Whether a custom signing key/algorithm is also provided for this template
                signing_algorithm:
                  type:
                  - string
                  - 'null'
                  description: The custom signing algorithm to use when minting JWTs. Required if `custom_signing_key` is `true`.
                signing_key:
                  type:
                  - string
                  - 'null'
                  description: The custom signing private key to use when minting JWTs. Required if `custom_signing_key` is `true`.
              required:
              - name
              - claims
      responses:
        '200':
          description: JWT template updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JWTTemplate'
        '400':
          $ref: '#/components/responses/ClerkErrors'
        '401':
          $ref: '#/components/responses/AuthenticationInvalid'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/AuthorizationInvalid'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
    delete:
      operationId: PlatformDeleteJWTTemplate
      x-speakeasy-group: platform
      x-speakeasy-name-override: deleteJWTTemplate
      tags:
      - JWT Templates
      summary: Delete a JWT Template
      description: 'Delete a JWT template from an application instance.


        Requires the `jwt_templates:manage` scope.'
      security:
      - platform_api_access_token: []
      parameters:
      - name: applicationID
        in: path
        description: Application ID.
        required: true
        schema:
          type: string
      - name: envOrInsID
        in: path
        description: 'Environment type (e.g., "development", "production") or instance ID.

          '
        required: true
        schema:
          type: string
      - name: templateID
        in: path
        description: JWT Template ID.
        required: true
        schema:
          type: string
      responses:
        '200':
          $ref: '#/components/responses/DeletedObject'
        '400':
          $ref: '#/components/responses/ClerkErrors'
        '401':
          $ref: '#/components/responses/AuthenticationInvalid'
        '403':
          $ref: '#/components/responses/AuthorizationInvalid'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
    servers:
    - url: https://api.clerk.com/v1
components:
  responses:
    AuthorizationInvalid:
      description: Authorization invalid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ClerkErrors'
    ResourceNotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ClerkErrors'
    ClerkErrors:
      description: Request was not successful
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ClerkErrors'
    JWTTemplate:
      description: Success
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/JWTTemplate'
    PaymentRequired:
      description: Payment required
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ClerkErrors'
    JWTTemplate.List:
      description: List of JWT templates
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: '#/components/schemas/JWTTemplate'
    UnprocessableEntity:
      description: Invalid request parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ClerkErrors'
    DeletedObject:
      description: Deleted Object
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DeletedObject'
    AuthenticationInvalid:
      description: Authentication invalid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ClerkErrors'
  schemas:
    ClerkError:
      type: object
      properties:
        message:
          type: string
        long_message:
          type: string
        code:
          type: string
        meta:
          type: object
      required:
      - message
      - long_message
      - code
    JWTTemplate:
      type: object
      additionalProperties: false
      properties:
        object:
          type: string
          enum:
          - jwt_template
        id:
          type: string
        name:
          type: string
        claims:
          type: object
        lifetime:
          type: integer
        allowed_clock_skew:
          type: integer
        custom_signing_key:
          type: boolean
        signing_algorithm:
          type: string
        created_at:
          type: integer
          format: int64
          description: 'Unix timestamp of creation.

            '
        updated_at:
          type: integer
          format: int64
          description: 'Unix timestamp of last update.

            '
      required:
      - object
      - id
      - name
      - claims
      - lifetime
      - allowed_clock_skew
      - custom_signing_key
      - signing_algorithm
      - created_at
      - updated_at
    DeletedObject:
      type: object
      additionalProperties: false
      properties:
        object:
          type: string
        id:
          type: string
        slug:
          type: string
        deleted:
          type: boolean
        external_id:
          type: string
      required:
      - object
      - deleted
    ClerkErrors:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ClerkError'
        meta:
          type: object
        clerk_trace_id:
          type: string
      required:
      - errors
  parameters:
    OffsetParameter:
      name: offset
      in: query
      description: 'Skip the first `offset` results when paginating.

        Needs to be an integer greater or equal to zero.

        To be used in conjunction with `limit`.'
      required: false
      schema:
        type: integer
        default: 0
        minimum: 0
    LimitParameter:
      name: limit
      in: query
      description: 'Applies a limit to the number of results returned.

        Can be used for paginating the results together with `offset`.'
      required: false
      schema:
        type: integer
        default: 10
        minimum: 1
        maximum: 500
    Paginated:
      name: paginated
      in: query
      description: 'Whether to paginate the results.

        If true, the results will be paginated.

        If false, the results will not be paginated.'
      required: false
      schema:
        type: boolean
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Secret key, obtained under "API Keys" in the Clerk Dashboard.
      bearerFormat: sk_<environment>_<secret value>
    platform_api_access_token:
      type: http
      scheme: bearer
      description: Platform API access token.
externalDocs:
  url: https://clerk.com/docs
x-refined-from:
- clerk-backend-api-openapi.yml
- clerk-platform-api-openapi.yml
x-speakeasy-retries:
  strategy: backoff
  backoff:
    initialInterval: 500
    maxInterval: 60000
    maxElapsedTime: 3600000
    exponent: 1.5
  statusCodes:
  - 5XX
  retryConnectionErrors: true