# Sites (projects)

URL: https://pieowl.com/docs/api/manage/projects



In the API, a site is called a project: the path is `/manage/projects`, and a site ID is `projectId`.

Authentication [#authentication]

Requires a `root` client. See the [Authentication](/docs/api/authentication) guide.

Base URL [#base-url]

```
https://api.pieowl.com/manage/projects
```

Endpoints [#endpoints]

| Method   | Path                    | What it does                                |
| -------- | ----------------------- | ------------------------------------------- |
| `GET`    | `/manage/projects`      | Lists all sites in your team                |
| `GET`    | `/manage/projects/{id}` | Gets one site                               |
| `POST`   | `/manage/projects`      | Creates a site                              |
| `PATCH`  | `/manage/projects/{id}` | Updates a site                              |
| `DELETE` | `/manage/projects/{id}` | Schedules the site for deletion in 24 hours |

Create a site [#create-a-site]

```bash
curl -X POST 'https://api.pieowl.com/manage/projects' \
  -H 'Content-Type: application/json' \
  -H 'pieowl-client-id: YOUR_ROOT_CLIENT_ID' \
  -H 'pieowl-client-secret: YOUR_ROOT_CLIENT_SECRET' \
  -d '{
    "name": "My website",
    "domain": "https://example.com",
    "cors": ["https://example.com"],
    "types": ["website"]
  }'
```

When you create a site, Pieowl also creates a default `write` client and returns it in the response. The client secret is only shown once, so save it right away.

For full request and response schemas, see the [API Reference](/docs/api-reference).
