# Sites API

> Sites, their snippets, domains, attached components and server keys. With curl and TypeScript examples.

## `GET /v1/sites`

List the sites of the workspace, newest first

Operation `listSites`. Scopes: `sites:read`.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `limit` | query | integer (1 to 100, default 20) | no | Page size, 1 to 100. |
| `cursor` | query | string | no | Opaque `next_cursor` of the previous page, for the same list and filters. Omit for the first page. |
| `client_id` | query | string | no | Only the sites of this client. An id that is not a client of your workspace gives an empty page. |

**Responses**

| Status | Meaning | Content type |
| --- | --- | --- |
| `200` | One page of sites; deleted sites are not listed. | `application/json` |
| `400` | `validation_failed` (bad `limit` or filter) or `invalid_cursor`. | `application/problem+json` |
| `401` | `unauthenticated`: no credentials, or credentials that prove nothing. | `application/problem+json` |
| `403` | `insufficient_scope`: the credential lacks a scope this route needs (see `missing_scopes`). `permission_denied`: the current workspace role does not allow the action. `oauth_consent_required`: an OAuth token whose person has not yet chosen the workspace and the permissions (see `consent_url`). `mfa_required`: a portal session that must still verify or set up MFA (see `mfa_reason`). `workspace_suspended`: Taggor suspended the workspace; every credential acting in it is refused until it is lifted. | `application/problem+json` |
| `405` | `method_not_allowed`: the path exists, but not for this method; `Allow` lists the methods it answers. | `application/problem+json` |
| `429` | `rate_limited`: the limit of the route class (`rate_limit.limit_class`: read, write, publish, heavy, approval, diff, metrics, destructive or ip) was reached. Wait `Retry-After` seconds. `rate_limiter_unavailable` (503) is answered for `heavy` routes and destructive calls when the limiter itself fails, and for a valid OAuth token with no grant when the consent-link limiter fails (never a 401, so an MCP client does not log in again). | `application/problem+json` |
| `500` | `internal_error` (nothing about the failure; quote `request_id`) or `configuration_error`. | `application/problem+json` |
| `503` | `database_unavailable`: the API could not reach its database (timeout, dropped connection). Wait `Retry-After` seconds and send the same request again: repeating is safe with the same `Idempotency-Key`; without it a POST may already have been applied. | `application/problem+json` |

```sh title="curl"
curl "https://api.taggor.dev/v1/sites" \
  -H "Authorization: Bearer $TAGGOR_API_KEY"
```

```ts title="TypeScript"
const response = await fetch("https://api.taggor.dev/v1/sites", {
  headers: { authorization: `Bearer ${process.env.TAGGOR_API_KEY}` },
});
if (!response.ok) throw new Error(await response.text());
const result: unknown = await response.json();
console.log(result);
```

```json title="Example response"
{
  "data": [
    {
      "id": "st_0123456789abcdefghjkmnpqrs",
      "name": "Loja Aurora",
      "production_site_key": "st_k3x7m2q7ab",
      "production_allowed_domains": [
        "cliente.com.br",
        "*.loja.cliente.com.br"
      ],
      "staging_site_key": "st_w5t2n4h6cd",
      "staging_allowed_domains": [
        "staging.cliente.com.br"
      ],
      "staging_fixed_domains": [
        "localhost",
        "127.0.0.1"
      ],
      "status": "active",
      "protection": {
        "suspects": "keep",
        "daily_cap": 1000,
        "respect_gpc": true
      },
      "client_id": "cl_0123456789abcdefghjkmnpqrs",
      "created_at": "2026-11-02T12:00:00.000Z",
      "updated_at": "2026-11-02T12:00:00.000Z"
    }
  ],
  "next_cursor": null,
  "has_more": false
}
```

## `POST /v1/sites`

Create a site of the workspace, with its production and staging site keys

Creates one site with two environments. The answer carries `production_site_key` and `staging_site_key`; `GET /v1/sites/{site_id}/snippet` gives the script tag of each. Paste the staging snippet on the test copy of the website (or a local page) and the production snippet on the live website. Production serves nowhere until `production_allowed_domains` lists the live domain; staging already works on `localhost` and `127.0.0.1`.

Operation `createSite`. Scopes: `sites:write`.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `idempotency-key` | header | string | no | Makes a retry safe: see [Idempotency](https://taggor.dev/docs/reference/api.md#idempotency). |

**Request body** (`application/json`, required)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string (up to 100 characters) | yes | What the site is called, to tell sites apart. |
| `production_allowed_domains` | array of string (up to 255 characters) | no | Hostnames where the PRODUCTION snippet (the one with `production_site_key`) mounts components and may send data: `cliente.com.br` (also its `www.`) or a wildcard on the first label, `*.cliente.com.br` (exactly one label, never the bare domain). No scheme, port or path; no IP address except `127.0.0.1`. An empty list serves nowhere. `localhost` and `127.0.0.1` work in production only if you list them here. Stored lowercase, IDN as punycode, repeated entries once; sending the field replaces the whole production list and leaves the staging list alone. |
| `staging_allowed_domains` | array of string (up to 255 characters) | no | Hostnames where the STAGING snippet (the one with `staging_site_key`) mounts components and may send data, besides `localhost` and `127.0.0.1`, which staging always allows and which must NOT be listed here (they are refused with `fixed_in_staging`). Same format as `production_allowed_domains`. An empty list means staging works only on the developer's own machine. Sending the field replaces the whole staging list and leaves the production list alone. Staging is not private: anyone who has the staging snippet can read what it serves. |
| `client_id` | string or null | no | The agency client this site belongs to (`GET /v1/clients`). It must be a client of your workspace; another workspace's id is refused like a missing one. |

**Responses**

| Status | Meaning | Content type |
| --- | --- | --- |
| `201` | The site, active, with a new site key for each environment. | `application/json` |
| `400` | `validation_failed`: a bad path parameter or body field; an allowed domain that is not a hostname is a field error at `/production_allowed_domains/<index>` or `/staging_allowed_domains/<index>` whose `code` is the reason (`has_scheme`, `has_port`, `has_path`, `is_ip_address`, `fixed_in_staging`, …) and whose `message` says what to write instead. | `application/problem+json` |
| `401` | `unauthenticated`: no credentials, or credentials that prove nothing. | `application/problem+json` |
| `402` | `workspace_payment_required`: the workspace needs a paid plan and has none, so it accepts no change; reading and exporting still work. A person pays in the portal, under Settings, Plan and billing. | `application/problem+json` |
| `403` | `insufficient_scope`: the credential lacks a scope this route needs (see `missing_scopes`). `permission_denied`: the current workspace role does not allow the action. `oauth_consent_required`: an OAuth token whose person has not yet chosen the workspace and the permissions (see `consent_url`). `mfa_required`: a portal session that must still verify or set up MFA (see `mfa_reason`). `cross_site_request`: authenticated by the session cookie, but not from the portal (another `Origin`, or not `Content-Type: application/json`). `workspace_suspended`: Taggor suspended the workspace; every credential acting in it is refused until it is lifted. | `application/problem+json` |
| `405` | `method_not_allowed`: the path exists, but not for this method; `Allow` lists the methods it answers. | `application/problem+json` |
| `409` | `plan_limit_reached`: the workspace already holds the most sites its plan allows. Nothing was created; the body carries `limit`, `plan` and `upgrade_url`. `idempotency_request_in_progress`: a request with this key is still running; retry after `Retry-After` seconds. | `application/problem+json` |
| `413` | `payload_too_large`: the request body is over the limit of the route (256 KiB for JSON). | `application/problem+json` |
| `415` | `unsupported_media_type`: the body was sent with a `Content-Type` other than `application/json`. Send the body as JSON with `Content-Type: application/json`. | `application/problem+json` |
| `422` | `idempotency_key_reused`: this key was used in the last 24 h with a different request. | `application/problem+json` |
| `429` | `rate_limited`: the limit of the route class (`rate_limit.limit_class`: read, write, publish, heavy, approval, diff, metrics, destructive or ip) was reached. Wait `Retry-After` seconds. `rate_limiter_unavailable` (503) is answered for `heavy` routes and destructive calls when the limiter itself fails, and for a valid OAuth token with no grant when the consent-link limiter fails (never a 401, so an MCP client does not log in again). | `application/problem+json` |
| `500` | `internal_error` (nothing about the failure; quote `request_id`) or `configuration_error`. | `application/problem+json` |
| `503` | `database_unavailable`: the API could not reach its database (timeout, dropped connection). Wait `Retry-After` seconds and send the same request again: repeating is safe with the same `Idempotency-Key`; without it a POST may already have been applied. | `application/problem+json` |

```sh title="curl"
curl -X POST "https://api.taggor.dev/v1/sites" \
  -H "Authorization: Bearer $TAGGOR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Loja Aurora",
  "production_allowed_domains": [
    "cliente.com.br",
    "*.loja.cliente.com.br"
  ],
  "staging_allowed_domains": [
    "staging.cliente.com.br"
  ],
  "client_id": "cl_0123456789abcdefghjkmnpqrs"
}'
```

```ts title="TypeScript"
const response = await fetch("https://api.taggor.dev/v1/sites", {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.TAGGOR_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({
    "name": "Loja Aurora",
    "production_allowed_domains": [
      "cliente.com.br",
      "*.loja.cliente.com.br"
    ],
    "staging_allowed_domains": [
      "staging.cliente.com.br"
    ],
    "client_id": "cl_0123456789abcdefghjkmnpqrs"
  }),
});
if (!response.ok) throw new Error(await response.text());
const result: unknown = await response.json();
console.log(result);
```

```json title="Example response"
{
  "id": "st_0123456789abcdefghjkmnpqrs",
  "name": "Loja Aurora",
  "production_site_key": "st_k3x7m2q7ab",
  "production_allowed_domains": [
    "cliente.com.br",
    "*.loja.cliente.com.br"
  ],
  "staging_site_key": "st_w5t2n4h6cd",
  "staging_allowed_domains": [
    "staging.cliente.com.br"
  ],
  "staging_fixed_domains": [
    "localhost",
    "127.0.0.1"
  ],
  "status": "active",
  "protection": {
    "suspects": "keep",
    "daily_cap": 1000,
    "respect_gpc": true
  },
  "client_id": "cl_0123456789abcdefghjkmnpqrs",
  "created_at": "2026-11-02T12:00:00.000Z",
  "updated_at": "2026-11-02T12:00:00.000Z"
}
```

## `GET /v1/sites/{site_id}`

Read one site of the workspace

Operation `getSite`. Scopes: `sites:read`.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `site_id` | path | string | yes | Public site id. |

**Responses**

| Status | Meaning | Content type |
| --- | --- | --- |
| `200` | The site. | `application/json` |
| `400` | `validation_failed`: a bad path parameter or body field; an allowed domain that is not a hostname is a field error at `/production_allowed_domains/<index>` or `/staging_allowed_domains/<index>` whose `code` is the reason (`has_scheme`, `has_port`, `has_path`, `is_ip_address`, `fixed_in_staging`, …) and whose `message` says what to write instead. | `application/problem+json` |
| `401` | `unauthenticated`: no credentials, or credentials that prove nothing. | `application/problem+json` |
| `403` | `insufficient_scope`: the credential lacks a scope this route needs (see `missing_scopes`). `permission_denied`: the current workspace role does not allow the action. `oauth_consent_required`: an OAuth token whose person has not yet chosen the workspace and the permissions (see `consent_url`). `mfa_required`: a portal session that must still verify or set up MFA (see `mfa_reason`). `workspace_suspended`: Taggor suspended the workspace; every credential acting in it is refused until it is lifted. | `application/problem+json` |
| `404` | `not_found`: no site with this id in the caller's workspace (also another workspace's, and a deleted one). | `application/problem+json` |
| `405` | `method_not_allowed`: the path exists, but not for this method; `Allow` lists the methods it answers. | `application/problem+json` |
| `429` | `rate_limited`: the limit of the route class (`rate_limit.limit_class`: read, write, publish, heavy, approval, diff, metrics, destructive or ip) was reached. Wait `Retry-After` seconds. `rate_limiter_unavailable` (503) is answered for `heavy` routes and destructive calls when the limiter itself fails, and for a valid OAuth token with no grant when the consent-link limiter fails (never a 401, so an MCP client does not log in again). | `application/problem+json` |
| `500` | `internal_error` (nothing about the failure; quote `request_id`) or `configuration_error`. | `application/problem+json` |
| `503` | `database_unavailable`: the API could not reach its database (timeout, dropped connection). Wait `Retry-After` seconds and send the same request again: repeating is safe with the same `Idempotency-Key`; without it a POST may already have been applied. | `application/problem+json` |

