# Authentication

> Account API keys, Bearer auth, and how to select a project when you have more than one blog.

HTML version: https://blogizi.com/docs/api-authentication
Markdown version: https://blogizi.com/docs/api-authentication.md

## Account API key

One key per account authorizes all of your projects. Copy it from **Dashboard → Account → API** (also shown under project **Settings → API**). Treat it like a password — never commit it or paste it into chat logs.

## Request headers

```http
Authorization: Bearer YOUR_ACCOUNT_API_KEY
X-Blogizi-Project: your-project-slug
Content-Type: application/json
```

`X-Blogizi-Project` is optional when the account has exactly one project (the server picks it). With multiple projects it is required unless you pass `projectSlug`, `project`, or `projectId` in the JSON body.

## Regenerate

Regenerating the key invalidates the old one. Re-run `blogizi auth` (and Obsidian settings) on every machine that uses the API.

```http
GET  /api/account/keys    # dashboard session — returns/migrates key
POST /api/account/keys    # dashboard session — regenerates key
```

Key management endpoints use the dashboard session, not the API key itself.
