> ## 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 WebAuthn Registration (beta)

> Verify a signed WebAuthn registration request for the specified user ID and complete and create the WebAuthn registration. This is usually returned by [navigator.credentials.create(options)](https://w3c.github.io/webappsec-credential-management/#algorithm-create-cred) or [webauthn-json](https://github.com/github/webauthn-json) library. If you are using the `webauthn-json` library, pass in the response from `const response = await create(options);` in `public_key_credential`.
## Returns

A successful response returns an `user_id` property and `webauthn_credential_id` property.



## OpenAPI

````yaml post /v1/auth/webauthn/registrations/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/webauthn/registrations/create:
    parameters: []
    post:
      tags:
        - WebAuthn
      summary: Create WebAuthn Registration (beta)
      description: >-
        Verify a signed WebAuthn registration request for the specified user ID
        and complete and create the WebAuthn registration. This is usually
        returned by
        [navigator.credentials.create(options)](https://w3c.github.io/webappsec-credential-management/#algorithm-create-cred)
        or [webauthn-json](https://github.com/github/webauthn-json) library. If
        you are using the `webauthn-json` library, pass in the response from
        `const response = await create(options);` in `public_key_credential`.

        ## Returns


        A successful response returns an `user_id` property and
        `webauthn_credential_id` property.
      operationId: CreateWebAuthnRegistration
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWebAuthnRegistrationRequest'
            examples:
              CreateWebAuthnRegistrationReq:
                value:
                  public_key_credential:
                    type: public-key
                    id: >-
                      Aex6qH_dUebV6v43lypXMBWzi8Okem5kik0iL9IYAX3ixRcBrCqIiJR3lhzK2rnAV0jY9IcWQe3sGEeP9vLm6J_lzs9JwRMpZ2pa8aT8db6YiQFeOg
                    rawId: >-
                      Aex6qH_dUebV6v43lypXMBWzi8Okem5kik0iL9IYAX3ixRcBrCqIiJR3lhzK2rnAV0jY9IcWQe3sGEeP9vLm6J_lzs9JwRMpZ2pa8aT8db6YiQFeOg
                    response:
                      clientDataJSON: >-
                        eyJ0eXBlIjoid2ViYXV0aG4uY3JlYXRlIiwiY2hhbGxlbmdlIjoiczUtMXNsNjVHZGhpdmlXNFl6V3QzVEtIaVdwTkgtN1VFMFZOMVVjdlJBayIsIm9yaWdpbiI6Imh0dHA6Ly9sb2NhbGhvc3Q6MTIzNCIsImNyb3NzT3JpZ2luIjpmYWxzZX0
                      attestationObject: >-
                        o2NmbXRkbm9uZWdhdHRTdG10oGhhdXRoRGF0YVjZSZYN5YgOjGh0NBcPZHZgW4_krrmihjLHmVzzuoMdl2NFYccF7K3OAAI1vMYKZIsLJfHwVQMAVQHseqh_3VHm1er-N5cqVzAVs4vDpHpuZIpNIi_SGAF94sUXAawqiIiUd5Ycytq5wFdI2PSHFkHt7BhHj_by5uif5c7PScETKWdqWvGk_HW-mIkBXjqlAQIDJiABIVgg0SIINWeg85kEAAbo7sc6VK3TlRcpnG-A773q6o2NQzkiWCBv_QKpoNh2O2tGyR6qtClGW7B2o10xYiBaWCbo-xdnpA
                    clientExtensionResults: {}
                  user_id: user_24wFP9pDa9YiMJLun94iKykoZs2
        description: ''
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                description: ''
                type: object
                properties:
                  user_id:
                    type: string
                    minLength: 1
                  webauthn_credential_id:
                    type: string
                    minLength: 1
                required:
                  - user_id
                  - webauthn_credential_id
              examples:
                CreateWebAuthnRegistrationResp:
                  value:
                    user_id: user_26l7dbfAY59ftejmm6m3OTf4oz1
                    webauthn_credential_id: webauthn_28AdsbHW3wTDHNpywVZnhxxogKQ
components:
  schemas:
    CreateWebAuthnRegistrationRequest:
      description: ''
      type: object
      properties:
        public_key_credential:
          type: object
          required:
            - type
            - id
            - rawId
            - response
            - clientExtensionResults
          description: >-
            `Required` The signed public key credential for the WebAuthn
            registration. This object is usually returned by
            `navigator.credentials.create()`.
          properties:
            type:
              type: string
              minLength: 1
            id:
              type: string
              minLength: 1
            rawId:
              type: string
              minLength: 1
            response:
              type: object
              required:
                - clientDataJSON
                - attestationObject
              properties:
                clientDataJSON:
                  type: string
                  minLength: 1
                attestationObject:
                  type: string
                  minLength: 1
            clientExtensionResults:
              type: object
        user_id:
          type: string
          minLength: 1
          description: >-
            `Required` User ID of the user to attach this WebAuthn registration
            to.
      required:
        - public_key_credential
        - 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"
        ```

````