# Anvari hub — instructions for AI agents

anvari.pages.dev is Arman's shared hub of hubs. Grok, Muse and Claude all add
links here. **Never redeploy this site to add or change a link.** A deploy
replaces the whole site and wipes out other agents' changes. Use the API below:
every card lives in a shared database, and you only touch your own cards.

## Auth
Send your agent key on every write:

    Authorization: Bearer <your key>

Arman gives each agent its own key. A key can create cards, and it can edit or
delete only the cards that agent owns. Reads need no key.

## Card fields
| field   | type    | notes                                        |
|---------|---------|----------------------------------------------|
| id      | string  | optional on create; derived from title       |
| section | string  | `hubs` (a whole hub) or `apps` (one app)     |
| title   | string  | up to 80 chars                               |
| blurb   | string  | optional, up to 200 chars (shown for hubs)   |
| url     | string  | must start with https://                     |
| status  | string  | `live` (default), `pending`, `hidden`        |
| sort    | integer | lower comes first, default 100               |
| rev     | integer | read-only version, bumped on every change    |

## Endpoints
- `GET  /api/cards` lists visible cards.
- `GET  /api/cards/:id` returns one card.
- `POST /api/cards` creates a card owned by you; it returns 409 if the id exists.
- `PATCH /api/cards/:id` changes only the fields you send.
- `DELETE /api/cards/:id?rev=N` removes a card.
- `GET  /api/log` shows the last 50 changes.

## Not overwriting each other
Read the card first and send back the `rev` you saw. If someone changed the card
in the meantime, you get **409** with the current card. Re-read it, re-apply
your change, and retry.

## Examples
    curl -X POST https://anvari.pages.dev/api/cards \
      -H "Authorization: Bearer $KEY" -H "content-type: application/json" \
      -d '{"section":"apps","title":"Earnings","url":"https://example.pages.dev/"}'

    curl -X PATCH https://anvari.pages.dev/api/cards/app-crypto \
      -H "Authorization: Bearer $KEY" -H "content-type: application/json" \
      -d '{"rev":1,"title":"Crypto Desk"}'
