curl --request PATCH \
--url https://api.athenahq.ai/api/v1/websites/{website_id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"external_id": "ws_a7f3b2c9"
}
'import requests
url = "https://api.athenahq.ai/api/v1/websites/{website_id}"
payload = { "external_id": "ws_a7f3b2c9" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({external_id: 'ws_a7f3b2c9'})
};
fetch('https://api.athenahq.ai/api/v1/websites/{website_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/websites/{website_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'external_id' => 'ws_a7f3b2c9'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.athenahq.ai/api/v1/websites/{website_id}"
payload := strings.NewReader("{\n \"external_id\": \"ws_a7f3b2c9\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.patch("https://api.athenahq.ai/api/v1/websites/{website_id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"external_id\": \"ws_a7f3b2c9\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.athenahq.ai/api/v1/websites/{website_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"external_id\": \"ws_a7f3b2c9\"\n}"
response = http.request(request)
puts response.read_body{
"website": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"websiteName": "My Awesome Blog",
"websiteUrl": "example.com",
"onboardingStep": null,
"externalId": "ws_a7f3b2c9"
}
}Update Website
Sets, replaces, or clears the partner external_id mapped to a website. Partner integrations only: pass external_id as a non-empty string to set or replace the mapping, or as null to clear it. Requires a global API key. Works on deleted websites too, because deleting a website does not release its external_id. An external_id already mapped to another website in your organization returns 409 naming the current holder; to move an id from one website to another, clear it on the current holder first, then set it on the new one.
curl --request PATCH \
--url https://api.athenahq.ai/api/v1/websites/{website_id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"external_id": "ws_a7f3b2c9"
}
'import requests
url = "https://api.athenahq.ai/api/v1/websites/{website_id}"
payload = { "external_id": "ws_a7f3b2c9" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({external_id: 'ws_a7f3b2c9'})
};
fetch('https://api.athenahq.ai/api/v1/websites/{website_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/websites/{website_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'external_id' => 'ws_a7f3b2c9'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.athenahq.ai/api/v1/websites/{website_id}"
payload := strings.NewReader("{\n \"external_id\": \"ws_a7f3b2c9\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.patch("https://api.athenahq.ai/api/v1/websites/{website_id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"external_id\": \"ws_a7f3b2c9\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.athenahq.ai/api/v1/websites/{website_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"external_id\": \"ws_a7f3b2c9\"\n}"
response = http.request(request)
puts response.read_body{
"website": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"websiteName": "My Awesome Blog",
"websiteUrl": "example.com",
"onboardingStep": null,
"externalId": "ws_a7f3b2c9"
}
}Path Parameters
The unique identifier of the website
Body
Request body for updating a website. external_id is required; unknown fields are rejected with 400.
Partner-only. Partner-supplied identifier to attach to this website. Pass a non-empty string to set or replace the mapping, or null to clear an existing mapping. Surrounding whitespace is trimmed; a blank value or one longer than 255 characters returns 400. Accepted only when authenticating with an API key for an organization flagged as a partner. Sending this field as a direct customer returns 403 Forbidden. Must be unique per resource type within your organization: setting a value already used by another website returns 409 with the existing website in the payload.
1 - 255"ws_a7f3b2c9"
Response
Mapping updated. externalId is always present on this response: the new value, or null after a clear. Like the external_id lookup responses, and unlike the GET /api/v1/websites listing, this endpoint does not return baseCountry.
Show child attributes
Show child attributes
Was this page helpful?