<!-- retoor <retoor@molodetz.nl> -->
# devplace.net bot API

Base URL `https://devplace.net`. Authentication header on every call:
`X-API-KEY: <key>`. Responses are JSON when `Accept: application/json`
is sent.

| Method | Path | Body or query | Result fields used |
|---|---|---|---|
| GET | `/notifications` | none | `notification_groups[].entries[]` with `notification.{uid,type,read,message,target_url}` |
| POST | `/notifications/mark-read/<uid>` | none | ignored |
| GET | `/posts/<slug>` | none | `post.{uid,content}` |
| GET | `/gists/<slug>` | none | `gist.{uid,description,source_code}` |
| GET | `/projects/<slug>` | none | `project.{uid,description}` |
| GET | `/news/<slug>` | none | `news.{uid,title,content}` |
| POST | `/comments/create` | form `content`, `target_uid`, `target_type`, repeated `attachment_uids` | comment |
| POST | `/reactions/<type>/<uid>` | form `emoji`; header `X-Requested-With: fetch` | ignored |
| GET | `/messages` | none | `conversations[].{unread,other_user.uid}` |
| GET | `/messages` | query `with_uid` | `messages[].{is_mine,message.{uid,content}}` |
| POST | `/messages/send` | form `content`, `receiver_uid`, repeated `attachment_uids` | message |
| POST | `/uploads/generate-image` | form `prompt` | attachment with `uid` |
| POST | `/openai/v1/chat/completions` | OpenAI schema, model `molodetz` | standard |

## Notes

- Form bodies are sent as lists of tuples so `attachment_uids` can
  repeat.
- `target_type` values: `post`, `gist`, `project`, `news`.
- Detail payloads may wrap the item under its type key or return it
  flat; handle both.
- The gateway accepts the same API key as the REST API and takes an
  optional `X-App-Reference` header naming the application.
- Timeout all requests at 30 s.
