Magic Link
curl --request POST \
--url https://api.example.com/external/v1/applications/magic-link/import requests
url = "https://api.example.com/external/v1/applications/magic-link/"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/external/v1/applications/magic-link/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/external/v1/applications/magic-link/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/external/v1/applications/magic-link/"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/external/v1/applications/magic-link/")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/external/v1/applications/magic-link/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyMagic Link
Generate a magic login link for an applicant
POST
/
external
/
v1
/
applications
/
magic-link
/
Magic Link
curl --request POST \
--url https://api.example.com/external/v1/applications/magic-link/import requests
url = "https://api.example.com/external/v1/applications/magic-link/"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/external/v1/applications/magic-link/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/external/v1/applications/magic-link/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/external/v1/applications/magic-link/"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/external/v1/applications/magic-link/")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/external/v1/applications/magic-link/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyGenerate Magic Login Link
Generate a magic login link for an applicant. When the applicant clicks the link, an application will be created (or found if exists) and they will be logged in automatically.Endpoint
POST /external/v1/applications/magic-link/
Authentication
[!NOTE] Requires a valid company API key in theAuthorizationheader (format:Api-Key <key>).
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
email | string (email) | Yes | The email address of the applicant |
hiring_flow_id | string (UUID) | Conditional | The ID of the hiring flow (required if hiring_flow_slug not provided) |
hiring_flow_slug | string | Conditional | The slug of the hiring flow (required if hiring_flow_id not provided) |
full_name | string | No | The full name of the applicant |
phone_number | string | No | The phone number of the applicant |
application_data | object | No | Form submission data to pre-fill in the application |
page_or_stage_id | string (UUID) | No | Stage/page ID to move the application to after creation |
stage_reason_id | string (UUID) | No | Reason ID for the stage transition |
expiry_duration_in_seconds | integer | No | Duration in seconds until the magic link expires. Defaults to 86400 (1 day) |
Example Request
curl -X POST "https://api.firstwork.com/external/v1/applications/magic-link/" \
-H "Authorization: Api-Key YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "john.doe@example.com",
"hiring_flow_id": "550e8400-e29b-41d4-a716-446655440000",
"full_name": "John Doe",
"phone_number": "+1234567890",
"expiry_duration_in_seconds": 172800
}'
Responses
200: OK
Successfully generated magic login link.400: Bad Request
Missing required fields or invalid hiring flow.500: Internal Server Error
Internal server error occurred while generating the magic link.Notes
- Magic links expire after the configured duration (default: 24 hours)
- The link logs the user in and redirects to their application
- If the candidate already has an application in the flow, the existing application is used
- Useful for sending in SMS or email notifications