Start the session
curl --request POST \
--url https://{host}/api/sessions/{session}/start \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '{}'import requests
url = "https://{host}/api/sessions/{session}/start"
payload = {}
headers = {
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://{host}/api/sessions/{session}/start', 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://{host}/api/sessions/{session}/start",
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([
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <api-key>"
],
]);
$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://{host}/api/sessions/{session}/start"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apikey", "<api-key>")
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://{host}/api/sessions/{session}/start")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/sessions/{session}/start")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Session started successfully",
"session": "my-session"
}
Sessions
Start Session
Start a new WhatsApp session
POST
/
api
/
sessions
/
{session}
/
start
Start the session
curl --request POST \
--url https://{host}/api/sessions/{session}/start \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '{}'import requests
url = "https://{host}/api/sessions/{session}/start"
payload = {}
headers = {
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://{host}/api/sessions/{session}/start', 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://{host}/api/sessions/{session}/start",
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([
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <api-key>"
],
]);
$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://{host}/api/sessions/{session}/start"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apikey", "<api-key>")
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://{host}/api/sessions/{session}/start")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/sessions/{session}/start")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Session started successfully",
"session": "my-session"
}
Description
This endpoint initializes a new WhatsApp session. After starting the session, you will need to authenticate it using the QR Code or pairing code. You can provide custom configurations for the session storage and logs.URL Parameters
Body
{
"config": {
"store": {
"dialect": "sqlite3",
"address": "/app/data/whatsmeow.db"
},
"log": {
"level": "INFO"
}
}
}
Body Parameters
| Property | Type | Required | Description |
|---|---|---|---|
config | object | ❌ No | Optional session configurations |
config.store | object | ❌ No | Session storage configurations |
config.store.dialect | string | ❌ No | Database type (default: “sqlite3”) |
config.store.address | string | ❌ No | Database file path (default: “/app/data/whatsmeow.db”) |
config.log | object | ❌ No | Session log configurations |
config.log.level | string | ❌ No | Log level: “DEBUG”, “INFO”, “WARN”, “ERROR” (default: “INFO”) |
{
"success": true,
"message": "Session started successfully",
"session": "my-session"
}
Status Codes
200- Session started successfully400- Invalid parameters409- Session already exists and is active
Usage Example
curl -X POST https://api.wappfy.com.br/api/sessions/my-session/start \
-H "Content-Type: application/json" \
-d '{
"config": {
"store": {
"dialect": "sqlite3",
"address": "/app/data/whatsmeow.db"
},
"log": {
"level": "INFO"
}
}
}'
const session = 'my-session';
const response = await fetch(`https://api.wappfy.com.br/api/sessions/${session}/start`, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
config: {
store: {
dialect: 'sqlite3',
address: '/app/data/whatsmeow.db'
},
log: {
level: 'INFO'
}
}
})
});
const data = await response.json();
console.log(data);
import requests
session = 'my-session'
response = requests.post(
f'https://api.wappfy.com.br/api/sessions/{session}/start',
json={
'config': {
'store': {
'dialect': 'sqlite3',
'address': '/app/data/whatsmeow.db'
},
'log': {
'level': 'INFO'
}
}
}
)
data = response.json()
print(data)
Body
application/json
The body is of type object.
