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

# Create Magic Link

> Create a Magic Link to allow users to connect their integrations via a temporary link.



## OpenAPI

````yaml post /magic-links
openapi: 3.1.0
info:
  description: >

    Trackstar is a Unified API that provides standard endpoints for Supply Chain
    Logistics. We currently offer an API for Warehouse Management Systems (WMS).
  title: Trackstar API
  version: 0.1.0
servers:
  - description: Trackstar API
    url: https://production.trackstarhq.com
security: []
tags: []
externalDocs:
  description: Trackstar API Documentation
  url: https://docs.trackstarhq.com
paths:
  /magic-links:
    post:
      tags:
        - Auth
      summary: Create Magic Link
      description: >-
        Create a Magic Link to allow users to connect their integrations via a
        temporary link.
      operationId: post_create_magic_link_external
      parameters:
        - in: header
          name: x-trackstar-api-key
          description: Your organization-level Trackstar API key.
          schema:
            type: string
            example: <x-trackstar-api-key>
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MagicLinkInputSchema'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MagicLinkResponseSchema'
          description: Successful response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
          description: Validation error
components:
  schemas:
    MagicLinkInputSchema:
      type: object
      properties:
        connection_id:
          type:
            - string
            - 'null'
          description: >-
            An optional existing connection ID. If provided, the connection is
            reinstalled instead of a new connection being created.
        integration_allow_list:
          type: array
          default: []
          description: >-
            Integrations that your users will be allowed to install. Mutually
            exclusive with `integration_block_list` and
            `integrations_with_endpoints`.
          example:
            - shipbob
          items:
            type: string
            description: ''
        integration_block_list:
          type: array
          default: []
          description: >-
            Integrations that your users will not be allowed to install.
            Mutually exclusive with `integration_allow_list`.
          example:
            - shipbob
          items:
            type: string
            description: ''
        integrations_with_endpoints:
          type: array
          default: []
          description: >-
            Only show integrations that support these endpoints. Mutually
            exclusive with `integration_allow_list`.
          example:
            - get_inventory
            - get_products
            - create_order
          items:
            type: string
            description: ''
        integration_type:
          type: string
          default: wms
          enum:
            - wms
            - freight
            - cart
            - carrier
            - erp
          description: The type of integration to filter by.
        link_duration:
          type: integer
          default: 7
          description: The number of days you want this magic link to be active.
          example: 7
        customer_id:
          type:
            - string
            - 'null'
          description: An identifier for your end customer.
          example: customer_id
      additionalProperties: false
      title: MagicLinkInputSchema
    MagicLinkResponseSchema:
      type: object
      properties:
        magic_link:
          $ref: '#/components/schemas/MagicLink'
      required:
        - magic_link
      additionalProperties: false
      title: MagicLinkResponseSchema
    ValidationError:
      properties:
        error:
          type: string
        detail:
          type: object
          properties:
            <location>:
              type: object
              properties:
                <field_name>:
                  type: array
                  items:
                    type: string
      required:
        - error
      type: object
      title: ValidationError
    MagicLink:
      type: object
      properties:
        id:
          type: string
          description: The magic link ID
          example: c0a4fef52f664ecf9e766c16811c3289
        url:
          type: string
          description: The full Magic Link URL to share with your customer
          example: https://link.trackstarhq.com/c0a4fef52f664ecf9e766c16811c3289
        expires_at:
          type: string
          description: ISO 8601 timestamp when link expires
          example: '2025-09-17T15:01:41Z'
        integration_type:
          type: string
          enum:
            - wms
            - freight
            - cart
            - carrier
            - erp
          description: Type of integration
          example: wms
        integration_allow_list:
          type: array
          description: Allowed integrations
          example:
            - shipbob
          items:
            type: string
            description: ''
        integration_block_list:
          type: array
          description: Blocked integrations
          example:
            - extensiv-3pl-central
          items:
            type: string
            description: ''
        integrations_with_endpoints:
          type: array
          description: Integrations with specific endpoints
          example:
            - get_inventory
          items:
            type: string
            description: ''
        customer_id:
          type:
            - string
            - 'null'
          description: Customer identifier
          example: customer-123
      required:
        - customer_id
        - expires_at
        - id
        - integration_allow_list
        - integration_block_list
        - integration_type
        - integrations_with_endpoints
        - url
      additionalProperties: false
      title: MagicLink

````