---
descriptions:
  magic_auth:
    self: 'The corresponding [Magic Auth](/reference/authkit/magic-auth) object.'
    object: Distinguishes the Magic Auth object.
    id: The unique ID of the Magic Auth code.
    user_id: The unique ID of the user.
    email: The email address of the user.
    expires_at: The timestamp when the Magic Auth code expires.
    code: The code used to verify the Magic Auth code.
    created_at: The timestamp when the Magic Auth code was created.
    updated_at: The timestamp when the Magic Auth code was last updated.
reference:
  curl:
    - url: /reference/authkit/magic-auth
      key: magic_auth
      id: magic_auth
      title: magic_auth
      properties:
        - key: id
          type: string
          description: (magic_auth.id)
        - key: user_id
          type: string
          description: (magic_auth.user_id)
        - key: email
          type: string
          description: (magic_auth.email)
        - key: expires_at
          type: string
          description: (magic_auth.expires_at)
        - key: code
          type: string
          description: (magic_auth.code)
        - key: created_at
          type: string
          description: (magic_auth.created_at)
        - key: updated_at
          type: string
          description: (magic_auth.updated_at)
  js:
    - url: /reference/authkit/magic-auth
      key: MagicAuth
      id: magic_auth
      title: interface MagicAuth
      properties:
        - key: object
          type: '"magic_auth"'
          description: (magic_auth.object)
        - key: id
          type: string
          description: (magic_auth.id)
        - key: userId
          type: string
          description: (magic_auth.user_id)
        - key: email
          type: string
          description: (magic_auth.email)
        - key: expiresAt
          type: string
          description: (magic_auth.expires_at)
        - key: code
          type: string
          description: (magic_auth.code)
        - key: createdAt
          type: string
          description: (magic_auth.created_at)
        - key: updatedAt
          type: string
          description: (magic_auth.updated_at)
  go:
    - url: /reference/authkit/magic-auth
      key: MagicAuth
      id: magic_auth
      title: usermanagement.MagicAuth
      properties:
        - key: ID
          type: string
          description: (magic_auth.id)
        - key: UserId
          type: string
          description: (magic_auth.user_id)
        - key: Email
          type: string
          description: (magic_auth.email)
        - key: ExpiresAt
          type: string
          description: (magic_auth.expires_at)
        - key: Code
          type: string
          description: (magic_auth.code)
        - key: CreatedAt
          type: string
          description: (magic_auth.created_at)
        - key: UpdatedAt
          type: string
          description: (magic_auth.updated_at)
  php:
    - url: /reference/authkit/magic-auth
      key: MagicAuth
      id: magic_auth
      title: WorkOS\Resource\MagicAuth
      properties:
        - key: object
          type: '"magic_auth"'
          description: (magic_auth.object)
        - key: id
          type: string
          description: (magic_auth.id)
        - key: userId
          type: string
          description: (magic_auth.user_id)
        - key: email
          type: string
          description: (magic_auth.email)
        - key: expiresAt
          type: string
          description: (magic_auth.expires_at)
        - key: code
          type: string
          description: (magic_auth.code)
        - key: createdAt
          type: string
          description: (magic_auth.created_at)
        - key: updatedAt
          type: string
          description: (magic_auth.updated_at)
  python:
    - url: /reference/authkit/magic-auth
      key: MagicAuth
      id: magic_auth
      title: MagicAuth
      properties:
        - key: id
          type: str
          description: (magic_auth.id)
        - key: user_id
          type: str
          description: (magic_auth.user_id)
        - key: email
          type: str
          description: (magic_auth.email)
        - key: expires_at
          type: str
          description: (magic_auth.expires_at)
        - key: code
          type: str
          description: (magic_auth.code)
        - key: created_at
          type: str
          description: (magic_auth.created_at)
        - key: updated_at
          type: str
          description: (magic_auth.updated_at)
  ruby:
    - url: /reference/authkit/magic-auth
      key: MagicAuth
      id: magic_auth
      title: class MagicAuth
      properties:
        - key: id
          type: String
          description: (magic_auth.id)
        - key: user_id
          type: String
          description: (magic_auth.user_id)
        - key: email
          type: String
          description: (magic_auth.email)
        - key: expires_at
          type: String
          description: (magic_auth.expires_at)
        - key: code
          type: String
          description: (magic_auth.code)
        - key: created_at
          type: String
          description: (magic_auth.created_at)
        - key: updated_at
          type: String
          description: (magic_auth.updated_at)
  java:
    - url: /reference/authkit/magic-auth
      key: MagicAuth
      id: magic_auth
      title: class MagicAuth
      properties:
        - key: id
          type: String
          description: (magic_auth.id)
        - key: userId
          type: String
          description: (magic_auth.user_id)
        - key: email
          type: String
          description: (magic_auth.email)
        - key: expiresAt
          type: String
          description: (magic_auth.expires_at)
        - key: code
          type: String
          description: (magic_auth.code)
        - key: createdAt
          type: String
          description: (magic_auth.created_at)
        - key: updatedAt
          type: String
          description: (magic_auth.updated_at)
originalPath: .tmp-workos-clone/packages/docs/content/reference/authkit/magic-auth/index.mdx
---

# Magic Auth

Magic Auth is a passwordless authentication method that allows users to sign in or sign up via a unique, six digit one-time-use code sent to their email inbox. To verify the code, [authenticate the user with Magic Auth](/reference/authkit/authentication/magic-auth).

<CodeBlock
  title="Example Magic Auth"
  referenceId="magic_auth"
  file="magic-auth"
/>
