Get a Site
curl --request GET \
--url https://api.usenotra.com/v1/sites/{siteId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.usenotra.com/v1/sites/{siteId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.usenotra.com/v1/sites/{siteId}', 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.usenotra.com/v1/sites/{siteId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.usenotra.com/v1/sites/{siteId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.usenotra.com/v1/sites/{siteId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usenotra.com/v1/sites/{siteId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"site": {
"id": "<string>",
"projectId": "<string>",
"name": "<string>",
"slug": "<string>",
"status": "active",
"suspendedReason": "<string>",
"repository": {
"id": "<string>",
"owner": "<string>",
"name": "<string>"
},
"productionBranch": "<string>",
"rootDirectory": "<string>",
"liveUrl": "https://example.com/blog",
"publicOrigin": "<string>",
"aliasOrigin": "<string>",
"mounts": {
"blog": "<string>",
"changelog": "<string>"
},
"mountsFromConfig": true,
"previewsEnabled": true,
"previewVisibility": "public",
"smartDeployments": true,
"analyticsEnabled": true,
"liveDeploymentId": "<string>",
"rollbackActive": true,
"liveSince": "<string>",
"createdAt": "<string>"
},
"domains": [
{
"id": "<string>",
"hostname": "<string>",
"kind": "subdomain",
"status": "pending",
"isPrimary": true,
"records": [
{
"type": "CNAME",
"name": "<string>",
"value": "<string>",
"purpose": "routing"
}
],
"lastError": "<string>",
"verifiedAt": "<string>"
}
],
"previews": [
{
"previewKey": "<string>",
"deploymentId": "<string>",
"visibility": "public",
"url": "<string>",
"branch": "<string>",
"pullRequestNumber": 123,
"commitSha": "<string>",
"activatedAt": "<string>"
}
],
"organization": {
"id": "<string>",
"slug": "<string>",
"name": "<string>",
"logo": "<string>"
}
}{
"error": "<string>",
"code": "<string>",
"recovery": "<string>"
}{
"error": "<string>",
"code": "<string>",
"recovery": "<string>"
}{
"error": "<string>",
"code": "<string>",
"recovery": "<string>"
}{
"error": "<string>",
"code": "<string>",
"recovery": "<string>"
}{
"error": "<string>",
"code": "<string>",
"recovery": "<string>"
}{
"error": "<string>",
"code": "<string>",
"recovery": "<string>"
}{
"error": "<string>",
"code": "<string>",
"recovery": "<string>"
}{
"error": "<string>",
"code": "<string>",
"recovery": "<string>"
}{
"error": "<string>",
"code": "<string>",
"recovery": "<string>"
}{
"error": "<string>",
"code": "<string>",
"recovery": "<string>"
}Get a Site
Returns a Site’s settings, live deployment, custom domains with their DNS records, and open previews.
GET
/
v1
/
sites
/
{siteId}
Get a Site
curl --request GET \
--url https://api.usenotra.com/v1/sites/{siteId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.usenotra.com/v1/sites/{siteId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.usenotra.com/v1/sites/{siteId}', 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.usenotra.com/v1/sites/{siteId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.usenotra.com/v1/sites/{siteId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.usenotra.com/v1/sites/{siteId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usenotra.com/v1/sites/{siteId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"site": {
"id": "<string>",
"projectId": "<string>",
"name": "<string>",
"slug": "<string>",
"status": "active",
"suspendedReason": "<string>",
"repository": {
"id": "<string>",
"owner": "<string>",
"name": "<string>"
},
"productionBranch": "<string>",
"rootDirectory": "<string>",
"liveUrl": "https://example.com/blog",
"publicOrigin": "<string>",
"aliasOrigin": "<string>",
"mounts": {
"blog": "<string>",
"changelog": "<string>"
},
"mountsFromConfig": true,
"previewsEnabled": true,
"previewVisibility": "public",
"smartDeployments": true,
"analyticsEnabled": true,
"liveDeploymentId": "<string>",
"rollbackActive": true,
"liveSince": "<string>",
"createdAt": "<string>"
},
"domains": [
{
"id": "<string>",
"hostname": "<string>",
"kind": "subdomain",
"status": "pending",
"isPrimary": true,
"records": [
{
"type": "CNAME",
"name": "<string>",
"value": "<string>",
"purpose": "routing"
}
],
"lastError": "<string>",
"verifiedAt": "<string>"
}
],
"previews": [
{
"previewKey": "<string>",
"deploymentId": "<string>",
"visibility": "public",
"url": "<string>",
"branch": "<string>",
"pullRequestNumber": 123,
"commitSha": "<string>",
"activatedAt": "<string>"
}
],
"organization": {
"id": "<string>",
"slug": "<string>",
"name": "<string>",
"logo": "<string>"
}
}{
"error": "<string>",
"code": "<string>",
"recovery": "<string>"
}{
"error": "<string>",
"code": "<string>",
"recovery": "<string>"
}{
"error": "<string>",
"code": "<string>",
"recovery": "<string>"
}{
"error": "<string>",
"code": "<string>",
"recovery": "<string>"
}{
"error": "<string>",
"code": "<string>",
"recovery": "<string>"
}{
"error": "<string>",
"code": "<string>",
"recovery": "<string>"
}{
"error": "<string>",
"code": "<string>",
"recovery": "<string>"
}{
"error": "<string>",
"code": "<string>",
"recovery": "<string>"
}{
"error": "<string>",
"code": "<string>",
"recovery": "<string>"
}{
"error": "<string>",
"code": "<string>",
"recovery": "<string>"
}Authorizations
Send your API key in the Authorization header as Bearer API_KEY. Account API keys work in every workspace you belong to: send X-Notra-Organization-Id with the workspace id or slug to choose one. Workspace endpoints require it when you belong to more than one workspace; GET /v1/me/workspaces works without it. Organization keys only accept their own workspace there.
Path Parameters
Minimum string length:
1Pattern:
^[A-Za-z0-9_-]{1,100}$Example:
"site_8f2kq1"
Was this page helpful?