# Clients

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



Authentication [#authentication]

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

Base URL [#base-url]

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

Client types [#client-types]

| Type    | What it can do                          |
| ------- | --------------------------------------- |
| `write` | Send events and profile updates         |
| `read`  | Read analytics data (Insights, Export)  |
| `root`  | Full access: Manage API, read and write |

Endpoints [#endpoints]

| Method   | Path                   | What it does                                            |
| -------- | ---------------------- | ------------------------------------------------------- |
| `GET`    | `/manage/clients`      | Lists all clients. Add `projectId` (site ID) to filter. |
| `GET`    | `/manage/clients/{id}` | Gets one client                                         |
| `POST`   | `/manage/clients`      | Creates a client                                        |
| `PATCH`  | `/manage/clients/{id}` | Renames a client                                        |
| `DELETE` | `/manage/clients/{id}` | Deletes a client for good                               |

Create a client [#create-a-client]

```bash
curl -X POST 'https://api.pieowl.com/manage/clients' \
  -H 'Content-Type: application/json' \
  -H 'pieowl-client-id: YOUR_ROOT_CLIENT_ID' \
  -H 'pieowl-client-secret: YOUR_ROOT_CLIENT_SECRET' \
  -d '{
    "name": "Reporting script",
    "projectId": "YOUR_PROJECT_ID",
    "type": "read"
  }'
```

If you leave out `type`, the client is a `write` client. The client secret is only returned when you create the client. You can't get it again later.

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