```sh title="curl"
curl "https://api.taggor.dev/v1/sites/st_0123456789abcdefghjkmnpqrs" \
  -H "Authorization: Bearer $TAGGOR_API_KEY"
```

```ts title="TypeScript"
const response = await fetch("https://api.taggor.dev/v1/sites/st_0123456789abcdefghjkmnpqrs", {
  headers: { authorization: `Bearer ${process.env.TAGGOR_API_KEY}` },
});
if (!response.ok) throw new Error(await response.text());
const result: unknown = await response.json();
console.log(result);
```

```json title="Example response"
{
  "id": "st_0123456789abcdefghjkmnpqrs",
  "name": "Loja Aurora",
  "production_site_key": "st_k3x7m2q7ab",
  "production_allowed_domains": [
    "cliente.com.br",
    "*.loja.cliente.com.br"
  ],
  "staging_site_key": "st_w5t2n4h6cd",
  "staging_allowed_domains": [
    "staging.cliente.com.br"
  ],
  "staging_fixed_domains": [
    "localhost",
    "127.0.0.1"
  ],
  "status": "active",
  "protection": {
    "suspects": "keep",
    "daily_cap": 1000,
    "respect_gpc": true
  },
  "client_id": "cl_0123456789abcdefghjkmnpqrs",
  "created_at": "2026-11-02T12:00:00.000Z",
  "updated_at": "2026-11-02T12:00:00.000Z"
}
```

## `PATCH /v1/sites/{site_id}`

Change a site's name, its client, the allowed domains of either environment, or its protection

Changes only the fields sent; at least one is required. `production_allowed_domains` and `staging_allowed_domains` each REPLACE the whole list of that environment (an empty array clears it): production then works nowhere, staging only on `localhost` and `127.0.0.1`, which always work in staging and are never listed. `client_id` takes `null` to clear; `protection` sets how the site's forms treat suspect submissions. The two site keys and the id never change, and a site cannot be moved between environments: it always has both. The old fields `allowed_domains` and `environment` are refused with the names of the fields that replaced them.

Operation `updateSite`. Scopes: `sites:write`.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `site_id` | path | string | yes | Public site id. |

**Request body** (`application/json`, required)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string (up to 100 characters) | no | What the site is called, to tell sites apart. |
| `production_allowed_domains` | array of string (up to 255 characters) | no | Hostnames where the PRODUCTION snippet (the one with `production_site_key`) mounts components and may send data: `cliente.com.br` (also its `www.`) or a wildcard on the first label, `*.cliente.com.br` (exactly one label, never the bare domain). No scheme, port or path; no IP address except `127.0.0.1`. An empty list serves nowhere. `localhost` and `127.0.0.1` work in production only if you list them here. Stored lowercase, IDN as punycode, repeated entries once; sending the field replaces the whole production list and leaves the staging list alone. |
| `staging_allowed_domains` | array of string (up to 255 characters) | no | Hostnames where the STAGING snippet (the one with `staging_site_key`) mounts components and may send data, besides `localhost` and `127.0.0.1`, which staging always allows and which must NOT be listed here (they are refused with `fixed_in_staging`). Same format as `production_allowed_domains`. An empty list means staging works only on the developer's own machine. Sending the field replaces the whole staging list and leaves the production list alone. Staging is not private: anyone who has the staging snippet can read what it serves. |
| `client_id` | string or null | no | Move the site to another client of the workspace, or `null` to unlink it. |
| `protection` | object | no | - |
| `protection.suspects` | one of keep, drop, null | no | `keep` or `drop`, or `null` for the default (`keep`). |
| `protection.daily_cap` | integer or null (1 to 1000000) | no | A new daily cap, up to the platform ceiling (`daily_cap_max` of the submission-usage route; above it is a 400 at `/protection/daily_cap`), or `null` for the default. |
| `protection.respect_gpc` | boolean or null | no | `true` or `false`, or `null` for the default (`true`). |

**Responses**

| Status | Meaning | Content type |
| --- | --- | --- |
| `200` | The site after the change. The two site keys never change. | `application/json` |
| `400` | `validation_failed`: a bad path parameter or body field; an allowed domain that is not a hostname is a field error at `/production_allowed_domains/<index>` or `/staging_allowed_domains/<index>` whose `code` is the reason (`has_scheme`, `has_port`, `has_path`, `is_ip_address`, `fixed_in_staging`, …) and whose `message` says what to write instead. | `application/problem+json` |
| `401` | `unauthenticated`: no credentials, or credentials that prove nothing. | `application/problem+json` |
| `402` | `workspace_payment_required`: the workspace needs a paid plan and has none, so it accepts no change; reading and exporting still work. A person pays in the portal, under Settings, Plan and billing. | `application/problem+json` |
| `403` | `insufficient_scope`: the credential lacks a scope this route needs (see `missing_scopes`). `permission_denied`: the current workspace role does not allow the action. `oauth_consent_required`: an OAuth token whose person has not yet chosen the workspace and the permissions (see `consent_url`). `mfa_required`: a portal session that must still verify or set up MFA (see `mfa_reason`). `cross_site_request`: authenticated by the session cookie, but not from the portal (another `Origin`, or not `Content-Type: application/json`). `workspace_suspended`: Taggor suspended the workspace; every credential acting in it is refused until it is lifted. | `application/problem+json` |
| `404` | `not_found`: no site with this id in the caller's workspace (also another workspace's, and a deleted one). | `application/problem+json` |
| `405` | `method_not_allowed`: the path exists, but not for this method; `Allow` lists the methods it answers. | `application/problem+json` |
| `413` | `payload_too_large`: the request body is over the limit of the route (256 KiB for JSON). | `application/problem+json` |
| `415` | `unsupported_media_type`: the body was sent with a `Content-Type` other than `application/json`. Send the body as JSON with `Content-Type: application/json`. | `application/problem+json` |
| `429` | `rate_limited`: the limit of the route class (`rate_limit.limit_class`: read, write, publish, heavy, approval, diff, metrics, destructive or ip) was reached. Wait `Retry-After` seconds. `rate_limiter_unavailable` (503) is answered for `heavy` routes and destructive calls when the limiter itself fails, and for a valid OAuth token with no grant when the consent-link limiter fails (never a 401, so an MCP client does not log in again). | `application/problem+json` |
| `500` | `internal_error` (nothing about the failure; quote `request_id`) or `configuration_error`. | `application/problem+json` |
| `503` | `database_unavailable`: the API could not reach its database (timeout, dropped connection). Wait `Retry-After` seconds and send the same request again: repeating is safe with the same `Idempotency-Key`; without it a POST may already have been applied. | `application/problem+json` |

```sh title="curl"
curl -X PATCH "https://api.taggor.dev/v1/sites/st_0123456789abcdefghjkmnpqrs" \
  -H "Authorization: Bearer $TAGGOR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Loja Aurora",
  "production_allowed_domains": [
    "cliente.com.br",
    "*.loja.cliente.com.br"
  ],
  "staging_allowed_domains": [
    "staging.cliente.com.br"
  ],
  "client_id": "cl_0123456789abcdefghjkmnpqrs"
}'
```

```ts title="TypeScript"
const response = await fetch("https://api.taggor.dev/v1/sites/st_0123456789abcdefghjkmnpqrs", {
  method: "PATCH",
  headers: { authorization: `Bearer ${process.env.TAGGOR_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({
    "name": "Loja Aurora",
    "production_allowed_domains": [
      "cliente.com.br",
      "*.loja.cliente.com.br"
    ],
    "staging_allowed_domains": [
      "staging.cliente.com.br"
    ],
    "client_id": "cl_0123456789abcdefghjkmnpqrs"
  }),
});
if (!response.ok) throw new Error(await response.text());
const result: unknown = await response.json();
console.log(result);
```

```json title="Example response"
{
  "id": "st_0123456789abcdefghjkmnpqrs",
  "name": "Renamed site",
  "production_site_key": "st_k3x7m2q7ab",
  "production_allowed_domains": [
    "cliente.com.br",
    "*.loja.cliente.com.br"
  ],
  "staging_site_key": "st_w5t2n4h6cd",
  "staging_allowed_domains": [
    "staging.cliente.com.br"
  ],
  "staging_fixed_domains": [
    "localhost",
    "127.0.0.1"
  ],
  "status": "active",
  "protection": {
    "suspects": "keep",
    "daily_cap": 1000,
    "respect_gpc": true
  },
  "client_id": "cl_0123456789abcdefghjkmnpqrs",
  "created_at": "2026-11-02T12:00:00.000Z",
  "updated_at": "2026-11-02T13:00:00.000Z"
}
```

## `DELETE /v1/sites/{site_id}`

Delete a site: it stops being served and every later read of it is a 404

Operation `deleteSite`. Scopes: `sites:write`.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `site_id` | path | string | yes | Public site id. |

**Responses**

| Status | Meaning | Content type |
| --- | --- | --- |
| `200` | The site as it was deleted (status `deleted`). Its two site keys are never issued again. | `application/json` |
| `400` | `validation_failed`: a bad path parameter or body field; an allowed domain that is not a hostname is a field error at `/production_allowed_domains/<index>` or `/staging_allowed_domains/<index>` whose `code` is the reason (`has_scheme`, `has_port`, `has_path`, `is_ip_address`, `fixed_in_staging`, …) and whose `message` says what to write instead. | `application/problem+json` |
| `401` | `unauthenticated`: no credentials, or credentials that prove nothing. | `application/problem+json` |
| `402` | `workspace_payment_required`: the workspace needs a paid plan and has none, so it accepts no change; reading and exporting still work. A person pays in the portal, under Settings, Plan and billing. | `application/problem+json` |
| `403` | `insufficient_scope`: the credential lacks a scope this route needs (see `missing_scopes`). `permission_denied`: the current workspace role does not allow the action. `oauth_consent_required`: an OAuth token whose person has not yet chosen the workspace and the permissions (see `consent_url`). `mfa_required`: a portal session that must still verify or set up MFA (see `mfa_reason`). `cross_site_request`: authenticated by the session cookie, but not from the portal (another `Origin`, or not `Content-Type: application/json`). `workspace_suspended`: Taggor suspended the workspace; every credential acting in it is refused until it is lifted. | `application/problem+json` |
| `404` | `not_found`: no site with this id in the caller's workspace (also another workspace's, and a deleted one). | `application/problem+json` |
| `405` | `method_not_allowed`: the path exists, but not for this method; `Allow` lists the methods it answers. | `application/problem+json` |
| `429` | `rate_limited`: the limit of the route class (`rate_limit.limit_class`: read, write, publish, heavy, approval, diff, metrics, destructive or ip) was reached. Wait `Retry-After` seconds. `rate_limiter_unavailable` (503) is answered for `heavy` routes and destructive calls when the limiter itself fails, and for a valid OAuth token with no grant when the consent-link limiter fails (never a 401, so an MCP client does not log in again). | `application/problem+json` |
| `500` | `internal_error` (nothing about the failure; quote `request_id`) or `configuration_error`. | `application/problem+json` |
| `503` | `database_unavailable`: the API could not reach its database (timeout, dropped connection). Wait `Retry-After` seconds and send the same request again: repeating is safe with the same `Idempotency-Key`; without it a POST may already have been applied. | `application/problem+json` |

```sh title="curl"
curl -X DELETE "https://api.taggor.dev/v1/sites/st_0123456789abcdefghjkmnpqrs" \
  -H "Authorization: Bearer $TAGGOR_API_KEY"
