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

# Generate a Magic Link

> **Scopes:** `auth:create`



## OpenAPI

````yaml /api-reference/openapi.json post /v0/auth/magic-link
openapi: 3.1.0
info:
  title: Asset API
  version: '0.1'
servers:
  - url: https://api.sandbox.getasset.com
    description: Sandbox
  - url: https://api.getasset.com
    description: Production
security: []
paths:
  /v0/auth/magic-link:
    post:
      tags:
        - Authentication
      summary: Generate a Magic Link
      description: '**Scopes:** `auth:create`'
      operationId: create_magic_link_v0_auth_magic_link_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MagicLinkCreate'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MagicLinkSuccess'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not Found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Content
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Service Unavailable
      security:
        - OAuth2PasswordBearer:
            - auth:create
components:
  schemas:
    MagicLinkCreate:
      properties:
        business_id:
          anyOf:
            - type: string
              format: biz_string
            - type: 'null'
          title: Business Id
          description: >-
            The id of the business in the Asset platform. Either this or
            external_business_id must be provided.
        external_business_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Business Id
          description: >-
            The id of the business in the tenant platform. Either this or
            business_id must be provided.
        ttl:
          type: integer
          maximum: 15
          minimum: 1
          title: Ttl
          description: >-
            The tokens' time to live in minutes. Default is 5 minutes, max is
            15.
          default: 5
        session_timeout:
          type: integer
          maximum: 7948800
          minimum: 1
          title: Session Timeout
          description: >-
            The session timeout in seconds. Default is 86400 seconds (1 day),
            max is 2592000 (30 days).
          default: 86400
        email:
          type: string
          format: email
          title: Email
          description: The user email to associate with this magic link
        path:
          anyOf:
            - type: string
            - type: 'null'
          title: Path
          description: The path to append to the magic link route
          examples:
            - /reports
      type: object
      title: MagicLinkCreate
    MagicLinkSuccess:
      properties:
        data:
          $ref: '#/components/schemas/MagicLinkResponse'
      type: object
      required:
        - data
      title: MagicLinkSuccess
    ErrorResponse:
      properties:
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
          description: A description of the error
        data:
          title: Data
          description: Data associated with the error
      type: object
      required:
        - error
        - data
      title: ErrorResponse
    MagicLinkResponse:
      properties:
        magic_link:
          type: string
          title: Magic Link
        magic_link_id:
          type: string
          format: mlk_string
          title: Magic Link Id
      type: object
      required:
        - magic_link
        - magic_link_id
      title: MagicLinkResponse
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: /v0/auth/token

````