Get Group
curl --request GET \
--url https://api.athenahq.ai/api/v1/groups/{group_id} \
--header 'x-api-key: <api-key>'import requests
url = "https://api.athenahq.ai/api/v1/groups/{group_id}"
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/groups/{group_id}', 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/groups/{group_id}",
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/groups/{group_id}"
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/groups/{group_id}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.athenahq.ai/api/v1/groups/{group_id}")
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{
"group": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Enterprise Clients",
"orgId": "987e6543-e21b-12d3-a456-426614174000",
"billingEnabled": false,
"createdAt": "2024-06-15T10:30:00.000Z",
"websites": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"websiteUrl": "example.com",
"websiteName": "My Awesome Blog",
"externalId": "ws_a7f3b2c9"
}
],
"externalId": "acct_9e4c1b8d"
}
}{
"error": "Invalid group ID format"
}{
"error": "Unauthorized"
}{
"error": "Forbidden: global API key required"
}{
"error": "Group not found"
}{
"error": "Unauthorized"
}Groups
Get Group
Returns a single group by ID, including associated websites. Requires a global API key. Partner integrations additionally receive an externalId field populated from the partner mapping (if any), and every website object inside websites carries its own externalId (null when that website has no mapping), so sites can be matched by your own identifier instead of by URL.
GET
/
api
/
v1
/
groups
/
{group_id}
Get Group
curl --request GET \
--url https://api.athenahq.ai/api/v1/groups/{group_id} \
--header 'x-api-key: <api-key>'import requests
url = "https://api.athenahq.ai/api/v1/groups/{group_id}"
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/groups/{group_id}', 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/groups/{group_id}",
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/groups/{group_id}"
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/groups/{group_id}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.athenahq.ai/api/v1/groups/{group_id}")
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{
"group": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Enterprise Clients",
"orgId": "987e6543-e21b-12d3-a456-426614174000",
"billingEnabled": false,
"createdAt": "2024-06-15T10:30:00.000Z",
"websites": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"websiteUrl": "example.com",
"websiteName": "My Awesome Blog",
"externalId": "ws_a7f3b2c9"
}
],
"externalId": "acct_9e4c1b8d"
}
}{
"error": "Invalid group ID format"
}{
"error": "Unauthorized"
}{
"error": "Forbidden: global API key required"
}{
"error": "Group not found"
}{
"error": "Unauthorized"
}Path Parameters
The unique identifier of the group
Response
Successful response with the group. Partner responses include an externalId field (string or null); direct-customer responses omit the field entirely.
A group of websites in your organization
Show child attributes
Show child attributes
Was this page helpful?
⌘I