```

```ts title="TypeScript"
const response = await fetch("https://api.taggor.dev/v1/sites/st_0123456789abcdefghjkmnpqrs", {
  method: "DELETE",
  headers: { authorization: `Bearer ${process.env.TAGGOR_API_KEY}` },
});
if (!response.ok) throw new Error(await response.text());
const result: unknown = await response.json();
console.log(result);
```

```json title="Example response"
{
  "id": "st_0123456789abcdefghjkmnpqrs",
  "name": "Loja Aurora",
  "production_site_key": "st_k3x7m2q7ab",
  "production_allowed_domains": [
    "cliente.com.br",
    "*.loja.cliente.com.br"
  ],
  "staging_site_key": "st_w5t2n4h6cd",
  "staging_allowed_domains": [
    "staging.cliente.com.br"
  ],
  "staging_fixed_domains": [
    "localhost",
    "127.0.0.1"
  ],
  "status": "deleted",
  "protection": {
    "suspects": "keep",
    "daily_cap": 1000,
    "respect_gpc": true
  },
  "client_id": "cl_0123456789abcdefghjkmnpqrs",
  "created_at": "2026-11-02T12:00:00.000Z",
  "updated_at": "2026-11-02T14:00:00.000Z"
}
```

## `GET /v1/sites/{site_id}/snippet`

Get the two HTML snippets of a site: the production one and the staging one

A site has one snippet per environment, each an async script tag that loads that environment's loader from the Taggor origin; a snippet is the only code a website installs. `production` goes on the live website and `staging` on its test copy (or a local page): the snippet a page carries, not its domain, decides which versions it gets. If the test copy is a clone of the live website, replace the production snippet in the clone with the staging one. Available for a disabled site too, so they can be pasted before the site goes live. With `preload=true` each `html` also starts with the `<link>` hints that load the loader and the runtime early; paste it all in `<head>`.

Operation `getSiteSnippet`. Scopes: `sites:read`.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `site_id` | path | string | yes | Public site id. |
| `hold` | query | one of 1, 2, 3 | no | Seconds (1 to 3, no more: the page is never held longer) to keep the page's `.taggor-region` invisible until its components are defined; after that the page's own fallback shows, so Taggor being down or slow costs at most this long. Adds a `<style>` to the snippet, for `<head>`. Absent: no hold (the default). |
| `preload` | query | one of true, false | no | `true`: the snippet also carries `<link>` hints for the page's `<head>`: `preconnect` to the CDN, `preload` of the loader and, when the runtime version the site is served can be read, `modulepreload` of the runtime, so a page that is mostly components shows them earlier. Component bundles change with every publish, so they are not in it. Absent or `false`: the plain script tag. |

**Responses**

| Status | Meaning | Content type |
| --- | --- | --- |
| `200` | The snippet of each environment of the site. | `application/json` |
| `400` | `validation_failed`: a bad path parameter or body field; an allowed domain that is not a hostname is a field error at `/production_allowed_domains/<index>` or `/staging_allowed_domains/<index>` whose `code` is the reason (`has_scheme`, `has_port`, `has_path`, `is_ip_address`, `fixed_in_staging`, …) and whose `message` says what to write instead. | `application/problem+json` |
| `401` | `unauthenticated`: no credentials, or credentials that prove nothing. | `application/problem+json` |
| `403` | `insufficient_scope`: the credential lacks a scope this route needs (see `missing_scopes`). `permission_denied`: the current workspace role does not allow the action. `oauth_consent_required`: an OAuth token whose person has not yet chosen the workspace and the permissions (see `consent_url`). `mfa_required`: a portal session that must still verify or set up MFA (see `mfa_reason`). `workspace_suspended`: Taggor suspended the workspace; every credential acting in it is refused until it is lifted. | `application/problem+json` |
| `404` | `not_found`: no site with this id in the caller's workspace (also another workspace's, and a deleted one). | `application/problem+json` |
| `405` | `method_not_allowed`: the path exists, but not for this method; `Allow` lists the methods it answers. | `application/problem+json` |
| `429` | `rate_limited`: the limit of the route class (`rate_limit.limit_class`: read, write, publish, heavy, approval, diff, metrics, destructive or ip) was reached. Wait `Retry-After` seconds. `rate_limiter_unavailable` (503) is answered for `heavy` routes and destructive calls when the limiter itself fails, and for a valid OAuth token with no grant when the consent-link limiter fails (never a 401, so an MCP client does not log in again). | `application/problem+json` |
| `500` | `internal_error` (nothing about the failure; quote `request_id`) or `configuration_error`. | `application/problem+json` |
| `503` | `database_unavailable`: the API could not reach its database (timeout, dropped connection). Wait `Retry-After` seconds and send the same request again: repeating is safe with the same `Idempotency-Key`; without it a POST may already have been applied. | `application/problem+json` |

```sh title="curl"
curl "https://api.taggor.dev/v1/sites/st_0123456789abcdefghjkmnpqrs/snippet" \
  -H "Authorization: Bearer $TAGGOR_API_KEY"
```

```ts title="TypeScript"
const response = await fetch("https://api.taggor.dev/v1/sites/st_0123456789abcdefghjkmnpqrs/snippet", {
  headers: { authorization: `Bearer ${process.env.TAGGOR_API_KEY}` },
});
if (!response.ok) throw new Error(await response.text());
const result: unknown = await response.json();
console.log(result);
```

```json title="Example response"
{
  "production": {
    "site_key": "st_k3x7m2q7ab",
    "html": "<script async src=\"https://cdn.taggorcdn.com/s/st_k3x7m2q7ab.js\"></script>",
    "src": "https://cdn.taggorcdn.com/s/st_k3x7m2q7ab.js"
  },
  "staging": {
    "site_key": "st_w5t2n4h6cd",
    "html": "<script async src=\"https://cdn.taggorcdn.com/s/st_w5t2n4h6cd.js\"></script>",
    "src": "https://cdn.taggorcdn.com/s/st_w5t2n4h6cd.js"
  }
}
```

## `GET /v1/sites/{site_id}/installation`

Check whether pages load the snippet of one environment of a site

Whether the snippet was seen loading in the last 24 hours, from the loader requests Taggor's edge records (only the site key and the hostname of the page's `Referer`; never an IP, path, query or user agent). `detected`: a page of an allowed domain (or one that sent no `Referer`) loaded it. `domain_mismatch`: only pages outside the allowed domains did; `hostnames` lists them. `not_detected`: none. A hint for onboarding, not proof (the `Referer` can be forged, so nothing authorizes on it). `unavailable` is true when the hits could not be read; the status is then `not_detected` and means `"unknown"`. Results are cached for a short time, so a first page load can take about a minute to show.

Operation `getSiteInstallation`. Scopes: `sites:read`.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `site_id` | path | string | yes | Public site id. |
| `environment` | query | one of production, staging | no | Which snippet to look for: `production` (the default) or `staging`. Each environment has its own key, so its own page loads and its own allowed domains. |

**Responses**

| Status | Meaning | Content type |
| --- | --- | --- |
| `200` | The installation status of the environment asked. | `application/json` |
| `400` | `validation_failed`: a bad path parameter or body field; an allowed domain that is not a hostname is a field error at `/production_allowed_domains/<index>` or `/staging_allowed_domains/<index>` whose `code` is the reason (`has_scheme`, `has_port`, `has_path`, `is_ip_address`, `fixed_in_staging`, …) and whose `message` says what to write instead. | `application/problem+json` |
| `401` | `unauthenticated`: no credentials, or credentials that prove nothing. | `application/problem+json` |
| `403` | `insufficient_scope`: the credential lacks a scope this route needs (see `missing_scopes`). `permission_denied`: the current workspace role does not allow the action. `oauth_consent_required`: an OAuth token whose person has not yet chosen the workspace and the permissions (see `consent_url`). `mfa_required`: a portal session that must still verify or set up MFA (see `mfa_reason`). `workspace_suspended`: Taggor suspended the workspace; every credential acting in it is refused until it is lifted. | `application/problem+json` |
| `404` | `not_found`: no site with this id in the caller's workspace (also another workspace's, and a deleted one). | `application/problem+json` |
| `405` | `method_not_allowed`: the path exists, but not for this method; `Allow` lists the methods it answers. | `application/problem+json` |
| `429` | `rate_limited`: the limit of the route class (`rate_limit.limit_class`: read, write, publish, heavy, approval, diff, metrics, destructive or ip) was reached. Wait `Retry-After` seconds. `rate_limiter_unavailable` (503) is answered for `heavy` routes and destructive calls when the limiter itself fails, and for a valid OAuth token with no grant when the consent-link limiter fails (never a 401, so an MCP client does not log in again). | `application/problem+json` |
| `500` | `internal_error` (nothing about the failure; quote `request_id`) or `configuration_error`. | `application/problem+json` |
| `503` | `database_unavailable`: the API could not reach its database (timeout, dropped connection). Wait `Retry-After` seconds and send the same request again: repeating is safe with the same `Idempotency-Key`; without it a POST may already have been applied. | `application/problem+json` |

```sh title="curl"
curl "https://api.taggor.dev/v1/sites/st_0123456789abcdefghjkmnpqrs/installation" \
  -H "Authorization: Bearer $TAGGOR_API_KEY"
