# Quickstart

> Make an API key, check it works, and read your first project.

You'll need a PlaybookOps account. Any member can make keys, unless an admin has turned the API off for your organization.

### Make a key

Open Account → API keys in PlaybookOps and click **New key**. Name it after what will use it, like "Zapier" or "Support agent". Then choose:

- **Read-only** to look around safely. Nothing can be changed with it.
- **Full access** when your code needs to create or update things.

You can also set it to expire after 30, 90 or 365 days. Copy the key when it's shown. It starts with `pbo_live_`, and you won't see it again. Keep it in an environment variable rather than in your code:

```bash
export PLAYBOOKOPS_API_KEY="pbo_live_…"
```

### Check who you are

`GET /v1/me` tells you who the key belongs to and what it's allowed to do.

**curl**

```bash
curl https://developers.playbookops.ai/v1/me \
  -H "Authorization: Bearer $PLAYBOOKOPS_API_KEY"
```

**Python**

```python
import os
import httpx

api = httpx.Client(
    base_url="https://developers.playbookops.ai/v1",
    headers={"Authorization": f"Bearer {os.environ['PLAYBOOKOPS_API_KEY']}"},
)
print(api.get("/me").json())
```

**JavaScript**

```javascript
const res = await fetch("https://developers.playbookops.ai/v1/me", {
  headers: { Authorization: `Bearer ${process.env.PLAYBOOKOPS_API_KEY}` },
});
console.log(await res.json());
```

You'll get your name, organization and the key's scopes:

```json
{
  "id": "4b1c…",
  "name": "Ana Ruiz",
  "organization_id": "9f20…",
  "role": "member",
  "scopes": ["projects:read", "tasks:read", "knowledge:read", "automations:read", "apps:read", "people:read", "kpis:read"],
  "via": "api_key"
}
```

A `401` means the key is wrong, expired or revoked. See [errors](https://developers.playbookops.ai/errors) for the rest.

### Read a project

List your projects, then the open items in one of them:

**curl**

```bash
curl "https://developers.playbookops.ai/v1/projects?limit=5" \
  -H "Authorization: Bearer $PLAYBOOKOPS_API_KEY"

curl "https://developers.playbookops.ai/v1/projects/PROJECT_ID/items?include_completed=false" \
  -H "Authorization: Bearer $PLAYBOOKOPS_API_KEY"
```

**Python**

```python
projects = api.get("/projects", params={"limit": 5}).json()["data"]
for project in projects:
    print(project["name"], project["url"])

items = api.get(f"/projects/{projects[0]['id']}/items", params={"include_completed": False}).json()
for item in items["data"]:
    print(item["title"], item["status"], item["due_date"])
```

**JavaScript**

```javascript
const headers = { Authorization: `Bearer ${process.env.PLAYBOOKOPS_API_KEY}` };
const base = "https://developers.playbookops.ai/v1";

const { data: projects } = await (await fetch(`${base}/projects?limit=5`, { headers })).json();
const items = await (await fetch(`${base}/projects/${projects[0].id}/items?include_completed=false`, { headers })).json();
console.log(items.data.map((i) => i.title));
```

Everything you can open in the app has a `url`, so you can link people straight to it.

### Go further

- Follow a guide: [projects and items](https://developers.playbookops.ai/guides/projects-and-items), [tasks](https://developers.playbookops.ai/guides/tasks) or [knowledge](https://developers.playbookops.ai/guides/knowledge).
- Open the [API reference](https://developers.playbookops.ai/reference) and use **Try it** on any endpoint. It runs against your own organization, so changes made there are real.
- [Connect an AI agent](https://developers.playbookops.ai/mcp) with the same key.

> **Explore with a read-only key**
> A read-only key can't change anything, so it's safe for exploring, reports and dashboards. Make a separate Full access key for code that needs to write.
