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

# Start Passkey Registration

> Initialize a registration for webauthn credentials



## OpenAPI

````yaml openapi-passkeys post /{tenant_id}/registration/initialize
openapi: 3.1.0
info:
  version: '1.2'
  title: passkey-server
  description: >-
    This API shall represent the private and public endpoints for passkey
    registration, management and authentication
  termsOfService: https://www.hanko.io/terms
  contact:
    email: developers@hanko.io
    url: https://www.hanko.io
    name: Hanko Dev Team
  license:
    url: https://www.gnu.org/licenses/gpl-3.0.de.html
    name: GPLv3
servers:
  - url: https://passkeys.hanko.io
security: []
tags:
  - name: credentials
    description: Represents all objects which are related to WebAuthn credentials
  - name: mfa
    description: Represents all objects which are related to MFA in common
  - name: webauthn
    description: Represents all objects which are related to WebAuthn in common
  - name: audit_logs
    description: Represents all objects which are related to audit logs
paths:
  /{tenant_id}/registration/initialize:
    post:
      tags:
        - credentials
      summary: Start Passkey Registration
      description: Initialize a registration for webauthn credentials
      operationId: post-registration-initialize
      parameters:
        - $ref: '#/components/parameters/X-API-KEY'
        - $ref: '#/components/parameters/tenant_id'
      requestBody:
        $ref: '#/components/requestBodies/post-registration-initialize'
      responses:
        '200':
          $ref: '#/components/responses/post-registration-initialize'
        '400':
          $ref: '#/components/responses/error'
        '401':
          $ref: '#/components/responses/error'
        '500':
          $ref: '#/components/responses/error'
      security: []
      servers:
        - url: https://passkeys.hanko.io
components:
  parameters:
    X-API-KEY:
      name: apiKey
      in: header
      description: Secret API key
      required: true
      schema:
        type: string
        minLength: 32
    tenant_id:
      name: tenant_id
      in: path
      description: UUID of the tenant
      required: true
      schema:
        type: string
        format: uuid
        minLength: 36
        maxLength: 36
        example:
          - 1f496bcd-49da-4839-a02f-7ce681ccb488
  requestBodies:
    post-registration-initialize:
      description: ''
      content:
        application/json:
          schema:
            type: object
            properties:
              user_id:
                type: string
              username:
                type: string
                maxLength: 128
              icon:
                type: string
              display_name:
                type: string
                maxLength: 128
            required:
              - user_id
              - username
  responses:
    post-registration-initialize:
      description: Example response
      content:
        application/json:
          schema:
            type: object
            properties:
              publicKey:
                type: object
                properties:
                  rp:
                    $ref: '#/components/schemas/relying-party-entity'
                  user:
                    $ref: '#/components/schemas/public-key-user'
                  challenge:
                    type: string
                  pubKeyCredParams:
                    type: array
                    items:
                      $ref: '#/components/schemas/credential-parameter-entity'
                  timeout:
                    type: integer
                  excludeCredentials:
                    type: array
                    items:
                      $ref: '#/components/schemas/credential-descriptor-entity'
                  authenticatorSelection:
                    $ref: '#/components/schemas/authentication-selection-entity'
                  attestation:
                    type: string
                    enum:
                      - direct
                      - enterprise
                      - indirect
                      - none
                  extensions:
                    type: object
                    properties:
                      appid:
                        type: string
                      appidExclude:
                        type: string
                      credProps:
                        type: boolean
                required:
                  - rp
                  - user
                  - challenge
                  - pubKeyCredParams
            required:
              - publicKey
    error:
      description: Error Response with detailed information
      content:
        application/json:
          schema:
            type: object
            properties:
              title:
                type: string
                example:
                  - explanatory title
              details:
                type: string
                example:
                  - Information which helps resolving the problem
              status:
                type: integer
  schemas:
    relying-party-entity:
      title: relying-party-entity
      allOf:
        - type: object
          properties:
            id:
              type: string
        - $ref: '#/components/schemas/credential-entity'
    public-key-user:
      type: object
      title: public-key-user
      properties:
        id:
          type: string
        displayName:
          type: string
        name:
          type: string
      required:
        - id
        - displayName
        - name
    credential-parameter-entity:
      type: object
      title: credential-parameter-entity
      properties:
        type:
          enum:
            - public-key
        alg:
          type: integer
          format: int32
      required:
        - type
        - alg
    credential-descriptor-entity:
      type: object
      title: credential-descriptor-entity
      properties:
        type:
          enum:
            - public-key
        id:
          type: string
        transports:
          type: array
          uniqueItems: true
          items:
            type: string
            enum:
              - ble
              - hybrid
              - internal
              - nfc
              - usb
      required:
        - type
        - id
    authentication-selection-entity:
      type: object
      title: authentication-selection-entity
      properties:
        authenticatorAttachement:
          type: string
          enum:
            - cross-platform
            - platform
        requireResidentKey:
          type: boolean
          default: false
        residentKey:
          type: string
          enum:
            - discouraged
            - preferred
            - required
        userVerification:
          type: string
          enum:
            - discouraged
            - preferred
            - required
    credential-entity:
      type: object
      title: credential-entity
      properties:
        name:
          type: string
      required:
        - name

````