```

```ts title="TypeScript"
const response = await fetch("https://api.taggor.dev/v1/sites/st_0123456789abcdefghjkmnpqrs/installation", {
  headers: { authorization: `Bearer ${process.env.TAGGOR_API_KEY}` },
});
if (!response.ok) throw new Error(await response.text());
const result: unknown = await response.json();
console.log(result);
```

```json title="Example response"
{
  "environment": "production",
  "status": "domain_mismatch",
  "last_seen_at": "2026-11-03T12:00:00.000Z",
  "hostnames": [
    {
      "hostname": "staging.cliente.com.br",
      "allowed": false,
      "last_seen_at": "2026-11-03T12:00:00.000Z",
      "hits": 3
    }
  ],
  "window_hours": 24,
  "unavailable": false
}
```

## `GET /v1/sites/{site_id}/submission-usage`

Read how much of the site's daily submission cap is used

The daily cap of the site, the platform ceiling it can be raised to, how many submissions without a human check the last 24 hours stored, and whether the cap was reached. The portal uses it for its notice; a CLI or agent can read it before changing `protection`.

Operation `getSiteSubmissionUsage`. Scopes: `sites:read`.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `site_id` | path | string | yes | Public site id. |

**Responses**

| Status | Meaning | Content type |
| --- | --- | --- |
| `200` | The cap and its use. | `application/json` |
| `400` | `validation_failed`: a bad path parameter or body field; an allowed domain that is not a hostname is a field error at `/production_allowed_domains/<index>` or `/staging_allowed_domains/<index>` whose `code` is the reason (`has_scheme`, `has_port`, `has_path`, `is_ip_address`, `fixed_in_staging`, …) and whose `message` says what to write instead. | `application/problem+json` |
| `401` | `unauthenticated`: no credentials, or credentials that prove nothing. | `application/problem+json` |
| `403` | `insufficient_scope`: the credential lacks a scope this route needs (see `missing_scopes`). `permission_denied`: the current workspace role does not allow the action. `oauth_consent_required`: an OAuth token whose person has not yet chosen the workspace and the permissions (see `consent_url`). `mfa_required`: a portal session that must still verify or set up MFA (see `mfa_reason`). `workspace_suspended`: Taggor suspended the workspace; every credential acting in it is refused until it is lifted. | `application/problem+json` |
| `404` | `not_found`: no site with this id in the caller's workspace (also another workspace's, and a deleted one). | `application/problem+json` |
| `405` | `method_not_allowed`: the path exists, but not for this method; `Allow` lists the methods it answers. | `application/problem+json` |
| `429` | `rate_limited`: the limit of the route class (`rate_limit.limit_class`: read, write, publish, heavy, approval, diff, metrics, destructive or ip) was reached. Wait `Retry-After` seconds. `rate_limiter_unavailable` (503) is answered for `heavy` routes and destructive calls when the limiter itself fails, and for a valid OAuth token with no grant when the consent-link limiter fails (never a 401, so an MCP client does not log in again). | `application/problem+json` |
| `500` | `internal_error` (nothing about the failure; quote `request_id`) or `configuration_error`. | `application/problem+json` |
| `503` | `database_unavailable`: the API could not reach its database (timeout, dropped connection). Wait `Retry-After` seconds and send the same request again: repeating is safe with the same `Idempotency-Key`; without it a POST may already have been applied. | `application/problem+json` |

```sh title="curl"
curl "https://api.taggor.dev/v1/sites/st_0123456789abcdefghjkmnpqrs/submission-usage" \
  -H "Authorization: Bearer $TAGGOR_API_KEY"
```

```ts title="TypeScript"
const response = await fetch("https://api.taggor.dev/v1/sites/st_0123456789abcdefghjkmnpqrs/submission-usage", {
  headers: { authorization: `Bearer ${process.env.TAGGOR_API_KEY}` },
});
if (!response.ok) throw new Error(await response.text());
const result: unknown = await response.json();
console.log(result);
```

```json title="Example response"
{
  "daily_cap": 1000,
  "daily_cap_max": 5000,
  "used_24h": 120,
  "capped": false
}
```

## `POST /v1/sites/{site_id}/disable`

Switch a site off (kill switch): the edge stops delivering its components

Operation `disableSite`. Scopes: `sites:write`.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `site_id` | path | string | yes | Public site id. |
| `idempotency-key` | header | string | no | Makes a retry safe: see [Idempotency](https://taggor.dev/docs/reference/api.md#idempotency). |

**Responses**

| Status | Meaning | Content type |
| --- | --- | --- |
| `200` | The site, now `disabled`; its manifest was recompiled. Also when it already was. | `application/json` |
| `400` | `validation_failed`: a bad path parameter or body field; an allowed domain that is not a hostname is a field error at `/production_allowed_domains/<index>` or `/staging_allowed_domains/<index>` whose `code` is the reason (`has_scheme`, `has_port`, `has_path`, `is_ip_address`, `fixed_in_staging`, …) and whose `message` says what to write instead. | `application/problem+json` |
| `401` | `unauthenticated`: no credentials, or credentials that prove nothing. | `application/problem+json` |
| `402` | `workspace_payment_required`: the workspace needs a paid plan and has none, so it accepts no change; reading and exporting still work. A person pays in the portal, under Settings, Plan and billing. | `application/problem+json` |
| `403` | `insufficient_scope`: the credential lacks a scope this route needs (see `missing_scopes`). `permission_denied`: the current workspace role does not allow the action. `oauth_consent_required`: an OAuth token whose person has not yet chosen the workspace and the permissions (see `consent_url`). `mfa_required`: a portal session that must still verify or set up MFA (see `mfa_reason`). `cross_site_request`: authenticated by the session cookie, but not from the portal (another `Origin`, or not `Content-Type: application/json`). `workspace_suspended`: Taggor suspended the workspace; every credential acting in it is refused until it is lifted. | `application/problem+json` |
| `404` | `not_found`: no site with this id in the caller's workspace (also another workspace's, and a deleted one). | `application/problem+json` |
| `405` | `method_not_allowed`: the path exists, but not for this method; `Allow` lists the methods it answers. | `application/problem+json` |
| `409` | `idempotency_request_in_progress`: a request with this key is still running; retry after `Retry-After` seconds. | `application/problem+json` |
| `422` | `idempotency_key_reused`: this key was used in the last 24 h with a different request. | `application/problem+json` |
| `429` | `rate_limited`: the limit of the route class (`rate_limit.limit_class`: read, write, publish, heavy, approval, diff, metrics, destructive or ip) was reached. Wait `Retry-After` seconds. `rate_limiter_unavailable` (503) is answered for `heavy` routes and destructive calls when the limiter itself fails, and for a valid OAuth token with no grant when the consent-link limiter fails (never a 401, so an MCP client does not log in again). | `application/problem+json` |
| `500` | `internal_error` (nothing about the failure; quote `request_id`) or `configuration_error`. | `application/problem+json` |
| `503` | `database_unavailable`: the API could not reach its database (timeout, dropped connection). Wait `Retry-After` seconds and send the same request again: repeating is safe with the same `Idempotency-Key`; without it a POST may already have been applied. | `application/problem+json` |

```sh title="curl"
curl -X POST "https://api.taggor.dev/v1/sites/st_0123456789abcdefghjkmnpqrs/disable" \
  -H "Authorization: Bearer $TAGGOR_API_KEY"
```

```ts title="TypeScript"
const response = await fetch("https://api.taggor.dev/v1/sites/st_0123456789abcdefghjkmnpqrs/disable", {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.TAGGOR_API_KEY}` },
});
if (!response.ok) throw new Error(await response.text());
const result: unknown = await response.json();
console.log(result);
```

```json title="Example response"
{
  "id": "st_0123456789abcdefghjkmnpqrs",
  "name": "Loja Aurora",
  "production_site_key": "st_k3x7m2q7ab",
  "production_allowed_domains": [
    "cliente.com.br",
    "*.loja.cliente.com.br"
  ],
  "staging_site_key": "st_w5t2n4h6cd",
  "staging_allowed_domains": [
    "staging.cliente.com.br"
  ],
  "staging_fixed_domains": [
    "localhost",
    "127.0.0.1"
  ],
  "status": "disabled",
  "protection": {
    "suspects": "keep",
    "daily_cap": 1000,
    "respect_gpc": true
  },
  "client_id": "cl_0123456789abcdefghjkmnpqrs",
  "created_at": "2026-11-02T12:00:00.000Z",
  "updated_at": "2026-11-02T12:00:00.000Z"
}
```

## `POST /v1/sites/{site_id}/enable`

Switch a disabled site back on

Operation `enableSite`. Scopes: `sites:write`.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `site_id` | path | string | yes | Public site id. |
| `idempotency-key` | header | string | no | Makes a retry safe: see [Idempotency](https://taggor.dev/docs/reference/api.md#idempotency). |

**Responses**

| Status | Meaning | Content type |
| --- | --- | --- |
| `200` | The site, now `active`; its manifest was recompiled. Also when it already was. | `application/json` |
| `400` | `validation_failed`: a bad path parameter or body field; an allowed domain that is not a hostname is a field error at `/production_allowed_domains/<index>` or `/staging_allowed_domains/<index>` whose `code` is the reason (`has_scheme`, `has_port`, `has_path`, `is_ip_address`, `fixed_in_staging`, …) and whose `message` says what to write instead. | `application/problem+json` |
| `401` | `unauthenticated`: no credentials, or credentials that prove nothing. | `application/problem+json` |
| `402` | `workspace_payment_required`: the workspace needs a paid plan and has none, so it accepts no change; reading and exporting still work. A person pays in the portal, under Settings, Plan and billing. | `application/problem+json` |
| `403` | `insufficient_scope`: the credential lacks a scope this route needs (see `missing_scopes`). `permission_denied`: the current workspace role does not allow the action. `oauth_consent_required`: an OAuth token whose person has not yet chosen the workspace and the permissions (see `consent_url`). `mfa_required`: a portal session that must still verify or set up MFA (see `mfa_reason`). `cross_site_request`: authenticated by the session cookie, but not from the portal (another `Origin`, or not `Content-Type: application/json`). `workspace_suspended`: Taggor suspended the workspace; every credential acting in it is refused until it is lifted. | `application/problem+json` |
| `404` | `not_found`: no site with this id in the caller's workspace (also another workspace's, and a deleted one). | `application/problem+json` |
| `405` | `method_not_allowed`: the path exists, but not for this method; `Allow` lists the methods it answers. | `application/problem+json` |
| `409` | `idempotency_request_in_progress`: a request with this key is still running; retry after `Retry-After` seconds. | `application/problem+json` |
| `422` | `idempotency_key_reused`: this key was used in the last 24 h with a different request. | `application/problem+json` |
| `429` | `rate_limited`: the limit of the route class (`rate_limit.limit_class`: read, write, publish, heavy, approval, diff, metrics, destructive or ip) was reached. Wait `Retry-After` seconds. `rate_limiter_unavailable` (503) is answered for `heavy` routes and destructive calls when the limiter itself fails, and for a valid OAuth token with no grant when the consent-link limiter fails (never a 401, so an MCP client does not log in again). | `application/problem+json` |
| `500` | `internal_error` (nothing about the failure; quote `request_id`) or `configuration_error`. | `application/problem+json` |
| `503` | `database_unavailable`: the API could not reach its database (timeout, dropped connection). Wait `Retry-After` seconds and send the same request again: repeating is safe with the same `Idempotency-Key`; without it a POST may already have been applied. | `application/problem+json` |

```sh title="curl"
curl -X POST "https://api.taggor.dev/v1/sites/st_0123456789abcdefghjkmnpqrs/enable" \
  -H "Authorization: Bearer $TAGGOR_API_KEY"
```

```ts title="TypeScript"
const response = await fetch("https://api.taggor.dev/v1/sites/st_0123456789abcdefghjkmnpqrs/enable", {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.TAGGOR_API_KEY}` },
});
if (!response.ok) throw new Error(await response.text());
const result: unknown = await response.json();
console.log(result);
```

```json title="Example response"
{
  "id": "st_0123456789abcdefghjkmnpqrs",
  "name": "Loja Aurora",
  "production_site_key": "st_k3x7m2q7ab",
  "production_allowed_domains": [
    "cliente.com.br",
    "*.loja.cliente.com.br"
  ],
  "staging_site_key": "st_w5t2n4h6cd",
  "staging_allowed_domains": [
    "staging.cliente.com.br"
  ],
  "staging_fixed_domains": [
    "localhost",
    "127.0.0.1"
  ],
  "status": "active",
  "protection": {
    "suspects": "keep",
    "daily_cap": 1000,
    "respect_gpc": true
  },
  "client_id": "cl_0123456789abcdefghjkmnpqrs",
  "created_at": "2026-11-02T12:00:00.000Z",
  "updated_at": "2026-11-02T12:00:00.000Z"
}
```

## `GET /v1/sites/{site_id}/server-keys`

List the unrevoked SSR server keys of a site (prefix and date, never the secret)

Operation `listSiteServerKeys`. Scopes: `sites:read`.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `site_id` | path | string | yes | Public site id. |
| `limit` | query | integer (1 to 100, default 20) | no | Page size, 1 to 100. |
| `cursor` | query | string | no | Opaque `next_cursor` of the previous page, for the same list and filters. Omit for the first page. |

**Responses**

| Status | Meaning | Content type |
| --- | --- | --- |
| `200` | One page of the unrevoked keys, newest first (a site holds at most four). | `application/json` |
| `400` | `validation_failed` (bad `limit` or filter) or `invalid_cursor`. | `application/problem+json` |
| `401` | `unauthenticated`: no credentials, or credentials that prove nothing. | `application/problem+json` |
| `403` | `insufficient_scope`: the credential lacks a scope this route needs (see `missing_scopes`). `permission_denied`: the current workspace role does not allow the action. `oauth_consent_required`: an OAuth token whose person has not yet chosen the workspace and the permissions (see `consent_url`). `mfa_required`: a portal session that must still verify or set up MFA (see `mfa_reason`). `workspace_suspended`: Taggor suspended the workspace; every credential acting in it is refused until it is lifted. | `application/problem+json` |
| `404` | `not_found`: no site with this id in the caller's workspace (also another workspace's, and a deleted one). | `application/problem+json` |
| `405` | `method_not_allowed`: the path exists, but not for this method; `Allow` lists the methods it answers. | `application/problem+json` |
| `429` | `rate_limited`: the limit of the route class (`rate_limit.limit_class`: read, write, publish, heavy, approval, diff, metrics, destructive or ip) was reached. Wait `Retry-After` seconds. `rate_limiter_unavailable` (503) is answered for `heavy` routes and destructive calls when the limiter itself fails, and for a valid OAuth token with no grant when the consent-link limiter fails (never a 401, so an MCP client does not log in again). | `application/problem+json` |
| `500` | `internal_error` (nothing about the failure; quote `request_id`) or `configuration_error`. | `application/problem+json` |
| `503` | `database_unavailable`: the API could not reach its database (timeout, dropped connection). Wait `Retry-After` seconds and send the same request again: repeating is safe with the same `Idempotency-Key`; without it a POST may already have been applied. | `application/problem+json` |

```sh title="curl"
curl "https://api.taggor.dev/v1/sites/st_0123456789abcdefghjkmnpqrs/server-keys" \
  -H "Authorization: Bearer $TAGGOR_API_KEY"
