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

# Get Custom Authentication Token

> Generates a custom Firebase authentication token for a user. Requires either email or partnerUserId. Does not support 2FA/OTP flow.



## OpenAPI

````yaml /client.json post /client/auth/custom-token
openapi: 3.0.0
info:
  title: Doshi Client API
  version: 1.0.0
  description: API specification for Doshi client-facing services.
servers:
  - url: https://api.doshi.app
    description: Production server
  - url: https://sandbox.api.doshi.app
    description: Sandbox server
security:
  - BearerAuth: []
tags:
  - name: Academy
    description: Endpoints related to educational content like courses, lessons, and paths.
  - name: Auth
    description: Endpoints for user authentication and authorization.
  - name: Marketplace
    description: Endpoints for rewards and redemptions.
  - name: User
    description: Endpoints for user data.
  - name: Quests
    description: Endpoints for quest management.
paths:
  /client/auth/custom-token:
    post:
      tags:
        - Auth
      summary: Get Custom Authentication Token
      description: >-
        Generates a custom Firebase authentication token for a user. Requires
        either email or partnerUserId. Does not support 2FA/OTP flow.
      parameters:
        - $ref: '#/components/parameters/AccessTypeHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetCustomTokenRequest'
      responses:
        '200':
          description: Successfully generated authentication token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetCustomTokenResponse'
        default:
          description: Error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  parameters:
    AccessTypeHeader:
      name: Access-Type
      in: header
      required: true
      schema:
        type: string
        enum:
          - client
      description: Must be set to 'client' for all API requests
  schemas:
    GetCustomTokenRequest:
      type: object
      properties:
        email:
          type: string
          format: email
        partnerUserId:
          type: string
          minLength: 1
          maxLength: 50
        branchId:
          type: string
          minLength: 2
          maxLength: 50
        firstName:
          type: string
          minLength: 2
          maxLength: 50
        lastName:
          type: string
          minLength: 2
          maxLength: 50
      description: >-
        Request body for generating a custom authentication token. Either email
        or partnerUserId is required.
    GetCustomTokenResponse:
      type: object
      properties:
        token:
          type: string
          description: Firebase authentication token
      required:
        - token
    Error:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
        details:
          type: object
          additionalProperties: true
      required:
        - code
        - message
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Authentication token (API Key) provided by Doshi. Your server's IP
        address must be whitelisted to use this API. Contact hello@doshi.app to
        whitelist your IPs.

````