Create Site
curl --request POST \
--url https://dash.tinyanalytics.io/api/organizations/{organizationId}/sites \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"domain": "example.com",
"name": "My Website",
"public": false,
"blockBots": true,
"excludedIPs": [],
"excludedCountries": [],
"sessionReplay": false,
"webVitals": false,
"trackErrors": false,
"trackOutbound": true,
"trackUrlParams": true,
"trackInitialPageView": true,
"trackSpaNavigation": true,
"trackIp": false,
"trackButtonClicks": false,
"trackCopy": false,
"trackFormInteractions": false,
"tags": []
}
'import requests
url = "https://dash.tinyanalytics.io/api/organizations/{organizationId}/sites"
payload = {
"domain": "example.com",
"name": "My Website",
"public": False,
"blockBots": True,
"excludedIPs": [],
"excludedCountries": [],
"sessionReplay": False,
"webVitals": False,
"trackErrors": False,
"trackOutbound": True,
"trackUrlParams": True,
"trackInitialPageView": True,
"trackSpaNavigation": True,
"trackIp": False,
"trackButtonClicks": False,
"trackCopy": False,
"trackFormInteractions": False,
"tags": []
}
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({
domain: 'example.com',
name: 'My Website',
public: false,
blockBots: true,
excludedIPs: [],
excludedCountries: [],
sessionReplay: false,
webVitals: false,
trackErrors: false,
trackOutbound: true,
trackUrlParams: true,
trackInitialPageView: true,
trackSpaNavigation: true,
trackIp: false,
trackButtonClicks: false,
trackCopy: false,
trackFormInteractions: false,
tags: []
})
};
fetch('https://dash.tinyanalytics.io/api/organizations/{organizationId}/sites', 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://dash.tinyanalytics.io/api/organizations/{organizationId}/sites",
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([
'domain' => 'example.com',
'name' => 'My Website',
'public' => false,
'blockBots' => true,
'excludedIPs' => [
],
'excludedCountries' => [
],
'sessionReplay' => false,
'webVitals' => false,
'trackErrors' => false,
'trackOutbound' => true,
'trackUrlParams' => true,
'trackInitialPageView' => true,
'trackSpaNavigation' => true,
'trackIp' => false,
'trackButtonClicks' => false,
'trackCopy' => false,
'trackFormInteractions' => false,
'tags' => [
]
]),
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://dash.tinyanalytics.io/api/organizations/{organizationId}/sites"
payload := strings.NewReader("{\n \"domain\": \"example.com\",\n \"name\": \"My Website\",\n \"public\": false,\n \"blockBots\": true,\n \"excludedIPs\": [],\n \"excludedCountries\": [],\n \"sessionReplay\": false,\n \"webVitals\": false,\n \"trackErrors\": false,\n \"trackOutbound\": true,\n \"trackUrlParams\": true,\n \"trackInitialPageView\": true,\n \"trackSpaNavigation\": true,\n \"trackIp\": false,\n \"trackButtonClicks\": false,\n \"trackCopy\": false,\n \"trackFormInteractions\": false,\n \"tags\": []\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://dash.tinyanalytics.io/api/organizations/{organizationId}/sites")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"domain\": \"example.com\",\n \"name\": \"My Website\",\n \"public\": false,\n \"blockBots\": true,\n \"excludedIPs\": [],\n \"excludedCountries\": [],\n \"sessionReplay\": false,\n \"webVitals\": false,\n \"trackErrors\": false,\n \"trackOutbound\": true,\n \"trackUrlParams\": true,\n \"trackInitialPageView\": true,\n \"trackSpaNavigation\": true,\n \"trackIp\": false,\n \"trackButtonClicks\": false,\n \"trackCopy\": false,\n \"trackFormInteractions\": false,\n \"tags\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dash.tinyanalytics.io/api/organizations/{organizationId}/sites")
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 \"domain\": \"example.com\",\n \"name\": \"My Website\",\n \"public\": false,\n \"blockBots\": true,\n \"excludedIPs\": [],\n \"excludedCountries\": [],\n \"sessionReplay\": false,\n \"webVitals\": false,\n \"trackErrors\": false,\n \"trackOutbound\": true,\n \"trackUrlParams\": true,\n \"trackInitialPageView\": true,\n \"trackSpaNavigation\": true,\n \"trackIp\": false,\n \"trackButtonClicks\": false,\n \"trackCopy\": false,\n \"trackFormInteractions\": false,\n \"tags\": []\n}"
response = http.request(request)
puts response.read_bodyCreate Site
Creates a new site in an organization. Requires admin/owner role.
POST
/
organizations
/
{organizationId}
/
sites
Create Site
curl --request POST \
--url https://dash.tinyanalytics.io/api/organizations/{organizationId}/sites \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"domain": "example.com",
"name": "My Website",
"public": false,
"blockBots": true,
"excludedIPs": [],
"excludedCountries": [],
"sessionReplay": false,
"webVitals": false,
"trackErrors": false,
"trackOutbound": true,
"trackUrlParams": true,
"trackInitialPageView": true,
"trackSpaNavigation": true,
"trackIp": false,
"trackButtonClicks": false,
"trackCopy": false,
"trackFormInteractions": false,
"tags": []
}
'import requests
url = "https://dash.tinyanalytics.io/api/organizations/{organizationId}/sites"
payload = {
"domain": "example.com",
"name": "My Website",
"public": False,
"blockBots": True,
"excludedIPs": [],
"excludedCountries": [],
"sessionReplay": False,
"webVitals": False,
"trackErrors": False,
"trackOutbound": True,
"trackUrlParams": True,
"trackInitialPageView": True,
"trackSpaNavigation": True,
"trackIp": False,
"trackButtonClicks": False,
"trackCopy": False,
"trackFormInteractions": False,
"tags": []
}
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({
domain: 'example.com',
name: 'My Website',
public: false,
blockBots: true,
excludedIPs: [],
excludedCountries: [],
sessionReplay: false,
webVitals: false,
trackErrors: false,
trackOutbound: true,
trackUrlParams: true,
trackInitialPageView: true,
trackSpaNavigation: true,
trackIp: false,
trackButtonClicks: false,
trackCopy: false,
trackFormInteractions: false,
tags: []
})
};
fetch('https://dash.tinyanalytics.io/api/organizations/{organizationId}/sites', 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://dash.tinyanalytics.io/api/organizations/{organizationId}/sites",
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([
'domain' => 'example.com',
'name' => 'My Website',
'public' => false,
'blockBots' => true,
'excludedIPs' => [
],
'excludedCountries' => [
],
'sessionReplay' => false,
'webVitals' => false,
'trackErrors' => false,
'trackOutbound' => true,
'trackUrlParams' => true,
'trackInitialPageView' => true,
'trackSpaNavigation' => true,
'trackIp' => false,
'trackButtonClicks' => false,
'trackCopy' => false,
'trackFormInteractions' => false,
'tags' => [
]
]),
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://dash.tinyanalytics.io/api/organizations/{organizationId}/sites"
payload := strings.NewReader("{\n \"domain\": \"example.com\",\n \"name\": \"My Website\",\n \"public\": false,\n \"blockBots\": true,\n \"excludedIPs\": [],\n \"excludedCountries\": [],\n \"sessionReplay\": false,\n \"webVitals\": false,\n \"trackErrors\": false,\n \"trackOutbound\": true,\n \"trackUrlParams\": true,\n \"trackInitialPageView\": true,\n \"trackSpaNavigation\": true,\n \"trackIp\": false,\n \"trackButtonClicks\": false,\n \"trackCopy\": false,\n \"trackFormInteractions\": false,\n \"tags\": []\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://dash.tinyanalytics.io/api/organizations/{organizationId}/sites")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"domain\": \"example.com\",\n \"name\": \"My Website\",\n \"public\": false,\n \"blockBots\": true,\n \"excludedIPs\": [],\n \"excludedCountries\": [],\n \"sessionReplay\": false,\n \"webVitals\": false,\n \"trackErrors\": false,\n \"trackOutbound\": true,\n \"trackUrlParams\": true,\n \"trackInitialPageView\": true,\n \"trackSpaNavigation\": true,\n \"trackIp\": false,\n \"trackButtonClicks\": false,\n \"trackCopy\": false,\n \"trackFormInteractions\": false,\n \"tags\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dash.tinyanalytics.io/api/organizations/{organizationId}/sites")
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 \"domain\": \"example.com\",\n \"name\": \"My Website\",\n \"public\": false,\n \"blockBots\": true,\n \"excludedIPs\": [],\n \"excludedCountries\": [],\n \"sessionReplay\": false,\n \"webVitals\": false,\n \"trackErrors\": false,\n \"trackOutbound\": true,\n \"trackUrlParams\": true,\n \"trackInitialPageView\": true,\n \"trackSpaNavigation\": true,\n \"trackIp\": false,\n \"trackButtonClicks\": false,\n \"trackCopy\": false,\n \"trackFormInteractions\": false,\n \"tags\": []\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
An API key created in your account settings, sent as Authorization: Bearer <key>.
Path Parameters
Example: org_abc123.
Body
application/json
Response
Success.
⌘I