```

```ts title="TypeScript"
const response = await fetch("https://api.taggor.dev/v1/sites/st_0123456789abcdefghjkmnpqrs/server-keys", {
  headers: { authorization: `Bearer ${process.env.TAGGOR_API_KEY}` },
});
if (!response.ok) throw new Error(await response.text());
const result: unknown = await response.json();
console.log(result);
```

```json title="Example response"
{
  "data": [
    {
      "id": "ssk_0123456789abcdefghjkmnpqrs",
      "site_id": "st_0123456789abcdefghjkmnpqrs",
      "environment": "production",
      "display_prefix": "tgs_live_9Fh3QpL2",
      "created_by": {
        "id": "usr_0123456789abcdefghjkmnpqrs",
        "kind": "user",
        "name": "Ana"
      },
      "created_at": "2026-11-13T12:00:00.000Z",
      "revoked_at": null
    }
  ],
  "next_cursor": null,
  "has_more": false
}
```

## `POST /v1/sites/{site_id}/server-keys`

Create an SSR server key for one environment of a site (turns server rendering on there); its secret is shown only in this response

The body says which environment the key is for (`production` or `staging`): a key renders what that environment serves and works only with that environment's site key. Each environment holds at most two keys (the current one and the previous one). A person must first enable server-side rendering for the workspace, once, in the portal (acceptance A.5 of the Terms; `POST /v1/ssr-acceptance` is the person's own act): until then this answers 403 `human_action_required` with the page and the steps, and no key is generated. After that an agent may create and revoke keys without a new acceptance. The secret is in this response only: put it in the server's environment, never in a log, a chat or the repository.

Operation `createSiteServerKey`. Scopes: `sites:write`.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `site_id` | path | string | yes | Public site id. |
| `idempotency-key` | header | string | no | Makes a retry safe: see [Idempotency](https://taggor.dev/docs/reference/api.md#idempotency). |

**Request body** (`application/json`, required)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `environment` | one of production, staging | yes | Which environment of the site the new key is for: `production` for the server of the live website (use it with `production_site_key`), `staging` for the server of the test copy (use it with `staging_site_key`). A key never works with the other environment's site key. |

**Responses**

| Status | Meaning | Content type |
| --- | --- | --- |
| `201` | The key and its `secret`. Store the secret now in the server's environment: it is never shown again, and a repeat with the same `Idempotency-Key` creates another key instead of replaying this response. | `application/json` |
| `400` | `validation_failed`: a bad path parameter. | `application/problem+json` |
| `401` | `unauthenticated`: no credentials, or credentials that prove nothing. | `application/problem+json` |
| `402` | `workspace_payment_required`: the workspace needs a paid plan and has none, so it accepts no change; reading and exporting still work. A person pays in the portal, under Settings, Plan and billing. | `application/problem+json` |
| `403` | `insufficient_scope`: the credential lacks a scope this route needs (see `missing_scopes`). `permission_denied`: the current workspace role does not allow the action. `oauth_consent_required`: an OAuth token whose person has not yet chosen the workspace and the permissions (see `consent_url`). `mfa_required`: a portal session that must still verify or set up MFA (see `mfa_reason`). `cross_site_request`: authenticated by the session cookie, but not from the portal (another `Origin`, or not `Content-Type: application/json`). `workspace_suspended`: Taggor suspended the workspace; every credential acting in it is refused until it is lifted. Also `human_action_required` (with `human_action.action` `ssr_acceptance`): no person has enabled server-side rendering for the workspace yet (acceptance A.5 of the Terms, `POST /v1/ssr-acceptance`): tell the person where to do it and do not retry. Revoking a key never needs it. | `application/problem+json` |
| `404` | `not_found`: no site with this id in the caller's workspace (also another workspace's, and a deleted one). | `application/problem+json` |
| `405` | `method_not_allowed`: the path exists, but not for this method; `Allow` lists the methods it answers. | `application/problem+json` |
| `409` | `server_key_limit_reached`: the site already holds two unrevoked server keys (current and previous); revoke one and retry. Nothing was created; the body carries `limit`, `plan` and `upgrade_url`. `idempotency_request_in_progress`: a request with this key is still running; retry after `Retry-After` seconds. | `application/problem+json` |
| `413` | `payload_too_large`: the request body is over the limit of the route (256 KiB for JSON). | `application/problem+json` |
| `415` | `unsupported_media_type`: the body was sent with a `Content-Type` other than `application/json`. Send the body as JSON with `Content-Type: application/json`. | `application/problem+json` |
| `422` | `idempotency_key_reused`: this key was used in the last 24 h with a different request. | `application/problem+json` |
| `429` | `rate_limited`: the limit of the route class (`rate_limit.limit_class`: read, write, publish, heavy, approval, diff, metrics, destructive or ip) was reached. Wait `Retry-After` seconds. `rate_limiter_unavailable` (503) is answered for `heavy` routes and destructive calls when the limiter itself fails, and for a valid OAuth token with no grant when the consent-link limiter fails (never a 401, so an MCP client does not log in again). | `application/problem+json` |
| `500` | `internal_error` (nothing about the failure; quote `request_id`) or `configuration_error`. | `application/problem+json` |
| `503` | `manifest_publish_unavailable`: the change was saved, but the site manifest could not be published yet; wait `Retry-After` seconds and send the same request again (the same `Idempotency-Key` is safe). `database_unavailable`: the API could not reach its database; wait `Retry-After` seconds and send the same request again. | `application/problem+json` |

```sh title="curl"
curl -X POST "https://api.taggor.dev/v1/sites/st_0123456789abcdefghjkmnpqrs/server-keys" \
  -H "Authorization: Bearer $TAGGOR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "environment": "production"
}'
```

```ts title="TypeScript"
const response = await fetch("https://api.taggor.dev/v1/sites/st_0123456789abcdefghjkmnpqrs/server-keys", {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.TAGGOR_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({
    "environment": "production"
  }),
});
if (!response.ok) throw new Error(await response.text());
const result: unknown = await response.json();
console.log(result);
```

```json title="Example response"
{
  "id": "ssk_0123456789abcdefghjkmnpqrs",
  "site_id": "st_0123456789abcdefghjkmnpqrs",
  "environment": "production",
  "display_prefix": "tgs_live_9Fh3QpL2",
  "created_by": {
    "id": "usr_0123456789abcdefghjkmnpqrs",
    "kind": "user",
    "name": "Ana"
  },
  "created_at": "2026-11-13T12:00:00.000Z",
  "revoked_at": null,
  "secret": "tgs_live_9Fh3QpL2…"
}
```

## `DELETE /v1/sites/{site_id}/server-keys/{server_key_id}`

Revoke an SSR server key of a site: the edge refuses it within about a minute

Operation `revokeSiteServerKey`. Scopes: `sites:write`.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `site_id` | path | string | yes | Public site id. |
| `server_key_id` | path | string | yes | Public server_key id. |

**Responses**

| Status | Meaning | Content type |
| --- | --- | --- |
| `200` | The revoked key (`revoked_at` set). Also when it already was: the edge copy is published again. | `application/json` |
| `400` | `validation_failed`: a bad path parameter. | `application/problem+json` |
| `401` | `unauthenticated`: no credentials, or credentials that prove nothing. | `application/problem+json` |
| `402` | `workspace_payment_required`: the workspace needs a paid plan and has none, so it accepts no change; reading and exporting still work. A person pays in the portal, under Settings, Plan and billing. | `application/problem+json` |
| `403` | `insufficient_scope`: the credential lacks a scope this route needs (see `missing_scopes`). `permission_denied`: the current workspace role does not allow the action. `oauth_consent_required`: an OAuth token whose person has not yet chosen the workspace and the permissions (see `consent_url`). `mfa_required`: a portal session that must still verify or set up MFA (see `mfa_reason`). `cross_site_request`: authenticated by the session cookie, but not from the portal (another `Origin`, or not `Content-Type: application/json`). `workspace_suspended`: Taggor suspended the workspace; every credential acting in it is refused until it is lifted. | `application/problem+json` |
| `404` | `not_found`: no such site in the caller's workspace, or no key with this id on it. | `application/problem+json` |
| `405` | `method_not_allowed`: the path exists, but not for this method; `Allow` lists the methods it answers. | `application/problem+json` |
| `429` | `rate_limited`: the limit of the route class (`rate_limit.limit_class`: read, write, publish, heavy, approval, diff, metrics, destructive or ip) was reached. Wait `Retry-After` seconds. `rate_limiter_unavailable` (503) is answered for `heavy` routes and destructive calls when the limiter itself fails, and for a valid OAuth token with no grant when the consent-link limiter fails (never a 401, so an MCP client does not log in again). | `application/problem+json` |
| `500` | `internal_error` (nothing about the failure; quote `request_id`) or `configuration_error`. | `application/problem+json` |
| `503` | `manifest_publish_unavailable`: the change was saved, but the site manifest could not be published yet; wait `Retry-After` seconds and send the same request again (the same `Idempotency-Key` is safe). `database_unavailable`: the API could not reach its database; wait `Retry-After` seconds and send the same request again. | `application/problem+json` |

```sh title="curl"
curl -X DELETE "https://api.taggor.dev/v1/sites/st_0123456789abcdefghjkmnpqrs/server-keys/ssk_0123456789abcdefghjkmnpqrs" \
  -H "Authorization: Bearer $TAGGOR_API_KEY"
