Start linking a WhatsApp number by phone pairing code.
curl --request POST \
--url https://app.timelines.ai/integrations/api/whatsapp_accounts/phone_pairing \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phone": "+972501234567",
"user_id": 42
}
'import requests
url = "https://app.timelines.ai/integrations/api/whatsapp_accounts/phone_pairing"
payload = {
"phone": "+972501234567",
"user_id": 42
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({phone: '+972501234567', user_id: 42})
};
fetch('https://app.timelines.ai/integrations/api/whatsapp_accounts/phone_pairing', 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/integrations/api/whatsapp_accounts/phone_pairing",
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([
'phone' => '+972501234567',
'user_id' => 42
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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/integrations/api/whatsapp_accounts/phone_pairing"
payload := strings.NewReader("{\n \"phone\": \"+972501234567\",\n \"user_id\": 42\n}")
req, _ := http.NewRequest("POST", url, payload)
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/integrations/api/whatsapp_accounts/phone_pairing")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"phone\": \"+972501234567\",\n \"user_id\": 42\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.timelines.ai/integrations/api/whatsapp_accounts/phone_pairing")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phone\": \"+972501234567\",\n \"user_id\": 42\n}"
response = http.request(request)
puts response.read_body{
"status": "ok",
"data": {
"id": 1234,
"phone": "+972501234567",
"state": "awaiting_code",
"pairing_code": "K7Q2M9XA",
"whatsapp_account_id": "972501234567@s.whatsapp.net",
"message": ""
}
}{
"message": "<string>",
"status": "error",
"error_code": "validation_error",
"errors": [
{
"fields": [
"url"
],
"msg": "must be a valid http(s) URL"
}
]
}{
"message": "<string>",
"status": "error",
"error_code": "validation_error",
"errors": [
{
"fields": [
"url"
],
"msg": "must be a valid http(s) URL"
}
]
}{
"message": "<string>",
"status": "error",
"error_code": "validation_error",
"errors": [
{
"fields": [
"url"
],
"msg": "must be a valid http(s) URL"
}
]
}WhatsApp Accounts
Start Phone Pairing
Start linking a WhatsApp number by phone pairing code.
POST
/
whatsapp_accounts
/
phone_pairing
Start linking a WhatsApp number by phone pairing code.
curl --request POST \
--url https://app.timelines.ai/integrations/api/whatsapp_accounts/phone_pairing \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phone": "+972501234567",
"user_id": 42
}
'import requests
url = "https://app.timelines.ai/integrations/api/whatsapp_accounts/phone_pairing"
payload = {
"phone": "+972501234567",
"user_id": 42
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({phone: '+972501234567', user_id: 42})
};
fetch('https://app.timelines.ai/integrations/api/whatsapp_accounts/phone_pairing', 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/integrations/api/whatsapp_accounts/phone_pairing",
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([
'phone' => '+972501234567',
'user_id' => 42
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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/integrations/api/whatsapp_accounts/phone_pairing"
payload := strings.NewReader("{\n \"phone\": \"+972501234567\",\n \"user_id\": 42\n}")
req, _ := http.NewRequest("POST", url, payload)
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/integrations/api/whatsapp_accounts/phone_pairing")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"phone\": \"+972501234567\",\n \"user_id\": 42\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.timelines.ai/integrations/api/whatsapp_accounts/phone_pairing")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phone\": \"+972501234567\",\n \"user_id\": 42\n}"
response = http.request(request)
puts response.read_body{
"status": "ok",
"data": {
"id": 1234,
"phone": "+972501234567",
"state": "awaiting_code",
"pairing_code": "K7Q2M9XA",
"whatsapp_account_id": "972501234567@s.whatsapp.net",
"message": ""
}
}{
"message": "<string>",
"status": "error",
"error_code": "validation_error",
"errors": [
{
"fields": [
"url"
],
"msg": "must be a valid http(s) URL"
}
]
}{
"message": "<string>",
"status": "error",
"error_code": "validation_error",
"errors": [
{
"fields": [
"url"
],
"msg": "must be a valid http(s) URL"
}
]
}{
"message": "<string>",
"status": "error",
"error_code": "validation_error",
"errors": [
{
"fields": [
"url"
],
"msg": "must be a valid http(s) URL"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
The phone to link and, optionally, the member it is for.
The WhatsApp phone number to link, in international format.
Example:
"+972501234567"
The member the link is for: the integer user_id from GET /workspace/teammates, the same id as DELETE /workspace/invitations/{user_id}. Optional on a user-scoped token, required on a legacy workspace token.
Example:
42

