# Versions and channels API

> Publish immutable versions and move the staging and production channels. With curl and TypeScript examples.

## `GET /v1/components/{component_id}/versions`

List the versions of a component, newest first

Operation `listComponentVersions`. Scopes: `components:read`.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `component_id` | path | string | yes | Public component 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 versions | `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 component with this id in the caller's workspace. | `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/components/cmp_0123456789abcdefghjkmnpqrs/versions" \
  -H "Authorization: Bearer $TAGGOR_API_KEY"
```

```ts title="TypeScript"
const response = await fetch("https://api.taggor.dev/v1/components/cmp_0123456789abcdefghjkmnpqrs/versions", {
  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": "ver_0123456789abcdefghjkmnpqrs",
      "component_id": "cmp_0123456789abcdefghjkmnpqrs",
      "semver": "1.0.0",
      "content_hash": "9f2c0e5b7a1d4c3e8f6a0b2d4c6e8f0a1b3d5c7e9f0a2b4c6d8e0f1a3b5c7d9e",
      "bundle_key": "b/9f2c0e5b7a1d4c3e8f6a0b2d4c6e8f0a1b3d5c7e9f0a2b4c6d8e0f1a3b5c7d9e.js",
      "contract_version": "1.0.0",
      "build_id": "bld_0123456789abcdefghjkmnpqrs",
      "manifest": {
        "contractVersion": "1.0.0",
        "name": "price-card",
        "tag": "price-card",
        "title": "Price card",
        "description": "Shows a price."
      },
      "lockfile": {
        "lockfileVersion": 1,
        "dependencies": {},
        "packages": {}
      },
      "gates": {
        "version": "security-rules 1; typescript 6.0.3",
        "results": [
          {
            "gate": "typecheck",
            "ok": true,
            "errors": 0,
            "warnings": 0
          }
        ]
      },
      "message": null,
      "created_by": {
        "id": "usr_0123456789abcdefghjkmnpqrs",
        "kind": "user",
        "name": "Ana"
      },
      "created_at": "2026-10-31T12:00:00.000Z",
      "compatibility": {
        "breaking": false,
        "base": null,
        "changes": [],
        "truncated": false,
        "base_unreadable": false
      },
      "origin": "cli",
      "size_gz_bytes": 1820
    }
  ],
  "next_cursor": null,
  "has_more": false
}
```

## `POST /v1/components/{component_id}/versions`

Create an immutable version from a build that passed every quality gate, or upload source code to build

Operation `createComponentVersion`. Scopes: `versions:publish`.

**Parameters**

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

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `build_id` | string | yes | A build of this workspace that succeeded, every quality gate passed. |
| `semver` | string | no | Version number: above every version of the component, and raising at least the part its manifest changes require against the version in production (or the latest one while production points nowhere): major for a breaking change, minor for an additive one, patch for none. Omitted: the component's highest version bumped by that part (1.0.0 for the first). Too small: 409 `semver_bump_too_small` with `suggested_semver`. |
| `message` | string (up to 500 characters) | no | What changed, for people and agents reading the list. |
| `allow_breaking` | boolean | no | Accept breaking changes to the schema of a collection the component already has (a removed field, a changed type, a tighter limit, a field that became required, a collection that became public). The collection starts a new schema version; submissions already stored are not rewritten. Default false: 409 `breaking_collection_change`. The other way out is a new collection name. |

**Responses**

| Status | Meaning | Content type |
| --- | --- | --- |
| `200` | This exact source already became a version of this component: that version, unchanged (versions are immutable). | `application/json` |
| `201` | The new version. It never changes; channels point to it. A breaking change of the manifest does not refuse it: see `compatibility` and `diagnostics`. | `application/json` |
| `202` | The source was stored and a build is queued (or the workspace already had a build of this exact source: same `build_id`, no new build). Follow `Location` for its status; when it succeeded, create the version with `{ build_id }`. | `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. `component_disabled`: Taggor disabled the component, so no new version of it is accepted. | `application/problem+json` |
| `404` | `not_found`: no component, or no build, with this id in the caller's workspace; for a source upload, also a shared folder the package names that the workspace has not published (`shared_folder` names 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` |
| `409` | `plan_limit_reached`: the build's manifest declares more `permissions.connect` network origins than the plan allows (`connectOriginsPerVersion`). Nothing was created; the body carries `limit`, `plan` and `upgrade_url`. `component_archived` (restore the component first), `shared_folder_archived` (a shared folder the package names is archived: `shared_folder` names it), `build_expired` (the build finished more than 7 days ago: build again), `build_not_publishable` (the build failed, is still running, or its gates or artifacts do not allow a version; see `reason` and `diagnostic_codes`), `version_already_exists` (this build or semver already has a version: `version_id`), `breaking_collection_change` (a declared collection breaks the stored schema of a collection that holds data: see `breaking_collections`; send `allow_breaking: true` or use a new collection name), `semver_bump_too_small` (the semver is not above every version, or raises a smaller part than the manifest changes require: send `suggested_semver`; see `required_bump`, `compatibility` and `diagnostics`), or `idempotency_request_in_progress`. | `application/problem+json` |
| `413` | `payload_too_large`: the body, or the unpacked package, is over the limit (`diagnostics[]` says which). | `application/problem+json` |
| `415` | `unsupported_media_type`: send `application/json` or `application/gzip`. | `application/problem+json` |
| `422` | `source_package_invalid` (not a valid source package: see `diagnostics[]`, nothing was stored) or `idempotency_key_reused` (the key was used with a different request). | `application/problem+json` |
| `429` | `build_quota_exceeded`: the workspace reached the builds its plan allows in any 7 days (`buildsPerWeek`; only builds that ran count); or `platform_build_capacity`: the platform paused new Free builds for a while. Retry after `Retry-After` seconds; both write nothing and the platform one is not the caller's fault. Also `rate_limited`: the limit of the route class was reached (`rate_limit.limit_class`); wait `Retry-After` seconds. | `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/components/cmp_0123456789abcdefghjkmnpqrs/versions" \
  -H "Authorization: Bearer $TAGGOR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "build_id": "bld_0123456789abcdefghjkmnpqrs",
  "semver": "1.2.0"
}'
```

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

## `GET /v1/components/{component_id}/channels`

List the channels of a component and the version each one points to

Operation `listComponentChannels`. Scopes: `components:read`.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `component_id` | path | string | yes | Public component 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 channels, the most recently moved first; `version_id` is null (and the channel last) until a version is promoted. | `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 component with this id in the caller's workspace. | `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/components/cmp_0123456789abcdefghjkmnpqrs/channels" \
  -H "Authorization: Bearer $TAGGOR_API_KEY"