```

```ts title="TypeScript"
const response = await fetch("https://api.taggor.dev/v1/sites/st_0123456789abcdefghjkmnpqrs/server-keys/ssk_0123456789abcdefghjkmnpqrs", {
  method: "DELETE",
  headers: { authorization: `Bearer ${process.env.TAGGOR_API_KEY}` },
});
if (!response.ok) throw new Error(await response.text());
const result: unknown = await response.json();
console.log(result);
```

```json title="Example response"
{
  "id": "ssk_0123456789abcdefghjkmnpqrs",
  "site_id": "st_0123456789abcdefghjkmnpqrs",
  "environment": "production",
  "display_prefix": "tgs_live_9Fh3QpL2",
  "created_by": {
    "id": "usr_0123456789abcdefghjkmnpqrs",
    "kind": "user",
    "name": "Ana"
  },
  "created_at": "2026-11-13T12:00:00.000Z",
  "revoked_at": "2026-11-14T09:00:00.000Z"
}
```

## `GET /v1/sites/{site_id}/components`

List the components attached to a site

Operation `listSiteComponents`. Scopes: `sites:read`.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `site_id` | path | string | yes | Public site id. |
| `limit` | query | integer (1 to 100, default 20) | no | Page size, 1 to 100. |
| `cursor` | query | string | no | Opaque `next_cursor` of the previous page, for the same list and filters. Omit for the first page. |

**Responses**

| Status | Meaning | Content type |
| --- | --- | --- |
| `200` | One page of the attachments, newest first. A site holds up to 800 by plan: follow `next_cursor` for the rest. | `application/json` |
| `400` | `validation_failed` (bad `limit` or filter) or `invalid_cursor`. | `application/problem+json` |
| `401` | `unauthenticated`: no credentials, or credentials that prove nothing. | `application/problem+json` |
| `403` | `insufficient_scope`: the credential lacks a scope this route needs (see `missing_scopes`). `permission_denied`: the current workspace role does not allow the action. `oauth_consent_required`: an OAuth token whose person has not yet chosen the workspace and the permissions (see `consent_url`). `mfa_required`: a portal session that must still verify or set up MFA (see `mfa_reason`). `workspace_suspended`: Taggor suspended the workspace; every credential acting in it is refused until it is lifted. | `application/problem+json` |
| `404` | `not_found`: no site (or, when attaching, component) with this id in the caller's workspace; also another workspace's. | `application/problem+json` |
| `405` | `method_not_allowed`: the path exists, but not for this method; `Allow` lists the methods it answers. | `application/problem+json` |
| `429` | `rate_limited`: the limit of the route class (`rate_limit.limit_class`: read, write, publish, heavy, approval, diff, metrics, destructive or ip) was reached. Wait `Retry-After` seconds. `rate_limiter_unavailable` (503) is answered for `heavy` routes and destructive calls when the limiter itself fails, and for a valid OAuth token with no grant when the consent-link limiter fails (never a 401, so an MCP client does not log in again). | `application/problem+json` |
| `500` | `internal_error` (nothing about the failure; quote `request_id`) or `configuration_error`. | `application/problem+json` |
| `503` | `database_unavailable`: the API could not reach its database (timeout, dropped connection). Wait `Retry-After` seconds and send the same request again: repeating is safe with the same `Idempotency-Key`; without it a POST may already have been applied. | `application/problem+json` |

```sh title="curl"
curl "https://api.taggor.dev/v1/sites/st_0123456789abcdefghjkmnpqrs/components" \
  -H "Authorization: Bearer $TAGGOR_API_KEY"
```

```ts title="TypeScript"
const response = await fetch("https://api.taggor.dev/v1/sites/st_0123456789abcdefghjkmnpqrs/components", {
  headers: { authorization: `Bearer ${process.env.TAGGOR_API_KEY}` },
});
if (!response.ok) throw new Error(await response.text());
const result: unknown = await response.json();
console.log(result);
```

```json title="Example response"
{
  "data": [
    {
      "id": "cmp_0123456789abcdefghjkmnpqrs",
      "tag": "price-card",
      "production": {
        "served_version_id": "ver_0123456789abcdefghjkmnpqrs",
        "served_semver": "1.2.0",
        "source": "production_channel",
        "pinned_version_id": null,
        "suspended_props": []
      },
      "staging": {
        "served_version_id": "ver_9876543210abcdefghjkmnpqrs",
        "served_semver": "1.3.0",
        "source": "staging_channel",
        "pinned_version_id": null,
        "suspended_props": []
      },
      "enabled": true,
      "loading": "eager",
      "archived_at": null,
      "props": {
        "accent": "#0a7d3b"
      },
      "props_revision": 3,
      "created_at": "2026-11-02T12:00:00.000Z"
    }
  ],
  "next_cursor": null,
  "has_more": false
}
```

## `POST /v1/sites/{site_id}/components`

Attach a component to a site

Operation `attachSiteComponent`. Scopes: `sites:write`.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `site_id` | path | string | yes | Public site id. |
| `idempotency-key` | header | string | no | Makes a retry safe: see [Idempotency](https://taggor.dev/docs/reference/api.md#idempotency). |

**Request body** (`application/json`, required)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `component_id` | string | yes | Public component id. |

**Responses**

| Status | Meaning | Content type |
| --- | --- | --- |
| `200` | The component was already attached: nothing changed. The manifest was recompiled again. | `application/json` |
| `201` | The component is now attached; the site's manifest was recompiled. | `application/json` |
| `400` | `validation_failed`: a bad path parameter or body field. | `application/problem+json` |
| `401` | `unauthenticated`: no credentials, or credentials that prove nothing. | `application/problem+json` |
| `402` | `workspace_payment_required`: the workspace needs a paid plan and has none, so it accepts no change; reading and exporting still work. A person pays in the portal, under Settings, Plan and billing. | `application/problem+json` |
| `403` | `insufficient_scope`: the credential lacks a scope this route needs (see `missing_scopes`). `permission_denied`: the current workspace role does not allow the action. `oauth_consent_required`: an OAuth token whose person has not yet chosen the workspace and the permissions (see `consent_url`). `mfa_required`: a portal session that must still verify or set up MFA (see `mfa_reason`). `cross_site_request`: authenticated by the session cookie, but not from the portal (another `Origin`, or not `Content-Type: application/json`). `workspace_suspended`: Taggor suspended the workspace; every credential acting in it is refused until it is lifted. | `application/problem+json` |
| `404` | `not_found`: no site (or, when attaching, component) with this id in the caller's workspace; also another workspace's. | `application/problem+json` |
| `405` | `method_not_allowed`: the path exists, but not for this method; `Allow` lists the methods it answers. | `application/problem+json` |
| `409` | `tag_conflict` (another attached component has the same tag: `tag`, `component_ids`), `component_archived`, `site_component_limit` or `idempotency_request_in_progress`. | `application/problem+json` |
| `413` | `payload_too_large`: the request body is over the limit of the route (256 KiB for JSON). | `application/problem+json` |
| `415` | `unsupported_media_type`: the body was sent with a `Content-Type` other than `application/json`. Send the body as JSON with `Content-Type: application/json`. | `application/problem+json` |
| `422` | `idempotency_key_reused`: this key was used in the last 24 h with a different request. | `application/problem+json` |
| `429` | `rate_limited`: the limit of the route class (`rate_limit.limit_class`: read, write, publish, heavy, approval, diff, metrics, destructive or ip) was reached. Wait `Retry-After` seconds. `rate_limiter_unavailable` (503) is answered for `heavy` routes and destructive calls when the limiter itself fails, and for a valid OAuth token with no grant when the consent-link limiter fails (never a 401, so an MCP client does not log in again). | `application/problem+json` |
| `500` | `internal_error` (nothing about the failure; quote `request_id`) or `configuration_error`. | `application/problem+json` |
| `503` | `manifest_publish_unavailable`: the change was saved, but the site manifest could not be published yet; wait `Retry-After` seconds and send the same request again (the same `Idempotency-Key` is safe). `database_unavailable`: the API could not reach its database; wait `Retry-After` seconds and send the same request again. | `application/problem+json` |

```sh title="curl"
curl -X POST "https://api.taggor.dev/v1/sites/st_0123456789abcdefghjkmnpqrs/components" \
  -H "Authorization: Bearer $TAGGOR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "component_id": "cmp_0123456789abcdefghjkmnpqrs"
}'
```

```ts title="TypeScript"
const response = await fetch("https://api.taggor.dev/v1/sites/st_0123456789abcdefghjkmnpqrs/components", {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.TAGGOR_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({
    "component_id": "cmp_0123456789abcdefghjkmnpqrs"
  }),
});
if (!response.ok) throw new Error(await response.text());
const result: unknown = await response.json();
console.log(result);
```

```json title="Example response"
{
  "id": "cmp_0123456789abcdefghjkmnpqrs",
  "tag": "price-card",
  "production": {
    "served_version_id": "ver_0123456789abcdefghjkmnpqrs",
    "served_semver": "1.2.0",
    "source": "production_channel",
    "pinned_version_id": null,
    "suspended_props": []
  },
  "staging": {
    "served_version_id": "ver_9876543210abcdefghjkmnpqrs",
    "served_semver": "1.3.0",
    "source": "staging_channel",
    "pinned_version_id": null,
    "suspended_props": []
  },
  "enabled": true,
  "loading": "eager",
  "archived_at": null,
  "props": {
    "accent": "#0a7d3b"
  },
  "props_revision": 3,
  "created_at": "2026-11-02T12:00:00.000Z"
}
```

## `PATCH /v1/sites/{site_id}/components/{component_id}`

Switch an attached component off or on for this site (kill switch)

Operation `updateSiteComponent`. Scopes: `sites:write`.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `site_id` | path | string | yes | Public site id. |
| `component_id` | path | string | yes | Public component id. |

**Request body** (`application/json`, required)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `enabled` | boolean | no | `false` stops the site delivering this component (the per-component kill switch); `true` brings it back. |
| `loading` | one of eager, idle | no | When the loader imports the component's bundle: `eager` on load (the default) or `idle` once the page is idle, so a component low on the page does not compete with what the visitor sees first. |

**Responses**

| Status | Meaning | Content type |
| --- | --- | --- |
| `200` | The attachment after the change; the site's manifest was recompiled, so the edge stops (or resumes) delivering the component within about a minute. | `application/json` |
| `400` | `validation_failed`: a bad path parameter or body field, or a body with no field to change. | `application/problem+json` |
| `401` | `unauthenticated`: no credentials, or credentials that prove nothing. | `application/problem+json` |
| `402` | `workspace_payment_required`: the workspace needs a paid plan and has none, so it accepts no change; reading and exporting still work. A person pays in the portal, under Settings, Plan and billing. | `application/problem+json` |
| `403` | `insufficient_scope`: the credential lacks a scope this route needs (see `missing_scopes`). `permission_denied`: the current workspace role does not allow the action. `oauth_consent_required`: an OAuth token whose person has not yet chosen the workspace and the permissions (see `consent_url`). `mfa_required`: a portal session that must still verify or set up MFA (see `mfa_reason`). `cross_site_request`: authenticated by the session cookie, but not from the portal (another `Origin`, or not `Content-Type: application/json`). `workspace_suspended`: Taggor suspended the workspace; every credential acting in it is refused until it is lifted. | `application/problem+json` |
| `404` | `not_found`: no site (or, when attaching, component) with this id in the caller's workspace; also another workspace's. | `application/problem+json` |
| `405` | `method_not_allowed`: the path exists, but not for this method; `Allow` lists the methods it answers. | `application/problem+json` |
| `413` | `payload_too_large`: the request body is over the limit of the route (256 KiB for JSON). | `application/problem+json` |
| `415` | `unsupported_media_type`: the body was sent with a `Content-Type` other than `application/json`. Send the body as JSON with `Content-Type: application/json`. | `application/problem+json` |
| `429` | `rate_limited`: the limit of the route class (`rate_limit.limit_class`: read, write, publish, heavy, approval, diff, metrics, destructive or ip) was reached. Wait `Retry-After` seconds. `rate_limiter_unavailable` (503) is answered for `heavy` routes and destructive calls when the limiter itself fails, and for a valid OAuth token with no grant when the consent-link limiter fails (never a 401, so an MCP client does not log in again). | `application/problem+json` |
| `500` | `internal_error` (nothing about the failure; quote `request_id`) or `configuration_error`. | `application/problem+json` |
| `503` | `manifest_publish_unavailable`: the change was saved, but the site manifest could not be published yet; wait `Retry-After` seconds and send the same request again (the same `Idempotency-Key` is safe). `database_unavailable`: the API could not reach its database; wait `Retry-After` seconds and send the same request again. | `application/problem+json` |

```sh title="curl"
curl -X PATCH "https://api.taggor.dev/v1/sites/st_0123456789abcdefghjkmnpqrs/components/cmp_0123456789abcdefghjkmnpqrs" \
  -H "Authorization: Bearer $TAGGOR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

