curl --request POST \
--url https://app.timelines.ai/partner/api/v1/workspaces \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-TL-Partner-Id: <x-tl-partner-id>' \
--data '
{
"display_name": "my-first-workspace (must contain only letters, digits and dash)",
"seats_purchased": 3
}
'import requests
url = "https://app.timelines.ai/partner/api/v1/workspaces"
payload = {
"display_name": "my-first-workspace (must contain only letters, digits and dash)",
"seats_purchased": 3
}
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({
display_name: 'my-first-workspace (must contain only letters, digits and dash)',
seats_purchased: 3
})
};
fetch('https://app.timelines.ai/partner/api/v1/workspaces', 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",
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([
'display_name' => 'my-first-workspace (must contain only letters, digits and dash)',
'seats_purchased' => 3
]),
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"
payload := strings.NewReader("{\n \"display_name\": \"my-first-workspace (must contain only letters, digits and dash)\",\n \"seats_purchased\": 3\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")
.header("X-TL-Partner-Id", "<x-tl-partner-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"display_name\": \"my-first-workspace (must contain only letters, digits and dash)\",\n \"seats_purchased\": 3\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.timelines.ai/partner/api/v1/workspaces")
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 \"display_name\": \"my-first-workspace (must contain only letters, digits and dash)\",\n \"seats_purchased\": 3\n}"
response = http.request(request)
puts response.read_body{
"workspace_id": "ws_1234567890abcdef",
"display_name": "my-first-workspace",
"plan_id": 1,
"seats_total": 3,
"seats_available": 2,
"updated_at": "2024-01-01T12:00:00Z",
"owner_user_id": 42,
"group_id": 7,
"created_at": "2024-01-01T10:00:00Z",
"suspended_members": [
{
"user_id": 123,
"whatsapp_account_id": 1092930,
"phone_numbers": [
"+1234567890"
]
}
]
}{
"error": "<string>",
"status": 123,
"description": "<string>"
}Create a workspace
Creates a new partner-managed workspace and automatically provisions an Owner user. The workspace_id identifier is derived from the requested display_name (lowercase, alphanumeric and dashes, up to 30 characters). The workspace is created on the calling partner’s plan and linked to that partner for ownership and billing-eligibility checks. An Owner user is created with a non-login, system-managed email of the form <user_id>-<workspace-id>@partners.timelines.ai and added to the default workspace group. Seats are allocated according to seats_purchased (1-999); the Owner consumes one seat and the remaining seats become available for additional agents. On success the response returns workspace metadata, seat counters and the newly created owner_user_id. Conflicts on identifier generation (duplicate workspace_id) are reported with a 409 WorkspaceCreationFailed error.
curl --request POST \
--url https://app.timelines.ai/partner/api/v1/workspaces \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-TL-Partner-Id: <x-tl-partner-id>' \
--data '
{
"display_name": "my-first-workspace (must contain only letters, digits and dash)",
"seats_purchased": 3
}
'import requests
url = "https://app.timelines.ai/partner/api/v1/workspaces"
payload = {
"display_name": "my-first-workspace (must contain only letters, digits and dash)",
"seats_purchased": 3
}
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({
display_name: 'my-first-workspace (must contain only letters, digits and dash)',
seats_purchased: 3
})
};
fetch('https://app.timelines.ai/partner/api/v1/workspaces', 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",
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([
'display_name' => 'my-first-workspace (must contain only letters, digits and dash)',
'seats_purchased' => 3
]),
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"
payload := strings.NewReader("{\n \"display_name\": \"my-first-workspace (must contain only letters, digits and dash)\",\n \"seats_purchased\": 3\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")
.header("X-TL-Partner-Id", "<x-tl-partner-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"display_name\": \"my-first-workspace (must contain only letters, digits and dash)\",\n \"seats_purchased\": 3\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.timelines.ai/partner/api/v1/workspaces")
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 \"display_name\": \"my-first-workspace (must contain only letters, digits and dash)\",\n \"seats_purchased\": 3\n}"
response = http.request(request)
puts response.read_body{
"workspace_id": "ws_1234567890abcdef",
"display_name": "my-first-workspace",
"plan_id": 1,
"seats_total": 3,
"seats_available": 2,
"updated_at": "2024-01-01T12:00:00Z",
"owner_user_id": 42,
"group_id": 7,
"created_at": "2024-01-01T10:00:00Z",
"suspended_members": [
{
"user_id": 123,
"whatsapp_account_id": 1092930,
"phone_numbers": [
"+1234567890"
]
}
]
}{
"error": "<string>",
"status": 123,
"description": "<string>"
}Authorizations
JWT bearer authentication. The token payload must include partner_id, nbf (not-before) and exp (expiry) claims. All Partner API requests must be authenticated with Authorization: Bearer .
Headers
The unique identifier for the partner.
Body
Workspace creation request payload
Request payload for creating a new partner-managed workspace. Partners supply a human-friendly display_name and the initial number of purchased seats. The server derives the internal workspace_id identifier from display_name and provisions the workspace on the partner’s plan with the requested seats.
Response
Workspace created
Representation of a partner-managed workspace returned after creation or update. It includes the stable workspace_id, display_name, linked plan_id, seat allocation and utilization, audit timestamps, the default group identifier, the automatically generated Owner user, and any suspended members that resulted from a seat downgrade.
Unique identifier for the workspace
"ws_1234567890abcdef"
Workspace display name
"my-first-workspace"
Workspace plan type
1
Total number of seats in the workspace
3
Number of available seats in the workspace
2
Timestamp of the last update
"2024-01-01T12:00:00Z"
User ID of the workspace owner
42
Group ID associated with the workspace
7
Timestamp of workspace creation
"2024-01-01T10:00:00Z"
array of suspended user IDs
Show child attributes
Show child attributes