```

```ts title="TypeScript"
const response = await fetch("https://api.taggor.dev/v1/components/cmp_0123456789abcdefghjkmnpqrs/channels", {
  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"
{
  "next_cursor": null,
  "has_more": false,
  "data": [
    {
      "channel": "production",
      "version_id": "ver_0123456789abcdefghjkmnpqrs",
      "semver": "1.0.0",
      "updated_at": "2026-10-31T12:00:00.000Z",
      "updated_by": {
        "id": "usr_0123456789abcdefghjkmnpqrs",
        "kind": "user",
        "name": "Ana"
      }
    },
    {
      "channel": "staging",
      "version_id": null,
      "semver": null,
      "updated_at": null,
      "updated_by": null
    }
  ]
}
```

## `GET /v1/components/{component_id}/changelog`

List the changelog of a component: each version's semver, message, author and date, newest first

Operation `listComponentChangelog`. Scopes: `components:read`.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `component_id` | path | string | yes | Public component 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 changelog, newest first; versions are created in semver order, so it is also descending semver. | `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 component with this id in the caller's workspace. | `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/components/cmp_0123456789abcdefghjkmnpqrs/changelog" \
  -H "Authorization: Bearer $TAGGOR_API_KEY"
```

```ts title="TypeScript"
const response = await fetch("https://api.taggor.dev/v1/components/cmp_0123456789abcdefghjkmnpqrs/changelog", {
  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": "ver_0123456789abcdefghjkmnpqrt",
      "semver": "1.1.0",
      "message": "Add the currency prop.",
      "created_by": {
        "id": "usr_0123456789abcdefghjkmnpqrs",
        "kind": "user",
        "name": "Ana"
      },
      "created_at": "2026-10-31T13:00:00.000Z",
      "breaking": false
    },
    {
      "id": "ver_0123456789abcdefghjkmnpqrs",
      "semver": "1.0.0",
      "message": "First version.",
      "created_by": {
        "id": "usr_0123456789abcdefghjkmnpqrs",
        "kind": "user",
        "name": "Ana"
      },
      "created_at": "2026-10-31T12:00:00.000Z",
      "breaking": false
    }
  ],
  "next_cursor": null,
  "has_more": false
}
```

## `GET /v1/components/{component_id}/history`

List the history of a component: versions published, promotions and rollbacks in one timeline, newest first, with who acted and from which client

Operation `listComponentHistory`. Scopes: `components:read`.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `component_id` | path | string | yes | Public component 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 timeline, newest first. | `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 component with this id in the caller's workspace. | `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/components/cmp_0123456789abcdefghjkmnpqrs/history" \
  -H "Authorization: Bearer $TAGGOR_API_KEY"
```

```ts title="TypeScript"
const response = await fetch("https://api.taggor.dev/v1/components/cmp_0123456789abcdefghjkmnpqrs/history", {
  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": "che_5m1x8q0c2v7b4n9t3r6p0s2k8z",
      "type": "promote",
      "created_at": "2026-10-31T13:00:00.000Z",
      "version_id": "ver_0123456789abcdefghjkmnpqrs",
      "semver": "1.0.0",
      "channel": "production",
      "from_version_id": null,
      "reason": null,
      "actor": {
        "id": "usr_0123456789abcdefghjkmnpqrs",
        "kind": "user",
        "name": "Ana"
      },
      "client": "portal"
    },
    {
      "id": "ver_0123456789abcdefghjkmnpqrs",
      "type": "version_published",
      "created_at": "2026-10-31T12:00:00.000Z",
      "version_id": "ver_0123456789abcdefghjkmnpqrs",
      "semver": "1.0.0",
      "channel": null,
      "from_version_id": null,
      "reason": null,
      "actor": {
        "id": "key_0123456789abcdefghjkmnpqrs",
        "kind": "api_key",
        "name": "ci"
      },
      "client": "cli/1.2.0"
    }
  ],
  "next_cursor": null,
  "has_more": false
}
```

## `GET /v1/activity`

Read the activity of the workspace: versions published, promotions and rollbacks per UTC day over up to 26 weeks, and the newest entries of any component

Operation `getWorkspaceActivity`. Scopes: `components:read`.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `from` | query | string | no | Start of the window (inclusive), RFC 3339. Default: the first UTC day of the last 182 days. Not older than that. |
| `to` | query | string | no | End of the window (exclusive), RFC 3339. Default: now. |

**Responses**

| Status | Meaning | Content type |
| --- | --- | --- |
| `200` | The days with activity and the newest entries. | `application/json` |
| `400` | `validation_failed`: `from` is not before `to`, or is older than the 182 days the activity keeps. | `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/activity" \
  -H "Authorization: Bearer $TAGGOR_API_KEY"
