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

# Generate an auth token for a given user identifier



## OpenAPI

````yaml /deploy/api/openapi.json post /api/v1/appuid/{appUid}/sdkusers/auth
openapi: 3.0.1
info:
  title: Mindset API Gateway
  version: 1.2.0
servers:
  - url: https://a.api.mindset.ai
  - url: https://b.api.mindset.ai
  - url: https://c.api.mindset.ai
  - url: https://d.api.mindset.ai
security: []
tags:
  - name: Agent Configuration
  - name: Agent Sessions
  - name: AppStatus
  - name: Context Files
  - name: Contexts
  - name: DynamicComponents
  - name: Labels
  - name: SDK Users
  - name: Threads
  - name: Webhooks
  - name: Agent Management (deprecated)
paths:
  /api/v1/appuid/{appUid}/sdkusers/auth:
    post:
      tags:
        - SDK Users
      summary: Generate an auth token for a given user identifier
      operationId: createSdkUserSession
      parameters:
        - name: appUid
          in: path
          description: Your application's uid
          required: true
          schema:
            minLength: 1
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  maxLength: 100
                  type: string
                  description: Friendly name to be set for the user
                userEmail:
                  maxLength: 100
                  type: string
                  description: >-
                    email address format user identifier. Deprecated. Prefer
                    using externalId.
                sdkUserEmail:
                  maxLength: 100
                  type: string
                  description: SDK user email address. Alias for userEmail.
                externalId:
                  maxLength: 100
                  type: string
                  description: Unique user identifier. Valid characters are A-Za-z0-9_-.
                accountUids:
                  maxItems: 10
                  type: array
                  description: >-
                    Array of account uids (max 10). The user will be added to
                    these accounts to allow access to restricted agents.
                  items:
                    maxLength: 128
                    minLength: 20
                    type: string
                externalTenantId:
                  maxLength: 100
                  type: string
                  description: Unique tenant identifier. Valid characters are A-Za-z0-9_-.
        required: true
      responses:
        '201':
          description: User found or created. Auth token generated
          content:
            application/json:
              schema:
                type: object
                properties:
                  authToken:
                    type: string
                    description: >-
                      authToken to be passed to the SDK to allow this user
                      access
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
        '404':
          description: A specified account was not found
          content: {}
        '422':
          description: Some error occured creating the user or generating the token
          content: {}
        '500':
          description: Internal Server Error
          content: {}
      security:
        - APIKeyHeader: []
components:
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      name: x-api-key
      in: header

````