Workspaces
Create a workspace
Creates a new workspace, available to your whole team.
POST
Create a workspace
Authorizations
Body
application/json
Response
The newly created workspace.
Create a workspace
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Creates a new workspace, available to your whole team.
curl --request POST \
--url https://api.peakmetrics.com/workspaces \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "Election coverage",
"query": "(\"election integrity\" OR \"voter fraud\") AND 2026",
"channels": [
"news",
"twitter"
],
"folder": {
"id": 12
}
}
'import requests
url = "https://api.peakmetrics.com/workspaces"
payload = {
"title": "Election coverage",
"query": "(\"election integrity\" OR \"voter fraud\") AND 2026",
"channels": ["news", "twitter"],
"folder": { "id": 12 }
}
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({
title: 'Election coverage',
query: '("election integrity" OR "voter fraud") AND 2026',
channels: ['news', 'twitter'],
folder: {id: 12}
})
};
fetch('https://api.peakmetrics.com/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://api.peakmetrics.com/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([
'title' => 'Election coverage',
'query' => '("election integrity" OR "voter fraud") AND 2026',
'channels' => [
'news',
'twitter'
],
'folder' => [
'id' => 12
]
]),
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://api.peakmetrics.com/workspaces"
payload := strings.NewReader("{\n \"title\": \"Election coverage\",\n \"query\": \"(\\\"election integrity\\\" OR \\\"voter fraud\\\") AND 2026\",\n \"channels\": [\n \"news\",\n \"twitter\"\n ],\n \"folder\": {\n \"id\": 12\n }\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://api.peakmetrics.com/workspaces")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Election coverage\",\n \"query\": \"(\\\"election integrity\\\" OR \\\"voter fraud\\\") AND 2026\",\n \"channels\": [\n \"news\",\n \"twitter\"\n ],\n \"folder\": {\n \"id\": 12\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.peakmetrics.com/workspaces")
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 \"title\": \"Election coverage\",\n \"query\": \"(\\\"election integrity\\\" OR \\\"voter fraud\\\") AND 2026\",\n \"channels\": [\n \"news\",\n \"twitter\"\n ],\n \"folder\": {\n \"id\": 12\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 2,
"title": "<string>",
"owner": "<string>",
"query": "<string>",
"channels": [
"news"
],
"created": "2023-11-07T05:31:56Z",
"modified": "2023-11-07T05:31:56Z",
"folder": {
"id": 123,
"title": "<string>"
}
}The newly created workspace.
Was this page helpful?
curl --request POST \
--url https://api.peakmetrics.com/workspaces \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "Election coverage",
"query": "(\"election integrity\" OR \"voter fraud\") AND 2026",
"channels": [
"news",
"twitter"
],
"folder": {
"id": 12
}
}
'import requests
url = "https://api.peakmetrics.com/workspaces"
payload = {
"title": "Election coverage",
"query": "(\"election integrity\" OR \"voter fraud\") AND 2026",
"channels": ["news", "twitter"],
"folder": { "id": 12 }
}
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({
title: 'Election coverage',
query: '("election integrity" OR "voter fraud") AND 2026',
channels: ['news', 'twitter'],
folder: {id: 12}
})
};
fetch('https://api.peakmetrics.com/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://api.peakmetrics.com/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([
'title' => 'Election coverage',
'query' => '("election integrity" OR "voter fraud") AND 2026',
'channels' => [
'news',
'twitter'
],
'folder' => [
'id' => 12
]
]),
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://api.peakmetrics.com/workspaces"
payload := strings.NewReader("{\n \"title\": \"Election coverage\",\n \"query\": \"(\\\"election integrity\\\" OR \\\"voter fraud\\\") AND 2026\",\n \"channels\": [\n \"news\",\n \"twitter\"\n ],\n \"folder\": {\n \"id\": 12\n }\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://api.peakmetrics.com/workspaces")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Election coverage\",\n \"query\": \"(\\\"election integrity\\\" OR \\\"voter fraud\\\") AND 2026\",\n \"channels\": [\n \"news\",\n \"twitter\"\n ],\n \"folder\": {\n \"id\": 12\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.peakmetrics.com/workspaces")
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 \"title\": \"Election coverage\",\n \"query\": \"(\\\"election integrity\\\" OR \\\"voter fraud\\\") AND 2026\",\n \"channels\": [\n \"news\",\n \"twitter\"\n ],\n \"folder\": {\n \"id\": 12\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 2,
"title": "<string>",
"owner": "<string>",
"query": "<string>",
"channels": [
"news"
],
"created": "2023-11-07T05:31:56Z",
"modified": "2023-11-07T05:31:56Z",
"folder": {
"id": 123,
"title": "<string>"
}
}