curl --request POST \
--url https://api.polymorfa.com/api/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"projectId": "<string>",
"sessionId": "<string>",
"name": "<string>",
"start": true,
"testMode": true,
"config": {}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
projectId: '<string>',
sessionId: '<string>',
name: '<string>',
start: true,
testMode: true,
config: {}
})
};
fetch('https://api.polymorfa.com/api/sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.polymorfa.com/api/sessions"
payload = {
"projectId": "<string>",
"sessionId": "<string>",
"name": "<string>",
"start": True,
"testMode": True,
"config": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.polymorfa.com/api/sessions"
payload := strings.NewReader("{\n \"projectId\": \"<string>\",\n \"sessionId\": \"<string>\",\n \"name\": \"<string>\",\n \"start\": true,\n \"testMode\": true,\n \"config\": {}\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))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.polymorfa.com/api/sessions",
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([
'projectId' => '<string>',
'sessionId' => '<string>',
'name' => '<string>',
'start' => true,
'testMode' => true,
'config' => [
]
]),
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;
}{
"success": true,
"data": {
"name": "<string>",
"tenantId": "<string>",
"connection": "linked_device",
"testMode": true,
"status": "<string>",
"config": {},
"createdAt": "<string>",
"updatedAt": "<string>",
"sessionId": "<string>",
"statusReason": "<string>",
"runnerId": "<string>",
"proxy": "<string>"
}
}{
"error": "<string>",
"docs": "<string>"
}{
"error": "<string>",
"docs": "<string>"
}{
"error": "<string>",
"docs": "<string>"
}{
"error": "<string>",
"docs": "<string>"
}{
"success": true,
"message": "<string>"
}{
"error": "<string>",
"docs": "<string>"
}Create a new session
curl --request POST \
--url https://api.polymorfa.com/api/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"projectId": "<string>",
"sessionId": "<string>",
"name": "<string>",
"start": true,
"testMode": true,
"config": {}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
projectId: '<string>',
sessionId: '<string>',
name: '<string>',
start: true,
testMode: true,
config: {}
})
};
fetch('https://api.polymorfa.com/api/sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.polymorfa.com/api/sessions"
payload = {
"projectId": "<string>",
"sessionId": "<string>",
"name": "<string>",
"start": True,
"testMode": True,
"config": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.polymorfa.com/api/sessions"
payload := strings.NewReader("{\n \"projectId\": \"<string>\",\n \"sessionId\": \"<string>\",\n \"name\": \"<string>\",\n \"start\": true,\n \"testMode\": true,\n \"config\": {}\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))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.polymorfa.com/api/sessions",
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([
'projectId' => '<string>',
'sessionId' => '<string>',
'name' => '<string>',
'start' => true,
'testMode' => true,
'config' => [
]
]),
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;
}{
"success": true,
"data": {
"name": "<string>",
"tenantId": "<string>",
"connection": "linked_device",
"testMode": true,
"status": "<string>",
"config": {},
"createdAt": "<string>",
"updatedAt": "<string>",
"sessionId": "<string>",
"statusReason": "<string>",
"runnerId": "<string>",
"proxy": "<string>"
}
}{
"error": "<string>",
"docs": "<string>"
}{
"error": "<string>",
"docs": "<string>"
}{
"error": "<string>",
"docs": "<string>"
}{
"error": "<string>",
"docs": "<string>"
}{
"success": true,
"message": "<string>"
}{
"error": "<string>",
"docs": "<string>"
}Authorizations
Polymorfa organization key (titan_ prefix), project token (titan_pt_ prefix), or client token (titan_ct_ prefix), where the operation permits that audience.
Body
Project id the session belongs to. Required.
1Canonical per-org session identifier (1-64 alphanumeric chars, dots, hyphens, underscores). Caller-supplied or generated; returned in the response. This is the id used in all /api/sessions/{session}/* paths.
1Optional human-friendly label for the session. Not an id.
1How the session connects to WhatsApp. 'linked_device' (default) pairs as a WhatsApp linked device; 'cloud_api' uses the Meta Cloud API and requires the cloudApi creds block. Immutable after create.
linked_device, cloud_api Create a simulated testing number (behaves like a real session via the simulated universe). Defaults to false.
Linked-device privacy mode. Defaults to 'magic'. 'magic' — Polymorfa holds the Signal session; full message visibility. 'passthrough' — Polymorfa holds noise creds only; neither messages nor app state are decryptable on Polymorfa's side. 'passthrough_plus' — the customer has uploaded AppStateSyncKeys for selected collections (contacts, labels, mute/archive, blocklist), so Polymorfa sees metadata mutations but never message content.
magic, passthrough, passthrough_plus Meta credentials. Required when connection='cloud_api'. Encrypted at rest before storage.
Show child attributes
Show child attributes
Show child attributes
Show child attributes