> ## Documentation Index
> Fetch the complete documentation index at: https://docs.upsolve.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Project User Token

> Use this endpoint to get a JWT token for a previously registered project user. Requires userId and apiKey. The token will be generated based on the user's stored data.



## OpenAPI

````yaml post /v1/api/projects/user-token
openapi: 3.1.0
info:
  title: Upsolve API
  version: 1.5.0
servers:
  - url: https://api.upsolve.ai
security: []
tags: []
paths:
  /v1/api/projects/user-token:
    post:
      summary: Get JWT token for registered project user
      description: >-
        Use this endpoint to get a JWT token for a previously registered project
        user. Requires userId and apiKey. The token will be generated based on
        the user's stored data.
      operationId: PostV1ApiProjectsUserToken
      requestBody:
        description: POST /v1/api/projects/user-token Request body
        content:
          application/json:
            schema:
              allOf:
                - type: object
                  properties:
                    apiKey:
                      type: string
                      minLength: 1
                      description: >-
                        Upsolve API key, generated under Account → Developer
                        settings in the Upsolve Hub. Keys are user-scoped: pass
                        organizationId alongside the key to select which org to
                        act on.
                      examples:
                        - up_embed_************
                    organizationId:
                      description: >-
                        Your Upsolve organization's UUID — the org that owns the
                        API key and project. This is NOT a project organization:
                        do not pass a value registered via
                        /projects/register-organization, and do not pass an
                        `externalId` (only `projectOrganizationId` accepts
                        those). Omit it when using an org-bound API key — the
                        org is read from the key and any value sent here is
                        ignored. Required only for user-scoped API keys (created
                        under Account → Developer settings) and for the Supabase
                        JWT path, where the org is ambiguous and membership is
                        verified against it.
                      examples:
                        - 123e4567-e89b-12d3-a456-426614174000
                      type: string
                      format: uuid
                      pattern: >-
                        ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                - type: object
                  properties: {}
                - type: object
                  properties:
                    userId:
                      type: string
                      format: uuid
                      pattern: >-
                        ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                      description: >-
                        The ID of the previously registered project user to
                        issue a token for.
                      examples:
                        - 123e4567-e89b-12d3-a456-426614174000
                    apiKey:
                      description: >-
                        API key for authentication (optional if using Supabase
                        JWT)
                      examples:
                        - up_embed_************
                      type: string
                    expiration:
                      examples:
                        - 1h
                      type: string
                      enum:
                        - 5m
                        - 15m
                        - 30m
                        - 1h
                        - 2h
                        - 6h
                        - 12h
                        - 24h
                        - 7d
                      description: >-
                        How long the token lives: one of 5m, 15m, 30m, 1h, 2h,
                        6h, 12h, 24h, 7d. Defaults to 1h.
                  required:
                    - userId
                  examples:
                    - userId: 123e4567-e89b-12d3-a456-426614174000
                      apiKey: up_admin_************
                      expiration: 1h
            examples:
              example1:
                value:
                  userId: 123e4567-e89b-12d3-a456-426614174000
                  apiKey: up_embed_************
                  expiration: 1h
                  organizationId: 123e4567-e89b-12d3-a456-426614174000
        required: true
      responses:
        '200':
          description: POST /v1/api/projects/user-token Positive response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    const: success
                  data:
                    type: object
                    properties:
                      token:
                        type: string
                        description: A JWT identifying this user
                        examples:
                          - >-
                            eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjp7InBhcmVudE9yZ0lkIjoiYWJkZTZmMjQtYWYwZi00Zjg3LWI4NzEtNzk0NGIyYzhjM2IzIiwiZGlzcGxheU5hbWUiOiJEZW1vIChBZG1pbikiLCJwYXlsb2FkIjp7fX0sImlhdCI6MTcwOTI2NTcyOSwiZXhwIjoxNzA5MjY5MzI5fQ.nfMwGbPe7zwCwlky079PVjA-ox0G2OtTuFo_0MXoLCE
                      expiresAt:
                        type: string
                        description: When the token expires, as an ISO 8601 timestamp.
                        examples:
                          - '2026-10-10T13:00:00.000Z'
                    required:
                      - token
                      - expiresAt
                    additionalProperties: false
                    examples:
                      - token: >-
                          eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjp7InBhcmVudE9yZ0lkIjoiYWJkZTZmMjQtYWYwZi00Zjg3LWI4NzEtNzk0NGIyYzhjM2IzIiwiZGlzcGxheU5hbWUiOiJEZW1vIChBZG1pbikiLCJwYXlsb2FkIjp7fX0sImlhdCI6MTcwOTI2NTcyOSwiZXhwIjoxNzA5MjY5MzI5fQ.nfMwGbPe7zwCwlky079PVjA-ox0G2OtTuFo_0MXoLCE
                        expiresAt: '2026-10-10T13:00:00.000Z'
                required:
                  - status
                  - data
                additionalProperties: false
        '400':
          description: POST /v1/api/projects/user-token Negative response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    const: error
                  error:
                    type: object
                    properties:
                      message:
                        type: string
                      code:
                        type: string
                      details:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                    required:
                      - message
                    additionalProperties: false
                required:
                  - status
                  - error
                additionalProperties: false
      security:
        - APIKEY_1: []
components:
  securitySchemes:
    APIKEY_1:
      type: apiKey
      in: query
      name: apiKey
      x-in-actual: body
      description: apiKey MUST be supplied within the request body instead of query

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.