---
title: "Find a site by name"
method: POST
path: "/api/v1/site/_byname"
tags: ["Site"]
---

# Find a site by name

`POST /api/v1/site/_byname`

Finds a site by its hostname. The site name is sent via POST body to avoid URL-escaping issues with special characters in hostnames.

## Response `200`

Site found successfully

- ResponseEntitySiteView
  - `errors` ErrorEntity[]
    - `errorCode` string
    - `message` string
    - `fieldName` string
  - `entity` object
  - `messages` MessageEntity[]
    - `message` string
  - `i18nMessagesMap` object
  - `permissions` string[]
  - `pagination` Pagination
    - `currentPage` integer
    - `perPage` integer
    - `totalEntries` integer

## Other responses

- `400` — Site name is null or invalid
- `401` — Unauthorized access
- `403` — User does not have permission to access sites
- `404` — Site not found

---

[API](https://skmtc.dev/jostens/apis/dotcms-rest-api.md) · [All operations](https://skmtc.dev/jostens/apis/dotcms-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/jostens/dotcms-rest-api/revisions/a088fe9f515c/schema)
