# Create activate — POST /v1/projects/{slug}/releases/{release}/activate

URL: https://docs.hanzo.ai/docs/openapi/project/post-projects-by-slug-releases-by-release-activate

> Points the site at an existing release — the go-live, and equally the ROLLBACK.

`POST /v1/projects/{slug}/releases/{release}/activate`

> [Project →](https://docs.hanzo.ai/docs/openapi/project) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                                                       |
| ------------- | --------------------------------------------------------------------- |
| **Address**   | `https://api.hanzo.ai/v1/projects/{slug}/releases/{release}/activate` |
| **Method**    | `POST`                                                                |
| **Operation** | `post_projects_by_slug_releases_by_release_activate`                  |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY`                                |

Points the site at an existing release — the go-live, and
equally the ROLLBACK.

Aim it at an older release and the site serves that one again: releases are
immutable and retained to the retention depth, so nothing is rebuilt or
re-copied and the flip is one atomic statement. Before the flip, two
conditions run in the order that gives each its own honest answer — the ROW
says whether this release exists for this tenant at all (404, with no signal
about a foreign id), and only then do the BYTES say whether it can still serve
(410 GONE when retention has reclaimed them; that rollback target is not
coming back, so publish again). Going live also claims the public host and
purges the edge, so the release is reachable and no cached predecessor is
served. NOT billed: no new content is produced, only a pointer moved.

Scope: a validated principal is required (401 without one) and the site is
resolved within that principal's org, so another tenant's slug is a 404.

## Request

2 fields.

| Field     | In   | Type   | Required | Description                                                                          |
| --------- | ---- | ------ | -------- | ------------------------------------------------------------------------------------ |
| `slug`    | path | string | yes      | Slug is the site the release belongs to, from the path.                              |
| `release` | path | string | yes      | Release is the content-addressed release id ("rel\_" + 32 hex chars), from the path. |

## Response

| Status    | Body                    | Meaning |
| --------- | ----------------------- | ------- |
| `200`     | project.projectsRelease | ok      |
| `default` | problem-details         | refused |

`200` body — 8 fields.

| Field       | In   | Type            | Always | Description                                                                                                                                                      |
| ----------- | ---- | --------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `active`    | body | boolean         | —      | Active is whether this is the release the site is SERVING right now.                                                                                             |
| `bytes`     | body | integer (int64) | —      | Bytes is their total size in bytes.                                                                                                                              |
| `createdAt` | body | integer (int64) | —      | CreatedAt is when the release was cut, as Unix seconds — not when it was last activated.                                                                         |
| `objects`   | body | integer (int64) | —      | Objects is how many files the release holds.                                                                                                                     |
| `releaseId` | body | string          | —      | ReleaseID is derived from a DIGEST of the release's own manifest, so identical content is the same release and a release can never be confused with another one. |
| `slug`      | body | string          | —      | Slug is the site this release belongs to.                                                                                                                        |
| `source`    | body | string          | —      | Source is what the release was cut from — the build output or upload it was promoted out of.                                                                     |
| `url`       | body | string          | —      | URL is where the site serves.                                                                                                                                    |

Failure carries the platform error shape — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo projects releases activate <slug> <release>
```

**SDK**

**.ts**

```ts
import { Configuration, ProjectApi } from 'hanzoai';

const api = new ProjectApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postProjectsBySlugReleasesByReleaseActivate({ slug: 'slug', release: 'release' });
```

**.py**

```python
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import ProjectApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = ProjectApi(client).post_projects_by_slug_releases_by_release_activate(slug='slug', release='release')
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.ProjectAPI.PostProjectsBySlugReleasesByReleaseActivate(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
use hanzo_client::apis::{configuration::Configuration, project_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = project_api::post_projects_by_slug_releases_by_release_activate(&cfg, Default::default()).await?;
```

**.java**

```java
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.ProjectApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new ProjectApi(client).postProjectsBySlugReleasesByReleaseActivate();
```

The method above is the one at the current release of the document. `hanzoai@8.5.914` (npm) and `hanzoai@8.5.914` (PyPI) were generated from an earlier release, where this operation carried a different id, so it spells the method differently — regenerating the clients is what makes the two agree. [SDKs →](https://docs.hanzo.ai/docs/sdks)

**HTTP**

```bash
curl -X POST https://api.hanzo.ai/v1/projects/<slug>/releases/<release>/activate \
  -H "Authorization: Bearer $HANZO_API_KEY"
```

**MCP**

Tool `project`, op `post_projects_by_slug_releases_by_release_activate` — POST the JSON-RPC envelope to `https://api.hanzo.ai/v1/mcp`.

```bash
curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "project",
         "arguments": {
           "op": "post_projects_by_slug_releases_by_release_activate",
           "input": {
             "slug": "<slug>",
             "release": "<release>"
           }
         }
       }
     }'
```

---

[Project API](https://docs.hanzo.ai/docs/openapi/project) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
