> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.itspropel.com/llms.txt.
> For full documentation content, see https://docs.itspropel.com/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.itspropel.com/_mcp/server.

# Magic Link Exchange

POST https://auth/magic-link
Content-Type: multipart/form-data

Reference: https://docs.itspropel.com/propel-biz/01-auth/magic-link-exchange

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: PropelBiz
  version: 1.0.0
paths:
  /auth/magic-link:
    post:
      operationId: magic-link-exchange
      summary: Magic Link Exchange
      tags:
        - subpackage_01Auth
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/01 Auth_Magic Link Exchange_Response_200'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PostAuthMagic-linkRequestUnprocessableEntityError
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                lt:
                  type: string
                  description: >-
                    Required: The single-use signed magic-link token extracted
                    from the `lt` query param on a CTA URL (e.g.
                    https://app.itspropel.com/cta?...&lt=eyJ...). Single-use,
                    15-min TTL from email send. Any failure mode (expired,
                    tampered, replayed, user-gone) returns the same generic 422
                    — do not try to distinguish.
                device_name:
                  type: string
                  description: >-
                    Optional: Label for the issued Sanctum token (shows in
                    /auth/session device list). Defaults to "magic-link" if
                    omitted.
              required:
                - lt
                - device_name
servers:
  - url: https:/
components:
  schemas:
    AuthMagicLinkPostResponsesContentApplicationJsonSchemaDataAttributes:
      type: object
      properties:
        created_at:
          type: string
          format: date-time
        expires_at:
          description: Any type
        token_type:
          type: string
        device_name:
          type: string
        access_token:
          type: string
      required:
        - created_at
        - token_type
        - device_name
        - access_token
      title: AuthMagicLinkPostResponsesContentApplicationJsonSchemaDataAttributes
    AuthMagicLinkPostResponsesContentApplicationJsonSchemaDataRelationshipsUserData:
      type: object
      properties:
        id:
          type: string
          format: uuid
        type:
          type: string
      required:
        - id
        - type
      title: >-
        AuthMagicLinkPostResponsesContentApplicationJsonSchemaDataRelationshipsUserData
    AuthMagicLinkPostResponsesContentApplicationJsonSchemaDataRelationshipsUser:
      type: object
      properties:
        data:
          $ref: >-
            #/components/schemas/AuthMagicLinkPostResponsesContentApplicationJsonSchemaDataRelationshipsUserData
      required:
        - data
      title: >-
        AuthMagicLinkPostResponsesContentApplicationJsonSchemaDataRelationshipsUser
    AuthMagicLinkPostResponsesContentApplicationJsonSchemaDataRelationships:
      type: object
      properties:
        user:
          $ref: >-
            #/components/schemas/AuthMagicLinkPostResponsesContentApplicationJsonSchemaDataRelationshipsUser
      required:
        - user
      title: AuthMagicLinkPostResponsesContentApplicationJsonSchemaDataRelationships
    AuthMagicLinkPostResponsesContentApplicationJsonSchemaData:
      type: object
      properties:
        id:
          type: string
          format: uuid
        type:
          type: string
        attributes:
          $ref: >-
            #/components/schemas/AuthMagicLinkPostResponsesContentApplicationJsonSchemaDataAttributes
        relationships:
          $ref: >-
            #/components/schemas/AuthMagicLinkPostResponsesContentApplicationJsonSchemaDataRelationships
      required:
        - id
        - type
        - attributes
        - relationships
      title: AuthMagicLinkPostResponsesContentApplicationJsonSchemaData
    AuthMagicLinkPostResponsesContentApplicationJsonSchemaIncludedItemsAttributes:
      type: object
      properties:
        email:
          type: string
          format: email
        phone:
          description: Any type
        avatar:
          description: Any type
        last_name:
          description: Any type
        created_at:
          type: string
          format: date-time
        first_name:
          type: string
        updated_at:
          type: string
          format: date-time
      required:
        - email
        - created_at
        - first_name
        - updated_at
      title: >-
        AuthMagicLinkPostResponsesContentApplicationJsonSchemaIncludedItemsAttributes
    AuthMagicLinkPostResponsesContentApplicationJsonSchemaIncludedItems:
      type: object
      properties:
        id:
          type: string
          format: uuid
        type:
          type: string
        attributes:
          $ref: >-
            #/components/schemas/AuthMagicLinkPostResponsesContentApplicationJsonSchemaIncludedItemsAttributes
      required:
        - id
        - type
        - attributes
      title: AuthMagicLinkPostResponsesContentApplicationJsonSchemaIncludedItems
    01 Auth_Magic Link Exchange_Response_200:
      type: object
      properties:
        data:
          $ref: >-
            #/components/schemas/AuthMagicLinkPostResponsesContentApplicationJsonSchemaData
        included:
          type: array
          items:
            $ref: >-
              #/components/schemas/AuthMagicLinkPostResponsesContentApplicationJsonSchemaIncludedItems
      required:
        - data
        - included
      title: 01 Auth_Magic Link Exchange_Response_200
    AuthMagicLinkPostResponsesContentApplicationJsonSchemaErrorsItemsSource:
      type: object
      properties:
        pointer:
          type: string
      required:
        - pointer
      title: AuthMagicLinkPostResponsesContentApplicationJsonSchemaErrorsItemsSource
    AuthMagicLinkPostResponsesContentApplicationJsonSchemaErrorsItems:
      type: object
      properties:
        title:
          type: string
        detail:
          type: string
        source:
          $ref: >-
            #/components/schemas/AuthMagicLinkPostResponsesContentApplicationJsonSchemaErrorsItemsSource
        status:
          type: string
      required:
        - title
        - detail
        - source
        - status
      title: AuthMagicLinkPostResponsesContentApplicationJsonSchemaErrorsItems
    PostAuthMagic-linkRequestUnprocessableEntityError:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: >-
              #/components/schemas/AuthMagicLinkPostResponsesContentApplicationJsonSchemaErrorsItems
      required:
        - errors
      title: PostAuthMagic-linkRequestUnprocessableEntityError

```

## SDK Code Examples

```python 01 Auth_Magic Link Exchange_example
import requests

url = "https://https/auth/magic-link"

payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"lt\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"device_name\"\r\n\r\nstring\r\n-----011000010111000001101001--\r\n"
headers = {"Content-Type": "multipart/form-data; boundary=---011000010111000001101001"}

response = requests.post(url, data=payload, headers=headers)

print(response.json())
```

```javascript 01 Auth_Magic Link Exchange_example
const url = 'https://https/auth/magic-link';
const form = new FormData();
form.append('lt', 'string');
form.append('device_name', 'string');

const options = {method: 'POST'};

options.body = form;

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go 01 Auth_Magic Link Exchange_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://https/auth/magic-link"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"lt\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"device_name\"\r\n\r\nstring\r\n-----011000010111000001101001--\r\n")

	req, _ := http.NewRequest("POST", url, payload)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby 01 Auth_Magic Link Exchange_example
require 'uri'
require 'net/http'

url = URI("https://https/auth/magic-link")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"lt\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"device_name\"\r\n\r\nstring\r\n-----011000010111000001101001--\r\n"

response = http.request(request)
puts response.read_body
```

```java 01 Auth_Magic Link Exchange_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://https/auth/magic-link")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"lt\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"device_name\"\r\n\r\nstring\r\n-----011000010111000001101001--\r\n")
  .asString();
```

```php 01 Auth_Magic Link Exchange_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://https/auth/magic-link', [
  'multipart' => [
    [
        'name' => 'lt',
        'contents' => 'string'
    ],
    [
        'name' => 'device_name',
        'contents' => 'string'
    ]
  ]
]);

echo $response->getBody();
```

```csharp 01 Auth_Magic Link Exchange_example
using RestSharp;

var client = new RestClient("https://https/auth/magic-link");
var request = new RestRequest(Method.POST);
request.AddParameter("undefined", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"lt\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"device_name\"\r\n\r\nstring\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift 01 Auth_Magic Link Exchange_example
import Foundation
let parameters = [
  [
    "name": "lt",
    "value": "string"
  ],
  [
    "name": "device_name",
    "value": "string"
  ]
]

let boundary = "---011000010111000001101001"

var body = ""
var error: NSError? = nil
for param in parameters {
  let paramName = param["name"]!
  body += "--\(boundary)\r\n"
  body += "Content-Disposition:form-data; name=\"\(paramName)\""
  if let filename = param["fileName"] {
    let contentType = param["content-type"]!
    let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8)
    if (error != nil) {
      print(error as Any)
    }
    body += "; filename=\"\(filename)\"\r\n"
    body += "Content-Type: \(contentType)\r\n\r\n"
    body += fileContent
  } else if let paramValue = param["value"] {
    body += "\r\n\r\n\(paramValue)"
  }
}

let request = NSMutableURLRequest(url: NSURL(string: "https://https/auth/magic-link")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```