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

# Create TOTP (beta)

> Initiates a TOTP authenticator for the specified user.
## Returns

A successful response returns an `TOTP` object.



## OpenAPI

````yaml post /v1/auth/totps/create
openapi: 3.1.0
info:
  title: MoonKey Auth API
  description: >-
    Explore all the details of MoonKey Auth API. All of our APIs are RESTful and
    accept and return JSON.
  version: v1
servers:
  - url: https://api.moonkey.fun
    description: Production
    variables: {}
security:
  - Authorization: []
tags:
  - name: Users
    description: User management API
  - name: Magic Links
    description: ''
  - name: OTPs
    description: >-
      Send OTP (One-time passcodes) by all the supported delivery methods such
      as SMS, email.
  - name: OAuth
    description: ''
  - name: Wallets Login
    description: ''
  - name: Managed Wallets
    description: ''
  - name: Wallet Import
    description: >-
      Import existing wallets into the platform using secure HPKE encryption.
      This flow ensures raw entropy (seed phrases or private keys) never touches
      the server in plaintext.
externalDocs:
  url: ''
  description: ''
paths:
  /v1/auth/totps/create:
    parameters: []
    post:
      tags:
        - TOTP (Time-based one-time passcode)
      summary: Create TOTP (beta)
      description: |-
        Initiates a TOTP authenticator for the specified user.
        ## Returns

        A successful response returns an `TOTP` object.
      operationId: CreateTOTP
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTOTPRequest'
            examples:
              CreateTOTPReq:
                value:
                  user_id: user_26l7dbfAY59ftejmm6m3OTf4oz1
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                description: ''
                type: object
                properties:
                  user_id:
                    type: string
                    minLength: 1
                  secret:
                    type: string
                    minLength: 1
                  totp_id:
                    type: string
                    minLength: 1
                  recovery_codes:
                    type: array
                    items:
                      type: string
                  qr_base64:
                    type: string
                    minLength: 1
                required:
                  - user_id
                  - secret
                  - totp_id
                  - recovery_codes
                  - qr_base64
              examples:
                CreateTOTPResp:
                  value:
                    user_id: user_26l7dbfAY59ftejmm6m3OTf4oz1
                    secret: G4YD2KSD35HSDKMISNDKDB2QN7372BPT
                    totp_id: totp_27LbM1TMjS3gQN1vuzb1jn8Fshw
                    recovery_codes:
                      - xwbwb-07bjt
                      - 5jsr0-9nepk
                      - 25gj8-2lzmw
                      - sfmcz-s7o2f
                      - 5p9k1-01g2c
                      - 5p5gx-8tlvl
                      - l31kr-xwd2f
                      - cfz0j-dq8rz
                      - st3hz-xgs86
                      - drydx-is8j6
                      - 48qm5-na80k
                      - 36vyz-s6lsz
                      - umzq0-iyp0g
                      - nwrnu-68loe
                      - 797ne-vd5lm
                      - zaafh-7zdhk
                    qr_base64: >-
                      data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADIEAAAAADYoy0BAAAGcElEQVR4nOyd4YrkvA5Eey7z/q+8l1nIR7exIqnksDVwzo+FThzb24WssSWlv//8eYER//vXE4BPvn/++frSHo6sa+1vbRfdv65Hn7Nxov4yqqtENJ9o3l1+nsdCzEAQMxDEjO/3D921tMq6xkZrbeY7VJ+RrfnR9e48snEj3vvDQsxAEDMQxIzv3cXqWlxtf93v+pK1/+h6dD/zLV1fqPqSzveJhZiBIGYgiBlbH3KKbO1efUn0XLQvyHxU9YypezYV+aoTYCFmIIgZCGLGIz4k269U4x3dfU82TpXqc09EW7EQMxDEDAQxY+tD1LUxey67n/mYbqy960uyfrvtLjrfJxZiBoKYgSBmfPgQNZ9opXqmpH7Oxrt4avz1e5rG3t/BQsxAEDMQxIy/PuTUmYwa257uX6pnXuoZ11O5wjuwEDMQxAwEMePrZ72brq1h50ksOmtXvV6dnzqf6TjV515YiB8IYgaCmPGxD+nmMXVrBS/Us6luvpQa/1DP1FaUuhQsxAwEMQNBzNjuQ/672cxL6q6x3X3GqZzdiFPjT2olsRAzEMQMBDHja7feq+8ieao28al3kZza50zjPexDjEEQMxDEDCkvS/17Xt13VMev7otOv8tEzSHegYWYgSBmIIgZt+/LWussonYr2dodtYvGm4673s/6O5XzG3Hnw7AQMxDEDAQx4/Z9WWpMfFrnXfVl3XEzH6bWtWf7mc6ZGBZiBoKYg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gSBmIIgZt+9cnNb6Re2z69Xxqqi+YFoHk7EbFwsxA0HMQBAzRu/LiqjWW0zrTFSflT2fcWo+O7AQMxDEDAQx4/Y3qDKiOgq1HqM6XjcPLPJl3XhINT6j5jJzlmUIgpiBIGZs3/2eUV0zT+dXdc/cqvEXNT7TnU8EeVnGIIgZCGLGtj5kujaeiiNM67/VnNvqOJkvqvZHjaExCGIGgpghveskYxqjVt9ZcipGn8VxsvEmtYZYiBkIYgaCmPGID7l4ugawu6+onnlN61smvg4LMQNBzEAQM7Y+ZJqnFf2d381jUt9XFfVXjfVHz0f9Ze1X7r4vLMQMBDEDQczYvuukSzeXVs1jisatzmuab3Wh7nei+b2DhZiBIGYgiBnb36CCfwcWYsb/AwAA///TRJe+QRQW/QAAAABJRU5ErkJggg==
components:
  schemas:
    CreateTOTPRequest:
      description: ''
      type: object
      properties:
        user_id:
          type: string
          minLength: 1
          description: '`Required` Unique user ID to associate the TOTP with.'
        expires_in:
          type: string
          description: >-
            `Optional` Set expiration time in minutes from now for TOTP instance
            that must be verified within a given timeframe to be activated. Must
            be between 5 to 2160 minutes (36 hours), defaults to 30 minutes if
            not provided.
      required:
        - user_id
  securitySchemes:
    Authorization:
      type: http
      scheme: bearer
      description: >-
        Auth Platform API includes all the Auth related features. All Users,
        Phone Numbers, Emails, and OTPs are associated with an `App` as the
        container.


        Endpoints only accept App's `Secret API keys` other than certain
        endpoints that are used client side or via SDK that accept the
        `public_token`.


        ## Authentication using App Api Key


        ## Header:


        ```

        Authorization: Bearer {api_key}

        ```


        ## Authenticated Request


        ```curl

        curl \
          -X GET https://api.moonkey.fun/v1/auth/users/user_24wFP9pDa9YiMJLun94iKykoZs2 \
          -H "Authorization: Bearer sk_test_pRqweh3wvWmJAAVYv7Z0T5iPLzFM4ql0muoyQcjOxGeN3p1r"
        ```

````