# Get sites — GET /v1/project/sites/{slug}

URL: https://docs.hanzo.ai/docs/openapi/project/get-project-sites-by-slug

> Returns one site — the same row ListSites carries, for one slug.

`GET /v1/project/sites/{slug}`

> [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/project/sites/{slug}` |
| **Method**    | `GET`                                          |
| **Operation** | `get_project_sites_by_slug`                    |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY`         |

Returns one site — the same row ListSites carries, for one slug.

Every sub-resource under a site already answered: deployments, releases,
publish. The site itself did not, and a route that is never registered
answers 404 for a LIVE site exactly as it does for one that was never
created. So the one call a client makes to ask "is it there yet?" could only
ever say no, and a CI lane watching for its own publish would wait forever on
a success it had already achieved.

The org is the caller's, never a path segment. A slug is unique within an org
and two orgs may both own `tel`; taking the org from the validated principal
instead of the URL means a caller cannot read another org's site by editing a
path, and it is the same scope ListProjects and ListSites already use.

A site that exists but is not live is NOT found here, matching ListSites,
which keeps only `live` rows so a draft or a failed build is never advertised
as a site. One definition of "is a site", used by both.

## Request

1 field.

| Field  | In   | Type   | Required | Description                                   |
| ------ | ---- | ------ | -------- | --------------------------------------------- |
| `slug` | path | string | yes      | Slug is the project to act on, from the path. |

## Response

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

`200` body — 5 fields.

| Field       | In   | Type            | Always | Description                                                                                                      |
| ----------- | ---- | --------------- | ------ | ---------------------------------------------------------------------------------------------------------------- |
| `name`      | body | string          | —      | Name is the site's display name.                                                                                 |
| `slug`      | body | string          | —      | Slug is the site's handle — also the label of the host it serves at.                                             |
| `status`    | body | string          | —      | Status is the project's state behind the site — whether it is serving, still building, or failed its last build. |
| `updatedAt` | body | integer (int64) | —      | UpdatedAt is when the project last changed, as Unix seconds.                                                     |
| `url`       | body | string          | —      | URL is the pretty address readers use, not the object-store path behind it.                                      |

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

## Examples

**CLI**

```bash
hanzo project sites get <slug>
```

**SDK**

**.ts**

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

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

**.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).get_project_sites_by_slug(slug='slug')
```

**.go**

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

resp, _, err := client.ProjectAPI.GetProjectSitesBySlug(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::get_project_sites_by_slug(&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).getProjectSitesBySlug();
```

**HTTP**

```bash
curl https://api.hanzo.ai/v1/project/sites/<slug> \
  -H "Authorization: Bearer $HANZO_API_KEY"
```

**MCP**

Tool `project`, op `get_project_sites_by_slug` — 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": "get_project_sites_by_slug",
           "input": {
             "slug": "<slug>"
           }
         }
       }
     }'
```

---

[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)
