curl --request POST \
--url https://app.timelines.ai/partner/api/v1/workspaces/{workspace_id}/users/{user_id}/qr \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-TL-Partner-Id: <x-tl-partner-id>' \
--data '
{
"expires_in_hours": 24
}
'import requests
url = "https://app.timelines.ai/partner/api/v1/workspaces/{workspace_id}/users/{user_id}/qr"
payload = { "expires_in_hours": 24 }
headers = {
"X-TL-Partner-Id": "<x-tl-partner-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-TL-Partner-Id': '<x-tl-partner-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({expires_in_hours: 24})
};
fetch('https://app.timelines.ai/partner/api/v1/workspaces/{workspace_id}/users/{user_id}/qr', 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://app.timelines.ai/partner/api/v1/workspaces/{workspace_id}/users/{user_id}/qr",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'expires_in_hours' => 24
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-TL-Partner-Id: <x-tl-partner-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.timelines.ai/partner/api/v1/workspaces/{workspace_id}/users/{user_id}/qr"
payload := strings.NewReader("{\n \"expires_in_hours\": 24\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-TL-Partner-Id", "<x-tl-partner-id>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.timelines.ai/partner/api/v1/workspaces/{workspace_id}/users/{user_id}/qr")
.header("X-TL-Partner-Id", "<x-tl-partner-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expires_in_hours\": 24\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.timelines.ai/partner/api/v1/workspaces/{workspace_id}/users/{user_id}/qr")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-TL-Partner-Id"] = '<x-tl-partner-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expires_in_hours\": 24\n}"
response = http.request(request)
puts response.read_body{
"workspace_id": "my-first-workspace",
"user_id": 42,
"qr_link": "<string>",
"expires_at": "2024-01-01T12:00:00Z",
"whatsapp_disconnected": true,
"previous_qr_revoked": true
}{
"error": "<string>",
"status": 123,
"description": "<string>"
}Generate QR code for user
Issues a long-lived WhatsApp QR-code link for a specific user in a partner-managed workspace. If the user already has a connected WhatsApp account, that account is disconnected first and the previous QR link (if any) is revoked. Only one active QR link per user is allowed at any given time; generating a new link invalidates any existing one. The request optionally accepts expires_in_hours (1–168, default 24) to control how long the QR link remains valid. The response includes the workspace_id, user_id, an unguessable qr_link URL, its expires_at timestamp, and flags indicating whether an existing WhatsApp account was disconnected and whether a previously active QR link was revoked. Generating a new QR code link is a destructive action: any currently connected WhatsApp account for this user will be forcibly disconnected.
curl --request POST \
--url https://app.timelines.ai/partner/api/v1/workspaces/{workspace_id}/users/{user_id}/qr \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-TL-Partner-Id: <x-tl-partner-id>' \
--data '
{
"expires_in_hours": 24
}
'import requests
url = "https://app.timelines.ai/partner/api/v1/workspaces/{workspace_id}/users/{user_id}/qr"
payload = { "expires_in_hours": 24 }
headers = {
"X-TL-Partner-Id": "<x-tl-partner-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-TL-Partner-Id': '<x-tl-partner-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({expires_in_hours: 24})
};
fetch('https://app.timelines.ai/partner/api/v1/workspaces/{workspace_id}/users/{user_id}/qr', 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://app.timelines.ai/partner/api/v1/workspaces/{workspace_id}/users/{user_id}/qr",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'expires_in_hours' => 24
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-TL-Partner-Id: <x-tl-partner-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.timelines.ai/partner/api/v1/workspaces/{workspace_id}/users/{user_id}/qr"
payload := strings.NewReader("{\n \"expires_in_hours\": 24\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-TL-Partner-Id", "<x-tl-partner-id>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.timelines.ai/partner/api/v1/workspaces/{workspace_id}/users/{user_id}/qr")
.header("X-TL-Partner-Id", "<x-tl-partner-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expires_in_hours\": 24\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.timelines.ai/partner/api/v1/workspaces/{workspace_id}/users/{user_id}/qr")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-TL-Partner-Id"] = '<x-tl-partner-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expires_in_hours\": 24\n}"
response = http.request(request)
puts response.read_body{
"workspace_id": "my-first-workspace",
"user_id": 42,
"qr_link": "<string>",
"expires_at": "2024-01-01T12:00:00Z",
"whatsapp_disconnected": true,
"previous_qr_revoked": true
}{
"error": "<string>",
"status": 123,
"description": "<string>"
}Authorizations
Path Parameters
Body
QR code link generation request payload
Request payload for configuring the lifetime of a WhatsApp QR link. The optional expires_in_hours field controls how long the issued qr_link remains valid. If omitted, a sensible default (24 hours) is applied by the server.
Response
QR code generated
Response payload returned when issuing a WhatsApp QR link for a user. Includes the workspace_id and user_id, the unguessable qr_link URL, its expires_at timestamp, and boolean flags showing whether an existing WhatsApp account was disconnected and whether any previously issued QR link for this user was revoked.