```ts title="TypeScript"
const response = await fetch("https://api.taggor.dev/v1/sites/st_0123456789abcdefghjkmnpqrs/components/cmp_0123456789abcdefghjkmnpqrs", {
  method: "PATCH",
  headers: { authorization: `Bearer ${process.env.TAGGOR_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}),
});
if (!response.ok) throw new Error(await response.text());
const result: unknown = await response.json();
console.log(result);
```

```json title="Example response"
{
  "id": "cmp_0123456789abcdefghjkmnpqrs",
  "tag": "price-card",
  "production": {
    "served_version_id": "ver_0123456789abcdefghjkmnpqrs",
    "served_semver": "1.2.0",
    "source": "production_channel",
    "pinned_version_id": null,
    "suspended_props": []
  },
  "staging": {
    "served_version_id": "ver_9876543210abcdefghjkmnpqrs",
    "served_semver": "1.3.0",
    "source": "staging_channel",
    "pinned_version_id": null,
    "suspended_props": []
  },
  "enabled": false,
  "loading": "eager",
  "archived_at": null,
  "props": {
    "accent": "#0a7d3b"
  },
  "props_revision": 3,
  "created_at": "2026-11-02T12:00:00.000Z"
}
```

## `DELETE /v1/sites/{site_id}/components/{component_id}`

Detach a component from a site

Removes the attachment with everything it holds: the props saved for this site, the version pinned in each environment and the loading setting. Attaching the component again starts a new attachment with none of them, so each environment follows its channel.

Operation `detachSiteComponent`. Scopes: `sites:write`.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `site_id` | path | string | yes | Public site id. |
| `component_id` | path | string | yes | Public component id. |

**Responses**

| Status | Meaning | Content type |
| --- | --- | --- |
| `200` | The attachment as it was before it was removed; the site's manifest was recompiled. A component that is not attached is a 404 (the manifest is compiled again anyway, which heals a first failed publish). | `application/json` |
| `400` | `validation_failed`: a bad path parameter. | `application/problem+json` |
| `401` | `unauthenticated`: no credentials, or credentials that prove nothing. | `application/problem+json` |
| `402` | `workspace_payment_required`: the workspace needs a paid plan and has none, so it accepts no change; reading and exporting still work. A person pays in the portal, under Settings, Plan and billing. | `application/problem+json` |
| `403` | `insufficient_scope`: the credential lacks a scope this route needs (see `missing_scopes`). `permission_denied`: the current workspace role does not allow the action. `oauth_consent_required`: an OAuth token whose person has not yet chosen the workspace and the permissions (see `consent_url`). `mfa_required`: a portal session that must still verify or set up MFA (see `mfa_reason`). `cross_site_request`: authenticated by the session cookie, but not from the portal (another `Origin`, or not `Content-Type: application/json`). `workspace_suspended`: Taggor suspended the workspace; every credential acting in it is refused until it is lifted. | `application/problem+json` |
| `404` | `not_found`: no site (or, when attaching, component) with this id in the caller's workspace; also another workspace's. | `application/problem+json` |
| `405` | `method_not_allowed`: the path exists, but not for this method; `Allow` lists the methods it answers. | `application/problem+json` |
| `429` | `rate_limited`: the limit of the route class (`rate_limit.limit_class`: read, write, publish, heavy, approval, diff, metrics, destructive or ip) was reached. Wait `Retry-After` seconds. `rate_limiter_unavailable` (503) is answered for `heavy` routes and destructive calls when the limiter itself fails, and for a valid OAuth token with no grant when the consent-link limiter fails (never a 401, so an MCP client does not log in again). | `application/problem+json` |
| `500` | `internal_error` (nothing about the failure; quote `request_id`) or `configuration_error`. | `application/problem+json` |
| `503` | `manifest_publish_unavailable`: the change was saved, but the site manifest could not be published yet; wait `Retry-After` seconds and send the same request again (the same `Idempotency-Key` is safe). `database_unavailable`: the API could not reach its database; wait `Retry-After` seconds and send the same request again. | `application/problem+json` |

```sh title="curl"
curl -X DELETE "https://api.taggor.dev/v1/sites/st_0123456789abcdefghjkmnpqrs/components/cmp_0123456789abcdefghjkmnpqrs" \
  -H "Authorization: Bearer $TAGGOR_API_KEY"
