Get Websites
curl --request GET \
--url https://api.athenahq.ai/api/v1/websites \
--header 'x-api-key: <api-key>'import requests
url = "https://api.athenahq.ai/api/v1/websites"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.athenahq.ai/api/v1/websites', 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.athenahq.ai/api/v1/websites",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <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"
"net/http"
"io"
)
func main() {
url := "https://api.athenahq.ai/api/v1/websites"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
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.athenahq.ai/api/v1/websites")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.athenahq.ai/api/v1/websites")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"websites": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"websiteName": "My Awesome Blog",
"websiteUrl": "example.com",
"baseCountry": "United States",
"onboardingStep": null,
"externalId": "ws_a7f3b2c9"
}
]
}{
"error": "Unauthorized"
}{
"error": "Forbidden: partner API key required"
}{
"error": "Unauthorized"
}Websites
Get Websites
Returns all active websites associated with your API key. Partner integrations may pass external_id as a query parameter to find the Athena website mapped to a partner-supplied identifier.
GET
/
api
/
v1
/
websites
Get Websites
curl --request GET \
--url https://api.athenahq.ai/api/v1/websites \
--header 'x-api-key: <api-key>'import requests
url = "https://api.athenahq.ai/api/v1/websites"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.athenahq.ai/api/v1/websites', 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.athenahq.ai/api/v1/websites",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <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"
"net/http"
"io"
)
func main() {
url := "https://api.athenahq.ai/api/v1/websites"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
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.athenahq.ai/api/v1/websites")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.athenahq.ai/api/v1/websites")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"websites": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"websiteName": "My Awesome Blog",
"websiteUrl": "example.com",
"baseCountry": "United States",
"onboardingStep": null,
"externalId": "ws_a7f3b2c9"
}
]
}{
"error": "Unauthorized"
}{
"error": "Forbidden: partner API key required"
}{
"error": "Unauthorized"
}Query Parameters
Partner-only. Filter results to the website mapped to this partner-supplied identifier. Accepted only when authenticating with a partner API key — direct customers that pass this parameter receive 403 Forbidden. Exact match, scoped to your organization; unmapped IDs return an empty array.
Minimum string length:
1Response
Successful response with list of websites. Partner responses include an externalId field on each item (string or null); direct-customer responses omit the field entirely.
Show child attributes
Show child attributes
Was this page helpful?