```

```ts title="TypeScript"
const response = await fetch("https://api.taggor.dev/v1/activity", {
  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"
{
  "start_at": "2026-05-03T00:00:00.000Z",
  "end_at": "2026-10-31T15:00:00.000Z",
  "days": [
    {
      "day": "2026-10-31",
      "versions_published": 1,
      "promotions": 1,
      "rollbacks": 0
    }
  ],
  "latest": [
    {
      "id": "che_5m1x8q0c2v7b4n9t3r6p0s2k8z",
      "type": "promote",
      "created_at": "2026-10-31T13:00:00.000Z",
      "version_id": "ver_0123456789abcdefghjkmnpqrs",
      "semver": "1.0.0",
      "channel": "production",
      "from_version_id": null,
      "reason": null,
      "actor": {
        "id": "usr_0123456789abcdefghjkmnpqrs",
        "kind": "user",
        "name": "Ana"
      },
      "client": "portal",
      "component": {
        "id": "cmp_0123456789abcdefghjkmnpqrs",
        "tag": "price-card"
      }
    }
  ]
}
```

## `GET /v1/components/{component_id}/versions/{version_id}/diff`

Compare manifest, dependencies, and gzipped bundle size between two versions

The source files that changed are a list of their own: `GET …/diff/files`, paged.

Operation `diffComponentVersions`. Scopes: `components:read`.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `component_id` | path | string | yes | Public component id. |
| `version_id` | path | string | yes | The version compared (the `"to"` side of the diff). |
| `from_version_id` | query | string | yes | The version it is compared against (the `"from"` side of the diff). |

**Responses**

| Status | Meaning | Content type |
| --- | --- | --- |
| `200` | Manifest, dependency, and bundle-size changes. | `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` |
| `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 component with this id in the caller's workspace. | `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/components/cmp_0123456789abcdefghjkmnpqrs/versions/ver_0123456789abcdefghjkmnpqrs/diff?from_version_id=ver_0123456789abcdefghjkmnpqrs" \
  -H "Authorization: Bearer $TAGGOR_API_KEY"
```

```ts title="TypeScript"
const response = await fetch("https://api.taggor.dev/v1/components/cmp_0123456789abcdefghjkmnpqrs/versions/ver_0123456789abcdefghjkmnpqrs/diff?from_version_id=ver_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"
{
  "from": {
    "version_id": "ver_0123456789abcdefghjkmnpqrs",
    "semver": "1.0.0"
  },
  "to": {
    "version_id": "ver_0123456789abcdefghjkmnpqrt",
    "semver": "1.1.0"
  },
  "manifest": {
    "breaking": false,
    "unavailable": false,
    "changes": []
  },
  "dependencies": [],
  "bundle_size_gzip": {
    "from_bytes": 1200,
    "to_bytes": 1240,
    "delta_bytes": 40
  }
}
```

## `GET /v1/components/{component_id}/versions/{version_id}/diff/files`

List the source files that differ between two versions, with their patches

Operation `listComponentVersionDiffFiles`. Scopes: `components:read`.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `component_id` | path | string | yes | Public component id. |
| `version_id` | path | string | yes | The version compared (the `"to"` side of the diff). |
| `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. |
| `from_version_id` | query | string | yes | The version it is compared against (the `"from"` side of the diff). |

**Responses**

| Status | Meaning | Content type |
| --- | --- | --- |
| `200` | One page of source-file diffs. A page also ends when its patches reach a size limit, so it may hold fewer than `limit` files. | `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 component with this id in the caller's workspace. | `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/components/cmp_0123456789abcdefghjkmnpqrs/versions/ver_0123456789abcdefghjkmnpqrs/diff/files?from_version_id=ver_0123456789abcdefghjkmnpqrs" \
  -H "Authorization: Bearer $TAGGOR_API_KEY"
```

```ts title="TypeScript"
const response = await fetch("https://api.taggor.dev/v1/components/cmp_0123456789abcdefghjkmnpqrs/versions/ver_0123456789abcdefghjkmnpqrs/diff/files?from_version_id=ver_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"
{
  "data": [
    {
      "path": "src/index.tsx",
      "status": "modified",
      "patch": "@@ -1,1 +1,1 @@\\n-old\\n+new"
    }
  ],
  "next_cursor": null,
  "has_more": false
}
```

## `GET /v1/components/{component_id}/versions/{version_id}/source`

Download the source package a version was built from

The `.tar.gz` source package exactly as it was published (a POSIX `.tar.gz` of the project files, the same package `taggor publish` uploads), at most 5 MiB. It is customer data: the workspace that owns the component can read it, nobody else (404 for another workspace's component or version, as for a missing one). `taggor pull` uses it to recreate the local project. The body is never unpacked or run by the API; unpack it only under the limits of the contract.

Operation `getComponentVersionSource`. Scopes: `components:read`.

**Parameters**

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

**Responses**

| Status | Meaning | Content type |
| --- | --- | --- |
| `200` | The source package, as an attachment. | `application/gzip` |
| `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` |
| `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 component with this id in the caller's workspace. | `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/components/cmp_0123456789abcdefghjkmnpqrs/versions/ver_0123456789abcdefghjkmnpqrs/source" \
  -H "Authorization: Bearer $TAGGOR_API_KEY"
```

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

## `GET /v1/components/{component_id}/types`

The type declarations of a component's custom element: DOM, React or Vue

Operation `getComponentTypes`. Scopes: `components:read`.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `component_id` | path | string | yes | Public component id. |
| `version_id` | query | string | no | The version to describe. Default: the one `production` points to, else `staging`, else the newest. |
| `target` | query | one of dom, react, vue | no | Which declaration file: `dom` (the element, its events, `window.taggor`), `react` (JSX, React 19) or `vue` (Vue 3 templates). The React and Vue files reference the DOM file, so saving all three side by side in one folder works. |

**Responses**

| Status | Meaning | Content type |
| --- | --- | --- |
| `200` | The declaration file, `text/plain`, as an attachment. | `text/plain` |
| `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` |
| `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 component with this id in the caller's workspace. | `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/components/cmp_0123456789abcdefghjkmnpqrs/types" \
  -H "Authorization: Bearer $TAGGOR_API_KEY"
```

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

## `GET /v1/components/{component_id}/preview-link`

A new private preview link for a version of a component

Operation `getPreviewLink`. Scopes: `components:read`.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `component_id` | path | string | yes | Public component id. |
| `version_id` | query | string | no | The version to preview. Leave it out to use `environment`, or the latest version when `environment` is left out too. |
| `environment` | query | one of production, staging | no | Preview the version the channel of this environment points to. Not with `version_id`. Without `version_id` and `environment`, the link is for the component's latest version. |

**Responses**

| Status | Meaning | Content type |
| --- | --- | --- |
| `200` | The link and why it is or is not there. | `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` |
| `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 component with this id in the caller's workspace. | `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/components/cmp_0123456789abcdefghjkmnpqrs/preview-link" \
  -H "Authorization: Bearer $TAGGOR_API_KEY"
```

```ts title="TypeScript"
const response = await fetch("https://api.taggor.dev/v1/components/cmp_0123456789abcdefghjkmnpqrs/preview-link", {
  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"
{
  "component_id": "cmp_0123456789abcdefghjkmnpqrs",
  "version_id": "ver_0123456789abcdefghjkmnpqrs",
  "semver": "1.0.0",
  "channel": "staging",
  "preview_url": "https://preview.taggor-preview.example/p/v1.bld_0123456789abcdefghjkmnpqrs.9f2c0e5b7a1d4c3e8f6a0b2d4c6e8f0a1b3d5c7e9f0a2b4c6d8e0f1a3b5c7d9e.1-0-0.1795000000.0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
  "preview_state": "ready"
}
```

## `POST /v1/components/{component_id}/channels/{environment}/promote`

Point a channel to a version (promote)

Moves the `production` or the `staging` channel of a component to one of its versions. Every site that has the component attached then serves that version in the environment that reads the channel (`production` channel: the production environment, and staging too while the component has no version on `staging`; `staging` channel: the staging environment), except where a version is pinned: those are listed in `pinned_sites` and keep their version.

Operation `promoteComponentVersion`. Scopes: `channels:promote`.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `component_id` | path | string | yes | Public component id. |
| `environment` | path | one of production, staging | yes | The environment whose channel moves: `production` or `staging`. |
| `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 |
| --- | --- | --- | --- |
| `version_id` | string | yes | A version of this component whose build succeeded. |
| `reason` | string (up to 500 characters) | no | Why the channel moves; kept with the event in the channel history. |
| `allow_breaking` | boolean | no | Lets `production` move to a version that breaks the one it replaces. Without it that is a 409 `breaking_change_not_allowed`. Not needed on `staging`. |

**Responses**

| Status | Meaning | Content type |
| --- | --- | --- |
| `200` | The channel after the move. The manifests of the sites that carry the component were recompiled; the loader serves the new version once the edge cache refreshes. | `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 component (or version) 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` | `component_archived`, `version_not_ready`, `breaking_change_not_allowed`, `no_previous_version`, `channel_moved` (rollback only: the channel left `expected_version_id`) 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` | `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/components/cmp_0123456789abcdefghjkmnpqrs/channels/production/promote" \
  -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/components/cmp_0123456789abcdefghjkmnpqrs/channels/production/promote", {
  method: "POST",
  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"
{
  "channel": "production",
  "version_id": "ver_0123456789abcdefghjkmnpqrs",
  "semver": "1.1.0",
  "updated_at": "2026-11-02T12:00:00.000Z",
  "updated_by": {
    "id": "usr_0123456789abcdefghjkmnpqrs",
    "kind": "user",
    "name": "Ana"
  },
  "previous_version_id": "ver_9876543210abcdefghjkmnpqrs",
  "changed": true,
  "pinned_sites": [],
  "suspended_site_props": []
}
```

## `POST /v1/components/{component_id}/channels/{environment}/rollback`

Point a channel back to an earlier version (rollback)

Moves a channel back to the version it pointed to before (or to `version_id`). It reaches the same sites and environments as a promote of that channel; an environment with a pinned version keeps it and is listed in `pinned_sites`.

Operation `rollbackComponentChannel`. Scopes: `channels:promote`.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `component_id` | path | string | yes | Public component id. |
| `environment` | path | one of production, staging | yes | The environment whose channel moves: `production` or `staging`. |
| `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 |
| --- | --- | --- | --- |
| `version_id` | string | no | The version to go back to. Omitted: the version the channel pointed to before the current one. |
| `reason` | string (up to 500 characters) | no | Why the channel moves; kept with the event in the channel history. |
| `allow_breaking` | boolean | no | Lets `production` move to a version that breaks the one it replaces. Without it that is a 409 `breaking_change_not_allowed`. Not needed on `staging`. |
| `expected_version_id` | string | no | The version the client saw in the channel when it decided to roll back. When the channel no longer points to it the answer is a 409 `channel_moved` (read the channel again), unless the channel's newest move is exactly this rollback away from it: then the answer is the channel as it is, with `changed: false`. Send it to make a retry after a lost answer safe; without it a rollback with no `version_id` goes back from wherever the channel is. |

**Responses**

| Status | Meaning | Content type |
| --- | --- | --- |
| `200` | The channel after the move. The manifests of the sites that carry the component were recompiled; the loader serves the new version once the edge cache refreshes. | `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 component (or version) 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` | `component_archived`, `version_not_ready`, `breaking_change_not_allowed`, `no_previous_version`, `channel_moved` (rollback only: the channel left `expected_version_id`) 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` | `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/components/cmp_0123456789abcdefghjkmnpqrs/channels/production/rollback" \
  -H "Authorization: Bearer $TAGGOR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "version_id": "ver_0123456789abcdefghjkmnpqrs",
  "expected_version_id": "ver_0123456789abcdefghjkmnpqrs"
}'
```

```ts title="TypeScript"
const response = await fetch("https://api.taggor.dev/v1/components/cmp_0123456789abcdefghjkmnpqrs/channels/production/rollback", {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.TAGGOR_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({
    "version_id": "ver_0123456789abcdefghjkmnpqrs",
    "expected_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"
{
  "channel": "production",
  "version_id": "ver_0123456789abcdefghjkmnpqrs",
  "semver": "1.1.0",
  "updated_at": "2026-11-02T12:00:00.000Z",
  "updated_by": {
    "id": "usr_0123456789abcdefghjkmnpqrs",
    "kind": "user",
    "name": "Ana"
  },
  "previous_version_id": "ver_9876543210abcdefghjkmnpqrs",
  "changed": true,
  "pinned_sites": [],
  "suspended_site_props": []
}
```