```

```ts title="TypeScript"
const response = await fetch("https://api.taggor.dev/v1/sites/st_0123456789abcdefghjkmnpqrs/components/cmp_0123456789abcdefghjkmnpqrs", {
  method: "DELETE",
  headers: { authorization: `Bearer ${process.env.TAGGOR_API_KEY}` },
});
if (!response.ok) throw new Error(await response.text());
const result: unknown = await response.json();
console.log(result);
```

```json title="Example response"
{
  "id": "cmp_0123456789abcdefghjkmnpqrs",
  "tag": "price-card",
  "production": {
    "served_version_id": "ver_0123456789abcdefghjkmnpqrs",
    "served_semver": "1.2.0",
    "source": "production_channel",
    "pinned_version_id": null,
    "suspended_props": []
  },
  "staging": {
    "served_version_id": "ver_9876543210abcdefghjkmnpqrs",
    "served_semver": "1.3.0",
    "source": "staging_channel",
    "pinned_version_id": null,
    "suspended_props": []
  },
  "enabled": true,
  "loading": "eager",
  "archived_at": null,
  "props": {
    "accent": "#0a7d3b"
  },
  "props_revision": 3,
  "created_at": "2026-11-02T12:00:00.000Z"
}
```

## `PUT /v1/sites/{site_id}/components/{component_id}/props`

Set the props a site gives an attached component

Replaces the props of this attachment, one set for both environments of the site. Each prop must be declared, with a value of its type, by the version that at least one environment serves; an environment whose version does not accept a prop leaves it out and lists it in its `suspended_props`. The props become the `defaults` of the component in the site's manifests; the attribute written on the page wins over them, and they win over the component's own default.

Operation `setSiteComponentProps`. Scopes: `sites:write`.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `site_id` | path | string | yes | Public site id. |
| `component_id` | path | string | yes | Public component id. |

**Request body** (`application/json`, required)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `props` | object | yes | The whole set of props for this site (it replaces the previous one; `{}` clears it), each one a prop the component's version on the attachment's channel declares, with a value of its type. Public in the site's manifest: put no secret or personal data here. At most 8 KiB of JSON (larger is a 400). |
| `expected_revision` | integer (0 to 2147483647) | no | The `props_revision` of the attachment you read before editing. When it changed since (another person or agent saved), nothing is written and the answer is a 409 `site_props_conflict`: read the attachment again and apply your change over what it holds now. Omitted: the props are replaced whatever they are. |
| `expected_attached_at` | string | no | The `created_at` of the attachment you read before editing. A detach and an attach make a new attachment whose `props_revision` starts again, so the revision alone can match one you never read; with this the write happens only over the attachment you read, else a 409 `site_props_conflict`. Optional and independent of `expected_revision`: omitted, it is not checked. |

**Responses**

| Status | Meaning | Content type |
| --- | --- | --- |
| `200` | The attachment with its props; the site's manifest was recompiled and its cached loader purged. | `application/json` |
| `400` | `validation_failed`: a bad path parameter or a malformed body, or a prop that no version served by the site declares, or a value of the wrong type for all of them; `errors[]` has the JSON Pointer of each (at most 50). | `application/problem+json` |
| `401` | `unauthenticated`: no credentials, or credentials that prove nothing. | `application/problem+json` |
| `402` | `workspace_payment_required`: the workspace needs a paid plan and has none, so it accepts no change; reading and exporting still work. A person pays in the portal, under Settings, Plan and billing. | `application/problem+json` |
| `403` | `insufficient_scope`: the credential lacks a scope this route needs (see `missing_scopes`). `permission_denied`: the current workspace role does not allow the action. `oauth_consent_required`: an OAuth token whose person has not yet chosen the workspace and the permissions (see `consent_url`). `mfa_required`: a portal session that must still verify or set up MFA (see `mfa_reason`). `cross_site_request`: authenticated by the session cookie, but not from the portal (another `Origin`, or not `Content-Type: application/json`). `workspace_suspended`: Taggor suspended the workspace; every credential acting in it is refused until it is lifted. | `application/problem+json` |
| `404` | `not_found`: no site (or, when attaching, component) with this id in the caller's workspace; also another workspace's. | `application/problem+json` |
| `405` | `method_not_allowed`: the path exists, but not for this method; `Allow` lists the methods it answers. | `application/problem+json` |
| `409` | `channel_has_no_version` (neither environment of the site serves a version of the component yet: promote one, or pin one), `component_archived`, or `site_props_conflict` (`expected_revision` or `expected_attached_at` is no longer the attachment's: read it again). | `application/problem+json` |
| `413` | `payload_too_large`: the request body is over the limit of the route (256 KiB for JSON). | `application/problem+json` |
| `415` | `unsupported_media_type`: the body was sent with a `Content-Type` other than `application/json`. Send the body as JSON with `Content-Type: application/json`. | `application/problem+json` |
| `429` | `rate_limited`: the limit of the route class (`rate_limit.limit_class`: read, write, publish, heavy, approval, diff, metrics, destructive or ip) was reached. Wait `Retry-After` seconds. `rate_limiter_unavailable` (503) is answered for `heavy` routes and destructive calls when the limiter itself fails, and for a valid OAuth token with no grant when the consent-link limiter fails (never a 401, so an MCP client does not log in again). | `application/problem+json` |
| `500` | `internal_error` (nothing about the failure; quote `request_id`) or `configuration_error`. | `application/problem+json` |
| `503` | `manifest_publish_unavailable`: the change was saved, but the site manifest could not be published yet; wait `Retry-After` seconds and send the same request again (the same `Idempotency-Key` is safe). `database_unavailable`: the API could not reach its database; wait `Retry-After` seconds and send the same request again. | `application/problem+json` |

```sh title="curl"
curl -X PUT "https://api.taggor.dev/v1/sites/st_0123456789abcdefghjkmnpqrs/components/cmp_0123456789abcdefghjkmnpqrs/props" \
  -H "Authorization: Bearer $TAGGOR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "props": {
    "accent": "#0a7d3b",
    "title": "Summer sale"
  },
  "expected_revision": 3,
  "expected_attached_at": "2026-11-02T12:00:00.000Z"
}'
```

```ts title="TypeScript"
const response = await fetch("https://api.taggor.dev/v1/sites/st_0123456789abcdefghjkmnpqrs/components/cmp_0123456789abcdefghjkmnpqrs/props", {
  method: "PUT",
  headers: { authorization: `Bearer ${process.env.TAGGOR_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({
    "props": {
      "accent": "#0a7d3b",
      "title": "Summer sale"
    },
    "expected_revision": 3,
    "expected_attached_at": "2026-11-02T12:00:00.000Z"
  }),
});
if (!response.ok) throw new Error(await response.text());
const result: unknown = await response.json();
console.log(result);
```

```json title="Example response"
{
  "id": "cmp_0123456789abcdefghjkmnpqrs",
  "tag": "price-card",
  "production": {
    "served_version_id": "ver_0123456789abcdefghjkmnpqrs",
    "served_semver": "1.2.0",
    "source": "production_channel",
    "pinned_version_id": null,
    "suspended_props": []
  },
  "staging": {
    "served_version_id": "ver_9876543210abcdefghjkmnpqrs",
    "served_semver": "1.3.0",
    "source": "staging_channel",
    "pinned_version_id": null,
    "suspended_props": []
  },
  "enabled": true,
  "loading": "eager",
  "archived_at": null,
  "props": {
    "accent": "#0a7d3b"
  },
  "props_revision": 3,
  "created_at": "2026-11-02T12:00:00.000Z"
}
```

## `PUT /v1/sites/{site_id}/components/{component_id}/pinned-versions/{environment}`

Pin a version of a component for one environment of a site

Makes ONE environment of ONE site serve the given version of an attached component, instead of the version its channel points to. The pin stays through every promote and rollback of the component's channels (their answers list the site in `pinned_sites`), and the site's other environment and every other site keep following their channels. Use it to hold a site on a known version, or to try a version on one site before promoting it. Undo it with `DELETE` on the same path. Takes effect within about a minute (the edge's cache). Needs `sites:write` and `channels:promote`. Repeating the same pin changes nothing.

Operation `pinSiteComponentVersion`. Scopes: `sites:write`, `channels:promote`.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `site_id` | path | string | yes | Public site id. |
| `component_id` | path | string | yes | Public component id. |
| `environment` | path | one of production, staging | yes | The environment of the site the pin is for: `production` (pages with the production snippet) or `staging` (pages with the staging snippet). The other environment is not touched. |

**Request body** (`application/json`, required)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `version_id` | string | yes | The version of this component to serve in that environment of this site. Any version whose build succeeded, also one that was never promoted to a channel (`GET /v1/components/{component_id}/versions` lists them). |

**Responses**

| Status | Meaning | Content type |
| --- | --- | --- |
| `200` | The attachment after the pin: the environment's `source` is `pinned_version` and its `served_version_id` is the pinned one. | `application/json` |
| `400` | `validation_failed`: a bad path parameter or a malformed body. | `application/problem+json` |
| `401` | `unauthenticated`: no credentials, or credentials that prove nothing. | `application/problem+json` |
| `402` | `workspace_payment_required`: the workspace needs a paid plan and has none, so it accepts no change; reading and exporting still work. A person pays in the portal, under Settings, Plan and billing. | `application/problem+json` |
| `403` | `insufficient_scope`: the credential lacks a scope this route needs (see `missing_scopes`). `permission_denied`: the current workspace role does not allow the action. `oauth_consent_required`: an OAuth token whose person has not yet chosen the workspace and the permissions (see `consent_url`). `mfa_required`: a portal session that must still verify or set up MFA (see `mfa_reason`). `cross_site_request`: authenticated by the session cookie, but not from the portal (another `Origin`, or not `Content-Type: application/json`). `workspace_suspended`: Taggor suspended the workspace; every credential acting in it is refused until it is lifted. | `application/problem+json` |
| `404` | `not_found`: no site (or, when attaching, component) with this id in the caller's workspace; also another workspace's. | `application/problem+json` |
| `405` | `method_not_allowed`: the path exists, but not for this method; `Allow` lists the methods it answers. | `application/problem+json` |
| `409` | `version_not_ready` (the version's build did not succeed; `build_status` says its state) or `component_archived`. | `application/problem+json` |
| `413` | `payload_too_large`: the request body is over the limit of the route (256 KiB for JSON). | `application/problem+json` |
| `415` | `unsupported_media_type`: the body was sent with a `Content-Type` other than `application/json`. Send the body as JSON with `Content-Type: application/json`. | `application/problem+json` |
| `429` | `rate_limited`: the limit of the route class (`rate_limit.limit_class`: read, write, publish, heavy, approval, diff, metrics, destructive or ip) was reached. Wait `Retry-After` seconds. `rate_limiter_unavailable` (503) is answered for `heavy` routes and destructive calls when the limiter itself fails, and for a valid OAuth token with no grant when the consent-link limiter fails (never a 401, so an MCP client does not log in again). | `application/problem+json` |
| `500` | `internal_error` (nothing about the failure; quote `request_id`) or `configuration_error`. | `application/problem+json` |
| `503` | `manifest_publish_unavailable`: the change was saved, but the site manifest could not be published yet; wait `Retry-After` seconds and send the same request again (the same `Idempotency-Key` is safe). `database_unavailable`: the API could not reach its database; wait `Retry-After` seconds and send the same request again. | `application/problem+json` |

```sh title="curl"
curl -X PUT "https://api.taggor.dev/v1/sites/st_0123456789abcdefghjkmnpqrs/components/cmp_0123456789abcdefghjkmnpqrs/pinned-versions/production" \
  -H "Authorization: Bearer $TAGGOR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "version_id": "ver_0123456789abcdefghjkmnpqrs"
}'
```

```ts title="TypeScript"
const response = await fetch("https://api.taggor.dev/v1/sites/st_0123456789abcdefghjkmnpqrs/components/cmp_0123456789abcdefghjkmnpqrs/pinned-versions/production", {
  method: "PUT",
  headers: { authorization: `Bearer ${process.env.TAGGOR_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({
    "version_id": "ver_0123456789abcdefghjkmnpqrs"
  }),
});
if (!response.ok) throw new Error(await response.text());
const result: unknown = await response.json();
console.log(result);
```

```json title="Example response"
{
  "id": "cmp_0123456789abcdefghjkmnpqrs",
  "tag": "price-card",
  "production": {
    "served_version_id": "ver_0123456789abcdefghjkmnpqrs",
    "served_semver": "1.2.0",
    "source": "production_channel",
    "pinned_version_id": null,
    "suspended_props": []
  },
  "staging": {
    "served_version_id": "ver_9876543210abcdefghjkmnpqrs",
    "served_semver": "1.3.0",
    "source": "staging_channel",
    "pinned_version_id": null,
    "suspended_props": []
  },
  "enabled": true,
  "loading": "eager",
  "archived_at": null,
  "props": {
    "accent": "#0a7d3b"
  },
  "props_revision": 3,
  "created_at": "2026-11-02T12:00:00.000Z"
}
```

## `DELETE /v1/sites/{site_id}/components/{component_id}/pinned-versions/{environment}`

Remove the pinned version of one environment of a site, so it follows its channel again

The one action that undoes a pin: that environment of the site goes back to the version its channel points to (`source` becomes `production_channel` in production; `staging_channel`, or `fallback_to_production_channel` when the component has no staging version, in staging), within about a minute. The other environment is not touched. Removing a pin that is not there is not an error. Needs `sites:write` and `channels:promote`.

Operation `unpinSiteComponentVersion`. Scopes: `sites:write`, `channels:promote`.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `site_id` | path | string | yes | Public site id. |
| `component_id` | path | string | yes | Public component id. |
| `environment` | path | one of production, staging | yes | The environment of the site the pin is for: `production` (pages with the production snippet) or `staging` (pages with the staging snippet). The other environment is not touched. |

**Responses**

| Status | Meaning | Content type |
| --- | --- | --- |
| `200` | The attachment after: the environment's `pinned_version_id` is `null` and it serves what its channel points to. | `application/json` |
| `400` | `validation_failed`: a bad path parameter or a malformed body. | `application/problem+json` |
| `401` | `unauthenticated`: no credentials, or credentials that prove nothing. | `application/problem+json` |
| `402` | `workspace_payment_required`: the workspace needs a paid plan and has none, so it accepts no change; reading and exporting still work. A person pays in the portal, under Settings, Plan and billing. | `application/problem+json` |
| `403` | `insufficient_scope`: the credential lacks a scope this route needs (see `missing_scopes`). `permission_denied`: the current workspace role does not allow the action. `oauth_consent_required`: an OAuth token whose person has not yet chosen the workspace and the permissions (see `consent_url`). `mfa_required`: a portal session that must still verify or set up MFA (see `mfa_reason`). `cross_site_request`: authenticated by the session cookie, but not from the portal (another `Origin`, or not `Content-Type: application/json`). `workspace_suspended`: Taggor suspended the workspace; every credential acting in it is refused until it is lifted. | `application/problem+json` |
| `404` | `not_found`: no site (or, when attaching, component) with this id in the caller's workspace; also another workspace's. | `application/problem+json` |
| `405` | `method_not_allowed`: the path exists, but not for this method; `Allow` lists the methods it answers. | `application/problem+json` |
| `429` | `rate_limited`: the limit of the route class (`rate_limit.limit_class`: read, write, publish, heavy, approval, diff, metrics, destructive or ip) was reached. Wait `Retry-After` seconds. `rate_limiter_unavailable` (503) is answered for `heavy` routes and destructive calls when the limiter itself fails, and for a valid OAuth token with no grant when the consent-link limiter fails (never a 401, so an MCP client does not log in again). | `application/problem+json` |
| `500` | `internal_error` (nothing about the failure; quote `request_id`) or `configuration_error`. | `application/problem+json` |
| `503` | `manifest_publish_unavailable`: the change was saved, but the site manifest could not be published yet; wait `Retry-After` seconds and send the same request again (the same `Idempotency-Key` is safe). `database_unavailable`: the API could not reach its database; wait `Retry-After` seconds and send the same request again. | `application/problem+json` |

```sh title="curl"
curl -X DELETE "https://api.taggor.dev/v1/sites/st_0123456789abcdefghjkmnpqrs/components/cmp_0123456789abcdefghjkmnpqrs/pinned-versions/production" \
  -H "Authorization: Bearer $TAGGOR_API_KEY"
```

```ts title="TypeScript"
const response = await fetch("https://api.taggor.dev/v1/sites/st_0123456789abcdefghjkmnpqrs/components/cmp_0123456789abcdefghjkmnpqrs/pinned-versions/production", {
  method: "DELETE",
  headers: { authorization: `Bearer ${process.env.TAGGOR_API_KEY}` },
});
if (!response.ok) throw new Error(await response.text());
const result: unknown = await response.json();
console.log(result);
```

```json title="Example response"
{
  "id": "cmp_0123456789abcdefghjkmnpqrs",
  "tag": "price-card",
  "production": {
    "served_version_id": "ver_0123456789abcdefghjkmnpqrs",
    "served_semver": "1.2.0",
    "source": "production_channel",
    "pinned_version_id": null,
    "suspended_props": []
  },
  "staging": {
    "served_version_id": "ver_9876543210abcdefghjkmnpqrs",
    "served_semver": "1.3.0",
    "source": "staging_channel",
    "pinned_version_id": null,
    "suspended_props": []
  },
  "enabled": true,
  "loading": "eager",
  "archived_at": null,
  "props": {
    "accent": "#0a7d3b"
  },
  "props_revision": 3,
  "created_at": "2026-11-02T12:00:00.000Z"
}
```
