# api.mail.m7.org Endpoint Documentation

Generated on 2026-07-19 from `cli/endpoints.php --json`, `config/general.json`, and the PHP handlers under `lib/php/thisProject/api`.

## Conventions

- Base URL: `https://api.mail.m7.org`
- Response format: `json`; error format: `json`.
- Request parameters are read from the parsed request payload (`$this->r`), which may include query, form, or JSON body values depending on the router parser.
- `ANY` means the route is registered without an HTTP-method constraint. Prefer `POST` for mutations and request bodies unless the caller contract says otherwise.
- "Detected request fields" are statically extracted from handlers and delegated service methods; table-backed filters may accept additional fields.

## Authentication

- M7 token config: check `soft`, issuer `id.m7.org`; allowed algorithms `RS512`.
- Principal route protection from config:
  - `/members, /v1/members` -> user, admin, root
  - `/admin, /v1/admin` -> admin, root

## Endpoint Summary

| Method | Path | Auth | Handler |
| --- | --- | --- | --- |
| `ANY` | `/hello` | no explicit auth gate detected in route/handler | `hello\Controller` |
| `ANY` | `/v1/admin/outbound` | principal route rule: admin, root | `admin\outbound\Controller` |
| `ANY` | `/v1/members/send` | principal route rule: user, admin, root | `members\send\Controller` |

## Endpoints

### ANY /hello

Handles hello.

- Handler: `thisProject\api\hello\Controller`
- Source: `lib/php/thisProject/api/hello/Controller.php`
- Auth: no explicit auth gate detected in route/handler
- Detected request fields: none in the handler; endpoint may be informational or delegates opaque input.
- Response: success comment(s): `OK`.

### ANY /v1/admin/outbound

Handles outbound.

- Handler: `thisProject\api\admin\outbound\Controller`
- Source: `lib/php/thisProject/api/admin/outbound/Controller.php`
- Auth: principal route rule: admin, root
- Detected request fields: none in the handler; endpoint may be informational or delegates opaque input.
- Response: success comment(s): `OK`.

### ANY /v1/members/send

Sends controller.

- Handler: `thisProject\api\members\send\Controller`
- Source: `lib/php/thisProject/api/members/send/Controller.php`
- Delegates to: `lib/php/thisProject/service/delivery/Controller.php::deliver`
- Auth: principal route rule: user, admin, root
- Detected request fields:
  - `method` (optional/detected). Method selector or delivery method. Default: `'email'`.
- Response: success comment(s): `OK`.
- Notable errors: `Unsupported delivery method`.
