---
title: "Update Website"
method: PATCH
path: "/api/v1/websites/{website_id}"
tags: ["Basics"]
---

# Update Website

`PATCH /api/v1/websites/{website_id}`

## Request

- Base URL: `https://api.athenahq.ai`
- URL: `https://api.athenahq.ai/api/v1/websites/{website_id}`
- Auth: API key in header `x-api-key`

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.

## Request body

- UpdateWebsiteRequest: Request body for updating a website. `external_id` is required; unknown fields are rejected with `400`.
  - `external_id` string, nullable, required: **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.

## Response `200`

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`.

- object
  - `website` object, required
    - `id` string, uuid, required: Unique identifier for the website
    - `websiteName` string, required: Display name of the website
    - `websiteUrl` string, required: The domain of the website (without protocol)
    - `onboardingStep` integer, nullable, required: Current onboarding step for the website. Null indicates onboarding is complete.
    - `externalId` string, nullable, required: The partner-supplied identifier now mapped to this website, or `null` when the request cleared the mapping.

## Other responses

- `400`: Bad request - Validation error or invalid website ID
- `401`: Unauthorized - Invalid or missing API key
- `403`: Forbidden - Requires a global API key, and the key must belong to an organization flagged as a partner.
- `404`: Not found - Website does not exist or does not belong to your organization
- `409`: Conflict - the supplied `external_id` is already mapped to another website in your organization. Clear it on that website first.
- `500`: Internal server error

## Changes

- **2026-11-03** `2d1d86d5e067`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/athenahq/apis/athenahq-api/changes/api/v1/websites/:website_id/patch.md)

---

[API](https://skmtc.dev/athenahq/apis/athenahq-api.md) - [All operations](https://skmtc.dev/athenahq/apis/athenahq-api/llms.txt) - [OpenAPI document](https://skmtc.dev/athenahq/apis/athenahq-api/revisions/6cf9ca58edf6?raw)
