Basics

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.

patch/api/v1/websites/{website_id}

Request

  • Base URL
    https://api.athenahq.ai
  • Auth
    API key in header x-api-key

Request body

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

Example request

{
  "external_id": "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.

Example response

{
  "website": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "websiteName": "My Awesome Blog",
    "websiteUrl": "example.com",
    "externalId": "ws_a7f3b2c9"
  }
}

Changes