Appearance
Exporters
Export plugins for generating PDFs and other outputs. An exporter has an external API endpoint that processes data and returns generated files.
Routes
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /api/exporters | Bearer | List exporters |
| GET | /api/exporter/:id | Bearer | Get single exporter |
| PUT | /api/exporter | JWT (admin/root) | Create an exporter |
| POST | /api/exporter/:id | JWT (admin/root) | Update an exporter |
| PATCH | /api/exporter/:id | JWT (admin/root) | Partially update an exporter |
| DELETE | /api/exporter/:id | JWT (admin/root) | Delete an exporter |
| DELETE | /api/exporter/clear/:id | JWT (admin/root) | Clear generated PDFs for an exporter |
| DELETE | /api/exporters | JWT (admin/root) | Bulk delete exporters |
| PUT | /api/exporter/trigger/:id | Bearer | Trigger an export job |
| POST | /api/exporter/callback/:id | None (JWT in body) | Callback from external exporter |
Trigger Export
PUT /api/exporter/trigger/:idTriggers a new export job. The exporter's API endpoint is called with the relevant data.
Body
| Field | Type | Required | Description |
|---|---|---|---|
data | number | No | |
issue | number | No | Parent issue (id or name) |
Response
json
{
"status": "ok",
"id": 123,
"apiResult": "processing",
"otc": "one-time-code"
}Processing States
| State | Code | Description |
|---|---|---|
| Error | 0 | Export failed |
| Processing | 1 | Export in progress |
| Complete | 2 | Export finished, files available |
Create Exporter (PUT)
PUT /api/exporterBody
| Field | Type | Required | Description |
|---|---|---|---|
id | number | No | Entity ID |
name | string | Yes | Display name |
api | string | Yes | Exporter API endpoint URL |
books | array | No | |
chapters | array | No | |
issues | array | No | |
templates | array | No |
Update Exporter (POST)
POST /api/exporter/:idBody
| Field | Type | Required | Description |
|---|---|---|---|
id | number | Yes | Entity ID |
name | string | Yes | Display name |
api | string | Yes | Exporter API endpoint URL |
books | array | No | |
chapters | array | No | |
issues | array | No | |
templates | array | No |
Partial Update (PATCH)
PATCH /api/exporter/:idBody
| Field | Type | Required | Description |
|---|---|---|---|
id | number | Yes | Entity ID |
name | string | No | Display name |
api | string | No | Exporter API endpoint URL |
books | array | No | |
chapters | array | No | |
issues | array | No | |
templates | array | No |
Clear PDFs
DELETE /api/exporter/clear/:idRemoves all generated PDF records for the exporter without deleting the exporter itself.
Exporter Callback
POST /api/exporter/callback/:idCalled by the external exporter service when processing is complete. Authenticated via a JWT token signed with the one-time code. Updates the PDF record and broadcasts a WebSocket event.