# MGService – API reference

*MGService 5.1.2 · 2026-11-21 · 348 endpoints*

## Overview

Everything the MGService interface shows and does goes through this API - the screens use exactly these
endpoints, with the rights of the person signed in. Requests and answers are JSON (UTF-8) unless an
endpoint says otherwise (CSV, PDF, Excel, files, the AI's stream).

The address is the installation's own, e.g. `https://mgservice.example.com`; on the server itself
`http://127.0.0.1:6644`. All paths below begin with `/api/`. Administration is under `/api/system/…`.

## Signing in

**API token (for scripts and other systems).** A person creates a token under *Account → API tokens*;
it is shown once. Send it in every request:

```
Authorization: Bearer <token>
```

A token carries exactly the rights of the person who made it - an administrator's token may do what an
administrator may, nothing more. *Who may* below names what an endpoint demands before anything else; on
top of that, an endpoint checks the rights on the very item (a project's permissions, a space's, a page's
restrictions) and answers 403 or 404 where they are missing. A revoked token is refused at once. Keep tokens out of logs and scripts
that others read.

**Session (the browser).** `POST /api/auth/login` with `{"username": "…", "password": "…"}` sets a
session cookie; `POST /api/auth/logout` ends it. Passkeys and the sign-in through identity providers
(Microsoft Entra, Google, Okta) go through the sign-in page, Active Directory accounts through the same
`POST /api/auth/login`.

**Customers** sign in to the portal (`/api/portal/…`) with an account of their own; the agents'
endpoints refuse them, and the portal's endpoints show a customer only their own requests and those
shared with their organisation.

## Errors

An error is an HTTP status with a JSON body:

```json
{"error": "A sentence that says what is wrong", "code": "optional_machine_readable_code"}
```

| Status | Meaning |
|---|---|
| 400 | The request is not right - the sentence says what. |
| 401 | Not signed in, or the token is not valid. |
| 403 | Signed in, but not allowed - or, for changes, no valid licence (`code: license_required`). |
| 404 | Not there, or not visible to this person (the API does not tell the two apart). |
| 409 | In conflict with what is there (e.g. a name taken). |
| 413 | Too big - send big files in pieces (see below). |
| 429 | Too many requests - wait as long as `Retry-After` says. |
| 500 | Unexpected; the answer carries `ref`, a reference that is in the server's log with the details. |

## Limits

Requests without a session are limited to 300 a minute per address, signed-in clients and tokens to
1200 a minute (each counted per worker process; an installation can change both,
`<PRODUCT>_RATE_LIMIT_ANON` and `<PRODUCT>_RATE_LIMIT`). Above it the answer is `429` with `Retry-After`
in seconds. `/api/health` is never limited; signing in (`/api/auth/…`) has a lockout after failed
attempts of its own instead.

## Formats

- Times are ISO 8601 in UTC, e.g. `2026-11-06T14:30:00Z`; plain dates `2026-11-06`.
- Durations are seconds (`seconds`), or text where an endpoint says so (`timeSpent: "1h 30m"`).
- Lists that can be long take `limit` and `offset` where they say so; the answer says how many there are.
- Searching uses **MQL**, the query language of the issue search, e.g.
  `project = ORB AND statusCategory != done ORDER BY updated DESC` (`GET /api/search?mql=…`).

## Big files in pieces

Proxies in front of a server often take only so much per request (Cloudflare: 100 MB). Big files go in
pieces of up to 50 MB:

1. `POST /api/uploads` with `{"filename": "…", "size": <bytes>}` → `{"id": "<upload id>", …}`
2. `PUT /api/uploads/<id>/<n>` with the bytes of piece `n` (0, 1, 2 …) as the body, in order
3. `GET /api/uploads/<id>` says how far it got - ask before sending a piece again after a break
4. attach the finished file with `"uploadId": "<id>"` in place of a form file; `DELETE /api/uploads/<id>`
   gives up

An upload belongs to whoever began it; one not finished within a day is removed.

## The AI assistant's answers

`POST /api/ai/ask` with `{"question": "…", "conversation": "<any id of the conversation>"}` answers as a
stream of JSON lines (`application/x-ndjson`), one event per line, as the work goes on:

| `type` | What it carries |
|---|---|
| `start` | the log id of this question |
| `step` | a tool the assistant used: `tool`, `input`, `summary` |
| `sources` | what it found and opened: `items` |
| `list` | a list from the database, with the query that made it |
| `chart` | a chart to draw: `chart` = `{type, title, labels, series[{name, values}], unit}` |
| `draft` | a change prepared for the person to confirm |
| `text` | the answer, in pieces |
| `error` | what went wrong, in a sentence |
| `end` | the answer is complete |

Every number in a chart comes from a tool result of the same answer; the assistant acts with the rights
of the person who asks.


## Contents

- [ai](#area-ai) – 8
- [applinks](#area-applinks) – 4
- [attachments](#area-attachments) – 5
- [auth](#area-auth) – 18
- [automation](#area-automation) – 6
- [bootstrap](#area-bootstrap) – 1
- [canned-responses](#area-canned-responses) – 4
- [chat](#area-chat) – 11
- [comments](#area-comments) – 2
- [custom-fields](#area-custom-fields) – 5
- [customers](#area-customers) – 11
- [dashboard](#area-dashboard) – 1
- [dashboards](#area-dashboards) – 6
- [default-workflows](#area-default-workflows) – 2
- [filters](#area-filters) – 3
- [gadgets](#area-gadgets) – 1
- [global-permissions](#area-global-permissions) – 2
- [groups](#area-groups) – 4
- [health](#area-health) – 2
- [issue-types](#area-issue-types) – 3
- [issues](#area-issues) – 21
- [kb](#area-kb) – 1
- [links](#area-links) – 4
- [mql](#area-mql) – 2
- [notification-schemes](#area-notification-schemes) – 5
- [notifications](#area-notifications) – 3
- [organisations](#area-organisations) – 8
- [permission-schemes](#area-permission-schemes) – 5
- [portal](#area-portal) – 29
- [portal-helpdesks](#area-portal-helpdesks) – 1
- [projects](#area-projects) – 27
- [queues](#area-queues) – 4
- [reports](#area-reports) – 9
- [request-types](#area-request-types) – 3
- [routines](#area-routines) – 6
- [screen-schemes](#area-screen-schemes) – 5
- [search](#area-search) – 2
- [sla](#area-sla) – 2
- [statuses](#area-statuses) – 3
- [system/accent](#area-system-accent) – 2
- [system/ai](#area-system-ai) – 14
- [system/announcement](#area-system-announcement) – 2
- [system/applinks](#area-system-applinks) – 6
- [system/audit](#area-system-audit) – 1
- [system/audit.csv](#area-system-audit-csv) – 1
- [system/branding](#area-system-branding) – 3
- [system/database](#area-system-database) – 3
- [system/db](#area-system-db) – 4
- [system/deactivated-tickets](#area-system-deactivated-tickets) – 1
- [system/entra](#area-system-entra) – 4
- [system/identity](#area-system-identity) – 5
- [system/instance](#area-system-instance) – 2
- [system/intake](#area-system-intake) – 6
- [system/jsm-import](#area-system-jsm-import) – 10
- [system/kb](#area-system-kb) – 4
- [system/license](#area-system-license) – 3
- [system/mail](#area-system-mail) – 3
- [system/mail-queue](#area-system-mail-queue) – 1
- [system/portal](#area-system-portal) – 1
- [third-party](#area-third-party) – 1
- [timeclock](#area-timeclock) – 8
- [uploads](#area-uploads) – 4
- [users](#area-users) – 7
- [webhooks](#area-webhooks) – 5
- [workflows](#area-workflows) – 6
- [worklogs](#area-worklogs) – 2

## Area: `ai`

<a id="area-ai"></a>

The AI assistant: asking a question (answered as a stream of events), searching, drafts the assistant prepared and the person confirms, and feedback on answers.

### `POST /api/ai/ask`

**Ask – AI assistant**

Answers as lines of JSON: first what was found, then the answer piece by
piece, then the end - so the box shows what was found at once.

- **Who may:** Anybody signed in
- **JSON body:** `question`, `previous`, `history`, `conversation`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/ai/ask' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"question": "…", "previous": "…", "history": "…", "conversation": "…"}'
```

**Returns**

A stream of JSON lines (application/x-ndjson), one event per line - see “The AI assistant's answers”.

### `POST /api/ai/drafts/{draft_id}/carry-out`

**Carry out – draft**

The button on a draft: the person confirms, and it is carried out as them.

- **Who may:** Anybody signed in
- **Path parameters:** `draft_id` (integer)

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/ai/drafts/{draft_id}/carry-out' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`ok`, `message`, `url`, `draft`

### `POST /api/ai/drafts/{draft_id}/discard`

**Discard – draft**

- **Who may:** Anybody signed in
- **Path parameters:** `draft_id` (integer)

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/ai/drafts/{draft_id}/discard' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`draft`

### `POST /api/ai/feedback`

**Give feedback – AI assistant**

- **Who may:** Anybody signed in
- **JSON body:** `question`, `refs`, `good`, `logId`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/ai/feedback' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"question": "…", "refs": "…", "good": "…", "logId": "…"}'
```

**Returns**

`ok`

### `POST /api/ai/query`

**Send query**

The assistant's read-only query, for a caller with the same rights: the probe run (tools/ai_eval.py)
works out the right answers with it, and MGHub can ask a tool for exact numbers. Only what the person may
see; checked and run exactly as the assistant's own (ai_query.py).

- **Who may:** Anybody signed in
- **JSON body:** `sql`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/ai/query' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"sql": "…"}'
```

**Returns**

JSON.

### `GET /api/ai/schema`

**Read schema**

The views the assistant queries, as it is told about them - for this person.

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/ai/schema' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `views` | string | `"issues(key: the item's key, e.g. ABC-12, summary: its title` |

<details><summary>Example answer</summary>

```json
{
  "views": "issues(key: the item's key, e.g. ABC-12, summary: its title, type: Task, Bug,…"
}
```

</details>

### `POST /api/ai/search`

**Send search**

The tickets alone, without an answer - also when the AI cannot be reached.

- **Who may:** Anybody signed in
- **JSON body:** `question`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/ai/search' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"question": "…"}'
```

**Returns**

`items`

### `GET /api/ai/state`

**Read the state – AI assistant**

For a client (the Mac app; the box): who this token or session is, and whether the AI assistant
answers them - one call to set a connection up.

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/ai/state' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `signedIn` | boolean | `true` |
| `user` | string | `"Administrator"` |
| `product` | string | `"mgservice"` |
| `box` | boolean | `false` |

<details><summary>Example answer</summary>

```json
{
  "signedIn": true,
  "user": "Administrator",
  "product": "mgservice",
  "box": false
}
```

</details>


## Area: `applinks`

<a id="area-applinks"></a>

Application links between MGWiki, MGProject and MGService: what an installation is, the key exchange when an administrator links two of them, removing a link, and as whom a linked request is seen.

### `GET /api/applinks/about`

**Read what this is – applinks**

What this installation is - the first question of an application setting up a link. Open to all.

- **Who may:** No sign-in needed

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/applinks/about' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `product` | string | `"mgservice"` |
| `product_name` | string | `"MGService"` |
| `applinks` | integer | `1` |

<details><summary>Example answer</summary>

```json
{
  "product": "mgservice",
  "product_name": "MGService",
  "applinks": 1
}
```

</details>

### `POST /api/applinks/handshake`

**Exchange the keys – applinks**

The other side of setting up a link: an administrator of this installation (by API token or signed in)
accepts the other application's key and hands over this one's.

- **Who may:** Administrators
- **JSON body:** `base_url`, `product`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/applinks/handshake' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"base_url": "…", "product": "…"}'
```

**Returns**

JSON.

### `POST /api/applinks/unlink`

**Remove the link – applinks**

The linked application removed the link - signed by the link itself.

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/applinks/unlink' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`ok`

### `GET /api/applinks/whoami`

**Read as whom – applinks**

As whom a request over an application link is seen here - the test of a link.

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/applinks/whoami' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `product` | string | `"mgservice"` |
| `product_name` | string | `"MGService"` |
| `username` | string | `"admin"` |
| `display_name` | string | `"Administrator"` |
| `email` | string | `""` |
| `matched_by` | null | `null` |

<details><summary>Example answer</summary>

```json
{
  "product": "mgservice",
  "product_name": "MGService",
  "username": "admin",
  "display_name": "Administrator",
  "email": "",
  "matched_by": null
}
```

</details>


## Area: `attachments`

<a id="area-attachments"></a>

Files attached to issues or pages: reading, downloading, the preview of office documents, changing who may see them and removing them.

### `GET /api/attachments/{aid}`

**Read attachment**

- **Who may:** Permission: `browse`
- **Path parameters:** `aid` (integer)
- **Query parameters:** `download` (string), `inline` (string)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/attachments/{aid}?download=…&inline=…' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

JSON.

### `DELETE /api/attachments/{aid}`

**Delete attachment**

- **Who may:** Anybody signed in
- **Path parameters:** `aid` (integer)

**Call**

```bash
curl -s -X DELETE 'http://127.0.0.1:6644/api/attachments/{aid}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`deleted`

### `GET /api/attachments/{aid}/preview`

**Preview – attachment**

An office document as PDF, so the viewer can show it as it really is.

Converted by LibreOffice on the server and kept beside the attachment, so
the same file is converted once. Without LibreOffice, or for a format it
cannot read, this answers 415 and the viewer offers the download instead.

- **Who may:** Permission: `browse`
- **Path parameters:** `aid` (integer)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/attachments/{aid}/preview' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

JSON.

### `POST /api/attachments/{aid}/seen`

**Create seen marker (attachment)**

The team opened a customer's upload - its NEW goes. Called by the ticket view when someone opens it (the
name, the picture, the viewer); the thumbnails the view loads on its own do not count.

- **Who may:** Permission: `browse`
- **Path parameters:** `aid` (integer)

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/attachments/{aid}/seen' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`seen`

### `PUT /api/attachments/{aid}/visibility`

**Change visibility (attachment)**

Change who sees a file the team attached: the customer too, or the team only.
A customer's own upload stays visible to them - it is theirs.

- **Who may:** Permission: `attach`
- **Path parameters:** `aid` (integer)
- **JSON body:** `customerVisible`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/attachments/{aid}/visibility' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"customerVisible": "…"}'
```

**Returns**

JSON.


## Area: `auth`

<a id="area-auth"></a>

Signing in and out, the own account: password, passkeys, API tokens and personal settings.

### `POST /api/auth/avatar`

**Send avatar**

Store a profile picture, squared and scaled down to a sensible size.

- **Who may:** Anybody signed in
- **JSON body:** `(multipart form: file)`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/auth/avatar' \
  -H 'Authorization: Bearer $TOKEN' \
  -F 'file=@/path/to/file'
```

**Returns**

JSON.

### `DELETE /api/auth/avatar`

**Delete avatar**

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X DELETE 'http://127.0.0.1:6644/api/auth/avatar' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

JSON.

### `POST /api/auth/login`

**Sign in – sign-in**

- **Who may:** No sign-in needed
- **JSON body:** `username`, `password`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/auth/login' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"username": "…", "password": "…"}'
```

**Returns**

`user`, `mustChangePassword`

### `POST /api/auth/logout`

**Sign out – sign-in**

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/auth/logout' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`ok`

### `GET /api/auth/me`

**Read own account**

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/auth/me' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `user` | object |  |
| `user.id` | integer | `6` |
| `user.username` | string | `"admin"` |
| `user.displayName` | string | `"Administrator"` |
| `user.email` | string | `""` |
| `user.avatarColor` | string | `"#007FA0"` |
| `user.isAdmin` | boolean | `true` |
| `user.active` | boolean | `true` |
| `user.clockPrompt` | boolean | `false` |
| `user.avatarUrl` | null | `null` |
| `user.hasPassword` | boolean | `true` |
| `user.mustChangePassword` | boolean | `false` |
| `user.lastLogin` | string | `"2026-11-21T21:28:57Z"` |
| `user.passkeys` | integer | `0` |
| `user.locked` | boolean | `false` |
| `method` | string | `"password"` |
| `passkeys` | array |  |
| `passkeysSupported` | boolean | `true` |
| `passkeyHint` | string | `""` |

<details><summary>Example answer</summary>

```json
{
  "user": {
    "id": 6,
    "username": "admin",
    "displayName": "Administrator",
    "email": "",
    "avatarColor": "#007FA0",
    "isAdmin": true,
    "active": true,
    "clockPrompt": false,
    "avatarUrl": null,
    "hasPassword": true,
    "mustChangePassword": false,
    "lastLogin": "2026-11-21T21:28:57Z",
    "passkeys": 0,
    "locked": false
  },
  "method": "password",
  "passkeys": [],
  "passkeysSupported": true,
  "passkeyHint": ""
}
```

</details>

### `GET /api/auth/passkeys`

**List passkeys**

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/auth/passkeys' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

```json
[]
```

### `POST /api/auth/passkeys/login/begin`

**Begin – login**

- **Who may:** No sign-in needed
- **JSON body:** `username`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/auth/passkeys/login/begin' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"username": "…"}'
```

**Returns**

JSON.

### `POST /api/auth/passkeys/login/finish`

**Finish – login**

- **Who may:** No sign-in needed
- **JSON body:** `credential`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/auth/passkeys/login/finish' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"credential": "…"}'
```

**Returns**

`user`, `mustChangePassword`

### `POST /api/auth/passkeys/register/begin`

**Begin – register**

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/auth/passkeys/register/begin' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

JSON.

### `POST /api/auth/passkeys/register/finish`

**Finish – register**

- **Who may:** Anybody signed in
- **JSON body:** `credential`, `name`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/auth/passkeys/register/finish' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"credential": "…", "name": "…"}'
```

**Returns**

`passkeys`

### `DELETE /api/auth/passkeys/{cid}`

**Delete passkey**

- **Who may:** Anybody signed in
- **Path parameters:** `cid` (integer)

**Call**

```bash
curl -s -X DELETE 'http://127.0.0.1:6644/api/auth/passkeys/{cid}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`deleted`

### `POST /api/auth/password`

**Send password**

- **Who may:** Anybody signed in
- **JSON body:** `currentPassword`, `newPassword`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/auth/password' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"currentPassword": "…", "newPassword": "…"}'
```

**Returns**

`ok`

### `GET /api/auth/preferences`

**List personal settings**

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/auth/preferences' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

```json
{}
```

### `PUT /api/auth/preferences`

**Change personal settings**

Small per person settings blob, currently the remembered dialog sizes.

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/auth/preferences' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

The same as `GET /api/auth/preferences`.

### `GET /api/auth/state`

**Read the state – sign-in**

- **Who may:** No sign-in needed

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/auth/state' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `authenticated` | boolean | `true` |
| `user` | object |  |
| `user.id` | integer | `6` |
| `user.username` | string | `"admin"` |
| `user.displayName` | string | `"Administrator"` |
| `user.email` | string | `""` |
| `user.avatarColor` | string | `"#007FA0"` |
| `user.isAdmin` | boolean | `true` |
| `user.active` | boolean | `true` |
| `user.clockPrompt` | boolean | `false` |
| `user.avatarUrl` | null | `null` |
| `user.hasPassword` | boolean | `true` |
| `user.mustChangePassword` | boolean | `false` |
| `user.lastLogin` | string | `"2026-11-21T21:28:57Z"` |
| `user.passkeys` | integer | `0` |
| `user.locked` | boolean | `false` |
| `passkeysSupported` | boolean | `true` |
| `passkeyHint` | string | `""` |
| `rpId` | string | `"localhost"` |
| `origin` | string | `"http://localhost"` |
| `version` | string | `"5.1.2"` |

<details><summary>Example answer</summary>

```json
{
  "authenticated": true,
  "user": {
    "id": 6,
    "username": "admin",
    "displayName": "Administrator",
    "email": "",
    "avatarColor": "#007FA0",
    "isAdmin": true,
    "active": true,
    "clockPrompt": false,
    "avatarUrl": null,
    "hasPassword": true,
    "mustChangePassword": false,
    "lastLogin": "2026-11-21T21:28:57Z",
    "passkeys": 0,
    "locked": false
  },
  "passkeysSupported": true,
  "passkeyHint": "",
  "rpId": "localhost",
  "origin": "http://localhost",
  "version": "5.1.2"
}
```

</details>

### `GET /api/auth/tokens`

**List API tokens**

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/auth/tokens' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `tokens` | array |  |

<details><summary>Example answer</summary>

```json
{
  "tokens": []
}
```

</details>

### `POST /api/auth/tokens`

**Create API token**

Hand out one token, once.

The value is shown here and never again: only its hash is stored, so a
database that falls into the wrong hands does not hand over anybody's access.

- **Who may:** Anybody signed in
- **JSON body:** `name`, `expires`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/auth/tokens' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"name": "…", "expires": "…"}'
```

**Returns**

`token`, `name`, `expires`, `username`

### `DELETE /api/auth/tokens/{tid}`

**Delete API token**

- **Who may:** Anybody signed in
- **Path parameters:** `tid` (integer)

**Call**

```bash
curl -s -X DELETE 'http://127.0.0.1:6644/api/auth/tokens/{tid}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`revoked`


## Area: `automation`

<a id="area-automation"></a>

Automation rules: when something happens to an issue, do something - and the log of what they did.

### `GET /api/automation`

**List automation rules**

- **Who may:** Administrators

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/automation' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `rules` | array |  |
| `catalogue` | object |  |
| `catalogue.events` | object |  |
| `catalogue.events.issue.created` | string | `"Issue created"` |
| `catalogue.events.issue.transitioned` | string | `"Status changed"` |
| `catalogue.events.issue.assigned` | string | `"Assignee changed"` |
| `catalogue.events.issue.updated` | string | `"Any field changed"` |
| `catalogue.events.issue.deleted` | string | `"Issue deleted"` |
| `catalogue.events.issue.deleting` | string | `"Issue is about to be deleted"` |
| `catalogue.events.comment.added` | string | `"Comment added by an agent"` |
| `catalogue.events.customer.commented` | string | `"Customer replied"` |
| `catalogue.events.issue.escalated` | string | `"Customer escalated"` |
| `catalogue.events.worklog.added` | string | `"Work logged"` |
| `catalogue.events.attachment.added` | string | `"Attachment added"` |
| `catalogue.events.customer.attached` | string | `"Customer uploaded an attachment"` |
| `catalogue.events.issue.inactive` | string | `"No activity for a while"` |
| `catalogue.watchableFields` | object |  |
| `catalogue.watchableFields.summary` | string | `"Summary"` |
| `catalogue.watchableFields.description` | string | `"Description"` |
| `catalogue.watchableFields.statusId` | string | `"Status"` |
| `catalogue.watchableFields.assigneeId` | string | `"Assignee"` |
| `catalogue.watchableFields.reporterId` | string | `"Reporter"` |
| `catalogue.watchableFields.priorityId` | string | `"Priority"` |
| `catalogue.watchableFields.customerId` | string | `"Customer"` |
| `catalogue.watchableFields.estimate` | string | `"Estimate"` |
| `catalogue.watchableFields.dueDate` | string | `"Due date"` |
| `catalogue.watchableFields.labels` | string | `"Labels"` |
| `catalogue.watchableFields.typeId` | string | `"Issue type"` |
| `catalogue.watchableFields.parentId` | string | `"Parent"` |
| `catalogue.conditions` | object |  |
| `catalogue.conditions.typeIs` | string | `"Issue type is"` |
| `catalogue.conditions.typeIsNot` | string | `"Issue type is not"` |
| `catalogue.conditions.statusIs` | string | `"Status is"` |
| `catalogue.conditions.statusCategoryIs` | string | `"Status category is"` |
| `catalogue.conditions.priorityIs` | string | `"Priority is"` |
| `catalogue.conditions.projectIs` | string | `"Project is"` |
| `catalogue.conditions.assigneeIsEmpty` | string | `"Issue has no assignee"` |
| `catalogue.conditions.assigneeIsSet` | string | `"Issue has an assignee"` |
| `catalogue.conditions.assigneeIs` | string | `"Assignee is"` |
| `catalogue.conditions.reporterIs` | string | `"Reporter is"` |

<details><summary>Example answer</summary>

```json
{
  "rules": [],
  "catalogue": {
    "events": {
      "issue.created": "Issue created",
      "issue.transitioned": "Status changed",
      "issue.assigned": "Assignee changed",
      "issue.updated": "Any field changed",
      "issue.deleted": "Issue deleted",
      "issue.deleting": "Issue is about to be deleted",
      "comment.added": "Comment added by an agent",
      "customer.commented": "Customer replied",
      "issue.escalated": "Customer escalated",
      "worklog.added": "Work logged",
      "attachment.added": "Attachment added",
      "customer.attached": "Customer uploaded an attachment",
      "issue.inactive": "No activity for a while"
    },
    "watchableFields": {
      "summary": "Summary",
      "description": "Description",
      "statusId": "Status",
      "assigneeId": "Assignee",
      "reporterId": "Reporter",
      "priorityId": "Priority",
      "customerId": "Customer",
      "estimate": "Estimate",
      "dueDate": "Due date",
      "labels": "Labels",
      "typeId": "Issue type",
      "parentId": "Parent"
    },
    "conditions": {
      "typeIs": "Issue type is",
      "typeIsNot": "Issue type is not",
      "statusIs": "Status is",
      "statusCategoryIs": "Status category is",
      "priorityIs": "Priority is",
      "projectIs": "Project is",
      "assigneeIsEmpty": "Issue has no assignee",
      "assigneeIsSet": "Issue has an assignee",
      "assigneeIs": "Assignee is",
      "reporterIs": "Reporter is",
      "isSubtask": "Issue is a sub-task",
      "isNotSubtask": "Issue is not a sub-task",
      "channelIs": "Came in through (portal, email, chat, agent)",
      "hasCustomer": "Issue belongs to a customer",
      "hasOpenChildren": "Issue has open children",
      "hasNoOpenChildren": "Every child is finished",
      "summa
…
```

</details>

### `POST /api/automation`

**Create automation rule**

- **Who may:** Administrators
- **JSON body:** `name`, `trigger`, `description`, `enabled`, `projectId`, `triggerConfig`, `conditions`, `actions`, `question`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/automation' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"name": "…", "trigger": "…", "description": "…", "enabled": "…", "projectId": "…", "triggerConfig": "…", "conditions": "…", "actions": "…"}'
```

**Returns**

The same as `GET /api/automation`.

### `GET /api/automation/log`

**List log**

Every evaluation, across all rules - the place to look when a rule
seems not to fire.

- **Who may:** Administrators

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/automation/log' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

```json
[]
```

### `PUT /api/automation/{rid}`

**Change automation rule**

- **Who may:** Administrators
- **Path parameters:** `rid` (integer)
- **JSON body:** `trigger`, `triggerConfig`, `question`, `name`, `description`, `enabled`, `projectId`, `conditions`, `actions`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/automation/{rid}' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"trigger": "…", "triggerConfig": "…", "question": "…", "name": "…", "description": "…", "enabled": "…", "projectId": "…", "conditions": "…"}'
```

**Returns**

JSON.

### `DELETE /api/automation/{rid}`

**Delete automation rule**

- **Who may:** Administrators
- **Path parameters:** `rid` (integer)

**Call**

```bash
curl -s -X DELETE 'http://127.0.0.1:6644/api/automation/{rid}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`deleted`

### `GET /api/automation/{rid}/runs`

**List runs (automation rule)**

- **Who may:** Administrators
- **Path parameters:** `rid` (integer)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/automation/{rid}/runs' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

```json
[]
```


## Area: `bootstrap`

<a id="area-bootstrap"></a>

What the browser needs to start: the person signed in, projects, statuses, types, the features they may use.

### `GET /api/bootstrap`

**Read start data**

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/bootstrap' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `instanceName` | string | `""` |
| `version` | string | `"5.1.2"` |
| `me` | object |  |
| `me.id` | integer | `6` |
| `me.username` | string | `"admin"` |
| `me.displayName` | string | `"Administrator"` |
| `me.email` | string | `""` |
| `me.avatarColor` | string | `"#007FA0"` |
| `me.isAdmin` | boolean | `true` |
| `me.active` | boolean | `true` |
| `me.clockPrompt` | boolean | `false` |
| `me.avatarUrl` | null | `null` |
| `me.hasPassword` | boolean | `true` |
| `me.mustChangePassword` | boolean | `false` |
| `me.lastLogin` | string | `"2026-11-21T21:28:57Z"` |
| `me.passkeys` | integer | `0` |
| `me.locked` | boolean | `false` |
| `users` | array |  |
| `users[].id` | integer | `6` |
| `users[].username` | string | `"admin"` |
| `users[].displayName` | string | `"Administrator"` |
| `users[].email` | string | `""` |
| `users[].avatarColor` | string | `"#007FA0"` |
| `users[].isAdmin` | boolean | `true` |
| `users[].active` | boolean | `true` |
| `users[].clockPrompt` | boolean | `false` |
| `users[].avatarUrl` | null | `null` |
| `users[].hasPassword` | boolean | `true` |
| `users[].mustChangePassword` | boolean | `false` |
| `users[].lastLogin` | string | `"2026-11-21T21:28:57Z"` |
| `users[].passkeys` | integer | `0` |
| `users[].locked` | boolean | `false` |
| `agentIds` | array |  |
| `projects` | array |  |
| `projects[].workflow` | object |  |
| `projects[].id` | integer | `1` |
| `projects[].key` | string | `"ITS"` |
| `projects[].name` | string | `"IT Service Desk"` |
| `projects[].description` | string | `"Internal IT: accounts, devices, access and outages."` |
| `projects[].type` | string | `"service"` |

<details><summary>Example answer</summary>

```json
{
  "instanceName": "",
  "version": "5.1.2",
  "me": {
    "id": 6,
    "username": "admin",
    "displayName": "Administrator",
    "email": "",
    "avatarColor": "#007FA0",
    "isAdmin": true,
    "active": true,
    "clockPrompt": false,
    "avatarUrl": null,
    "hasPassword": true,
    "mustChangePassword": false,
    "lastLogin": "2026-11-21T21:28:57Z",
    "passkeys": 0,
    "locked": false
  },
  "users": [
    {
      "id": 6,
      "username": "admin",
      "displayName": "Administrator",
      "email": "",
      "avatarColor": "#007FA0",
      "isAdmin": true,
      "active": true,
      "clockPrompt": false,
      "avatarUrl": null,
      "hasPassword": true,
      "mustChangePassword": false,
      "lastLogin": "2026-11-21T21:28:57Z",
      "passkeys": 0,
      "locked": false
    },
    {
      "id": 4,
      "username": "jnovak",
      "displayName": "Jan Novak",
      "email": "jan.novak@example.invalid",
      "avatarColor": "#5243AA",
      "isAdmin": false,
      "active": true,
      "clockPrompt": false,
      "avatarUrl": null,
      "hasPassword": false,
      "mustChangePassword": false,
      "lastLogin": null,
      "passkeys": 0,
      "locked": false
    },
    "…"
  ],
  "agentIds": [
    2,
    3,
    "…"
  ],
  "projects": [
    {
      "workflow": {
        "id": 1,
        "name": "Service desk workflow"
      },
      "id": 1,
      "key": "ITS",
      "name": "IT Service Desk",
      "description": "Internal IT: accounts, devices, access and outages.",
      "type": "service",
      "avatarColor": "#0052CC",
      "lead": {
        "id": 1,
        "username": "mkoch",
        "displayName": "Marie Koch",
        "email": "marie.koch@example.invalid",
        "avatarColor": "#0052CC",
        "isAdmin": true,
        "active": tru
…
```

</details>


## Area: `canned-responses`

<a id="area-canned-responses"></a>

### `GET /api/canned-responses`

**Read canned responses**

- **Who may:** Permission: `browse`
- **Query parameters:** `project` (string)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/canned-responses?project=…' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

```json
[]
```

### `POST /api/canned-responses`

**Send canned responses**

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/canned-responses' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

The same as `GET /api/canned-responses`.

### `PUT /api/canned-responses/{cid}`

**Change canned responses**

- **Who may:** Anybody signed in
- **Path parameters:** `cid` (integer)

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/canned-responses/{cid}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

JSON.

### `DELETE /api/canned-responses/{cid}`

**Delete canned responses**

- **Who may:** Anybody signed in
- **Path parameters:** `cid` (integer)

**Call**

```bash
curl -s -X DELETE 'http://127.0.0.1:6644/api/canned-responses/{cid}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`deleted`


## Area: `chat`

<a id="area-chat"></a>

Live chat between customers in the portal and agents.

### `GET /api/chat/agents`

**List agents**

Who could answer chats, and who does right now - for the Live chats page.

- **Who may:** Permission: `liveChat`

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/chat/agents' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `agents` | array |  |
| `agents[].id` | integer | `6` |
| `agents[].username` | string | `"admin"` |
| `agents[].displayName` | string | `"Administrator"` |
| `agents[].email` | string | `""` |
| `agents[].avatarColor` | string | `"#007FA0"` |
| `agents[].isAdmin` | boolean | `true` |
| `agents[].active` | boolean | `true` |
| `agents[].clockPrompt` | boolean | `false` |
| `agents[].avatarUrl` | null | `null` |
| `agents[].switchedOn` | boolean | `false` |
| `agents[].state` | string | `"off"` |
| `agents[].openChats` | integer | `0` |

<details><summary>Example answer</summary>

```json
{
  "agents": [
    {
      "id": 6,
      "username": "admin",
      "displayName": "Administrator",
      "email": "",
      "avatarColor": "#007FA0",
      "isAdmin": true,
      "active": true,
      "clockPrompt": false,
      "avatarUrl": null,
      "switchedOn": false,
      "state": "off",
      "openChats": 0
    },
    {
      "id": 4,
      "username": "jnovak",
      "displayName": "Jan Novak",
      "email": "jan.novak@example.invalid",
      "avatarColor": "#5243AA",
      "isAdmin": false,
      "active": true,
      "clockPrompt": false,
      "avatarUrl": null,
      "switchedOn": false,
      "state": "off",
      "openChats": 0
    },
    "…"
  ]
}
```

</details>

### `GET /api/chat/history`

**Read history**

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/chat/history' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `chats` | array |  |
| `chats[].id` | integer | `1` |
| `chats[].status` | string | `"closed"` |
| `chats[].subject` | string | `"Where do I find the invoices?"` |
| `chats[].created` | string | `"2026-11-20T15:28:57Z"` |
| `chats[].closed` | string | `"2026-11-20T15:40:57Z"` |
| `chats[].mayTakeOver` | boolean | `false` |
| `chats[].customer` | object |  |
| `chats[].agent` | object |  |
| `chats[].issueKey` | null | `null` |

<details><summary>Example answer</summary>

```json
{
  "chats": [
    {
      "id": 1,
      "status": "closed",
      "subject": "Where do I find the invoices?",
      "created": "2026-11-20T15:28:57Z",
      "closed": "2026-11-20T15:40:57Z",
      "mayTakeOver": false,
      "customer": {
        "id": 5,
        "email": "julia.meyer@example.invalid",
        "displayName": "Julia Meyer",
        "organisation": "Greenleaf Studio",
        "organisationId": 2,
        "organisationShares": true,
        "active": true
      },
      "agent": {
        "id": 4,
        "username": "jnovak",
        "displayName": "Jan Novak",
        "email": "jan.novak@example.invalid",
        "avatarColor": "#5243AA",
        "isAdmin": false,
        "active": true,
        "clockPrompt": false,
        "avatarUrl": null
      },
      "issueKey": null
    }
  ]
}
```

</details>

### `GET /api/chat/inbox`

**Read inbox**

The agent's open chats, with what arrived since the ids the browser already has.

``after`` is a JSON object {chatId: lastMessageId}; without it everything is
returned. Waiting chats are listed as well, so an agent can see the line.

- **Who may:** Anybody signed in
- **Query parameters:** `after` (string)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/chat/inbox?after=…' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `available` | boolean | `false` |
| `chats` | array |  |
| `waiting` | array |  |
| `taken` | array |  |

<details><summary>Example answer</summary>

```json
{
  "available": false,
  "chats": [],
  "waiting": [],
  "taken": []
}
```

</details>

### `POST /api/chat/presence`

**Send presence**

The agent's heartbeat. ``available`` switches taking chats on and off.

- **Who may:** Anybody signed in
- **JSON body:** `leaving`, `available`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/chat/presence' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"leaving": "…", "available": "…"}'
```

**Returns**

`available`, `leaving`

### `GET /api/chat/{sid}`

**Read chat**

- **Who may:** Anybody signed in
- **Path parameters:** `sid` (integer)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/chat/{sid}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `id` | integer | `1` |
| `status` | string | `"closed"` |
| `subject` | string | `"Where do I find the invoices?"` |
| `created` | string | `"2026-11-20T15:28:57Z"` |
| `assigned` | string | `"2026-11-20T15:28:57Z"` |
| `closed` | string | `"2026-11-20T15:40:57Z"` |
| `project` | object |  |
| `project.key` | string | `"SUP"` |
| `project.name` | string | `"Customer Support"` |
| `customer` | object |  |
| `customer.id` | integer | `5` |
| `customer.email` | string | `"julia.meyer@example.invalid"` |
| `customer.displayName` | string | `"Julia Meyer"` |
| `customer.organisation` | string | `"Greenleaf Studio"` |
| `customer.organisationId` | integer | `2` |
| `customer.organisationShares` | boolean | `true` |
| `customer.active` | boolean | `true` |
| `agent` | object |  |
| `agent.displayName` | string | `"Jan Novak"` |
| `agent.avatarColor` | string | `"#5243AA"` |
| `agent.id` | integer | `4` |
| `issueKey` | null | `null` |
| `intake` | array |  |
| `files` | array |  |
| `messages` | array |  |
| `messages[].id` | integer | `1` |
| `messages[].sender` | string | `"customer"` |
| `messages[].body` | string | `"Hello, where do I find my invoices?"` |
| `messages[].created` | string | `"2026-11-20T15:28:57Z"` |
| `messages[].name` | string | `"Julia Meyer"` |

<details><summary>Example answer</summary>

```json
{
  "id": 1,
  "status": "closed",
  "subject": "Where do I find the invoices?",
  "created": "2026-11-20T15:28:57Z",
  "assigned": "2026-11-20T15:28:57Z",
  "closed": "2026-11-20T15:40:57Z",
  "project": {
    "key": "SUP",
    "name": "Customer Support"
  },
  "customer": {
    "id": 5,
    "email": "julia.meyer@example.invalid",
    "displayName": "Julia Meyer",
    "organisation": "Greenleaf Studio",
    "organisationId": 2,
    "organisationShares": true,
    "active": true
  },
  "agent": {
    "displayName": "Jan Novak",
    "avatarColor": "#5243AA",
    "id": 4
  },
  "issueKey": null,
  "intake": [],
  "files": [],
  "messages": [
    {
      "id": 1,
      "sender": "customer",
      "body": "Hello, where do I find my invoices?",
      "created": "2026-11-20T15:28:57Z",
      "name": "Julia Meyer"
    },
    {
      "id": 2,
      "sender": "agent",
      "body": "Hi Julia! Under Account, then Billing.",
      "created": "2026-11-20T15:30:09Z",
      "name": "Jan Novak"
    },
    "…"
  ]
}
```

</details>

### `POST /api/chat/{sid}/close`

**Close – chat**

- **Who may:** Anybody signed in
- **Path parameters:** `sid` (integer)

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/chat/{sid}/close' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`ok`

### `GET /api/chat/{sid}/files/{fid}`

**Read file (chat)**

- **Who may:** Anybody signed in
- **Path parameters:** `sid` (integer), `fid` (integer)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/chat/{sid}/files/{fid}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

JSON.

### `POST /api/chat/{sid}/messages`

**Create message (chat)**

- **Who may:** Anybody signed in
- **Path parameters:** `sid` (integer)
- **JSON body:** `body`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/chat/{sid}/messages' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"body": "…"}'
```

**Returns**

`ok`

### `POST /api/chat/{sid}/take`

**Take over – chat**

Pick a waiting chat by hand instead of waiting for the balancing.

- **Who may:** Anybody signed in
- **Path parameters:** `sid` (integer)

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/chat/{sid}/take' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`ok`

### `POST /api/chat/{sid}/takeover`

**Send takeover (chat)**

Take over a chat a colleague answers - they are away, or it needs someone else.

- **Who may:** Anybody signed in
- **Path parameters:** `sid` (integer)

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/chat/{sid}/takeover' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`ok`

### `POST /api/chat/{sid}/ticket`

**Send ticket (chat)**

Turn the chat into a request that carries on after the chat ends.

- **Who may:** Permission: `create`
- **Path parameters:** `sid` (integer)
- **JSON body:** `project`, `summary`, `typeId`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/chat/{sid}/ticket' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"project": "…", "summary": "…", "typeId": "…"}'
```

**Returns**

`key`


## Area: `comments`

<a id="area-comments"></a>

Comments: changing and deleting them. New comments are added under the issue or page.

### `PUT /api/comments/{cid}`

**Change comment**

- **Who may:** Anybody signed in
- **Path parameters:** `cid` (integer)

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/comments/{cid}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

JSON.

### `DELETE /api/comments/{cid}`

**Delete comment**

- **Who may:** Anybody signed in
- **Path parameters:** `cid` (integer)

**Call**

```bash
curl -s -X DELETE 'http://127.0.0.1:6644/api/comments/{cid}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`deleted`


## Area: `custom-fields`

<a id="area-custom-fields"></a>

Custom fields: their definition, the values to choose from, where they appear.

### `GET /api/custom-fields`

**List custom fields**

Readable for anybody signed in - a form will need them later.

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/custom-fields' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `fields` | array |  |
| `kinds` | object |  |
| `kinds.text` | string | `"One line of text"` |
| `kinds.textarea` | string | `"Several lines of text"` |
| `kinds.number` | string | `"A number"` |
| `kinds.date` | string | `"A date"` |
| `kinds.select` | string | `"One of a list"` |
| `kinds.multiselect` | string | `"Several from a list"` |
| `kinds.checkbox` | string | `"Yes or no"` |
| `kinds.user` | string | `"A person"` |
| `kinds.url` | string | `"A link"` |

<details><summary>Example answer</summary>

```json
{
  "fields": [],
  "kinds": {
    "text": "One line of text",
    "textarea": "Several lines of text",
    "number": "A number",
    "date": "A date",
    "select": "One of a list",
    "multiselect": "Several from a list",
    "checkbox": "Yes or no",
    "user": "A person",
    "url": "A link"
  }
}
```

</details>

### `POST /api/custom-fields`

**Create custom field**

- **Who may:** Administrators
- **JSON body:** `name`, `kind`, `key`, `options`, `description`, `required`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/custom-fields' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"name": "…", "kind": "…", "key": "…", "options": "…", "description": "…", "required": "…"}'
```

**Returns**

The same as `GET /api/custom-fields`.

### `POST /api/custom-fields/order`

**Send order**

- **Who may:** Administrators
- **JSON body:** `ids`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/custom-fields/order' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"ids": "…"}'
```

**Returns**

`ok`

### `PUT /api/custom-fields/{fid}`

**Change custom field**

- **Who may:** Administrators
- **Path parameters:** `fid` (integer)
- **JSON body:** `kind`, `options`, `name`, `description`, `required`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/custom-fields/{fid}' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"kind": "…", "options": "…", "name": "…", "description": "…", "required": "…"}'
```

**Returns**

JSON.

### `DELETE /api/custom-fields/{fid}`

**Delete custom field**

- **Who may:** Administrators
- **Path parameters:** `fid` (integer)

**Call**

```bash
curl -s -X DELETE 'http://127.0.0.1:6644/api/custom-fields/{fid}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`deleted`


## Area: `customers`

<a id="area-customers"></a>

Customers of the service desk: listing, creating, changing, their portal access, export as CSV.

### `GET /api/customers`

**List customers**

- **Who may:** Anybody signed in
- **Query parameters:** `q` (string), `organisation` (string)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/customers?q=…&organisation=…' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `customers` | array |  |
| `customers[].id` | integer | `1` |
| `customers[].email` | string | `"anna.berg@example.invalid"` |
| `customers[].displayName` | string | `"Anna Berg"` |
| `customers[].organisation` | string | `"Northwind Trading"` |
| `customers[].organisationId` | integer | `3` |
| `customers[].organisationShares` | boolean | `true` |
| `customers[].active` | boolean | `true` |
| `customers[].phone` | string | `""` |
| `customers[].hasPassword` | boolean | `false` |
| `customers[].source` | string | `"agent"` |
| `customers[].created` | string | `"2026-09-22T21:28:57Z"` |
| `customers[].lastLogin` | null | `null` |
| `customers[].requests` | integer | `3` |
| `customers[].invitedAt` | null | `null` |
| `customers[].deletable` | boolean | `false` |
| `customers[].notDeletableBecause` | string | `"3 requests belong to this customer. Deactivate the customer` |
| `mayManage` | boolean | `true` |

<details><summary>Example answer</summary>

```json
{
  "customers": [
    {
      "id": 1,
      "email": "anna.berg@example.invalid",
      "displayName": "Anna Berg",
      "organisation": "Northwind Trading",
      "organisationId": 3,
      "organisationShares": true,
      "active": true,
      "phone": "",
      "hasPassword": false,
      "source": "agent",
      "created": "2026-09-22T21:28:57Z",
      "lastLogin": null,
      "requests": 3,
      "invitedAt": null,
      "deletable": false,
      "notDeletableBecause": "3 requests belong to this customer. Deactivate the customer instead - the req…"
    },
    {
      "id": 3,
      "email": "claire.dubois@example.invalid",
      "displayName": "Claire Dubois",
      "organisation": "Bluefield Logistics",
      "organisationId": 1,
      "organisationShares": true,
      "active": true,
      "phone": "",
      "hasPassword": false,
      "source": "agent",
      "created": "2026-09-22T21:28:57Z",
      "lastLogin": null,
      "requests": 2,
      "invitedAt": null,
      "deletable": false,
      "notDeletableBecause": "2 requests belong to this customer. Deactivate the customer instead - the req…"
    },
    "…"
  ],
  "mayManage": true
}
```

</details>

### `POST /api/customers`

**Create customer**

- **Who may:** Anybody signed in
- **JSON body:** `email`, `name`, `organisationId`, `phone`, `invite`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/customers' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"email": "…", "name": "…", "organisationId": "…", "phone": "…", "invite": "…"}'
```

**Returns**

`customer`, `invited`

### `POST /api/customers/invitations`

**Create invitation**

- **Who may:** Anybody signed in
- **JSON body:** `days`, `message`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/customers/invitations' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"days": "…", "message": "…"}'
```

**Returns**

JSON.

### `GET /api/customers/invitations/preview`

**Preview – invitation**

- **Who may:** Anybody signed in
- **Query parameters:** `includeInvited` (string)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/customers/invitations/preview?includeInvited=…' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `count` | integer | `5` |
| `customers` | array |  |
| `customers[].id` | integer | `3` |
| `customers[].displayName` | string | `"Claire Dubois"` |
| `customers[].email` | string | `"claire.dubois@example.invalid"` |
| `customers[].organisation` | string | `"Bluefield Logistics"` |
| `customers[].invitedAt` | null | `null` |
| `invitedBefore` | integer | `0` |
| `mail` | boolean | `false` |
| `portalUrl` | string | `""` |
| `title` | string | `"Help Center"` |
| `defaultText` | string | `"We have moved our service desk. From now on you raise and f` |
| `days` | array |  |
| `running` | boolean | `false` |

<details><summary>Example answer</summary>

```json
{
  "count": 5,
  "customers": [
    {
      "id": 3,
      "displayName": "Claire Dubois",
      "email": "claire.dubois@example.invalid",
      "organisation": "Bluefield Logistics",
      "invitedAt": null
    },
    {
      "id": 4,
      "displayName": "Omar Haddad",
      "email": "omar.haddad@example.invalid",
      "organisation": "Bluefield Logistics",
      "invitedAt": null
    },
    "…"
  ],
  "invitedBefore": 0,
  "mail": false,
  "portalUrl": "",
  "title": "Help Center",
  "defaultText": "We have moved our service desk. From now on you raise and follow your request…",
  "days": [
    7,
    14,
    "…"
  ],
  "running": false
}
```

</details>

### `GET /api/customers/invitations/progress`

**Read progress**

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/customers/invitations/progress' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `state` | string | `"idle"` |

<details><summary>Example answer</summary>

```json
{
  "state": "idle"
}
```

</details>

### `PUT /api/customers/{cid}`

**Change customer**

- **Who may:** Anybody signed in
- **Path parameters:** `cid` (integer)
- **JSON body:** `email`, `organisationId`, `name`, `phone`, `active`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/customers/{cid}' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"email": "…", "organisationId": "…", "name": "…", "phone": "…", "active": "…"}'
```

**Returns**

`customer`

### `DELETE /api/customers/{cid}`

**Delete customer**

Delete a customer who has no tickets. Everything else stays untouched.

- **Who may:** Anybody signed in
- **Path parameters:** `cid` (integer)

**Call**

```bash
curl -s -X DELETE 'http://127.0.0.1:6644/api/customers/{cid}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`deleted`

### `POST /api/customers/{cid}/invite`

**Invite – customer**

- **Who may:** Anybody signed in
- **Path parameters:** `cid` (integer)

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/customers/{cid}/invite' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`sent`

### `GET /api/customers/{cid}/portal-access`

**Read portal access (customer)**

- **Who may:** Anybody signed in
- **Path parameters:** `cid` (integer)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/customers/{cid}/portal-access' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `organisationProjects` | array |  |
| `organisationProjects[].id` | integer | `2` |
| `organisationProjects[].key` | string | `"SUP"` |
| `organisationProjects[].name` | string | `"Customer Support"` |
| `organisationProjects[].on` | boolean | `true` |
| `organisationProjects[].isDefault` | boolean | `false` |
| `visible` | array |  |
| `visible[].id` | integer | `2` |
| `visible[].key` | string | `"SUP"` |
| `visible[].name` | string | `"Customer Support"` |
| `fallback` | boolean | `false` |
| `mayManage` | boolean | `true` |

<details><summary>Example answer</summary>

```json
{
  "organisationProjects": [
    {
      "id": 2,
      "key": "SUP",
      "name": "Customer Support",
      "on": true,
      "isDefault": false
    },
    {
      "id": 1,
      "key": "ITS",
      "name": "IT Service Desk",
      "on": true,
      "isDefault": true
    }
  ],
  "visible": [
    {
      "id": 2,
      "key": "SUP",
      "name": "Customer Support"
    },
    {
      "id": 1,
      "key": "ITS",
      "name": "IT Service Desk"
    }
  ],
  "fallback": false,
  "mayManage": true
}
```

</details>

### `PUT /api/customers/{cid}/portal-access`

**Change portal access (customer)**

- **Who may:** Anybody signed in
- **Path parameters:** `cid` (integer)
- **JSON body:** `hidden`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/customers/{cid}/portal-access' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"hidden": "…"}'
```

**Returns**

The same as `GET /api/customers/{cid}/portal-access`.

### `GET /api/customers/{cid}/requests`

**List requests (customer)**

- **Who may:** Anybody signed in
- **Path parameters:** `cid` (integer)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/customers/{cid}/requests' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `issues` | array |  |
| `issues[].id` | integer | `1` |
| `issues[].key` | string | `"ITS-1"` |
| `issues[].seq` | integer | `1` |
| `issues[].summary` | string | `"VPN drops every few minutes"` |
| `issues[].description` | string | `"Since this morning the VPN connection drops every five to t` |
| `issues[].descriptionHtml` | null | `null` |
| `issues[].project` | object |  |
| `issues[].type` | object |  |
| `issues[].status` | object |  |
| `issues[].priority` | object |  |
| `issues[].assignee` | object |  |
| `issues[].reporter` | null | `null` |
| `issues[].customer` | object |  |
| `issues[].organisation` | object |  |
| `issues[].orgShared` | boolean | `true` |
| `issues[].raisedBy` | object |  |
| `issues[].requestType` | null | `null` |
| `issues[].channel` | string | `"portal"` |
| `issues[].firstResponse` | string | `"2026-11-21T18:40:57Z"` |
| `issues[].parent` | null | `null` |
| `issues[].labels` | array |  |
| `issues[].components` | array |  |
| `issues[].rank` | number | `2000.0` |
| `issues[].dueDate` | null | `null` |
| `issues[].participants` | array |  |
| `issues[].startDate` | null | `null` |
| `issues[].endDate` | null | `null` |
| `issues[].estimate` | null | `null` |
| `issues[].timeLeft` | null | `null` |
| `issues[].progress` | null | `null` |
| `issues[].created` | string | `"2026-11-21T18:28:57Z"` |
| `issues[].updated` | string | `"2026-11-21T18:28:57Z"` |
| `issues[].resolved` | null | `null` |
| `issues[].commentCount` | integer | `3` |
| `issues[].subtaskCount` | integer | `0` |
| `issues[].timeSpent` | integer | `3600` |

<details><summary>Example answer</summary>

```json
{
  "issues": [
    {
      "id": 1,
      "key": "ITS-1",
      "seq": 1,
      "summary": "VPN drops every few minutes",
      "description": "Since this morning the VPN connection drops every five to ten minutes. Collea…",
      "descriptionHtml": null,
      "project": {
        "id": 1,
        "key": "ITS",
        "name": "IT Service Desk",
        "color": "#0052CC"
      },
      "type": {
        "id": 1,
        "name": "Incident",
        "icon": "incident",
        "color": "#E5493A",
        "subtask": false
      },
      "status": {
        "id": 2,
        "name": "In Progress",
        "category": "inprogress"
      },
      "priority": {
        "id": 1,
        "name": "Highest",
        "icon": "up",
        "color": "#CD1317"
      },
      "assignee": {
        "id": 2,
        "username": "tbauer",
        "displayName": "Tom Bauer",
        "avatarColor": "#00875A",
        "active": true
      },
      "reporter": null,
      "customer": {
        "id": 1,
        "email": "anna.berg@example.invalid",
        "displayName": "Anna Berg"
      },
      "organisation": {
        "id": 3,
        "name": "Northwind Trading"
      },
      "orgShared": true,
      "raisedBy": {
        "type": "customer",
        "id": 1,
        "displayName": "Anna Berg",
        "email": "anna.berg@example.invalid"
      },
      "requestType": null,
      "channel": "portal",
      "firstResponse": "2026-11-21T18:40:57Z",
      "parent": null,
      "labels": [],
      "components": [],
      "rank": 2000.0,
      "dueDate": null,
      "participants": []
    },
    {
      "id": 11,
      "key": "SUP-4",
      "seq": 4,
      "summary": "Rename our company in the invoices",
      "description": "Northwind Trading is now Northwind Trading GmbH.",
      "descript
…
```

</details>


## Area: `dashboard`

<a id="area-dashboard"></a>

The start page of a person: what is waiting for them.

### `GET /api/dashboard`

**Read dashboard**

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/dashboard' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `assigned` | array |  |
| `reported` | array |  |
| `recent` | array |  |
| `recent[].id` | integer | `10` |
| `recent[].key` | string | `"SUP-3"` |
| `recent[].seq` | integer | `3` |
| `recent[].summary` | string | `"Login page returns an error 502"` |
| `recent[].description` | string | `"Since a few minutes the login page shows 'Bad gateway'."` |
| `recent[].descriptionHtml` | null | `null` |
| `recent[].project` | object |  |
| `recent[].type` | object |  |
| `recent[].status` | object |  |
| `recent[].priority` | object |  |
| `recent[].assignee` | null | `null` |
| `recent[].reporter` | null | `null` |
| `recent[].customer` | object |  |
| `recent[].organisation` | object |  |
| `recent[].orgShared` | boolean | `true` |
| `recent[].raisedBy` | object |  |
| `recent[].requestType` | null | `null` |
| `recent[].channel` | string | `"email"` |
| `recent[].firstResponse` | null | `null` |
| `recent[].parent` | null | `null` |
| `recent[].labels` | array |  |
| `recent[].components` | array |  |
| `recent[].rank` | number | `11000.0` |
| `recent[].dueDate` | null | `null` |
| `recent[].participants` | array |  |
| `recent[].startDate` | null | `null` |
| `recent[].endDate` | null | `null` |
| `recent[].estimate` | null | `null` |
| `recent[].timeLeft` | null | `null` |
| `recent[].progress` | null | `null` |
| `recent[].created` | string | `"2026-11-21T20:46:57Z"` |
| `recent[].updated` | string | `"2026-11-21T20:46:57Z"` |
| `recent[].resolved` | null | `null` |
| `recent[].commentCount` | integer | `0` |
| `recent[].subtaskCount` | integer | `0` |
| `recent[].timeSpent` | integer | `0` |
| `activity` | array |  |

<details><summary>Example answer</summary>

```json
{
  "assigned": [],
  "reported": [],
  "recent": [
    {
      "id": 10,
      "key": "SUP-3",
      "seq": 3,
      "summary": "Login page returns an error 502",
      "description": "Since a few minutes the login page shows 'Bad gateway'.",
      "descriptionHtml": null,
      "project": {
        "id": 2,
        "key": "SUP",
        "name": "Customer Support",
        "color": "#00875A"
      },
      "type": {
        "id": 1,
        "name": "Incident",
        "icon": "incident",
        "color": "#E5493A",
        "subtask": false
      },
      "status": {
        "id": 1,
        "name": "Waiting for support",
        "category": "todo"
      },
      "priority": {
        "id": 1,
        "name": "Highest",
        "icon": "up",
        "color": "#CD1317"
      },
      "assignee": null,
      "reporter": null,
      "customer": {
        "id": 4,
        "email": "omar.haddad@example.invalid",
        "displayName": "Omar Haddad"
      },
      "organisation": {
        "id": 1,
        "name": "Bluefield Logistics"
      },
      "orgShared": true,
      "raisedBy": {
        "type": "customer",
        "id": 4,
        "displayName": "Omar Haddad",
        "email": "omar.haddad@example.invalid"
      },
      "requestType": null,
      "channel": "email",
      "firstResponse": null,
      "parent": null,
      "labels": [],
      "components": [],
      "rank": 11000.0,
      "dueDate": null,
      "participants": []
    },
    {
      "id": 1,
      "key": "ITS-1",
      "seq": 1,
      "summary": "VPN drops every few minutes",
      "description": "Since this morning the VPN connection drops every five to ten minutes. Collea…",
      "descriptionHtml": null,
      "project": {
        "id": 1,
        "key": "ITS",
        "name": "IT Service Desk",
 
…
```

</details>


## Area: `dashboards`

<a id="area-dashboards"></a>

Dashboards with gadgets: creating, sharing, arranging.

### `GET /api/dashboards`

**List dashboards**

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/dashboards' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `dashboards` | array |  |
| `dashboards[].id` | integer | `1` |
| `dashboards[].name` | string | `"Service overview"` |
| `dashboards[].shared` | string | `"read"` |
| `dashboards[].layout` | array |  |
| `dashboards[].owner` | object |  |
| `dashboards[].shares` | array |  |
| `dashboards[].permission` | string | `"owner"` |
| `dashboards[].canEdit` | boolean | `true` |
| `dashboards[].isOwner` | boolean | `true` |
| `dashboards[].created` | string | `"2026-11-21T21:28:57Z"` |
| `dashboards[].updated` | null | `null` |
| `lastId` | null | `null` |

<details><summary>Example answer</summary>

```json
{
  "dashboards": [
    {
      "id": 1,
      "name": "Service overview",
      "shared": "read",
      "layout": [
        {
          "id": "g1",
          "type": "stats",
          "size": "full"
        },
        {
          "id": "g2",
          "type": "assigned",
          "size": "half",
          "title": "Assigned to me"
        },
        "…"
      ],
      "owner": {
        "id": 1,
        "username": "mkoch",
        "displayName": "Marie Koch",
        "email": "marie.koch@example.invalid",
        "avatarColor": "#0052CC",
        "isAdmin": true,
        "active": true,
        "clockPrompt": false,
        "avatarUrl": null
      },
      "shares": [],
      "permission": "owner",
      "canEdit": true,
      "isOwner": true,
      "created": "2026-11-21T21:28:57Z",
      "updated": null
    }
  ],
  "lastId": null
}
```

</details>

### `POST /api/dashboards`

**Create dashboard**

- **Who may:** Anybody signed in
- **JSON body:** `name`, `layout`, `copyFrom`, `shared`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/dashboards' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"name": "…", "layout": "…", "copyFrom": "…", "shared": "…"}'
```

**Returns**

The same as `GET /api/dashboards`.

### `GET /api/dashboards/current`

**List current ones**

The dashboard last opened by this person, or a sensible fallback.

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/dashboards/current' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `id` | integer | `1` |
| `name` | string | `"Service overview"` |
| `shared` | string | `"read"` |
| `layout` | array |  |
| `layout[].id` | string | `"g1"` |
| `layout[].type` | string | `"stats"` |
| `layout[].size` | string | `"full"` |
| `owner` | object |  |
| `owner.id` | integer | `1` |
| `owner.username` | string | `"mkoch"` |
| `owner.displayName` | string | `"Marie Koch"` |
| `owner.email` | string | `"marie.koch@example.invalid"` |
| `owner.avatarColor` | string | `"#0052CC"` |
| `owner.isAdmin` | boolean | `true` |
| `owner.active` | boolean | `true` |
| `owner.clockPrompt` | boolean | `false` |
| `owner.avatarUrl` | null | `null` |
| `shares` | array |  |
| `permission` | string | `"owner"` |
| `canEdit` | boolean | `true` |
| `isOwner` | boolean | `true` |
| `created` | string | `"2026-11-21T21:28:57Z"` |
| `updated` | null | `null` |

<details><summary>Example answer</summary>

```json
{
  "id": 1,
  "name": "Service overview",
  "shared": "read",
  "layout": [
    {
      "id": "g1",
      "type": "stats",
      "size": "full"
    },
    {
      "id": "g2",
      "type": "assigned",
      "size": "half",
      "title": "Assigned to me"
    },
    "…"
  ],
  "owner": {
    "id": 1,
    "username": "mkoch",
    "displayName": "Marie Koch",
    "email": "marie.koch@example.invalid",
    "avatarColor": "#0052CC",
    "isAdmin": true,
    "active": true,
    "clockPrompt": false,
    "avatarUrl": null
  },
  "shares": [],
  "permission": "owner",
  "canEdit": true,
  "isOwner": true,
  "created": "2026-11-21T21:28:57Z",
  "updated": null
}
```

</details>

### `GET /api/dashboards/{did}`

**Read dashboard**

- **Who may:** Anybody signed in
- **Path parameters:** `did` (integer)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/dashboards/{did}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `id` | integer | `1` |
| `name` | string | `"Service overview"` |
| `shared` | string | `"read"` |
| `layout` | array |  |
| `layout[].id` | string | `"g1"` |
| `layout[].type` | string | `"stats"` |
| `layout[].size` | string | `"full"` |
| `owner` | object |  |
| `owner.id` | integer | `1` |
| `owner.username` | string | `"mkoch"` |
| `owner.displayName` | string | `"Marie Koch"` |
| `owner.email` | string | `"marie.koch@example.invalid"` |
| `owner.avatarColor` | string | `"#0052CC"` |
| `owner.isAdmin` | boolean | `true` |
| `owner.active` | boolean | `true` |
| `owner.clockPrompt` | boolean | `false` |
| `owner.avatarUrl` | null | `null` |
| `shares` | array |  |
| `permission` | string | `"owner"` |
| `canEdit` | boolean | `true` |
| `isOwner` | boolean | `true` |
| `created` | string | `"2026-11-21T21:28:57Z"` |
| `updated` | null | `null` |

<details><summary>Example answer</summary>

```json
{
  "id": 1,
  "name": "Service overview",
  "shared": "read",
  "layout": [
    {
      "id": "g1",
      "type": "stats",
      "size": "full"
    },
    {
      "id": "g2",
      "type": "assigned",
      "size": "half",
      "title": "Assigned to me"
    },
    "…"
  ],
  "owner": {
    "id": 1,
    "username": "mkoch",
    "displayName": "Marie Koch",
    "email": "marie.koch@example.invalid",
    "avatarColor": "#0052CC",
    "isAdmin": true,
    "active": true,
    "clockPrompt": false,
    "avatarUrl": null
  },
  "shares": [],
  "permission": "owner",
  "canEdit": true,
  "isOwner": true,
  "created": "2026-11-21T21:28:57Z",
  "updated": null
}
```

</details>

### `PUT /api/dashboards/{did}`

**Change dashboard**

- **Who may:** Permission: `manageDashboards`
- **Path parameters:** `did` (integer)
- **JSON body:** `layout`, `name`, `shared`, `shares`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/dashboards/{did}' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"layout": "…", "name": "…", "shared": "…", "shares": "…"}'
```

**Returns**

The same as `GET /api/dashboards/{did}`.

### `DELETE /api/dashboards/{did}`

**Delete dashboard**

- **Who may:** Anybody signed in
- **Path parameters:** `did` (integer)

**Call**

```bash
curl -s -X DELETE 'http://127.0.0.1:6644/api/dashboards/{did}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`deleted`


## Area: `default-workflows`

<a id="area-default-workflows"></a>

Which workflow a new project gets for each issue type.

### `GET /api/default-workflows`

**List default workflows**

- **Who may:** Administrators

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/default-workflows' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `types` | array |  |
| `types[].id` | integer | `1` |
| `types[].name` | string | `"Incident"` |
| `types[].icon` | string | `"incident"` |
| `types[].color` | string | `"#E5493A"` |
| `types[].subtask` | boolean | `false` |
| `types[].workflowId` | null | `null` |
| `workflows` | array |  |
| `workflows[].id` | integer | `1` |
| `workflows[].name` | string | `"Service desk workflow"` |
| `workflows[].isDefault` | boolean | `true` |
| `fallback` | object |  |
| `fallback.id` | integer | `1` |
| `fallback.name` | string | `"Service desk workflow"` |

<details><summary>Example answer</summary>

```json
{
  "types": [
    {
      "id": 1,
      "name": "Incident",
      "icon": "incident",
      "color": "#E5493A",
      "subtask": false,
      "workflowId": null
    },
    {
      "id": 2,
      "name": "Help Request",
      "icon": "help",
      "color": "#4BADE8",
      "subtask": false,
      "workflowId": null
    },
    "…"
  ],
  "workflows": [
    {
      "id": 1,
      "name": "Service desk workflow",
      "isDefault": true
    }
  ],
  "fallback": {
    "id": 1,
    "name": "Service desk workflow"
  }
}
```

</details>

### `PUT /api/default-workflows`

**Change default workflows**

- **Who may:** Administrators
- **JSON body:** `types`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/default-workflows' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"types": "…"}'
```

**Returns**

`types`


## Area: `filters`

<a id="area-filters"></a>

Saved filters: an MQL query with a name, shared or private.

### `GET /api/filters`

**List saved filters**

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/filters' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `[].id` | integer | `2` |
| `[].name` | string | `"My open requests"` |
| `[].mql` | string | `"assignee = currentUser() AND statusCategory != done"` |
| `[].owner_id` | integer | `1` |
| `[].created` | string | `"2026-11-21T21:28:57Z"` |

<details><summary>Example answer</summary>

```json
[
  {
    "id": 2,
    "name": "My open requests",
    "mql": "assignee = currentUser() AND statusCategory != done",
    "owner_id": 1,
    "created": "2026-11-21T21:28:57Z"
  },
  {
    "id": 1,
    "name": "Open incidents",
    "mql": "type = Incident AND statusCategory != done ORDER BY priority DESC",
    "owner_id": 1,
    "created": "2026-11-21T21:28:57Z"
  }
]
```

</details>

### `POST /api/filters`

**Create saved filter**

- **Who may:** Anybody signed in
- **JSON body:** `name`, `mql`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/filters' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"name": "…", "mql": "…"}'
```

**Returns**

The same as `GET /api/filters`.

### `DELETE /api/filters/{fid}`

**Delete saved filter**

Filters are seen by everybody (boards and dashboards are built on them) - deleted only by the one
who saved it, or an administrator. There was no check: anybody could delete anybody's filter, and the
boards and gadgets built on it with it.

- **Who may:** Anybody signed in
- **Path parameters:** `fid` (integer)

**Call**

```bash
curl -s -X DELETE 'http://127.0.0.1:6644/api/filters/{fid}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`deleted`


## Area: `gadgets`

<a id="area-gadgets"></a>

The data behind one gadget of a dashboard.

### `GET /api/gadgets/{kind}`

**Read gadget**

Data for one dashboard gadget.

- **Who may:** Anybody signed in
- **Path parameters:** `kind` (string)
- **Query parameters:** `limit` (int, default 8), `mql` (string, default ""), `group` (string, default "status"), `project` (string, default "")

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/gadgets/{kind}?limit=…&mql=…&group=…' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`issues`, `total`, `items`


## Area: `global-permissions`

<a id="area-global-permissions"></a>

General permissions: who may create projects, see everybody's time, use the AI and more.

### `GET /api/global-permissions`

**List general permissions**

- **Who may:** Administrators

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/global-permissions' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `permissions` | array |  |
| `permissions[].key` | string | `"createProject"` |
| `permissions[].label` | string | `"Create service projects"` |
| `permissions[].legacyGroup` | null | `null` |
| `permissions[].grants` | array |  |
| `groups` | array |  |
| `groups[].id` | integer | `1` |
| `groups[].name` | string | `"helpdesk-agent"` |
| `users` | array |  |
| `users[].id` | integer | `6` |
| `users[].displayName` | string | `"Administrator"` |

<details><summary>Example answer</summary>

```json
{
  "permissions": [
    {
      "key": "createProject",
      "label": "Create service projects",
      "legacyGroup": null,
      "grants": []
    },
    {
      "key": "manageProjects",
      "label": "Change any project's settings",
      "legacyGroup": null,
      "grants": []
    },
    "…"
  ],
  "groups": [
    {
      "id": 1,
      "name": "helpdesk-agent"
    },
    {
      "id": 3,
      "name": "routine-admin"
    },
    "…"
  ],
  "users": [
    {
      "id": 6,
      "displayName": "Administrator"
    },
    {
      "id": 4,
      "displayName": "Jan Novak"
    },
    "…"
  ]
}
```

</details>

### `PUT /api/global-permissions`

**Change general permissions**

- **Who may:** Administrators
- **JSON body:** `permission`, `grants`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/global-permissions' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"permission": "…", "grants": "…"}'
```

**Returns**

`permission`


## Area: `groups`

<a id="area-groups"></a>

Groups of people, and who is in them.

### `GET /api/groups`

**List groups**

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/groups' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `[].id` | integer | `1` |
| `[].name` | string | `"helpdesk-agent"` |
| `[].description` | string | `"Answers live chats from the customer portal and looks after` |
| `[].created` | string | `"2026-08-23T21:28:57Z"` |
| `[].members` | array |  |
| `[].members[].id` | integer | `4` |
| `[].members[].username` | string | `"jnovak"` |
| `[].members[].displayName` | string | `"Jan Novak"` |
| `[].members[].email` | string | `"jan.novak@example.invalid"` |
| `[].members[].avatarColor` | string | `"#5243AA"` |
| `[].members[].isAdmin` | boolean | `false` |
| `[].members[].active` | boolean | `true` |
| `[].members[].clockPrompt` | boolean | `false` |
| `[].members[].avatarUrl` | null | `null` |

<details><summary>Example answer</summary>

```json
[
  {
    "id": 1,
    "name": "helpdesk-agent",
    "description": "Answers live chats from the customer portal and looks after portal customers.",
    "created": "2026-08-23T21:28:57Z",
    "members": [
      {
        "id": 4,
        "username": "jnovak",
        "displayName": "Jan Novak",
        "email": "jan.novak@example.invalid",
        "avatarColor": "#5243AA",
        "isAdmin": false,
        "active": true,
        "clockPrompt": false,
        "avatarUrl": null
      },
      {
        "id": 3,
        "username": "lfrei",
        "displayName": "Lena Frei",
        "email": "lena.frei@example.invalid",
        "avatarColor": "#BF2600",
        "isAdmin": false,
        "active": true,
        "clockPrompt": false,
        "avatarUrl": null
      },
      "…"
    ]
  },
  {
    "id": 3,
    "name": "routine-admin",
    "description": "May write and change routines. Running them is open to everybody who may crea…",
    "created": "2026-11-21T21:28:57Z",
    "members": []
  },
  "…"
]
```

</details>

### `POST /api/groups`

**Create group**

- **Who may:** Administrators
- **JSON body:** `name`, `description`, `memberIds`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/groups' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"name": "…", "description": "…", "memberIds": "…"}'
```

**Returns**

The same as `GET /api/groups`.

### `PUT /api/groups/{gid}`

**Change group**

- **Who may:** Administrators
- **Path parameters:** `gid` (integer)
- **JSON body:** `name`, `description`, `memberIds`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/groups/{gid}' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"name": "…", "description": "…", "memberIds": "…"}'
```

**Returns**

JSON.

### `DELETE /api/groups/{gid}`

**Delete group**

- **Who may:** Administrators
- **Path parameters:** `gid` (integer)

**Call**

```bash
curl -s -X DELETE 'http://127.0.0.1:6644/api/groups/{gid}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`deleted`


## Area: `health`

<a id="area-health"></a>

For monitoring: whether the service answers, and in detail how it stands.

### `GET /api/health`

**Read health check**

- **Who may:** No sign-in needed

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/health' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `status` | string | `"ok"` |
| `product` | string | `"mgservice"` |
| `version` | string | `"5.1.2"` |
| `release` | string | `""` |

<details><summary>Example answer</summary>

```json
{
  "status": "ok",
  "product": "mgservice",
  "version": "5.1.2",
  "release": ""
}
```

</details>

### `GET /api/health/details`

**Read details**

For monitoring: answers to an administrator, an admin API token, or a
request from the server itself (a local monitoring agent).

- **Who may:** Administrators

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/health/details' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `status` | string | `"degraded"` |
| `version` | string | `"5.1.2"` |
| `release` | string | `""` |
| `instance` | string | `""` |
| `checks` | object |  |
| `checks.database` | object |  |
| `checks.database.ok` | boolean | `true` |
| `checks.database.backend` | string | `"postgres"` |
| `checks.database.latencyMs` | number | `9.1` |
| `checks.migrations` | object |  |
| `checks.migrations.ok` | boolean | `true` |
| `checks.migrations.current` | integer | `15` |
| `checks.migrations.latest` | integer | `15` |
| `checks.backgroundJobs` | object |  |
| `checks.backgroundJobs.ok` | boolean | `false` |
| `checks.backgroundJobs.lastSign` | null | `null` |
| `checks.backgroundJobs.note` | string | `"no background process has reported yet"` |
| `checks.mail` | object |  |
| `checks.mail.ok` | boolean | `true` |
| `checks.mail.configured` | boolean | `false` |
| `checks.disk` | object |  |
| `checks.disk.ok` | boolean | `true` |
| `checks.disk.freeMb` | integer | `85247` |

<details><summary>Example answer</summary>

```json
{
  "status": "degraded",
  "version": "5.1.2",
  "release": "",
  "instance": "",
  "checks": {
    "database": {
      "ok": true,
      "backend": "postgres",
      "latencyMs": 9.1
    },
    "migrations": {
      "ok": true,
      "current": 15,
      "latest": 15
    },
    "backgroundJobs": {
      "ok": false,
      "lastSign": null,
      "note": "no background process has reported yet"
    },
    "mail": {
      "ok": true,
      "configured": false
    },
    "disk": {
      "ok": true,
      "freeMb": 85247
    }
  }
}
```

</details>


## Area: `issue-types`

<a id="area-issue-types"></a>

Issue types: Bug, Task, Story and your own, with their icons.

### `POST /api/issue-types/move`

**Move – issue type**

Change issues from one type to another, in one project or in all of them.

- **Who may:** Administrators
- **JSON body:** `fromTypeId`, `toTypeId`, `project`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/issue-types/move' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"fromTypeId": "…", "toTypeId": "…", "project": "…"}'
```

**Returns**

`moved`, `scope`, `from`, `to`

### `PUT /api/issue-types/{tid}`

**Change issue type**

Rename a type or change its colour.

- **Who may:** Administrators
- **Path parameters:** `tid` (integer)
- **JSON body:** `name`, `color`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/issue-types/{tid}' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"name": "…", "color": "…"}'
```

**Returns**

JSON.

### `DELETE /api/issue-types/{tid}`

**Delete issue type**

Remove a type nothing uses any more.

- **Who may:** Administrators
- **Path parameters:** `tid` (integer)

**Call**

```bash
curl -s -X DELETE 'http://127.0.0.1:6644/api/issue-types/{tid}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`deleted`


## Area: `issues`

<a id="area-issues"></a>

Issues (tickets): creating, reading, changing, moving through the workflow, comments, worklogs, links, attachments, watchers and history.

### `POST /api/issues`

**Create issue**

- **Who may:** Permission: `create`, `attach`
- **JSON body:** `project`, `projectId`, `summary`, `uploads`, `typeId`, `type`, `statusId`, `status`, `priorityId`, `priority`, `channel`, `customerId`, `description`, `assigneeId`, `reporterId`, `orgShared`, `requestTypeId`, `parentId`, `labels`, `components`, `dueDate`, `estimate`, `descriptionHtml`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/issues' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"project": "…", "projectId": "…", "summary": "…", "uploads": "…", "typeId": "…", "type": "…", "statusId": "…", "status": "…"}'
```

**Returns**

JSON.

### `POST /api/issues/bulk`

**Change several at once – issue**

Change many tickets at once - giving away the tickets of somebody who
has left, moving a batch to another status.

Built for thousands. The batch is read in one query; a permission is
asked once per project, and per ticket only where the project does not
grant it outright (being the assignee or the reporter can); the changes
and their history are written in one transaction. Before, every ticket
was read in full, checked from scratch and committed twice on its own -
some eight thousand commits for four thousand tickets.

- **Who may:** Anybody signed in
- **JSON body:** `keys`, `changes`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/issues/bulk' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"keys": "…", "changes": "…"}'
```

**Returns**

`updated`, `refused`

### `GET /api/issues/{key}`

**Read issue**

- **Who may:** Permission: `browse`
- **Path parameters:** `key` (string)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/issues/{key}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `id` | integer | `1` |
| `key` | string | `"ITS-1"` |
| `seq` | integer | `1` |
| `summary` | string | `"VPN drops every few minutes"` |
| `description` | string | `"Since this morning the VPN connection drops every five to t` |
| `descriptionHtml` | null | `null` |
| `project` | object |  |
| `project.id` | integer | `1` |
| `project.key` | string | `"ITS"` |
| `project.name` | string | `"IT Service Desk"` |
| `project.color` | string | `"#0052CC"` |
| `type` | object |  |
| `type.id` | integer | `1` |
| `type.name` | string | `"Incident"` |
| `type.icon` | string | `"incident"` |
| `type.color` | string | `"#E5493A"` |
| `type.subtask` | boolean | `false` |
| `status` | object |  |
| `status.id` | integer | `2` |
| `status.name` | string | `"In Progress"` |
| `status.category` | string | `"inprogress"` |
| `priority` | object |  |
| `priority.id` | integer | `1` |
| `priority.name` | string | `"Highest"` |
| `priority.icon` | string | `"up"` |
| `priority.color` | string | `"#CD1317"` |
| `assignee` | object |  |
| `assignee.id` | integer | `2` |
| `assignee.username` | string | `"tbauer"` |
| `assignee.displayName` | string | `"Tom Bauer"` |
| `assignee.avatarColor` | string | `"#00875A"` |
| `assignee.active` | boolean | `true` |
| `reporter` | null | `null` |
| `customer` | object |  |
| `customer.id` | integer | `1` |
| `customer.email` | string | `"anna.berg@example.invalid"` |
| `customer.displayName` | string | `"Anna Berg"` |
| `customer.organisation` | string | `"Northwind Trading"` |
| `customer.organisationId` | integer | `3` |
| `customer.organisationShares` | boolean | `true` |

<details><summary>Example answer</summary>

```json
{
  "id": 1,
  "key": "ITS-1",
  "seq": 1,
  "summary": "VPN drops every few minutes",
  "description": "Since this morning the VPN connection drops every five to ten minutes. Collea…",
  "descriptionHtml": null,
  "project": {
    "id": 1,
    "key": "ITS",
    "name": "IT Service Desk",
    "color": "#0052CC"
  },
  "type": {
    "id": 1,
    "name": "Incident",
    "icon": "incident",
    "color": "#E5493A",
    "subtask": false
  },
  "status": {
    "id": 2,
    "name": "In Progress",
    "category": "inprogress"
  },
  "priority": {
    "id": 1,
    "name": "Highest",
    "icon": "up",
    "color": "#CD1317"
  },
  "assignee": {
    "id": 2,
    "username": "tbauer",
    "displayName": "Tom Bauer",
    "avatarColor": "#00875A",
    "active": true
  },
  "reporter": null,
  "customer": {
    "id": 1,
    "email": "anna.berg@example.invalid",
    "displayName": "Anna Berg",
    "organisation": "Northwind Trading",
    "organisationId": 3,
    "organisationShares": true,
    "active": true,
    "phone": "",
    "hasPassword": false,
    "source": "agent",
    "created": "2026-09-22T21:28:57Z",
    "lastLogin": null,
    "requests": 3,
    "invitedAt": null,
    "deletable": false,
    "notDeletableBecause": "3 requests belong to this customer. Deactivate the customer instead - the req…"
  },
  "organisation": {
    "id": 3,
    "name": "Northwind Trading"
  },
  "orgShared": true,
  "raisedBy": {
    "type": "customer",
    "id": 1,
    "displayName": "Anna Berg",
    "email": "anna.berg@example.invalid"
  },
  "requestType": null,
  "channel": "portal",
  "firstResponse": "2026-11-21T18:40:57Z",
  "parent": null,
  "labels": [],
  "components": [],
  "rank": 2000.0,
  "dueDate": null,
  "participants": []
}
```

</details>

### `PUT /api/issues/{key}`

**Change issue**

- **Who may:** Permission: `edit`, `transition`, `assign`
- **Path parameters:** `key` (string)
- **JSON body:** `assigneeId`, `description`, `channel`, `statusId`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/issues/{key}' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"assigneeId": "…", "description": "…", "channel": "…", "statusId": "…"}'
```

**Returns**

`status`, `statusId`, `questions`

### `DELETE /api/issues/{key}`

**Delete issue**

- **Who may:** Permission: `delete`
- **Path parameters:** `key` (string)

**Call**

```bash
curl -s -X DELETE 'http://127.0.0.1:6644/api/issues/{key}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`deleted`

### `GET /api/issues/{key}/attachments`

**List attachments (issue)**

- **Who may:** Anybody signed in
- **Path parameters:** `key` (string)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/issues/{key}/attachments' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

```json
[]
```

### `POST /api/issues/{key}/attachments`

**Create attachment (issue)**

- **Who may:** Permission: `attach`
- **Path parameters:** `key` (string)
- **JSON body:** `(multipart form: file)`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/issues/{key}/attachments' \
  -H 'Authorization: Bearer $TOKEN' \
  -F 'file=@/path/to/file'
```

**Returns**

The same as `GET /api/issues/{key}/attachments`.

### `POST /api/issues/{key}/comments`

**Create comment (issue)**

A reply to the customer, or an internal note between agents.

Internal is the default: a comment reaches a customer only when somebody
chose "Reply to customer" - sending by accident cannot be taken back.

- **Who may:** Permission: `comment`
- **Path parameters:** `key` (string)
- **JSON body:** `bodyHtml`, `body`, `internal`, `public`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/issues/{key}/comments' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"bodyHtml": "…", "body": "…", "internal": "…", "public": "…"}'
```

**Returns**

JSON.

### `GET /api/issues/{key}/creation-questions`

**List questions when creating (issue)**

Rules that want to ask something about an issue just created.

A question needs somebody at a screen, so it cannot be answered while the
issue is being written. The issue exists first, then it is asked, then the
answer runs the rule - which is why a "no" simply leaves the issue as it is.

- **Who may:** Anybody signed in
- **Path parameters:** `key` (string)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/issues/{key}/creation-questions' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `questions` | array |  |

<details><summary>Example answer</summary>

```json
{
  "questions": []
}
```

</details>

### `POST /api/issues/{key}/creation-questions`

**Create question when creating (issue)**

- **Who may:** Permission: `edit`
- **Path parameters:** `key` (string)
- **JSON body:** `answers`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/issues/{key}/creation-questions' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"answers": "…"}'
```

**Returns**

`ran`

### `GET /api/issues/{key}/delete-questions`

**List questions when deleting (issue)**

What a rule wants to know before this issue goes.

Asked beforehand, unlike everything else: once the issue is deleted there is
nothing left to ask about, and an answer of "no" has to leave the children
standing.

- **Who may:** Permission: `delete`
- **Path parameters:** `key` (string)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/issues/{key}/delete-questions' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `questions` | array |  |
| `children` | array |  |

<details><summary>Example answer</summary>

```json
{
  "questions": [],
  "children": []
}
```

</details>

### `GET /api/issues/{key}/fields`

**List fields (issue)**

The custom fields this issue's form has, with whatever is in them.

- **Who may:** Permission: `browse`
- **Path parameters:** `key` (string)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/issues/{key}/fields' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `scheme` | string | `"Default screen"` |
| `fields` | array |  |

<details><summary>Example answer</summary>

```json
{
  "scheme": "Default screen",
  "fields": []
}
```

</details>

### `PUT /api/issues/{key}/fields`

**Change fields (issue)**

- **Who may:** Permission: `edit`
- **Path parameters:** `key` (string)
- **JSON body:** `values`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/issues/{key}/fields' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"values": "…"}'
```

**Returns**

`ok`

### `POST /api/issues/{key}/links`

**Create link (issue)**

- **Who may:** Anybody signed in
- **Path parameters:** `key` (string)
- **JSON body:** `target`, `type`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/issues/{key}/links' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"target": "…", "type": "…"}'
```

**Returns**

`ok`

### `GET /api/issues/{key}/mentionable`

**List people to mention (issue)**

Who can be named with @ in a comment on this request.

Two circles: the agents who may see the queue, and the customers of the
organisation the request belongs to. A request is a conversation with a
customer, so somebody on their side has to be callable by name.

- **Who may:** Permission: `browse`
- **Path parameters:** `key` (string)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/issues/{key}/mentionable' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `users` | array |  |
| `users[].id` | integer | `4` |
| `users[].username` | string | `"jnovak"` |
| `users[].displayName` | string | `"Jan Novak"` |
| `users[].avatarColor` | string | `"#5243AA"` |
| `users[].kind` | string | `"agent"` |

<details><summary>Example answer</summary>

```json
{
  "users": [
    {
      "id": 4,
      "username": "jnovak",
      "displayName": "Jan Novak",
      "avatarColor": "#5243AA",
      "kind": "agent"
    },
    {
      "id": 3,
      "username": "lfrei",
      "displayName": "Lena Frei",
      "avatarColor": "#BF2600",
      "kind": "agent"
    },
    "…"
  ]
}
```

</details>

### `PUT /api/issues/{key}/participants`

**Change participants (issue)**

Who is helping on this issue.

The whole list is given at once rather than added and removed one by one: the
field is edited as a set, and a half-applied change would be worse than none.

Anybody who may edit the issue may say who helps. Participants themselves get
no more rights than they had - they support the assignee, and the status stays
the assignee's to move.

- **Who may:** Permission: `edit`
- **Path parameters:** `key` (string)
- **JSON body:** `customerIds`, `userIds`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/issues/{key}/participants' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"customerIds": "…", "userIds": "…"}'
```

**Returns**

`participants`, `customerParticipants`

### `GET /api/issues/{key}/sla`

**List SLAs (issue)**

- **Who may:** Permission: `browse`
- **Path parameters:** `key` (string)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/issues/{key}/sla' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `sla` | array |  |
| `sla[].metric` | string | `"first_response"` |
| `sla[].label` | string | `"Time to first response"` |
| `sla[].goalMinutes` | integer | `15` |
| `sla[].elapsedMinutes` | integer | `12` |
| `sla[].remainingMinutes` | integer | `3` |
| `sla[].state` | string | `"met"` |
| `sla[].running` | boolean | `false` |
| `sla[].due` | null | `null` |
| `sla[].resumes` | null | `null` |
| `sla[].workingTime` | boolean | `false` |

<details><summary>Example answer</summary>

```json
{
  "sla": [
    {
      "metric": "first_response",
      "label": "Time to first response",
      "goalMinutes": 15,
      "elapsedMinutes": 12,
      "remainingMinutes": 3,
      "state": "met",
      "running": false,
      "due": null,
      "resumes": null,
      "workingTime": false
    },
    {
      "metric": "resolution",
      "label": "Time to resolution",
      "goalMinutes": 240,
      "elapsedMinutes": 180,
      "remainingMinutes": 59,
      "state": "at_risk",
      "running": true,
      "due": "2026-11-21T22:28:57Z",
      "resumes": null,
      "workingTime": false
    },
    "…"
  ]
}
```

</details>

### `POST /api/issues/{key}/transition`

**Move to another status – issue**

Move an issue, asking first when an automation wants an answer.

Answering happens in two steps: the first call reports the questions, the
second repeats the request with the answers and carries the move out.

- **Who may:** Permission: `transition`
- **Path parameters:** `key` (string)
- **JSON body:** `statusId`, `answers`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/issues/{key}/transition' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"statusId": "…", "answers": "…"}'
```

**Returns**

`status`, `questions`, `statusId`, `issue`

### `GET /api/issues/{key}/transitions`

**List transitions (issue)**

- **Who may:** Permission: `transition`
- **Path parameters:** `key` (string)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/issues/{key}/transitions' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `current` | object |  |
| `current.id` | integer | `2` |
| `current.name` | string | `"In Progress"` |
| `enforced` | boolean | `true` |
| `allowed` | boolean | `true` |
| `transitions` | array |  |
| `transitions[].id` | integer | `2` |
| `transitions[].name` | string | `"Ask the customer"` |
| `transitions[].toStatusId` | integer | `3` |
| `transitions[].toName` | string | `"Waiting for customer"` |
| `transitions[].toCategory` | string | `"inprogress"` |
| `transitions[].description` | string | `""` |
| `transitions[].rules` | object |  |

<details><summary>Example answer</summary>

```json
{
  "current": {
    "id": 2,
    "name": "In Progress"
  },
  "enforced": true,
  "allowed": true,
  "transitions": [
    {
      "id": 2,
      "name": "Ask the customer",
      "toStatusId": 3,
      "toName": "Waiting for customer",
      "toCategory": "inprogress",
      "description": "",
      "rules": {
        "conditions": [],
        "validators": [],
        "postFunctions": []
      }
    },
    {
      "id": 4,
      "name": "Escalate",
      "toStatusId": 4,
      "toName": "Escalated",
      "toCategory": "inprogress",
      "description": "",
      "rules": {
        "conditions": [],
        "validators": [],
        "postFunctions": []
      }
    },
    "…"
  ]
}
```

</details>

### `POST /api/issues/{key}/watch`

**Watch or stop watching – issue**

- **Who may:** Anybody signed in
- **Path parameters:** `key` (string)

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/issues/{key}/watch' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`watching`

### `POST /api/issues/{key}/worklog`

**Create worklog (issue)**

- **Who may:** Permission: `worklog`
- **Path parameters:** `key` (string)
- **JSON body:** `seconds`, `timeSpent`, `authorId`, `started`, `comment`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/issues/{key}/worklog' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"seconds": "…", "timeSpent": "…", "authorId": "…", "started": "…", "comment": "…"}'
```

**Returns**

`ok`


## Area: `kb`

<a id="area-kb"></a>

### `GET /api/kb/search`

**Read search**

The knowledge base the portal searches, for an agent sharing an article in a reply.

- **Who may:** Anybody signed in
- **Query parameters:** `q` (string, default "")

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/kb/search?q=…' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `enabled` | boolean | `false` |
| `results` | array |  |

<details><summary>Example answer</summary>

```json
{
  "enabled": false,
  "results": []
}
```

</details>


## Area: `links`

<a id="area-links"></a>

Links between issues (blocks, relates to …) or the quick links of the navigation.

### `GET /api/links`

**List links**

Readable by everybody who is signed in; only the label is what they see.

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/links' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `links` | array |  |

<details><summary>Example answer</summary>

```json
{
  "links": []
}
```

</details>

### `POST /api/links`

**Create link**

- **Who may:** Administrators
- **JSON body:** `label`, `url`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/links' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"label": "…", "url": "…"}'
```

**Returns**

`id`, `label`, `url`

### `DELETE /api/links/{lid}`

**Delete link**

- **Who may:** Administrators
- **Path parameters:** `lid` (integer)

**Call**

```bash
curl -s -X DELETE 'http://127.0.0.1:6644/api/links/{lid}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`deleted`

### `DELETE /api/links/{lid}`

**Delete link**

- **Who may:** Anybody signed in
- **Path parameters:** `lid` (integer)

**Call**

```bash
curl -s -X DELETE 'http://127.0.0.1:6644/api/links/{lid}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`deleted`


## Area: `mql`

<a id="area-mql"></a>

MQL, the query language: which fields exist, and checking a query.

### `GET /api/mql/check`

**Check – MQL query**

Validate a query and report how many issues it matches.

- **Who may:** Anybody signed in
- **Query parameters:** `mql` (string), `jql` (string)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/mql/check?mql=…&jql=…' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `ok` | boolean | `true` |
| `total` | integer | `12` |

<details><summary>Example answer</summary>

```json
{
  "ok": true,
  "total": 12
}
```

</details>

### `GET /api/mql/meta`

**Read field list**

Field names, operators and the values each field can take.

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/mql/meta' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `fields` | object |  |
| `fields.project` | string | `"a project key"` |
| `fields.type` | string | `"an issue type"` |
| `fields.status` | string | `"a status"` |
| `fields.statusCategory` | string | `"todo, inprogress or done"` |
| `fields.priority` | string | `"a priority"` |
| `fields.assignee` | string | `"a user name"` |
| `fields.reporter` | string | `"a user name"` |
| `fields.customer` | string | `"a customer's e-mail address"` |
| `fields.channel` | string | `"portal, email, chat or agent"` |
| `fields.organisation` | string | `"an organisation name"` |
| `fields.labels` | string | `"a label"` |
| `fields.summary` | string | `"free text"` |
| `fields.description` | string | `"free text"` |
| `fields.text` | string | `"free text"` |
| `fields.created` | string | `"a date"` |
| `fields.updated` | string | `"a date"` |
| `fields.resolved` | string | `"a date"` |
| `fields.duedate` | string | `"a date"` |
| `fields.resolution` | string | `"Done or empty"` |
| `fields.key` | string | `"an issue key"` |
| `fields.parent` | string | `"an issue key"` |
| `operators` | array |  |
| `keywords` | array |  |
| `values` | object |  |
| `values.project` | array |  |
| `values.type` | array |  |
| `values.issuetype` | array |  |
| `values.status` | array |  |
| `values.statuscategory` | array |  |
| `values.priority` | array |  |
| `values.assignee` | array |  |
| `values.reporter` | array |  |
| `values.channel` | array |  |
| `values.organisation` | array |  |
| `values.resolution` | array |  |
| `values.labels` | array |  |

<details><summary>Example answer</summary>

```json
{
  "fields": {
    "project": "a project key",
    "type": "an issue type",
    "status": "a status",
    "statusCategory": "todo, inprogress or done",
    "priority": "a priority",
    "assignee": "a user name",
    "reporter": "a user name",
    "customer": "a customer's e-mail address",
    "channel": "portal, email, chat or agent",
    "organisation": "an organisation name",
    "labels": "a label",
    "summary": "free text",
    "description": "free text",
    "text": "free text",
    "created": "a date",
    "updated": "a date",
    "resolved": "a date",
    "duedate": "a date",
    "resolution": "Done or empty",
    "key": "an issue key",
    "parent": "an issue key"
  },
  "operators": [
    "=",
    "!=",
    "…"
  ],
  "keywords": [
    "AND",
    "OR",
    "…"
  ],
  "values": {
    "project": [
      "ITS",
      "SUP"
    ],
    "type": [
      "Incident",
      "Help Request",
      "…"
    ],
    "issuetype": [
      "Incident",
      "Help Request",
      "…"
    ],
    "status": [
      "Waiting for support",
      "In Progress",
      "…"
    ],
    "statuscategory": [
      "todo",
      "inprogress",
      "…"
    ],
    "priority": [
      "Highest",
      "High",
      "…"
    ],
    "assignee": [
      "admin",
      "jnovak",
      "…"
    ],
    "reporter": [
      "admin",
      "jnovak",
      "…"
    ],
    "channel": [
      "portal",
      "email",
      "…"
    ],
    "organisation": [
      "Bluefield Logistics",
      "Greenleaf Studio",
      "…"
    ],
    "resolution": [
      "Done",
      "EMPTY"
    ],
    "labels": []
  }
}
```

</details>


## Area: `notification-schemes`

<a id="area-notification-schemes"></a>

Notification schemes: who is told by mail when something happens to an issue.

### `GET /api/notification-schemes`

**List notification schemes**

- **Who may:** Administrators

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/notification-schemes' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `schemes` | array |  |
| `schemes[].id` | integer | `1` |
| `schemes[].name` | string | `"Default notification scheme"` |
| `schemes[].description` | string | `"The reporter, the assignee and the watchers of an issue."` |
| `schemes[].isDefault` | boolean | `true` |
| `schemes[].rules` | array |  |
| `schemes[].projects` | array |  |
| `events` | object |  |
| `events.issue.created` | string | `"An issue is created"` |
| `events.issue.assigned` | string | `"An issue is assigned to somebody"` |
| `events.issue.transitioned` | string | `"An issue changes status"` |
| `events.issue.participants` | string | `"Somebody is added as a participant"` |
| `events.comment.added` | string | `"Somebody comments"` |
| `events.customer.commented` | string | `"The customer replies"` |
| `events.issue.mentioned` | string | `"Somebody is mentioned in a comment"` |
| `events.issue.escalated` | string | `"A customer escalates a request"` |
| `recipients` | object |  |
| `recipients.reporter` | string | `"The reporter"` |
| `recipients.assignee` | string | `"The assignee"` |
| `recipients.watchers` | string | `"The watchers"` |
| `recipients.participants` | string | `"The participants - agents always, customers only what custo` |
| `recipients.lead` | string | `"The project lead"` |
| `recipients.actor` | string | `"Whoever did it"` |
| `recipients.group` | string | `"A group"` |
| `recipients.user` | string | `"One person"` |
| `groups` | array |  |
| `groups[].id` | integer | `1` |
| `groups[].name` | string | `"helpdesk-agent"` |
| `users` | array |  |
| `users[].id` | integer | `6` |
| `users[].displayName` | string | `"Administrator"` |
| `projects` | array |  |
| `projects[].key` | string | `"ITS"` |
| `projects[].name` | string | `"IT Service Desk"` |
| `projects[].schemeId` | integer | `1` |

<details><summary>Example answer</summary>

```json
{
  "schemes": [
    {
      "id": 1,
      "name": "Default notification scheme",
      "description": "The reporter, the assignee and the watchers of an issue.",
      "isDefault": true,
      "rules": [
        {
          "event": "issue.created",
          "recipient": "reporter",
          "subjectId": null
        },
        {
          "event": "issue.created",
          "recipient": "assignee",
          "subjectId": null
        },
        "…"
      ],
      "projects": [
        "ITS",
        "SUP"
      ]
    }
  ],
  "events": {
    "issue.created": "An issue is created",
    "issue.assigned": "An issue is assigned to somebody",
    "issue.transitioned": "An issue changes status",
    "issue.participants": "Somebody is added as a participant",
    "comment.added": "Somebody comments",
    "customer.commented": "The customer replies",
    "issue.mentioned": "Somebody is mentioned in a comment",
    "issue.escalated": "A customer escalates a request"
  },
  "recipients": {
    "reporter": "The reporter",
    "assignee": "The assignee",
    "watchers": "The watchers",
    "participants": "The participants - agents always, customers only what customers may see",
    "lead": "The project lead",
    "actor": "Whoever did it",
    "group": "A group",
    "user": "One person"
  },
  "groups": [
    {
      "id": 1,
      "name": "helpdesk-agent"
    },
    {
      "id": 3,
      "name": "routine-admin"
    },
    "…"
  ],
  "users": [
    {
      "id": 6,
      "displayName": "Administrator"
    },
    {
      "id": 4,
      "displayName": "Jan Novak"
    },
    "…"
  ],
  "projects": [
    {
      "key": "ITS",
      "name": "IT Service Desk",
      "schemeId": 1
    },
    {
      "key": "SUP",
      "name": "Customer Support",
      "schemeId": 1
    }
  ]
}
```

</details>

### `POST /api/notification-schemes`

**Create notification scheme**

- **Who may:** Administrators
- **JSON body:** `name`, `description`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/notification-schemes' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"name": "…", "description": "…"}'
```

**Returns**

`id`, `name`

### `PUT /api/notification-schemes/{sid}`

**Change notification scheme**

- **Who may:** Administrators
- **Path parameters:** `sid` (integer)
- **JSON body:** `name`, `description`, `rules`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/notification-schemes/{sid}' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"name": "…", "description": "…", "rules": "…"}'
```

**Returns**

`id`

### `DELETE /api/notification-schemes/{sid}`

**Delete notification scheme**

- **Who may:** Administrators
- **Path parameters:** `sid` (integer)

**Call**

```bash
curl -s -X DELETE 'http://127.0.0.1:6644/api/notification-schemes/{sid}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`deleted`

### `POST /api/notification-schemes/{sid}/apply`

**Apply – notification scheme**

- **Who may:** Administrators
- **Path parameters:** `sid` (integer)
- **JSON body:** `projects`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/notification-schemes/{sid}/apply' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"projects": "…"}'
```

**Returns**

`scheme`, `projects`


## Area: `notifications`

<a id="area-notifications"></a>

Notices in the browser for the signed-in person.

### `GET /api/notifications/pending`

**List pending items**

What the browser has not shown yet, handed over once.

Marked as delivered as it is read: a message shown twice is worse than one
missed, and a second tab would otherwise repeat everything.

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/notifications/pending' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `notices` | array |  |

<details><summary>Example answer</summary>

```json
{
  "notices": []
}
```

</details>

### `POST /api/notifications/seen`

**Create seen marker**

Draw a line under everything waiting.

Switching the notices on means "from now on". Without this, a day's worth of
events would arrive at once the moment somebody turns them on.

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/notifications/seen' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`cleared`

### `POST /api/notifications/test`

**Test – notification**

Put one notice in this person's own queue.

The whole chain is otherwise hard to check: whoever creates an issue is left
out of its notices on purpose, so the obvious test - make a ticket and watch
- shows nothing and looks broken.

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/notifications/test' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`queued`


## Area: `organisations`

<a id="area-organisations"></a>

Organisations of customers, and which helpdesks they may use.

### `GET /api/organisations`

**List organisations**

- **Who may:** Anybody signed in
- **Query parameters:** `q` (string)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/organisations?q=…' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `organisations` | array |  |
| `organisations[].id` | integer | `1` |
| `organisations[].name` | string | `"Bluefield Logistics"` |
| `organisations[].domains` | array |  |
| `organisations[].sharing` | boolean | `true` |
| `organisations[].isDefault` | boolean | `false` |
| `organisations[].notes` | string | `""` |
| `organisations[].created` | string | `"2026-08-23T21:28:57Z"` |
| `organisations[].members` | integer | `2` |
| `organisations[].requests` | integer | `4` |
| `organisations[].projectIds` | array |  |
| `organisations[].deletable` | boolean | `false` |
| `organisations[].notDeletableBecause` | string | `"2 customers still belong to it. Move them to another organi` |
| `mayManage` | boolean | `true` |

<details><summary>Example answer</summary>

```json
{
  "organisations": [
    {
      "id": 1,
      "name": "Bluefield Logistics",
      "domains": [],
      "sharing": true,
      "isDefault": false,
      "notes": "",
      "created": "2026-08-23T21:28:57Z",
      "members": 2,
      "requests": 4,
      "projectIds": [
        1,
        2
      ],
      "deletable": false,
      "notDeletableBecause": "2 customers still belong to it. Move them to another organisation first - eve…"
    },
    {
      "id": 2,
      "name": "Greenleaf Studio",
      "domains": [],
      "sharing": true,
      "isDefault": false,
      "notes": "",
      "created": "2026-08-23T21:28:57Z",
      "members": 1,
      "requests": 2,
      "projectIds": [
        1,
        2
      ],
      "deletable": false,
      "notDeletableBecause": "1 customer still belongs to it. Move them to another organisation first - eve…"
    },
    "…"
  ],
  "mayManage": true
}
```

</details>

### `POST /api/organisations`

**Create organisation**

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/organisations' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

The same as `GET /api/organisations`.

### `GET /api/organisations/{oid}`

**Read organisation**

- **Who may:** Anybody signed in
- **Path parameters:** `oid` (integer)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/organisations/{oid}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `organisation` | object |  |
| `organisation.id` | integer | `1` |
| `organisation.name` | string | `"Bluefield Logistics"` |
| `organisation.domains` | array |  |
| `organisation.sharing` | boolean | `true` |
| `organisation.isDefault` | boolean | `false` |
| `organisation.notes` | string | `""` |
| `organisation.created` | string | `"2026-08-23T21:28:57Z"` |
| `organisation.members` | integer | `2` |
| `organisation.requests` | integer | `4` |
| `organisation.projectIds` | array |  |
| `organisation.deletable` | boolean | `false` |
| `organisation.notDeletableBecause` | string | `"2 customers still belong to it. Move them to another organi` |
| `customers` | array |  |
| `customers[].id` | integer | `3` |
| `customers[].email` | string | `"claire.dubois@example.invalid"` |
| `customers[].displayName` | string | `"Claire Dubois"` |
| `customers[].organisation` | string | `"Bluefield Logistics"` |
| `customers[].organisationId` | integer | `1` |
| `customers[].organisationShares` | boolean | `true` |
| `customers[].active` | boolean | `true` |
| `customers[].phone` | string | `""` |
| `customers[].hasPassword` | boolean | `false` |
| `customers[].source` | string | `"agent"` |
| `customers[].created` | string | `"2026-09-22T21:28:57Z"` |
| `customers[].lastLogin` | null | `null` |
| `customers[].requests` | integer | `2` |
| `customers[].invitedAt` | null | `null` |
| `customers[].deletable` | boolean | `false` |
| `customers[].notDeletableBecause` | string | `"2 requests belong to this customer. Deactivate the customer` |
| `issues` | array |  |
| `issues[].id` | integer | `10` |
| `issues[].key` | string | `"SUP-3"` |
| `issues[].seq` | integer | `3` |
| `issues[].summary` | string | `"Login page returns an error 502"` |
| `issues[].description` | string | `"Since a few minutes the login page shows 'Bad gateway'."` |
| `issues[].descriptionHtml` | null | `null` |
| `issues[].project` | object |  |
| `issues[].type` | object |  |
| `issues[].status` | object |  |

<details><summary>Example answer</summary>

```json
{
  "organisation": {
    "id": 1,
    "name": "Bluefield Logistics",
    "domains": [],
    "sharing": true,
    "isDefault": false,
    "notes": "",
    "created": "2026-08-23T21:28:57Z",
    "members": 2,
    "requests": 4,
    "projectIds": [
      1,
      2
    ],
    "deletable": false,
    "notDeletableBecause": "2 customers still belong to it. Move them to another organisation first - eve…"
  },
  "customers": [
    {
      "id": 3,
      "email": "claire.dubois@example.invalid",
      "displayName": "Claire Dubois",
      "organisation": "Bluefield Logistics",
      "organisationId": 1,
      "organisationShares": true,
      "active": true,
      "phone": "",
      "hasPassword": false,
      "source": "agent",
      "created": "2026-09-22T21:28:57Z",
      "lastLogin": null,
      "requests": 2,
      "invitedAt": null,
      "deletable": false,
      "notDeletableBecause": "2 requests belong to this customer. Deactivate the customer instead - the req…"
    },
    {
      "id": 4,
      "email": "omar.haddad@example.invalid",
      "displayName": "Omar Haddad",
      "organisation": "Bluefield Logistics",
      "organisationId": 1,
      "organisationShares": true,
      "active": true,
      "phone": "",
      "hasPassword": false,
      "source": "agent",
      "created": "2026-09-22T21:28:57Z",
      "lastLogin": null,
      "requests": 2,
      "invitedAt": null,
      "deletable": false,
      "notDeletableBecause": "2 requests belong to this customer. Deactivate the customer instead - the req…"
    }
  ],
  "issues": [
    {
      "id": 10,
      "key": "SUP-3",
      "seq": 3,
      "summary": "Login page returns an error 502",
      "description": "Since a few minutes the login page shows 'Bad gateway'.",
      "descriptionHtml": null,
      "project
…
```

</details>

### `PUT /api/organisations/{oid}`

**Change organisation**

- **Who may:** Anybody signed in
- **Path parameters:** `oid` (integer)

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/organisations/{oid}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

The same as `GET /api/organisations/{oid}`.

### `DELETE /api/organisations/{oid}`

**Delete organisation**

- **Who may:** Anybody signed in
- **Path parameters:** `oid` (integer)

**Call**

```bash
curl -s -X DELETE 'http://127.0.0.1:6644/api/organisations/{oid}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`deleted`

### `POST /api/organisations/{oid}/collect`

**Collect – organisation**

Every customer with an address in one of the organisation's domains, into it.

Without a domain nothing happens. With ``dry`` it only says who would come -
the page shows that before anything moves. Customers already in the
organisation are left out; the others come from Individual customers or from
another organisation, and the answer says how many from where.

- **Who may:** Anybody signed in
- **Path parameters:** `oid` (integer)
- **JSON body:** `dry`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/organisations/{oid}/collect' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"dry": "…"}'
```

**Returns**

`requests`

### `POST /api/organisations/{oid}/members`

**Create member (organisation)**

Existing customers into this organisation.

- **Who may:** Anybody signed in
- **Path parameters:** `oid` (integer)
- **JSON body:** `customerIds`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/organisations/{oid}/members' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"customerIds": "…"}'
```

**Returns**

`added`, `requests`

### `DELETE /api/organisations/{oid}/members/{cid}`

**Delete member (organisation)**

Take a customer out: into Individual customers, since everyone needs one.

- **Who may:** Anybody signed in
- **Path parameters:** `oid` (integer), `cid` (integer)

**Call**

```bash
curl -s -X DELETE 'http://127.0.0.1:6644/api/organisations/{oid}/members/{cid}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`removed`, `requests`


## Area: `permission-schemes`

<a id="area-permission-schemes"></a>

Permission schemes: who may do what in the projects that use them.

### `GET /api/permission-schemes`

**List permission schemes**

- **Who may:** Administrators

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/permission-schemes' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `schemes` | array |  |
| `schemes[].id` | integer | `1` |
| `schemes[].name` | string | `"Default permission scheme"` |
| `schemes[].description` | string | `"Open to everyone who is signed in - managing the project an` |
| `schemes[].isDefault` | boolean | `true` |
| `schemes[].projects` | array |  |
| `schemes[].grants` | array |  |
| `permissions` | array |  |
| `permissions[].key` | string | `"browse"` |
| `permissions[].label` | string | `"Browse the project and its issues"` |
| `projects` | array |  |
| `projects[].key` | string | `"ITS"` |
| `projects[].name` | string | `"IT Service Desk"` |
| `unassigned` | array |  |
| `unassigned[].key` | string | `"ITS"` |
| `unassigned[].name` | string | `"IT Service Desk"` |

<details><summary>Example answer</summary>

```json
{
  "schemes": [
    {
      "id": 1,
      "name": "Default permission scheme",
      "description": "Open to everyone who is signed in - managing the project and deleting are the…",
      "isDefault": true,
      "projects": [],
      "grants": [
        {
          "permission": "browse",
          "subjectType": "role",
          "subjectId": null,
          "subjectRole": "anyone"
        },
        {
          "permission": "create",
          "subjectType": "role",
          "subjectId": null,
          "subjectRole": "anyone"
        },
        "…"
      ]
    }
  ],
  "permissions": [
    {
      "key": "browse",
      "label": "Browse the project and its issues"
    },
    {
      "key": "create",
      "label": "Create issues"
    },
    "…"
  ],
  "projects": [
    {
      "key": "ITS",
      "name": "IT Service Desk"
    },
    {
      "key": "SUP",
      "name": "Customer Support"
    }
  ],
  "unassigned": [
    {
      "key": "ITS",
      "name": "IT Service Desk"
    },
    {
      "key": "SUP",
      "name": "Customer Support"
    }
  ]
}
```

</details>

### `POST /api/permission-schemes`

**Create permission scheme**

- **Who may:** Administrators
- **JSON body:** `name`, `description`, `copyOf`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/permission-schemes' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"name": "…", "description": "…", "copyOf": "…"}'
```

**Returns**

`id`, `name`

### `PUT /api/permission-schemes/{sid}`

**Change permission scheme**

- **Who may:** Administrators
- **Path parameters:** `sid` (integer)
- **JSON body:** `name`, `description`, `grants`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/permission-schemes/{sid}' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"name": "…", "description": "…", "grants": "…"}'
```

**Returns**

`id`, `name`

### `DELETE /api/permission-schemes/{sid}`

**Delete permission scheme**

- **Who may:** Administrators
- **Path parameters:** `sid` (integer)

**Call**

```bash
curl -s -X DELETE 'http://127.0.0.1:6644/api/permission-schemes/{sid}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`deleted`

### `POST /api/permission-schemes/{sid}/apply`

**Apply – permission scheme**

Attach one scheme to a number of projects at once.

- **Who may:** Administrators
- **Path parameters:** `sid` (integer)
- **JSON body:** `projects`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/permission-schemes/{sid}/apply' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"projects": "…"}'
```

**Returns**

`scheme`, `projects`


## Area: `portal`

<a id="area-portal"></a>

The customer portal: signing up and in, raising requests, answering, attachments - what a customer does.

### `GET /api/portal/attachments/{aid}`

**Read attachment**

- **Who may:** Anybody signed in
- **Path parameters:** `aid` (integer)
- **Query parameters:** `download` (string), `inline` (string)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/portal/attachments/{aid}?download=…&inline=…' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

JSON.

### `GET /api/portal/attachments/{aid}/preview`

**Preview – attachment**

An office document as PDF for the viewer in the portal - the same
conversion the team's viewer uses, behind the portal's own check.

- **Who may:** Anybody signed in
- **Path parameters:** `aid` (integer)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/portal/attachments/{aid}/preview' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

JSON.

### `POST /api/portal/attachments/{aid}/seen`

**Create seen marker (attachment)**

The customer opened what the team attached - its NEW goes. Asked with the same question as the file
itself (portal_attachment_row): nobody can mark what they may not see.

- **Who may:** Anybody signed in
- **Path parameters:** `aid` (integer)

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/portal/attachments/{aid}/seen' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`seen`

### `GET /api/portal/chat`

**List chats**

The customer's open chat, with everything after the last message seen.

- **Who may:** Anybody signed in
- **Query parameters:** `id` (string), `after` (string)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/portal/chat?id=…&after=…' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`chat`

### `POST /api/portal/chat`

**Create chat**

- **Who may:** Anybody signed in
- **JSON body:** `project`, `intake`, `message`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/portal/chat' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"project": "…", "intake": "…", "message": "…"}'
```

**Returns**

`chat`

### `GET /api/portal/chat/availability`

**Read availability**

- **Who may:** Anybody signed in
- **Query parameters:** `project` (string)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/portal/chat/availability?project=…' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`enabled`, `online`, `questions`

### `POST /api/portal/chat/{sid}/close`

**Close – chat**

- **Who may:** Anybody signed in
- **Path parameters:** `sid` (integer)

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/portal/chat/{sid}/close' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`ok`

### `GET /api/portal/chat/{sid}/files/{fid}`

**Read file (chat)**

- **Who may:** Anybody signed in
- **Path parameters:** `sid` (integer), `fid` (integer)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/portal/chat/{sid}/files/{fid}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

JSON.

### `POST /api/portal/chat/{sid}/messages`

**Create message (chat)**

- **Who may:** Anybody signed in
- **Path parameters:** `sid` (integer)
- **JSON body:** `body`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/portal/chat/{sid}/messages' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"body": "…"}'
```

**Returns**

`ok`

### `POST /api/portal/forgot`

**Ask for a new password – customer portal**

Always answers the same, so the form cannot be used to test addresses.

With sign-up closed, a link only goes to an account the team set up or one
that has a password already. Somebody whose first contact was a mail has an
entry but no portal access until the team invites them - otherwise this
form would be sign-up through the back door.

- **Who may:** No sign-in needed
- **JSON body:** `email`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/portal/forgot' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"email": "…"}'
```

**Returns**

`status`, `mail`

### `GET /api/portal/kb/search`

**Read search**

- **Who may:** Anybody signed in
- **Query parameters:** `q` (string, default "")

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/portal/kb/search?q=…' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`enabled`, `results`

### `POST /api/portal/login`

**Sign in – customer portal**

- **Who may:** No sign-in needed
- **JSON body:** `email`, `password`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/portal/login' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"email": "…", "password": "…"}'
```

**Returns**

`customer`

### `POST /api/portal/logout`

**Sign out – customer portal**

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/portal/logout' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`ok`

### `PUT /api/portal/me`

**Change own account**

- **Who may:** Anybody signed in
- **JSON body:** `name`, `newPassword`, `currentPassword`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/portal/me' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"name": "…", "newPassword": "…", "currentPassword": "…"}'
```

**Returns**

`customer`

### `POST /api/portal/password`

**Send password**

- **Who may:** Anybody signed in
- **JSON body:** `token`, `password`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/portal/password' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"token": "…", "password": "…"}'
```

**Returns**

`customer`

### `GET /api/portal/projects/{key}`

**Read project**

- **Who may:** Anybody signed in
- **Path parameters:** `key` (string)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/portal/projects/{key}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

JSON.

### `POST /api/portal/projects/{key}/requests`

**Create request (project)**

- **Who may:** Anybody signed in
- **Path parameters:** `key` (string)
- **JSON body:** `requestTypeId`, `fields`, `descriptionHtml`, `uploads`, `summary`, `description`, `attachmentCount`, `priority`, `shared`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/portal/projects/{key}/requests' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"requestTypeId": "…", "fields": "…", "descriptionHtml": "…", "uploads": "…", "summary": "…", "description": "…", "attachmentCount": "…", "priority": "…"}'
```

**Returns**

JSON.

### `GET /api/portal/requests`

**List requests**

- **Who may:** Anybody signed in
- **Query parameters:** `status` (string, default "open"), `scope` (string, default "all")

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/portal/requests?status=…&scope=…' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`requests`, `organisation`, `orgSharing`

### `GET /api/portal/requests/{key}`

**Read request**

- **Who may:** Anybody signed in
- **Path parameters:** `key` (string)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/portal/requests/{key}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

JSON.

### `POST /api/portal/requests/{key}/attachments`

**Create attachment (request)**

- **Who may:** Anybody signed in
- **Path parameters:** `key` (string)
- **JSON body:** `(multipart form: file)`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/portal/requests/{key}/attachments' \
  -H 'Authorization: Bearer $TOKEN' \
  -F 'file=@/path/to/file'
```

**Returns**

JSON.

### `POST /api/portal/requests/{key}/comments`

**Create comment (request)**

- **Who may:** Anybody signed in
- **Path parameters:** `key` (string)

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/portal/requests/{key}/comments' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

JSON.

### `POST /api/portal/requests/{key}/escalate`

**Escalate – request**

The customer escalates a request: it goes to "Escalated" and the team hears
about it at once - the assignee and the project lead by default, set under
the notification scheme's "A customer escalates a request".

What the customer writes with it lands on the request as their comment, so
the team sees why without asking.

- **Who may:** Anybody signed in
- **Path parameters:** `key` (string)
- **JSON body:** `reason`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/portal/requests/{key}/escalate' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"reason": "…"}'
```

**Returns**

JSON.

### `PUT /api/portal/requests/{key}/sharing`

**Change sharing (request)**

The one who raised a request decides whether colleagues see it.

- **Who may:** Anybody signed in
- **Path parameters:** `key` (string)
- **JSON body:** `shared`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/portal/requests/{key}/sharing' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"shared": "…"}'
```

**Returns**

JSON.

### `POST /api/portal/signup`

**Sign up – customer portal**

Create an account - always confirmed through a link to the address.

Without the confirmation anybody could sign up as somebody@their-company and,
through the organisation that address belongs to, read that company's shared
requests. So the password is chosen through a link sent to the address
itself, and the answer is the same whether the address was known or not.

- **Who may:** No sign-in needed
- **JSON body:** `email`, `name`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/portal/signup' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"email": "…", "name": "…"}'
```

**Returns**

`status`

### `GET /api/portal/state`

**Read the state – customer portal**

- **Who may:** No sign-in needed

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/portal/state' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `customer` | null | `null` |
| `portals` | array |  |
| `signup` | boolean | `true` |
| `title` | string | `"Help Center"` |
| `loginLink` | boolean | `true` |
| `signupAvailable` | boolean | `false` |
| `mail` | boolean | `false` |
| `version` | string | `"5.1.2"` |
| `knowledgeBase` | boolean | `false` |

<details><summary>Example answer</summary>

```json
{
  "customer": null,
  "portals": [],
  "signup": true,
  "title": "Help Center",
  "loginLink": true,
  "signupAvailable": false,
  "mail": false,
  "version": "5.1.2",
  "knowledgeBase": false
}
```

</details>

### `POST /api/portal/uploads`

**Create upload**

A customer's big file in pieces: begin.

- **Who may:** Anybody signed in
- **JSON body:** `filename`, `size`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/portal/uploads' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"filename": "…", "size": "…"}'
```

**Returns**

JSON.

### `GET /api/portal/uploads/{uid}`

**Read upload**

- **Who may:** Anybody signed in
- **Path parameters:** `uid` (string)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/portal/uploads/{uid}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

JSON.

### `DELETE /api/portal/uploads/{uid}`

**Delete upload**

- **Who may:** Anybody signed in
- **Path parameters:** `uid` (string)

**Call**

```bash
curl -s -X DELETE 'http://127.0.0.1:6644/api/portal/uploads/{uid}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

The same as `GET /api/portal/uploads/{uid}`.

### `PUT /api/portal/uploads/{uid}/{index}`

**Change upload**

A customer's big file in pieces: one piece, in order.

- **Who may:** Anybody signed in
- **Path parameters:** `uid` (string), `index` (integer)

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/portal/uploads/{uid}/{index}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

JSON.


## Area: `portal-helpdesks`

<a id="area-portal-helpdesks"></a>

Which helpdesks the portal offers.

### `GET /api/portal-helpdesks`

**List helpdesks of the portal**

The projects an organisation can be given: those with the portal on, the
Default Helpdesk marked.

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/portal-helpdesks' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `helpdesks` | array |  |
| `helpdesks[].id` | integer | `2` |
| `helpdesks[].key` | string | `"SUP"` |
| `helpdesks[].name` | string | `"Customer Support"` |
| `helpdesks[].isDefault` | boolean | `false` |
| `defaultId` | integer | `1` |

<details><summary>Example answer</summary>

```json
{
  "helpdesks": [
    {
      "id": 2,
      "key": "SUP",
      "name": "Customer Support",
      "isDefault": false
    },
    {
      "id": 1,
      "key": "ITS",
      "name": "IT Service Desk",
      "isDefault": true
    }
  ],
  "defaultId": 1
}
```

</details>


## Area: `projects`

<a id="area-projects"></a>

Projects: their settings, components, versions, people, permission and notification schemes, and the SLA settings of service projects.

### `GET /api/projects`

**List projects**

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/projects' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `[].workflow` | object |  |
| `[].workflow.id` | integer | `1` |
| `[].workflow.name` | string | `"Service desk workflow"` |
| `[].id` | integer | `1` |
| `[].key` | string | `"ITS"` |
| `[].name` | string | `"IT Service Desk"` |
| `[].description` | string | `"Internal IT: accounts, devices, access and outages."` |
| `[].type` | string | `"service"` |
| `[].avatarColor` | string | `"#0052CC"` |
| `[].lead` | object |  |
| `[].lead.id` | integer | `1` |
| `[].lead.username` | string | `"mkoch"` |
| `[].lead.displayName` | string | `"Marie Koch"` |
| `[].lead.email` | string | `"marie.koch@example.invalid"` |
| `[].lead.avatarColor` | string | `"#0052CC"` |
| `[].lead.isAdmin` | boolean | `true` |
| `[].lead.active` | boolean | `true` |
| `[].lead.clockPrompt` | boolean | `false` |
| `[].lead.avatarUrl` | null | `null` |
| `[].issueCount` | integer | `7` |
| `[].doneCount` | integer | `1` |
| `[].created` | string | `"2026-08-23T21:28:57Z"` |
| `[].iconUrl` | null | `null` |
| `[].may` | object |  |
| `[].may.create` | boolean | `true` |
| `[].may.edit` | boolean | `true` |
| `[].may.manage` | boolean | `true` |
| `[].may.transition` | boolean | `true` |
| `[].may.assign` | boolean | `true` |

<details><summary>Example answer</summary>

```json
[
  {
    "workflow": {
      "id": 1,
      "name": "Service desk workflow"
    },
    "id": 1,
    "key": "ITS",
    "name": "IT Service Desk",
    "description": "Internal IT: accounts, devices, access and outages.",
    "type": "service",
    "avatarColor": "#0052CC",
    "lead": {
      "id": 1,
      "username": "mkoch",
      "displayName": "Marie Koch",
      "email": "marie.koch@example.invalid",
      "avatarColor": "#0052CC",
      "isAdmin": true,
      "active": true,
      "clockPrompt": false,
      "avatarUrl": null
    },
    "issueCount": 7,
    "doneCount": 1,
    "created": "2026-08-23T21:28:57Z",
    "iconUrl": null,
    "may": {
      "create": true,
      "edit": true,
      "manage": true,
      "transition": true,
      "assign": true
    }
  },
  {
    "workflow": {
      "id": 1,
      "name": "Service desk workflow"
    },
    "id": 2,
    "key": "SUP",
    "name": "Customer Support",
    "description": "Questions and problems from the customers of our products.",
    "type": "service",
    "avatarColor": "#00875A",
    "lead": {
      "id": 3,
      "username": "lfrei",
      "displayName": "Lena Frei",
      "email": "lena.frei@example.invalid",
      "avatarColor": "#BF2600",
      "isAdmin": false,
      "active": true,
      "clockPrompt": false,
      "avatarUrl": null
    },
    "issueCount": 5,
    "doneCount": 2,
    "created": "2026-08-23T21:28:57Z",
    "iconUrl": null,
    "may": {
      "create": true,
      "edit": true,
      "manage": true,
      "transition": true,
      "assign": true
    }
  }
]
```

</details>

### `POST /api/projects`

**Create project**

- **Who may:** Anybody signed in
- **JSON body:** `key`, `name`, `description`, `leadId`, `avatarColor`, `workflowId`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/projects' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"key": "…", "name": "…", "description": "…", "leadId": "…", "avatarColor": "…", "workflowId": "…"}'
```

**Returns**

The same as `GET /api/projects`.

### `GET /api/projects/{key}`

**Read project**

- **Who may:** Anybody signed in
- **Path parameters:** `key` (string)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/projects/{key}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `workflow` | object |  |
| `workflow.id` | integer | `1` |
| `workflow.name` | string | `"Service desk workflow"` |
| `id` | integer | `1` |
| `key` | string | `"ITS"` |
| `name` | string | `"IT Service Desk"` |
| `description` | string | `"Internal IT: accounts, devices, access and outages."` |
| `type` | string | `"service"` |
| `avatarColor` | string | `"#0052CC"` |
| `lead` | object |  |
| `lead.id` | integer | `1` |
| `lead.username` | string | `"mkoch"` |
| `lead.displayName` | string | `"Marie Koch"` |
| `lead.email` | string | `"marie.koch@example.invalid"` |
| `lead.avatarColor` | string | `"#0052CC"` |
| `lead.isAdmin` | boolean | `true` |
| `lead.active` | boolean | `true` |
| `lead.clockPrompt` | boolean | `false` |
| `lead.avatarUrl` | null | `null` |
| `issueCount` | integer | `7` |
| `doneCount` | integer | `1` |
| `created` | string | `"2026-08-23T21:28:57Z"` |
| `iconUrl` | null | `null` |
| `may` | object |  |
| `may.create` | boolean | `true` |
| `may.edit` | boolean | `true` |
| `may.manage` | boolean | `true` |
| `may.transition` | boolean | `true` |
| `may.assign` | boolean | `true` |

<details><summary>Example answer</summary>

```json
{
  "workflow": {
    "id": 1,
    "name": "Service desk workflow"
  },
  "id": 1,
  "key": "ITS",
  "name": "IT Service Desk",
  "description": "Internal IT: accounts, devices, access and outages.",
  "type": "service",
  "avatarColor": "#0052CC",
  "lead": {
    "id": 1,
    "username": "mkoch",
    "displayName": "Marie Koch",
    "email": "marie.koch@example.invalid",
    "avatarColor": "#0052CC",
    "isAdmin": true,
    "active": true,
    "clockPrompt": false,
    "avatarUrl": null
  },
  "issueCount": 7,
  "doneCount": 1,
  "created": "2026-08-23T21:28:57Z",
  "iconUrl": null,
  "may": {
    "create": true,
    "edit": true,
    "manage": true,
    "transition": true,
    "assign": true
  }
}
```

</details>

### `PUT /api/projects/{key}`

**Change project**

- **Who may:** Permission: `manage`
- **Path parameters:** `key` (string)
- **JSON body:** `name`, `description`, `leadId`, `avatarColor`, `workflowId`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/projects/{key}' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"name": "…", "description": "…", "leadId": "…", "avatarColor": "…", "workflowId": "…"}'
```

**Returns**

The same as `GET /api/projects/{key}`.

### `DELETE /api/projects/{key}`

**Delete project**

- **Who may:** Administrators
- **Path parameters:** `key` (string)

**Call**

```bash
curl -s -X DELETE 'http://127.0.0.1:6644/api/projects/{key}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`deleted`

### `GET /api/projects/{key}/assignable`

**List people to assign (project)**

- **Who may:** Anybody signed in
- **Path parameters:** `key` (string)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/projects/{key}/assignable' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `restricted` | boolean | `true` |
| `users` | array |  |
| `users[].id` | integer | `4` |
| `users[].displayName` | string | `"Jan Novak"` |
| `users[].username` | string | `"jnovak"` |
| `users[].isAdmin` | boolean | `false` |
| `users[].avatarColor` | string | `"#5243AA"` |
| `users[].avatarUrl` | null | `null` |

<details><summary>Example answer</summary>

```json
{
  "restricted": true,
  "users": [
    {
      "id": 4,
      "displayName": "Jan Novak",
      "username": "jnovak",
      "isAdmin": false,
      "avatarColor": "#5243AA",
      "avatarUrl": null
    },
    {
      "id": 3,
      "displayName": "Lena Frei",
      "username": "lfrei",
      "isAdmin": false,
      "avatarColor": "#BF2600",
      "avatarUrl": null
    },
    "…"
  ]
}
```

</details>

### `GET /api/projects/{key}/create-screen`

**Read the form for creating – project**

- **Who may:** Permission: `browse`
- **Path parameters:** `key` (string)
- **Query parameters:** `typeId` (string), `type` (string)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/projects/{key}/create-screen?typeId=…&type=…' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `scheme` | string | `"Default screen"` |
| `standard` | object |  |
| `standard.summary` | boolean | `true` |
| `standard.description` | boolean | `false` |
| `standard.issuetype` | boolean | `true` |
| `standard.status` | boolean | `false` |
| `standard.priority` | boolean | `false` |
| `standard.assignee` | boolean | `false` |
| `standard.reporter` | boolean | `false` |
| `standard.customer` | boolean | `false` |
| `standard.labels` | boolean | `false` |
| `standard.components` | boolean | `false` |
| `standard.estimate` | boolean | `false` |
| `standard.dueDate` | boolean | `false` |
| `standard.attachments` | boolean | `false` |
| `custom` | array |  |

<details><summary>Example answer</summary>

```json
{
  "scheme": "Default screen",
  "standard": {
    "summary": true,
    "description": false,
    "issuetype": true,
    "status": false,
    "priority": false,
    "assignee": false,
    "reporter": false,
    "customer": false,
    "labels": false,
    "components": false,
    "estimate": false,
    "dueDate": false,
    "attachments": false
  },
  "custom": []
}
```

</details>

### `POST /api/projects/{key}/icon`

**Send icon (project)**

A picture for the project, shown wherever its key appears.

Re-encoded rather than stored as sent: that drops any metadata or payload
that came with the file, and it keeps the size sane.

- **Who may:** Permission: `manage`
- **Path parameters:** `key` (string)
- **JSON body:** `(multipart form: file)`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/projects/{key}/icon' \
  -H 'Authorization: Bearer $TOKEN' \
  -F 'file=@/path/to/file'
```

**Returns**

JSON.

### `DELETE /api/projects/{key}/icon`

**Delete icon (project)**

- **Who may:** Permission: `manage`
- **Path parameters:** `key` (string)

**Call**

```bash
curl -s -X DELETE 'http://127.0.0.1:6644/api/projects/{key}/icon' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

JSON.

### `GET /api/projects/{key}/issue-types`

**List issue types (project)**

- **Who may:** Anybody signed in
- **Path parameters:** `key` (string)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/projects/{key}/issue-types' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `types` | array |  |
| `types[].id` | integer | `1` |
| `types[].name` | string | `"Incident"` |
| `types[].icon` | string | `"incident"` |
| `types[].color` | string | `"#E5493A"` |
| `types[].subtask` | boolean | `false` |
| `types[].enabled` | boolean | `true` |
| `types[].fixed` | boolean | `false` |
| `types[].used` | integer | `3` |
| `configured` | boolean | `true` |

<details><summary>Example answer</summary>

```json
{
  "types": [
    {
      "id": 1,
      "name": "Incident",
      "icon": "incident",
      "color": "#E5493A",
      "subtask": false,
      "enabled": true,
      "fixed": false,
      "used": 3
    },
    {
      "id": 2,
      "name": "Help Request",
      "icon": "help",
      "color": "#4BADE8",
      "subtask": false,
      "enabled": true,
      "fixed": false,
      "used": 2
    },
    "…"
  ],
  "configured": true
}
```

</details>

### `PUT /api/projects/{key}/issue-types`

**Change issue types (project)**

- **Who may:** Permission: `manage`
- **Path parameters:** `key` (string)
- **JSON body:** `typeIds`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/projects/{key}/issue-types' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"typeIds": "…"}'
```

**Returns**

`typeIds`

### `POST /api/projects/{key}/issue-types/move`

**Move – issue type (project)**

Change every issue of one type in a project over to another type.

This is what frees a type so it can be taken away from the project. Two
conversions are refused rather than guessed at: between sub-task and
ordinary types, because a sub-task needs a parent and the others must not
have one.

- **Who may:** Permission: `manage`
- **Path parameters:** `key` (string)
- **JSON body:** `fromTypeId`, `toTypeId`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/projects/{key}/issue-types/move' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"fromTypeId": "…", "toTypeId": "…"}'
```

**Returns**

`moved`, `from`, `to`

### `GET /api/projects/{key}/permissions`

**List permissions (project)**

- **Who may:** Anybody signed in
- **Path parameters:** `key` (string)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/projects/{key}/permissions' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `project` | object |  |
| `project.workflow` | object |  |
| `project.workflow.id` | integer | `1` |
| `project.workflow.name` | string | `"Service desk workflow"` |
| `project.id` | integer | `1` |
| `project.key` | string | `"ITS"` |
| `project.name` | string | `"IT Service Desk"` |
| `project.description` | string | `"Internal IT: accounts, devices, access and outages."` |
| `project.type` | string | `"service"` |
| `project.avatarColor` | string | `"#0052CC"` |
| `project.lead` | object |  |
| `project.lead.id` | integer | `1` |
| `project.lead.username` | string | `"mkoch"` |
| `project.lead.displayName` | string | `"Marie Koch"` |
| `project.lead.email` | string | `"marie.koch@example.invalid"` |
| `project.lead.avatarColor` | string | `"#0052CC"` |
| `project.lead.isAdmin` | boolean | `true` |
| `project.lead.active` | boolean | `true` |
| `project.lead.clockPrompt` | boolean | `false` |
| `project.lead.avatarUrl` | null | `null` |
| `project.issueCount` | integer | `7` |
| `project.doneCount` | integer | `1` |
| `project.created` | string | `"2026-08-23T21:28:57Z"` |
| `project.iconUrl` | null | `null` |
| `project.may` | object |  |
| `project.may.create` | boolean | `true` |
| `project.may.edit` | boolean | `true` |
| `project.may.manage` | boolean | `true` |
| `project.may.transition` | boolean | `true` |
| `project.may.assign` | boolean | `true` |
| `catalogue` | object |  |
| `catalogue.browse` | string | `"Browse the project and its issues"` |
| `catalogue.create` | string | `"Create issues"` |
| `catalogue.edit` | string | `"Edit issues"` |
| `catalogue.transition` | string | `"Move issues through the workflow"` |
| `catalogue.assign` | string | `"Assign issues"` |
| `catalogue.assignable` | string | `"Be assigned issues in this project"` |
| `catalogue.delete` | string | `"Delete issues"` |
| `catalogue.comment` | string | `"Comment on issues (internal notes)"` |
| `catalogue.reply` | string | `"Reply to customers"` |

<details><summary>Example answer</summary>

```json
{
  "project": {
    "workflow": {
      "id": 1,
      "name": "Service desk workflow"
    },
    "id": 1,
    "key": "ITS",
    "name": "IT Service Desk",
    "description": "Internal IT: accounts, devices, access and outages.",
    "type": "service",
    "avatarColor": "#0052CC",
    "lead": {
      "id": 1,
      "username": "mkoch",
      "displayName": "Marie Koch",
      "email": "marie.koch@example.invalid",
      "avatarColor": "#0052CC",
      "isAdmin": true,
      "active": true,
      "clockPrompt": false,
      "avatarUrl": null
    },
    "issueCount": 7,
    "doneCount": 1,
    "created": "2026-08-23T21:28:57Z",
    "iconUrl": null,
    "may": {
      "create": true,
      "edit": true,
      "manage": true,
      "transition": true,
      "assign": true
    }
  },
  "catalogue": {
    "browse": "Browse the project and its issues",
    "create": "Create issues",
    "edit": "Edit issues",
    "transition": "Move issues through the workflow",
    "assign": "Assign issues",
    "assignable": "Be assigned issues in this project",
    "delete": "Delete issues",
    "comment": "Comment on issues (internal notes)",
    "reply": "Reply to customers",
    "worklog": "Log work",
    "attach": "Add and remove attachments",
    "manage": "Change project settings and permissions"
  },
  "roles": {
    "anyone": "Anyone signed in",
    "lead": "The project lead",
    "assignee": "The assignee of the issue",
    "reporter": "The reporter of the issue",
    "participant": "A participant on the issue",
    "admin": "Administrators"
  },
  "entries": [
    {
      "id": 1,
      "permission": "browse",
      "subjectType": "role",
      "subjectId": null,
      "subjectRole": "anyone",
      "label": "Anyone signed in"
    },
    {
      "id": 2,
      "permission": "cre
…
```

</details>

### `PUT /api/projects/{key}/permissions`

**Change permissions (project)**

- **Who may:** Permission: `manage`
- **Path parameters:** `key` (string)
- **JSON body:** `entries`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/projects/{key}/permissions' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"entries": "…"}'
```

**Returns**

The same as `GET /api/projects/{key}/permissions`.

### `GET /api/projects/{key}/portal`

**Read customer portal (project)**

- **Who may:** Anybody signed in
- **Path parameters:** `key` (string)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/projects/{key}/portal' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `enabled` | boolean | `true` |
| `title` | string | `"IT Service Desk"` |
| `intro` | string | `"Welcome! Tell us what you need and we will take care of it.` |
| `chat` | boolean | `true` |
| `inviteByMail` | boolean | `true` |
| `chatQuestions` | array |  |
| `chatQuestions[].id` | string | `"product"` |
| `chatQuestions[].label` | string | `"Which of our products is it about?"` |
| `chatQuestions[].kind` | string | `"text"` |
| `chatQuestions[].options` | array |  |
| `chatQuestionsDefault` | array |  |
| `chatQuestionsDefault[].id` | string | `"product"` |
| `chatQuestionsDefault[].label` | string | `"Which of our products is it about?"` |
| `chatQuestionsDefault[].kind` | string | `"text"` |
| `chatQuestionsDefault[].options` | array |  |
| `chatRouting` | string | `"take"` |
| `defaultHelpdesk` | boolean | `true` |
| `defaultHelpdeskName` | string | `"IT Service Desk"` |
| `requestTypes` | array |  |
| `requestTypes[].id` | integer | `1` |
| `requestTypes[].typeId` | integer | `1` |
| `requestTypes[].name` | string | `"Report a system problem"` |
| `requestTypes[].description` | string | `"Something is broken or not available."` |
| `requestTypes[].visible` | boolean | `true` |
| `requestTypes[].notice` | null | `null` |
| `portalUrl` | string | `"http://localhost/portal#/p/ITS"` |
| `general` | object |  |
| `general.signup` | boolean | `true` |
| `general.title` | string | `"Help Center"` |
| `general.loginLink` | boolean | `true` |
| `mail` | boolean | `false` |
| `mayManage` | boolean | `true` |

<details><summary>Example answer</summary>

```json
{
  "enabled": true,
  "title": "IT Service Desk",
  "intro": "Welcome! Tell us what you need and we will take care of it.",
  "chat": true,
  "inviteByMail": true,
  "chatQuestions": [
    {
      "id": "product",
      "label": "Which of our products is it about?",
      "kind": "text",
      "options": []
    },
    {
      "id": "version",
      "label": "Which version of it do you use?",
      "kind": "text",
      "options": []
    },
    "…"
  ],
  "chatQuestionsDefault": [
    {
      "id": "product",
      "label": "Which of our products is it about?",
      "kind": "text",
      "options": []
    },
    {
      "id": "version",
      "label": "Which version of it do you use?",
      "kind": "text",
      "options": []
    },
    "…"
  ],
  "chatRouting": "take",
  "defaultHelpdesk": true,
  "defaultHelpdeskName": "IT Service Desk",
  "requestTypes": [
    {
      "id": 1,
      "typeId": 1,
      "name": "Report a system problem",
      "description": "Something is broken or not available.",
      "visible": true,
      "notice": null
    },
    {
      "id": 2,
      "typeId": 2,
      "name": "Get help",
      "description": "Ask a question or request assistance.",
      "visible": true,
      "notice": null
    },
    "…"
  ],
  "portalUrl": "http://localhost/portal#/p/ITS",
  "general": {
    "signup": true,
    "title": "Help Center",
    "loginLink": true
  },
  "mail": false,
  "mayManage": true
}
```

</details>

### `PUT /api/projects/{key}/portal`

**Change customer portal (project)**

- **Who may:** Anybody signed in
- **Path parameters:** `key` (string)
- **JSON body:** `enabled`, `defaultHelpdesk`, `title`, `intro`, `chat`, `inviteByMail`, `chatQuestions`, `chatRouting`, `requestTypes`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/projects/{key}/portal' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"enabled": "…", "defaultHelpdesk": "…", "title": "…", "intro": "…", "chat": "…", "inviteByMail": "…", "chatQuestions": "…", "chatRouting": "…"}'
```

**Returns**

The same as `GET /api/projects/{key}/portal`.

### `GET /api/projects/{key}/queues`

**List queues (project)**

- **Who may:** Anybody signed in
- **Path parameters:** `key` (string)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/projects/{key}/queues' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `queues` | array |  |
| `queues[].id` | integer | `1` |
| `queues[].name` | string | `"All open"` |
| `queues[].mql` | string | `"statusCategory != done ORDER BY priority DESC, created ASC"` |
| `queues[].position` | integer | `0` |
| `queues[].count` | integer | `6` |
| `queues[].error` | null | `null` |
| `mayManage` | boolean | `true` |

<details><summary>Example answer</summary>

```json
{
  "queues": [
    {
      "id": 1,
      "name": "All open",
      "mql": "statusCategory != done ORDER BY priority DESC, created ASC",
      "position": 0,
      "count": 6,
      "error": null
    },
    {
      "id": 2,
      "name": "Assigned to me",
      "mql": "assignee = currentUser() AND statusCategory != done ORDER BY priority DESC, c…",
      "position": 1,
      "count": 0,
      "error": null
    },
    "…"
  ],
  "mayManage": true
}
```

</details>

### `POST /api/projects/{key}/queues`

**Create queue (project)**

- **Who may:** Anybody signed in
- **Path parameters:** `key` (string)
- **JSON body:** `name`, `mql`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/projects/{key}/queues' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"name": "…", "mql": "…"}'
```

**Returns**

`id`

### `POST /api/projects/{key}/queues/order`

**Send order (project)**

- **Who may:** Anybody signed in
- **Path parameters:** `key` (string)
- **JSON body:** `ids`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/projects/{key}/queues/order' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"ids": "…"}'
```

**Returns**

`ok`

### `GET /api/projects/{key}/scheme`

**Read scheme (project)**

Which permission scheme this project follows, and what it grants.

- **Who may:** Anybody signed in
- **Path parameters:** `key` (string)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/projects/{key}/scheme' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `scheme` | object |  |
| `scheme.id` | integer | `1` |
| `scheme.name` | string | `"Default permission scheme"` |
| `scheme.description` | string | `"Open to everyone who is signed in - managing the project an` |
| `scheme.isDefault` | boolean | `true` |
| `scheme.inherited` | boolean | `true` |
| `grants` | array |  |
| `grants[].permission` | string | `"browse"` |
| `grants[].subjectType` | string | `"role"` |
| `grants[].subjectId` | null | `null` |
| `grants[].subjectRole` | string | `"anyone"` |
| `permissions` | array |  |
| `permissions[].key` | string | `"browse"` |
| `permissions[].label` | string | `"Browse the project and its issues"` |
| `schemes` | array |  |
| `schemes[].id` | integer | `1` |
| `schemes[].name` | string | `"Default permission scheme"` |

<details><summary>Example answer</summary>

```json
{
  "scheme": {
    "id": 1,
    "name": "Default permission scheme",
    "description": "Open to everyone who is signed in - managing the project and deleting are the…",
    "isDefault": true,
    "inherited": true
  },
  "grants": [
    {
      "permission": "browse",
      "subjectType": "role",
      "subjectId": null,
      "subjectRole": "anyone"
    },
    {
      "permission": "create",
      "subjectType": "role",
      "subjectId": null,
      "subjectRole": "anyone"
    },
    "…"
  ],
  "permissions": [
    {
      "key": "browse",
      "label": "Browse the project and its issues"
    },
    {
      "key": "create",
      "label": "Create issues"
    },
    "…"
  ],
  "schemes": [
    {
      "id": 1,
      "name": "Default permission scheme"
    }
  ]
}
```

</details>

### `PUT /api/projects/{key}/scheme`

**Change scheme (project)**

- **Who may:** Permission: `manage`
- **Path parameters:** `key` (string)
- **JSON body:** `schemeId`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/projects/{key}/scheme' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"schemeId": "…"}'
```

**Returns**

`schemeId`

### `GET /api/projects/{key}/sla`

**List SLAs (project)**

- **Who may:** Anybody signed in
- **Path parameters:** `key` (string)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/projects/{key}/sla' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `metrics` | object |  |
| `metrics.first_response` | string | `"Time to first response"` |
| `metrics.resolution` | string | `"Time to resolution"` |
| `metrics.overall` | string | `"Overall time"` |
| `goals` | array |  |
| `goals[].id` | integer | `1` |
| `goals[].metric` | string | `"first_response"` |
| `goals[].typeId` | integer | `1` |
| `goals[].priorityId` | integer | `1` |
| `goals[].minutes` | integer | `15` |
| `pauseStatusIds` | array |  |
| `calendar` | null | `null` |
| `mayManage` | boolean | `true` |

<details><summary>Example answer</summary>

```json
{
  "metrics": {
    "first_response": "Time to first response",
    "resolution": "Time to resolution",
    "overall": "Overall time"
  },
  "goals": [
    {
      "id": 1,
      "metric": "first_response",
      "typeId": 1,
      "priorityId": 1,
      "minutes": 15
    },
    {
      "id": 2,
      "metric": "first_response",
      "typeId": 1,
      "priorityId": null,
      "minutes": 60
    },
    "…"
  ],
  "pauseStatusIds": [
    3
  ],
  "calendar": null,
  "mayManage": true
}
```

</details>

### `PUT /api/projects/{key}/sla`

**Change SLAs (project)**

Replace the goals and pause statuses in one go - the page saves as a whole.

- **Who may:** Anybody signed in
- **Path parameters:** `key` (string)
- **JSON body:** `goals`, `calendar`, `pauseStatusIds`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/projects/{key}/sla' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"goals": "…", "calendar": "…", "pauseStatusIds": "…"}'
```

**Returns**

The same as `GET /api/projects/{key}/sla`.

### `POST /api/projects/{key}/sla/recalculate`

**Recalculate – SLA (project)**

Measure every request of the project now - open and closed - with the goals, pause statuses
and working time as they stand. The queues and the ticket compute their clocks when shown; this
brings what MQL and the lists read (sla_states) up to date at once instead of within the
worker's next rounds.

- **Who may:** Anybody signed in
- **Path parameters:** `key` (string)

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/projects/{key}/sla/recalculate' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

JSON.

### `GET /api/projects/{key}/stats`

**Read statistics (project)**

- **Who may:** Anybody signed in
- **Path parameters:** `key` (string)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/projects/{key}/stats' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `project` | object |  |
| `project.workflow` | object |  |
| `project.workflow.id` | integer | `1` |
| `project.workflow.name` | string | `"Service desk workflow"` |
| `project.id` | integer | `1` |
| `project.key` | string | `"ITS"` |
| `project.name` | string | `"IT Service Desk"` |
| `project.description` | string | `"Internal IT: accounts, devices, access and outages."` |
| `project.type` | string | `"service"` |
| `project.avatarColor` | string | `"#0052CC"` |
| `project.lead` | object |  |
| `project.lead.id` | integer | `1` |
| `project.lead.username` | string | `"mkoch"` |
| `project.lead.displayName` | string | `"Marie Koch"` |
| `project.lead.email` | string | `"marie.koch@example.invalid"` |
| `project.lead.avatarColor` | string | `"#0052CC"` |
| `project.lead.isAdmin` | boolean | `true` |
| `project.lead.active` | boolean | `true` |
| `project.lead.clockPrompt` | boolean | `false` |
| `project.lead.avatarUrl` | null | `null` |
| `project.issueCount` | integer | `7` |
| `project.doneCount` | integer | `1` |
| `project.created` | string | `"2026-08-23T21:28:57Z"` |
| `project.iconUrl` | null | `null` |
| `project.may` | object |  |
| `project.may.create` | boolean | `true` |
| `project.may.edit` | boolean | `true` |
| `project.may.manage` | boolean | `true` |
| `project.may.transition` | boolean | `true` |
| `project.may.assign` | boolean | `true` |
| `byStatus` | array |  |
| `byStatus[].label` | string | `"Waiting for support"` |
| `byStatus[].value` | integer | `3` |
| `byStatus[].color` | string | `"#8993A4"` |
| `byType` | array |  |
| `byType[].label` | string | `"Incident"` |
| `byType[].value` | integer | `3` |
| `byType[].color` | string | `"#E5493A"` |
| `byPriority` | array |  |
| `byPriority[].label` | string | `"Highest"` |

<details><summary>Example answer</summary>

```json
{
  "project": {
    "workflow": {
      "id": 1,
      "name": "Service desk workflow"
    },
    "id": 1,
    "key": "ITS",
    "name": "IT Service Desk",
    "description": "Internal IT: accounts, devices, access and outages.",
    "type": "service",
    "avatarColor": "#0052CC",
    "lead": {
      "id": 1,
      "username": "mkoch",
      "displayName": "Marie Koch",
      "email": "marie.koch@example.invalid",
      "avatarColor": "#0052CC",
      "isAdmin": true,
      "active": true,
      "clockPrompt": false,
      "avatarUrl": null
    },
    "issueCount": 7,
    "doneCount": 1,
    "created": "2026-08-23T21:28:57Z",
    "iconUrl": null,
    "may": {
      "create": true,
      "edit": true,
      "manage": true,
      "transition": true,
      "assign": true
    }
  },
  "byStatus": [
    {
      "label": "Waiting for support",
      "value": 3,
      "color": "#8993A4"
    },
    {
      "label": "In Progress",
      "value": 1,
      "color": "#0052CC"
    },
    "…"
  ],
  "byType": [
    {
      "label": "Incident",
      "value": 3,
      "color": "#E5493A"
    },
    {
      "label": "Help Request",
      "value": 2,
      "color": "#4BADE8"
    },
    "…"
  ],
  "byPriority": [
    {
      "label": "Highest",
      "value": 1,
      "color": "#CD1317"
    },
    {
      "label": "High",
      "value": 2,
      "color": "#E9494A"
    },
    "…"
  ],
  "byAssignee": [
    {
      "label": "Unassigned",
      "value": 3,
      "color": "#8993A4"
    },
    {
      "label": "Marie Koch",
      "value": 1,
      "color": "#0052CC"
    },
    "…"
  ],
  "byProject": [
    {
      "label": "ITS",
      "value": 7,
      "color": "#0052CC"
    }
  ],
  "createdPerDay": [
    {
      "date": "2026-11-16",
      "count": 1
    },
    {
      "date": "2026-11-18
…
```

</details>

### `GET /api/projects/{key}/workflows`

**List workflows (project)**

- **Who may:** Anybody signed in
- **Path parameters:** `key` (string)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/projects/{key}/workflows' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `default` | integer | `1` |
| `types` | array |  |
| `types[].id` | integer | `1` |
| `types[].name` | string | `"Incident"` |
| `types[].icon` | string | `"incident"` |
| `types[].color` | string | `"#E5493A"` |
| `types[].subtask` | boolean | `false` |
| `types[].workflowId` | null | `null` |
| `workflows` | array |  |
| `workflows[].id` | integer | `1` |
| `workflows[].name` | string | `"Service desk workflow"` |

<details><summary>Example answer</summary>

```json
{
  "default": 1,
  "types": [
    {
      "id": 1,
      "name": "Incident",
      "icon": "incident",
      "color": "#E5493A",
      "subtask": false,
      "workflowId": null
    },
    {
      "id": 2,
      "name": "Help Request",
      "icon": "help",
      "color": "#4BADE8",
      "subtask": false,
      "workflowId": null
    },
    "…"
  ],
  "workflows": [
    {
      "id": 1,
      "name": "Service desk workflow"
    }
  ]
}
```

</details>

### `PUT /api/projects/{key}/workflows`

**Change workflows (project)**

- **Who may:** Permission: `manage`
- **Path parameters:** `key` (string)
- **JSON body:** `types`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/projects/{key}/workflows' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"types": "…"}'
```

**Returns**

The same as `GET /api/projects/{key}/workflows`.


## Area: `queues`

<a id="area-queues"></a>

Queues of a service project: an MQL query with a name, in an order per person.

### `PUT /api/queues/{qid}`

**Change queue**

- **Who may:** Anybody signed in
- **Path parameters:** `qid` (integer)
- **JSON body:** `name`, `mql`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/queues/{qid}' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"name": "…", "mql": "…"}'
```

**Returns**

`id`

### `DELETE /api/queues/{qid}`

**Delete queue**

- **Who may:** Anybody signed in
- **Path parameters:** `qid` (integer)

**Call**

```bash
curl -s -X DELETE 'http://127.0.0.1:6644/api/queues/{qid}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`deleted`

### `GET /api/queues/{qid}/issues`

**List issues (queue)**

- **Who may:** Permission: `browse`
- **Path parameters:** `qid` (integer)
- **Query parameters:** `limit` (int, default 200)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/queues/{qid}/issues?limit=…' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `queue` | object |  |
| `queue.id` | integer | `1` |
| `queue.name` | string | `"All open"` |
| `queue.mql` | string | `"statusCategory != done ORDER BY priority DESC, created ASC"` |
| `issues` | array |  |
| `issues[].id` | integer | `1` |
| `issues[].key` | string | `"ITS-1"` |
| `issues[].seq` | integer | `1` |
| `issues[].summary` | string | `"VPN drops every few minutes"` |
| `issues[].description` | string | `"Since this morning the VPN connection drops every five to t` |
| `issues[].descriptionHtml` | null | `null` |
| `issues[].project` | object |  |
| `issues[].type` | object |  |
| `issues[].status` | object |  |
| `issues[].priority` | object |  |
| `issues[].assignee` | object |  |
| `issues[].reporter` | null | `null` |
| `issues[].customer` | object |  |
| `issues[].organisation` | object |  |
| `issues[].orgShared` | boolean | `true` |
| `issues[].raisedBy` | object |  |
| `issues[].requestType` | null | `null` |
| `issues[].channel` | string | `"portal"` |
| `issues[].firstResponse` | string | `"2026-11-21T18:40:57Z"` |
| `issues[].parent` | null | `null` |
| `issues[].labels` | array |  |
| `issues[].components` | array |  |
| `issues[].rank` | number | `2000.0` |
| `issues[].dueDate` | null | `null` |
| `issues[].participants` | array |  |
| `issues[].startDate` | null | `null` |
| `issues[].endDate` | null | `null` |
| `issues[].estimate` | null | `null` |
| `issues[].timeLeft` | null | `null` |
| `issues[].progress` | null | `null` |
| `issues[].created` | string | `"2026-11-21T18:28:57Z"` |
| `issues[].updated` | string | `"2026-11-21T18:28:57Z"` |
| `issues[].resolved` | null | `null` |
| `issues[].commentCount` | integer | `3` |
| `issues[].subtaskCount` | integer | `0` |

<details><summary>Example answer</summary>

```json
{
  "queue": {
    "id": 1,
    "name": "All open",
    "mql": "statusCategory != done ORDER BY priority DESC, created ASC"
  },
  "issues": [
    {
      "id": 1,
      "key": "ITS-1",
      "seq": 1,
      "summary": "VPN drops every few minutes",
      "description": "Since this morning the VPN connection drops every five to ten minutes. Collea…",
      "descriptionHtml": null,
      "project": {
        "id": 1,
        "key": "ITS",
        "name": "IT Service Desk",
        "color": "#0052CC"
      },
      "type": {
        "id": 1,
        "name": "Incident",
        "icon": "incident",
        "color": "#E5493A",
        "subtask": false
      },
      "status": {
        "id": 2,
        "name": "In Progress",
        "category": "inprogress"
      },
      "priority": {
        "id": 1,
        "name": "Highest",
        "icon": "up",
        "color": "#CD1317"
      },
      "assignee": {
        "id": 2,
        "username": "tbauer",
        "displayName": "Tom Bauer",
        "avatarColor": "#00875A",
        "active": true
      },
      "reporter": null,
      "customer": {
        "id": 1,
        "email": "anna.berg@example.invalid",
        "displayName": "Anna Berg"
      },
      "organisation": {
        "id": 3,
        "name": "Northwind Trading"
      },
      "orgShared": true,
      "raisedBy": {
        "type": "customer",
        "id": 1,
        "displayName": "Anna Berg",
        "email": "anna.berg@example.invalid"
      },
      "requestType": null,
      "channel": "portal",
      "firstResponse": "2026-11-21T18:40:57Z",
      "parent": null,
      "labels": [],
      "components": [],
      "rank": 2000.0,
      "dueDate": null,
      "participants": []
    },
    {
      "id": 5,
      "key": "ITS-5",
      "seq": 5,
      "summary": 
…
```

</details>

### `PUT /api/queues/{qid}/view`

**Change view (queue)**

One person's columns and sort for one queue - nobody else's changes.

- **Who may:** Permission: `browse`
- **Path parameters:** `qid` (integer)
- **JSON body:** `reset`, `columns`, `sort`, `dir`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/queues/{qid}/view' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"reset": "…", "columns": "…", "sort": "…", "dir": "…"}'
```

**Returns**

JSON.


## Area: `reports`

<a id="area-reports"></a>

Reports: time, sprints, SLAs, customers - as JSON, and as CSV, PDF or Excel where it says so.

### `GET /api/reports/customers`

**List customers**

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/reports/customers' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `customers` | array |  |
| `customers[].id` | integer | `1` |
| `customers[].name` | string | `"Anna Berg"` |
| `customers[].email` | string | `"anna.berg@example.invalid"` |
| `customers[].organisation` | string | `"Northwind Trading"` |
| `customers[].total` | integer | `3` |
| `customers[].resolved` | integer | `0` |
| `customers[].open` | integer | `3` |
| `customers[].first` | string | `"2026-11-16T21:28:57Z"` |
| `customers[].last` | string | `"2026-11-21T18:28:57Z"` |
| `organisations` | array |  |
| `organisations[].organisation` | string | `"Northwind Trading"` |
| `organisations[].total` | integer | `6` |
| `organisations[].customers` | integer | `2` |
| `total` | integer | `12` |
| `withoutCustomer` | integer | `0` |
| `filters` | object |  |
| `filters.from` | string | `""` |
| `filters.to` | string | `""` |
| `filters.projects` | array |  |

<details><summary>Example answer</summary>

```json
{
  "customers": [
    {
      "id": 1,
      "name": "Anna Berg",
      "email": "anna.berg@example.invalid",
      "organisation": "Northwind Trading",
      "total": 3,
      "resolved": 0,
      "open": 3,
      "first": "2026-11-16T21:28:57Z",
      "last": "2026-11-21T18:28:57Z"
    },
    {
      "id": 2,
      "name": "Paul Weber",
      "email": "paul.weber@example.invalid",
      "organisation": "Northwind Trading",
      "total": 3,
      "resolved": 1,
      "open": 2,
      "first": "2026-11-05T05:28:57Z",
      "last": "2026-11-21T01:28:57Z"
    },
    "…"
  ],
  "organisations": [
    {
      "organisation": "Northwind Trading",
      "total": 6,
      "customers": 2
    },
    {
      "organisation": "Bluefield Logistics",
      "total": 4,
      "customers": 2
    },
    "…"
  ],
  "total": 12,
  "withoutCustomer": 0,
  "filters": {
    "from": "",
    "to": "",
    "projects": []
  }
}
```

</details>

### `GET /api/reports/customers.csv`

**Export customers as CSV**

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/reports/customers.csv' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

A file (text/csv).

### `GET /api/reports/sla`

**List SLAs**

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/reports/sla' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `metrics` | array |  |
| `metrics[].metric` | string | `"first_response"` |
| `metrics[].label` | string | `"Time to first response"` |
| `metrics[].met` | integer | `5` |
| `metrics[].breached` | integer | `7` |
| `metrics[].running` | integer | `0` |
| `metrics[].atRisk` | integer | `0` |
| `metrics[].paused` | integer | `0` |
| `metrics[].compliance` | number | `41.7` |
| `byProject` | array |  |
| `byProject[].project` | string | `"ITS"` |
| `byProject[].metric` | string | `"first_response"` |
| `byProject[].label` | string | `"Time to first response"` |
| `byProject[].met` | integer | `3` |
| `byProject[].breached` | integer | `4` |
| `byProject[].compliance` | number | `42.9` |
| `breaches` | array |  |
| `breaches[].key` | string | `"SUP-3"` |
| `breaches[].summary` | string | `"Login page returns an error 502"` |
| `breaches[].project` | string | `"SUP"` |
| `breaches[].metric` | string | `"Time to first response"` |
| `breaches[].goalMinutes` | integer | `15` |
| `breaches[].elapsedMinutes` | integer | `42` |
| `ticketCount` | integer | `12` |
| `capped` | boolean | `false` |
| `filters` | object |  |
| `filters.from` | string | `""` |
| `filters.to` | string | `""` |
| `filters.projects` | array |  |

<details><summary>Example answer</summary>

```json
{
  "metrics": [
    {
      "metric": "first_response",
      "label": "Time to first response",
      "met": 5,
      "breached": 7,
      "running": 0,
      "atRisk": 0,
      "paused": 0,
      "compliance": 41.7
    },
    {
      "metric": "resolution",
      "label": "Time to resolution",
      "met": 2,
      "breached": 1,
      "running": 4,
      "atRisk": 2,
      "paused": 1,
      "compliance": 66.7
    },
    "…"
  ],
  "byProject": [
    {
      "project": "ITS",
      "metric": "first_response",
      "label": "Time to first response",
      "met": 3,
      "breached": 4,
      "compliance": 42.9
    },
    {
      "project": "ITS",
      "metric": "overall",
      "label": "Overall time",
      "met": 1,
      "breached": 0,
      "compliance": 100.0
    },
    "…"
  ],
  "breaches": [
    {
      "key": "SUP-3",
      "summary": "Login page returns an error 502",
      "project": "SUP",
      "metric": "Time to first response",
      "goalMinutes": 15,
      "elapsedMinutes": 42
    },
    {
      "key": "ITS-6",
      "summary": "Password reset for the CRM",
      "project": "ITS",
      "metric": "Time to first response",
      "goalMinutes": 240,
      "elapsedMinutes": 360
    },
    "…"
  ],
  "ticketCount": 12,
  "capped": false,
  "filters": {
    "from": "",
    "to": "",
    "projects": []
  }
}
```

</details>

### `GET /api/reports/sla.csv`

**Export SLAs as CSV**

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/reports/sla.csv' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

A file (text/csv).

### `GET /api/reports/time-in-status`

**Read time in status**

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/reports/time-in-status' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `statuses` | array |  |
| `statuses[].status` | string | `"Waiting for support"` |
| `statuses[].tickets` | integer | `12` |
| `statuses[].category` | string | `"todo"` |
| `statuses[].averageHours` | number | `17.28` |
| `statuses[].totalHours` | number | `207.41` |
| `tickets` | array |  |
| `tickets[].key` | string | `"SUP-3"` |
| `tickets[].summary` | string | `"Login page returns an error 502"` |
| `tickets[].project` | string | `"SUP"` |
| `tickets[].status` | string | `"Waiting for support"` |
| `tickets[].created` | string | `"2026-11-21T20:46:57Z"` |
| `tickets[].hours` | object |  |
| `ticketCount` | integer | `12` |
| `capped` | boolean | `false` |
| `filters` | object |  |
| `filters.from` | string | `""` |
| `filters.to` | string | `""` |
| `filters.projects` | array |  |

<details><summary>Example answer</summary>

```json
{
  "statuses": [
    {
      "status": "Waiting for support",
      "tickets": 12,
      "category": "todo",
      "averageHours": 17.28,
      "totalHours": 207.41
    },
    {
      "status": "In Progress",
      "tickets": 7,
      "category": "inprogress",
      "averageHours": 10.9,
      "totalHours": 76.3
    },
    "…"
  ],
  "tickets": [
    {
      "key": "SUP-3",
      "summary": "Login page returns an error 502",
      "project": "SUP",
      "status": "Waiting for support",
      "created": "2026-11-21T20:46:57Z",
      "hours": {
        "Waiting for support": 0.7
      }
    },
    {
      "key": "ITS-1",
      "summary": "VPN drops every few minutes",
      "project": "ITS",
      "status": "In Progress",
      "created": "2026-11-21T18:28:57Z",
      "hours": {
        "Waiting for support": 0.2,
        "In Progress": 2.8
      }
    },
    "…"
  ],
  "ticketCount": 12,
  "capped": false,
  "filters": {
    "from": "",
    "to": "",
    "projects": []
  }
}
```

</details>

### `GET /api/reports/time-in-status.csv`

**Export time in status as CSV**

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/reports/time-in-status.csv' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

A file (text/csv).

### `GET /api/reports/worklog`

**List worklogs**

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/reports/worklog' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `issues` | array |  |
| `issues[].key` | string | `"ITS-1"` |
| `issues[].summary` | string | `"VPN drops every few minutes"` |
| `issues[].type` | string | `"Incident"` |
| `issues[].status` | string | `"In Progress"` |
| `issues[].project` | string | `"ITS"` |
| `issues[].projectName` | string | `"IT Service Desk"` |
| `issues[].estimate` | null | `null` |
| `issues[].seconds` | integer | `3600` |
| `issues[].entries` | array |  |
| `total` | integer | `9000` |
| `entryCount` | integer | `3` |
| `byUser` | array |  |
| `byUser[].author` | string | `"Tom Bauer"` |
| `byUser[].seconds` | integer | `9000` |
| `filters` | object |  |
| `filters.from` | string | `""` |
| `filters.to` | string | `""` |
| `filters.users` | array |  |
| `filters.projects` | array |  |

<details><summary>Example answer</summary>

```json
{
  "issues": [
    {
      "key": "ITS-1",
      "summary": "VPN drops every few minutes",
      "type": "Incident",
      "status": "In Progress",
      "project": "ITS",
      "projectName": "IT Service Desk",
      "estimate": null,
      "seconds": 3600,
      "entries": [
        {
          "id": 1,
          "seconds": 3600,
          "comment": "Analysis",
          "started": "2026-11-21T19:28:57Z",
          "author": "Tom Bauer"
        }
      ]
    },
    {
      "key": "ITS-4",
      "summary": "Printer on the second floor shows paper jam",
      "type": "Incident",
      "status": "Resolved",
      "project": "ITS",
      "projectName": "IT Service Desk",
      "estimate": null,
      "seconds": 1800,
      "entries": [
        {
          "id": 2,
          "seconds": 1800,
          "comment": "Analysis",
          "started": "2026-11-21T19:28:57Z",
          "author": "Tom Bauer"
        }
      ]
    },
    "…"
  ],
  "total": 9000,
  "entryCount": 3,
  "byUser": [
    {
      "author": "Tom Bauer",
      "seconds": 9000
    }
  ],
  "filters": {
    "from": "",
    "to": "",
    "users": [],
    "projects": []
  }
}
```

</details>

### `GET /api/reports/worklog.csv`

**Export worklogs as CSV**

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/reports/worklog.csv' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

A file (text/csv).

### `GET /api/reports/worklog.pdf`

**Export worklogs as PDF**

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/reports/worklog.pdf' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

A file (application/pdf).


## Area: `request-types`

<a id="area-request-types"></a>

Request types of the portal.

### `GET /api/request-types/{rtid}/form`

**Read form (request type)**

- **Who may:** Permission: `browse`
- **Path parameters:** `rtid` (integer)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/request-types/{rtid}/form' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `requestType` | object |  |
| `requestType.id` | integer | `1` |
| `requestType.name` | string | `"Report a system problem"` |
| `fields` | array |  |
| `fields[].key` | string | `"summary"` |
| `fields[].builtin` | boolean | `true` |
| `fields[].name` | string | `"Summary"` |
| `fields[].kind` | string | `"text"` |
| `fields[].label` | string | `"Summary"` |
| `fields[].help` | string | `"In a few words"` |
| `fields[].required` | boolean | `true` |
| `available` | array |  |
| `available[].key` | string | `"description"` |
| `available[].name` | string | `"Description"` |
| `available[].builtin` | boolean | `true` |
| `available[].kind` | string | `"textarea"` |
| `kinds` | object |  |
| `kinds.text` | string | `"One line of text"` |
| `kinds.textarea` | string | `"Several lines of text"` |
| `kinds.number` | string | `"A number"` |
| `kinds.date` | string | `"A date"` |
| `kinds.select` | string | `"One of a list"` |
| `kinds.multiselect` | string | `"Several from a list"` |
| `kinds.checkbox` | string | `"Yes or no"` |
| `kinds.url` | string | `"A link"` |
| `mayManage` | boolean | `true` |
| `mayCreateFields` | boolean | `true` |

<details><summary>Example answer</summary>

```json
{
  "requestType": {
    "id": 1,
    "name": "Report a system problem"
  },
  "fields": [
    {
      "key": "summary",
      "builtin": true,
      "name": "Summary",
      "kind": "text",
      "label": "Summary",
      "help": "In a few words",
      "required": true
    },
    {
      "key": "description",
      "builtin": true,
      "name": "Description",
      "kind": "textarea",
      "label": "Description",
      "help": "What happened, since when, and what you tried",
      "required": false
    },
    "…"
  ],
  "available": [
    {
      "key": "description",
      "name": "Description",
      "builtin": true,
      "kind": "textarea"
    },
    {
      "key": "attachments",
      "name": "Attachments",
      "builtin": true,
      "kind": "files"
    },
    "…"
  ],
  "kinds": {
    "text": "One line of text",
    "textarea": "Several lines of text",
    "number": "A number",
    "date": "A date",
    "select": "One of a list",
    "multiselect": "Several from a list",
    "checkbox": "Yes or no",
    "url": "A link"
  },
  "mayManage": true,
  "mayCreateFields": true
}
```

</details>

### `PUT /api/request-types/{rtid}/form`

**Change form (request type)**

- **Who may:** Permission: `manage`
- **Path parameters:** `rtid` (integer)
- **JSON body:** `fields`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/request-types/{rtid}/form' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"fields": "…"}'
```

**Returns**

The same as `GET /api/request-types/{rtid}/form`.

### `PUT /api/request-types/{rtid}/notice`

**Change notice (request type)**

The notice over this request type's form in the portal: formatted text, the box it stands in.

- **Who may:** Permission: `manage`
- **Path parameters:** `rtid` (integer)
- **JSON body:** `html`, `style`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/request-types/{rtid}/notice' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"html": "…", "style": "…"}'
```

**Returns**

`notice`


## Area: `routines`

<a id="area-routines"></a>

Routines: issues created on a schedule.

### `GET /api/routines`

**List routines**

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/routines' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `routines` | array |  |
| `mayWrite` | boolean | `true` |
| `types` | array |  |
| `types[].id` | integer | `1` |
| `types[].name` | string | `"Incident"` |
| `types[].subtask` | boolean | `false` |
| `projects` | array |  |
| `projects[].key` | string | `"ITS"` |
| `projects[].name` | string | `"IT Service Desk"` |

<details><summary>Example answer</summary>

```json
{
  "routines": [],
  "mayWrite": true,
  "types": [
    {
      "id": 1,
      "name": "Incident",
      "subtask": false
    },
    {
      "id": 2,
      "name": "Help Request",
      "subtask": false
    },
    "…"
  ],
  "projects": [
    {
      "key": "ITS",
      "name": "IT Service Desk"
    },
    {
      "key": "SUP",
      "name": "Customer Support"
    }
  ]
}
```

</details>

### `POST /api/routines`

**Create routine**

- **Who may:** Anybody signed in
- **JSON body:** `name`, `description`, `projectKey`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/routines' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"name": "…", "description": "…", "projectKey": "…"}'
```

**Returns**

The same as `GET /api/routines`.

### `PUT /api/routines/{rid}`

**Change routine**

- **Who may:** Anybody signed in
- **Path parameters:** `rid` (integer)
- **JSON body:** `name`, `description`, `projectKey`, `steps`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/routines/{rid}' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"name": "…", "description": "…", "projectKey": "…", "steps": "…"}'
```

**Returns**

JSON.

### `DELETE /api/routines/{rid}`

**Delete routine**

- **Who may:** Anybody signed in
- **Path parameters:** `rid` (integer)

**Call**

```bash
curl -s -X DELETE 'http://127.0.0.1:6644/api/routines/{rid}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`deleted`

### `GET /api/routines/{rid}/questions`

**List questions (routine)**

What has to be answered before this routine can run.

- **Who may:** Anybody signed in
- **Path parameters:** `rid` (integer)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/routines/{rid}/questions' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`routine`, `questions`

### `POST /api/routines/{rid}/run`

**Run – routine**

Create what the routine describes, in one go.

Every ticket marked "link to the first" is linked to the first ticket of the
run - the usual shape: one request and the pieces of work it needs, such as
a new starter with laptop, accounts and access as tickets of their own.

- **Who may:** Permission: `create`
- **Path parameters:** `rid` (integer)
- **JSON body:** `answers`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/routines/{rid}/run' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"answers": "…"}'
```

**Returns**

`created`, `project`


## Area: `screen-schemes`

<a id="area-screen-schemes"></a>

Screen schemes: which fields a form shows, per issue type and operation.

### `GET /api/screen-schemes`

**List screen schemes**

- **Who may:** Administrators

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/screen-schemes' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `schemes` | array |  |
| `schemes[].id` | integer | `1` |
| `schemes[].name` | string | `"Default screen"` |
| `schemes[].description` | string | `"The standard form. Cannot be changed, and is what a project` |
| `schemes[].isDefault` | boolean | `true` |
| `schemes[].created` | string | `"2026-11-21T21:28:57Z"` |
| `schemes[].fields` | array |  |
| `standard` | array |  |
| `standard[].key` | string | `"summary"` |
| `standard[].name` | string | `"Summary"` |
| `custom` | array |  |
| `unremovable` | array |  |
| `assignments` | array |  |
| `projects` | array |  |
| `projects[].key` | string | `"ITS"` |
| `projects[].name` | string | `"IT Service Desk"` |
| `types` | array |  |
| `types[].id` | integer | `1` |
| `types[].name` | string | `"Incident"` |

<details><summary>Example answer</summary>

```json
{
  "schemes": [
    {
      "id": 1,
      "name": "Default screen",
      "description": "The standard form. Cannot be changed, and is what a project uses unless somet…",
      "isDefault": true,
      "created": "2026-11-21T21:28:57Z",
      "fields": [
        {
          "key": "summary",
          "position": 0,
          "required": true
        },
        {
          "key": "description",
          "position": 1,
          "required": false
        },
        "…"
      ]
    }
  ],
  "standard": [
    {
      "key": "summary",
      "name": "Summary"
    },
    {
      "key": "description",
      "name": "Description"
    },
    "…"
  ],
  "custom": [],
  "unremovable": [
    "issuetype",
    "summary"
  ],
  "assignments": [],
  "projects": [
    {
      "key": "ITS",
      "name": "IT Service Desk"
    },
    {
      "key": "SUP",
      "name": "Customer Support"
    }
  ],
  "types": [
    {
      "id": 1,
      "name": "Incident"
    },
    {
      "id": 2,
      "name": "Help Request"
    },
    "…"
  ]
}
```

</details>

### `POST /api/screen-schemes`

**Create screen scheme**

- **Who may:** Administrators
- **JSON body:** `name`, `description`, `copyFrom`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/screen-schemes' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"name": "…", "description": "…", "copyFrom": "…"}'
```

**Returns**

The same as `GET /api/screen-schemes`.

### `PUT /api/screen-schemes/{sid}`

**Change screen scheme**

- **Who may:** Administrators
- **Path parameters:** `sid` (integer)
- **JSON body:** `name`, `description`, `fields`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/screen-schemes/{sid}' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"name": "…", "description": "…", "fields": "…"}'
```

**Returns**

JSON.

### `DELETE /api/screen-schemes/{sid}`

**Delete screen scheme**

- **Who may:** Administrators
- **Path parameters:** `sid` (integer)

**Call**

```bash
curl -s -X DELETE 'http://127.0.0.1:6644/api/screen-schemes/{sid}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`deleted`

### `POST /api/screen-schemes/{sid}/assign`

**Assign – screen scheme**

Hang a scheme on a project, for one issue type or for all of them.

- **Who may:** Administrators
- **Path parameters:** `sid` (integer)
- **JSON body:** `project`, `typeId`, `remove`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/screen-schemes/{sid}/assign' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"project": "…", "typeId": "…", "remove": "…"}'
```

**Returns**

`project`, `typeId`, `scheme`


## Area: `search`

<a id="area-search"></a>

Searching issues with MQL, and exporting the result.

### `GET /api/search`

**Read search**

- **Who may:** Anybody signed in
- **Query parameters:** `mql` (string), `jql` (string), `limit` (int, default 200), `offset` (int, default 0)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/search?mql=…&jql=…&limit=…' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `total` | integer | `12` |
| `issues` | array |  |
| `issues[].id` | integer | `1` |
| `issues[].key` | string | `"ITS-1"` |
| `issues[].seq` | integer | `1` |
| `issues[].summary` | string | `"VPN drops every few minutes"` |
| `issues[].description` | string | `"Since this morning the VPN connection drops every five to t` |
| `issues[].descriptionHtml` | null | `null` |
| `issues[].project` | object |  |
| `issues[].type` | object |  |
| `issues[].status` | object |  |
| `issues[].priority` | object |  |
| `issues[].assignee` | object |  |
| `issues[].reporter` | null | `null` |
| `issues[].customer` | object |  |
| `issues[].organisation` | object |  |
| `issues[].orgShared` | boolean | `true` |
| `issues[].raisedBy` | object |  |
| `issues[].requestType` | null | `null` |
| `issues[].channel` | string | `"portal"` |
| `issues[].firstResponse` | string | `"2026-11-21T18:40:57Z"` |
| `issues[].parent` | null | `null` |
| `issues[].labels` | array |  |
| `issues[].components` | array |  |
| `issues[].rank` | number | `2000.0` |
| `issues[].dueDate` | null | `null` |
| `issues[].participants` | array |  |
| `issues[].startDate` | null | `null` |
| `issues[].endDate` | null | `null` |
| `issues[].estimate` | null | `null` |
| `issues[].timeLeft` | null | `null` |
| `issues[].progress` | null | `null` |
| `issues[].created` | string | `"2026-11-21T18:28:57Z"` |
| `issues[].updated` | string | `"2026-11-21T18:28:57Z"` |
| `issues[].resolved` | null | `null` |
| `issues[].commentCount` | integer | `3` |
| `issues[].subtaskCount` | integer | `0` |
| `issues[].timeSpent` | integer | `3600` |
| `mql` | string | `""` |

<details><summary>Example answer</summary>

```json
{
  "total": 12,
  "issues": [
    {
      "id": 1,
      "key": "ITS-1",
      "seq": 1,
      "summary": "VPN drops every few minutes",
      "description": "Since this morning the VPN connection drops every five to ten minutes. Collea…",
      "descriptionHtml": null,
      "project": {
        "id": 1,
        "key": "ITS",
        "name": "IT Service Desk",
        "color": "#0052CC"
      },
      "type": {
        "id": 1,
        "name": "Incident",
        "icon": "incident",
        "color": "#E5493A",
        "subtask": false
      },
      "status": {
        "id": 2,
        "name": "In Progress",
        "category": "inprogress"
      },
      "priority": {
        "id": 1,
        "name": "Highest",
        "icon": "up",
        "color": "#CD1317"
      },
      "assignee": {
        "id": 2,
        "username": "tbauer",
        "displayName": "Tom Bauer",
        "avatarColor": "#00875A",
        "active": true
      },
      "reporter": null,
      "customer": {
        "id": 1,
        "email": "anna.berg@example.invalid",
        "displayName": "Anna Berg"
      },
      "organisation": {
        "id": 3,
        "name": "Northwind Trading"
      },
      "orgShared": true,
      "raisedBy": {
        "type": "customer",
        "id": 1,
        "displayName": "Anna Berg",
        "email": "anna.berg@example.invalid"
      },
      "requestType": null,
      "channel": "portal",
      "firstResponse": "2026-11-21T18:40:57Z",
      "parent": null,
      "labels": [],
      "components": [],
      "rank": 2000.0,
      "dueDate": null,
      "participants": []
    },
    {
      "id": 2,
      "key": "ITS-2",
      "seq": 2,
      "summary": "New starter needs a laptop and accounts",
      "description": "Our new colleague Mia starts on Monday and need
…
```

</details>

### `GET /api/search/export.{fmt}`

**Export export.<fmt> as a file**

A query's tickets as a file - PDF, Excel or CSV - run with the rights of the person
asking, as the list in the box is: only what they may see.

- **Who may:** Anybody signed in
- **Path parameters:** `fmt` (string)
- **Query parameters:** `mql` (string)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/search/export.{fmt}?mql=…' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

JSON.


## Area: `sla`

<a id="area-sla"></a>

SLA working-time calendars: the countries and regions to choose from, and their holidays.

### `GET /api/sla/calendars`

**List calendars**

What a working-time calendar can be made of: countries with their regions and weekend,
and the time zones.

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/sla/calendars' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `countries` | array |  |
| `countries[].code` | string | `"AF"` |
| `countries[].name` | string | `"Afghanistan"` |
| `countries[].regions` | array |  |
| `countries[].weekend` | array |  |
| `timezones` | array |  |

<details><summary>Example answer</summary>

```json
{
  "countries": [
    {
      "code": "AF",
      "name": "Afghanistan",
      "regions": [],
      "weekend": [
        4,
        5
      ]
    },
    {
      "code": "AX",
      "name": "Aland Islands",
      "regions": [],
      "weekend": [
        5,
        6
      ]
    },
    "…"
  ],
  "timezones": [
    "Africa/Abidjan",
    "Africa/Accra",
    "…"
  ]
}
```

</details>

### `GET /api/sla/holidays`

**List holidays**

One year's public holidays of a country (and region) - what the clocks will skip.

- **Who may:** Anybody signed in
- **Query parameters:** `country` (string), `region` (string), `year` (int)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/sla/holidays?country=…&region=…&year=…' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`holidays`


## Area: `statuses`

<a id="area-statuses"></a>

Statuses and their categories (to do, in progress, done).

### `POST /api/statuses`

**Create status**

- **Who may:** Administrators
- **JSON body:** `name`, `category`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/statuses' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"name": "…", "category": "…"}'
```

**Returns**

JSON.

### `PUT /api/statuses/{sid}`

**Change status**

Rename a status or move it to another category.

The category is what queues, SLAs and the dashboards read, so
a wrong one is worth correcting rather than working around. Changing it
changes the meaning of every issue in that status at once - the answer says
how many that is.

- **Who may:** Administrators
- **Path parameters:** `sid` (integer)
- **JSON body:** `name`, `category`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/statuses/{sid}' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"name": "…", "category": "…"}'
```

**Returns**

`affected`, `categoryChanged`

### `DELETE /api/statuses/{sid}`

**Delete status**

Remove a status nothing points at any more.

- **Who may:** Administrators
- **Path parameters:** `sid` (integer)

**Call**

```bash
curl -s -X DELETE 'http://127.0.0.1:6644/api/statuses/{sid}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`deleted`


## Area: `system/accent`

<a id="area-system-accent"></a>

System settings, for administrators: licence, mail, database, logo, announcements, the AI, identity providers and more.

### `GET /api/system/accent`

**Read accent colour**

- **Who may:** No sign-in needed

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/system/accent' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `color` | string | `"#50226B"` |
| `auto` | boolean | `true` |
| `isDefault` | boolean | `true` |
| `palette` | object |  |
| `palette.accent` | string | `"#50226B"` |
| `palette.hover` | string | `"#68407F"` |
| `palette.deep` | string | `"#39184D"` |
| `palette.soft` | string | `"#EDE8F0"` |
| `palette.darkAccent` | string | `"#9E85AD"` |
| `palette.darkHover` | string | `"#B9A6C3"` |
| `palette.darkSoft` | string | `"#240F30"` |

<details><summary>Example answer</summary>

```json
{
  "color": "#50226B",
  "auto": true,
  "isDefault": true,
  "palette": {
    "accent": "#50226B",
    "hover": "#68407F",
    "deep": "#39184D",
    "soft": "#EDE8F0",
    "darkAccent": "#9E85AD",
    "darkHover": "#B9A6C3",
    "darkSoft": "#240F30"
  }
}
```

</details>

### `PUT /api/system/accent`

**Change accent colour**

- **Who may:** Administrators
- **JSON body:** `auto`, `color`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/system/accent' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"auto": "…", "color": "…"}'
```

**Returns**

`palette`


## Area: `system/ai`

<a id="area-system-ai"></a>

System settings, for administrators: licence, mail, database, logo, announcements, the AI, identity providers and more.

### `GET /api/system/ai`

**Read AI assistant**

- **Who may:** Administrators

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/system/ai' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `kind` | string | `"ollama"` |
| `baseUrl` | string | `""` |
| `defaultUrl` | string | `"http://127.0.0.1:11434"` |
| `chatModel` | string | `""` |
| `embedModel` | string | `""` |
| `toolModel` | string | `""` |
| `mode` | string | `"guided"` |
| `basicUser` | string | `""` |
| `context` | integer | `16384` |
| `hasKey` | boolean | `false` |
| `hasBasicPassword` | boolean | `false` |
| `enabled` | boolean | `false` |
| `ready` | boolean | `false` |
| `leaves` | boolean | `true` |
| `destination` | string | `""` |
| `consent` | null | `null` |
| `index` | object |  |
| `index.documents` | integer | `0` |
| `index.withVectors` | integer | `0` |
| `index.waiting` | integer | `12` |
| `index.lastRound` | null | `null` |
| `index.lastError` | null | `null` |

<details><summary>Example answer</summary>

```json
{
  "kind": "ollama",
  "baseUrl": "",
  "defaultUrl": "http://127.0.0.1:11434",
  "chatModel": "",
  "embedModel": "",
  "toolModel": "",
  "mode": "guided",
  "basicUser": "",
  "context": 16384,
  "hasKey": false,
  "hasBasicPassword": false,
  "enabled": false,
  "ready": false,
  "leaves": true,
  "destination": "",
  "consent": null,
  "index": {
    "documents": 0,
    "withVectors": 0,
    "waiting": 12,
    "lastRound": null,
    "lastError": null
  }
}
```

</details>

### `PUT /api/system/ai`

**Change AI assistant**

Saved as given. Switching on with an address that leaves this server needs
the administrator's confirmation of exactly that address.

- **Who may:** Administrators
- **JSON body:** `kind`, `baseUrl`, `chatModel`, `embedModel`, `toolModel`, `mode`, `basicUser`, `context`, `apiKey`, `clearApiKey`, `basicPassword`, `confirmLeaves`, `confirmHost`, `enabled`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/system/ai' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"kind": "…", "baseUrl": "…", "chatModel": "…", "embedModel": "…", "toolModel": "…", "mode": "…", "basicUser": "…", "context": "…"}'
```

**Returns**

The same as `GET /api/system/ai`.

### `GET /api/system/ai/cases`

**List test cases**

- **Who may:** Administrators

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/system/ai/cases' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `cases` | array |  |

<details><summary>Example answer</summary>

```json
{
  "cases": []
}
```

</details>

### `POST /api/system/ai/cases`

**Create test case**

A question and what a right answer holds: the tickets of an MQL query (all of
them, the first, or their number), or tickets that must be among the sources.

- **Who may:** Administrators
- **JSON body:** `question`, `expect`, `expected`, `example`, `note`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/system/ai/cases' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"question": "…", "expect": "…", "expected": "…", "example": "…", "note": "…"}'
```

**Returns**

The same as `GET /api/system/ai/cases`.

### `POST /api/system/ai/cases/standard`

**Create standard question**

The standard questions - the ones that went wrong once - into the catalogue: the
measure every change to the assistant is held against. A question already there is
left as it is.

- **Who may:** Administrators

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/system/ai/cases/standard' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`added`

### `DELETE /api/system/ai/cases/{cid}`

**Delete test case**

- **Who may:** Administrators
- **Path parameters:** `cid` (integer)

**Call**

```bash
curl -s -X DELETE 'http://127.0.0.1:6644/api/system/ai/cases/{cid}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`ok`

### `GET /api/system/ai/glossary`

**List glossary**

- **Who may:** Administrators

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/system/ai/glossary' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `terms` | array |  |
| `terms[].id` | integer | `2` |
| `terms[].term` | string | `"SLA gerissen"` |
| `terms[].meaning` | string | `"the same as an SLA breached: sla = breached"` |

<details><summary>Example answer</summary>

```json
{
  "terms": [
    {
      "id": 2,
      "term": "SLA gerissen",
      "meaning": "the same as an SLA breached: sla = breached"
    },
    {
      "id": 1,
      "term": "überfällig",
      "meaning": "past its due date: duedate < now() AND statusCategory != done. Tickets here r…"
    }
  ]
}
```

</details>

### `POST /api/system/ai/glossary`

**Create glossary term**

A word of this team and what it means here - "überfällig", "Greenleaf", "der Orbit-Sprint".

- **Who may:** Administrators
- **JSON body:** `term`, `meaning`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/system/ai/glossary' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"term": "…", "meaning": "…"}'
```

**Returns**

`ok`

### `DELETE /api/system/ai/glossary/{gid}`

**Delete glossary term**

- **Who may:** Administrators
- **Path parameters:** `gid` (integer)

**Call**

```bash
curl -s -X DELETE 'http://127.0.0.1:6644/api/system/ai/glossary/{gid}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`ok`

### `GET /api/system/ai/log`

**List log**

The last questions, for the administrator: way, steps, query, outcome, time, thumbs.

- **Who may:** Administrators
- **Query parameters:** `limit` (int, default 50)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/system/ai/log?limit=…' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `entries` | array |  |
| `days` | integer | `30` |

<details><summary>Example answer</summary>

```json
{
  "entries": [],
  "days": 30
}
```

</details>

### `POST /api/system/ai/reindex`

**Rebuild the index – AI assistant**

Everything again - after a change of model, or to be sure.

- **Who may:** Administrators

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/system/ai/reindex' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

JSON.

### `GET /api/system/ai/runs`

**List runs**

- **Who may:** Administrators

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/system/ai/runs' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `runs` | array |  |

<details><summary>Example answer</summary>

```json
{
  "runs": []
}
```

</details>

### `POST /api/system/ai/runs`

**Create run**

The whole catalogue against the model in use - in the background; the page asks
for progress. mode: the way to test, guided or agent, so the two can be compared.

- **Who may:** Administrators
- **JSON body:** `mode`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/system/ai/runs' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"mode": "…"}'
```

**Returns**

`id`

### `POST /api/system/ai/test`

**Test – AI assistant**

Reaches the server, lists its models, and has the chosen one say a word.

- **Who may:** Administrators
- **JSON body:** `kind`, `baseUrl`, `chatModel`, `embedModel`, `basicUser`, `apiKey`, `basicPassword`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/system/ai/test' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"kind": "…", "baseUrl": "…", "chatModel": "…", "embedModel": "…", "basicUser": "…", "apiKey": "…", "basicPassword": "…"}'
```

**Returns**

JSON.


## Area: `system/announcement`

<a id="area-system-announcement"></a>

System settings, for administrators: licence, mail, database, logo, announcements, the AI, identity providers and more.

### `GET /api/system/announcement`

**Read announcement**

Readable by anybody signed in - everybody is meant to see it.

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/system/announcement' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `message` | string | `""` |
| `active` | boolean | `false` |
| `updatedBy` | null | `null` |
| `updated` | string | `"2026-11-21T21:29:04Z"` |

<details><summary>Example answer</summary>

```json
{
  "message": "",
  "active": false,
  "updatedBy": null,
  "updated": "2026-11-21T21:29:04Z"
}
```

</details>

### `PUT /api/system/announcement`

**Change announcement**

- **Who may:** Administrators
- **JSON body:** `message`, `active`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/system/announcement' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"message": "…", "active": "…"}'
```

**Returns**

The same as `GET /api/system/announcement`.


## Area: `system/applinks`

<a id="area-system-applinks"></a>

System settings, for administrators: licence, mail, database, logo, announcements, the AI, identity providers and more.

### `GET /api/system/applinks`

**Read applinks**

The application links of this installation. Administrators.

- **Who may:** Administrators

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/system/applinks' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `links` | array |  |
| `product` | string | `"mgservice"` |

<details><summary>Example answer</summary>

```json
{
  "links": [],
  "product": "mgservice"
}
```

</details>

### `POST /api/system/applinks`

**Send applinks**

Set up a link: the other application's address, an administrator's login there (password or API
token - used once, not kept) and this installation's address as the other one reaches it.

- **Who may:** Administrators
- **JSON body:** `base_url`, `username`, `secret`, `own_url`, `own_name`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/system/applinks' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"base_url": "…", "username": "…", "secret": "…", "own_url": "…", "own_name": "…"}'
```

**Returns**

`link`

### `POST /api/system/applinks/browser`

**Send browser**

Set up a link in the browser - no password, no token: the address to open, where you approve the link
signed in over there as you are (any identity provider it has, or a password); that application checks you are one of its
administrators. Back here, /api/system/applinks/complete keeps it.

- **Who may:** Administrators
- **JSON body:** `base_url`, `own_url`, `own_name`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/system/applinks/browser' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"base_url": "…", "own_url": "…", "own_name": "…"}'
```

**Returns**

JSON.

### `POST /api/system/applinks/complete`

**Complete – applinks**

The browser is back from approving the link over there, with that side's key: kept here too - only for
the administrator who started it.

- **Who may:** Administrators

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/system/applinks/complete' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`link`

### `DELETE /api/system/applinks/{link_id}`

**Delete applinks**

Remove a link - here and in the other application.

- **Who may:** Administrators
- **Path parameters:** `link_id` (integer)

**Call**

```bash
curl -s -X DELETE 'http://127.0.0.1:6644/api/system/applinks/{link_id}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`error`, `ok`, `other_side`

### `POST /api/system/applinks/{link_id}/test`

**Test – applinks**

Ask the other application as whom it sees you over the link.

- **Who may:** Administrators
- **Path parameters:** `link_id` (integer)

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/system/applinks/{link_id}/test' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`error`


## Area: `system/audit`

<a id="area-system-audit"></a>

System settings, for administrators: licence, mail, database, logo, announcements, the AI, identity providers and more.

### `GET /api/system/audit`

**List audit log**

The audit log, newest first, filtered by person, text and dates.

- **Who may:** Administrators
- **Query parameters:** `limit` (int, default 100)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/system/audit?limit=…' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `entries` | array |  |
| `entries[].id` | integer | `1` |
| `entries[].at` | string | `"2026-11-21T21:28:58Z"` |
| `entries[].actor_id` | integer | `6` |
| `entries[].actor` | string | `"admin"` |
| `entries[].ip` | string | `"127.0.0.1"` |
| `entries[].action` | string | `"sign-in"` |
| `entries[].target` | string | `"admin"` |
| `entries[].details` | null | `null` |
| `entries[].status` | integer | `200` |
| `more` | boolean | `false` |

<details><summary>Example answer</summary>

```json
{
  "entries": [
    {
      "id": 1,
      "at": "2026-11-21T21:28:58Z",
      "actor_id": 6,
      "actor": "admin",
      "ip": "127.0.0.1",
      "action": "sign-in",
      "target": "admin",
      "details": null,
      "status": 200
    }
  ],
  "more": false
}
```

</details>


## Area: `system/audit.csv`

<a id="area-system-audit-csv"></a>

System settings, for administrators: licence, mail, database, logo, announcements, the AI, identity providers and more.

### `GET /api/system/audit.csv`

**Export audit log as CSV**

The same, as a CSV file - for an auditor, or a SIEM import.

- **Who may:** Administrators

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/system/audit.csv' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

A file (text/csv).


## Area: `system/branding`

<a id="area-system-branding"></a>

System settings, for administrators: licence, mail, database, logo, announcements, the AI, identity providers and more.

### `GET /api/system/branding`

**Read logo and colours**

- **Who may:** Administrators

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/system/branding' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `light` | null | `null` |
| `dark` | null | `null` |
| `favicon` | null | `null` |
| `folder` | string | `"/tmp/apidocs-jals_l9y/branding"` |
| `accept` | array |  |

<details><summary>Example answer</summary>

```json
{
  "light": null,
  "dark": null,
  "favicon": null,
  "folder": "/tmp/apidocs-jals_l9y/branding",
  "accept": [
    "image/jpeg",
    "image/png",
    "…"
  ]
}
```

</details>

### `POST /api/system/branding`

**Send logo and colours**

Take a new logo. One file per slot, and every other spelling of that slot
is removed: a leftover logo.svg beats a fresh logo.png in the reading order,
which is exactly the trap somebody would fall into here.

- **Who may:** Administrators
- **Query parameters:** `slot` (string)
- **JSON body:** `(multipart form: file)`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/system/branding?slot=…' \
  -H 'Authorization: Bearer $TOKEN' \
  -F 'file=@/path/to/file'
```

**Returns**

`accent`

### `DELETE /api/system/branding`

**Delete logo and colours**

Back to the logo that ships with MGService.

- **Who may:** Administrators
- **Query parameters:** `slot` (string)

**Call**

```bash
curl -s -X DELETE 'http://127.0.0.1:6644/api/system/branding?slot=…' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`removed`


## Area: `system/database`

<a id="area-system-database"></a>

System settings, for administrators: licence, mail, database, logo, announcements, the AI, identity providers and more.

### `GET /api/system/database`

**Read database**

- **Who may:** Administrators

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/system/database' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `backend` | string | `"postgres"` |
| `postgres` | object |  |
| `postgres.host` | string | `"127.0.0.1"` |
| `postgres.port` | integer | `5432` |
| `postgres.user` | string | `"mg"` |
| `postgres.dbname` | string | `"mgservice_apidocs_3006123_1795296536"` |
| `hasPassword` | boolean | `true` |
| `driverInstalled` | boolean | `true` |
| `counts` | object |  |
| `counts.users` | integer | `6` |
| `counts.projects` | integer | `2` |
| `counts.issues` | integer | `12` |
| `counts.comments` | integer | `7` |
| `counts.history` | integer | `25` |
| `configPath` | string | `"/tmp/apidocs-jals_l9y/database.json"` |
| `live` | object |  |
| `live.backend` | string | `"postgres"` |
| `live.database` | string | `"mgservice_apidocs_3006123_1795296536"` |
| `live.user` | string | `"mg"` |
| `live.schema` | string | `"public"` |
| `live.host` | string | `"127.0.0.1"` |
| `live.port` | integer | `5432` |
| `mismatch` | boolean | `false` |

<details><summary>Example answer</summary>

```json
{
  "backend": "postgres",
  "postgres": {
    "host": "127.0.0.1",
    "port": 5432,
    "user": "mg",
    "dbname": "mgservice_apidocs_3006123_1795296536"
  },
  "hasPassword": true,
  "driverInstalled": true,
  "counts": {
    "users": 6,
    "projects": 2,
    "issues": 12,
    "comments": 7,
    "history": 25
  },
  "configPath": "/tmp/apidocs-jals_l9y/database.json",
  "live": {
    "backend": "postgres",
    "database": "mgservice_apidocs_3006123_1795296536",
    "user": "mg",
    "schema": "public",
    "host": "127.0.0.1",
    "port": 5432
  },
  "mismatch": false
}
```

</details>

### `GET /api/system/database/check`

**Check – database**

Where the service writes, and whether every table of the schema is there.

- **Who may:** Administrators

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/system/database/check' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `writes` | object |  |
| `writes.backend` | string | `"postgres"` |
| `writes.database` | string | `"mgservice_apidocs_3006123_1795296536"` |
| `writes.user` | string | `"mg"` |
| `writes.schema` | string | `"public"` |
| `writes.host` | string | `"127.0.0.1"` |
| `writes.port` | integer | `5432` |
| `configPath` | string | `"/tmp/apidocs-jals_l9y/database.json"` |
| `tables` | array |  |
| `tables[].table` | string | `"users"` |
| `tables[].present` | boolean | `true` |
| `tables[].rows` | integer | `6` |
| `missing` | array |  |

<details><summary>Example answer</summary>

```json
{
  "writes": {
    "backend": "postgres",
    "database": "mgservice_apidocs_3006123_1795296536",
    "user": "mg",
    "schema": "public",
    "host": "127.0.0.1",
    "port": 5432
  },
  "configPath": "/tmp/apidocs-jals_l9y/database.json",
  "tables": [
    {
      "table": "users",
      "present": true,
      "rows": 6
    },
    {
      "table": "user_identities",
      "present": true,
      "rows": 0
    },
    "…"
  ],
  "missing": []
}
```

</details>

### `POST /api/system/database/test`

**Test – database**

- **Who may:** Administrators
- **JSON body:** `password`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/system/database/test' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"password": "…"}'
```

**Returns**

`ok`, `error`


## Area: `system/db`

<a id="area-system-db"></a>

System settings, for administrators: licence, mail, database, logo, announcements, the AI, identity providers and more.

### `POST /api/system/db/query`

**Send query**

Run one statement. SELECT shows rows; anything else says how many it hit.

One statement at a time: a semicolon in the middle is refused, because a
second statement after a checked first one is exactly how this kind of page
gets abused.

- **Who may:** Administrators
- **JSON body:** `sql`, `preview`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/system/db/query' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"sql": "…", "preview": "…"}'
```

**Returns**

`kind`, `columns`, `rows`, `total`, `shown`, `table`, `message`

### `GET /api/system/db/table/{name}`

**Read table**

One page of a table, with a filter per column.

- **Who may:** Administrators
- **Path parameters:** `name` (string)
- **Query parameters:** `f_` (string), `page` (string)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/system/db/table/{name}?f_=…&page=…' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `table` | string | `"users"` |
| `columns` | array |  |
| `columns[].name` | string | `"id"` |
| `columns[].type` | string | `"integer"` |
| `key` | string | `"id"` |
| `sealed` | array |  |
| `total` | integer | `6` |
| `page` | integer | `0` |
| `pages` | integer | `1` |
| `rows` | array |  |
| `rows[].id` | integer | `1` |
| `rows[].username` | string | `"mkoch"` |
| `rows[].display_name` | string | `"Marie Koch"` |
| `rows[].email` | string | `"marie.koch@example.invalid"` |
| `rows[].avatar_color` | string | `"#0052CC"` |
| `rows[].is_admin` | integer | `1` |
| `rows[].active` | integer | `1` |
| `rows[].created` | string | `"2026-08-23T21:28:57Z"` |
| `rows[].password_hash` | null | `null` |
| `rows[].must_change_password` | string | `"<hidden>"` |
| `rows[].password_changed` | null | `null` |
| `rows[].last_login` | null | `null` |
| `rows[].failed_logins` | integer | `0` |
| `rows[].locked_until` | null | `null` |
| `rows[].clock_prompt` | integer | `0` |
| `rows[].entra_oid` | null | `null` |
| `rows[].avatar_file` | null | `null` |
| `rows[].preferences` | null | `null` |
| `rows[].last_dashboard_id` | integer | `1` |

<details><summary>Example answer</summary>

```json
{
  "table": "users",
  "columns": [
    {
      "name": "id",
      "type": "integer"
    },
    {
      "name": "username",
      "type": "text"
    },
    "…"
  ],
  "key": "id",
  "sealed": [
    "client_secret",
    "credential_id",
    "…"
  ],
  "total": 6,
  "page": 0,
  "pages": 1,
  "rows": [
    {
      "id": 1,
      "username": "mkoch",
      "display_name": "Marie Koch",
      "email": "marie.koch@example.invalid",
      "avatar_color": "#0052CC",
      "is_admin": 1,
      "active": 1,
      "created": "2026-08-23T21:28:57Z",
      "password_hash": null,
      "must_change_password": "<hidden>",
      "password_changed": null,
      "last_login": null,
      "failed_logins": 0,
      "locked_until": null,
      "clock_prompt": 0,
      "entra_oid": null,
      "avatar_file": null,
      "preferences": null,
      "last_dashboard_id": 1
    },
    {
      "id": 2,
      "username": "tbauer",
      "display_name": "Tom Bauer",
      "email": "tom.bauer@example.invalid",
      "avatar_color": "#00875A",
      "is_admin": 0,
      "active": 1,
      "created": "2026-08-23T21:28:57Z",
      "password_hash": null,
      "must_change_password": "<hidden>",
      "password_changed": null,
      "last_login": null,
      "failed_logins": 0,
      "locked_until": null,
      "clock_prompt": 0,
      "entra_oid": null,
      "avatar_file": null,
      "preferences": null,
      "last_dashboard_id": null
    },
    "…"
  ]
}
```

</details>

### `PUT /api/system/db/table/{name}`

**Change table**

Change one value in one row, named by its key. Nothing else.

- **Who may:** Administrators
- **Path parameters:** `name` (string)
- **JSON body:** `column`, `keyColumn`, `keyValue`, `value`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/system/db/table/{name}' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"column": "…", "keyColumn": "…", "keyValue": "…", "value": "…"}'
```

**Returns**

`table`, `column`, `was`, `now`

### `GET /api/system/db/tables`

**List database tables**

- **Who may:** Administrators

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/system/db/tables' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `tables` | array |  |
| `tables[].name` | string | `"agent_presence"` |
| `tables[].rows` | integer | `0` |
| `backend` | string | `"postgres"` |
| `database` | string | `"127.0.0.1/mgservice_apidocs_3006123_1795296536"` |

<details><summary>Example answer</summary>

```json
{
  "tables": [
    {
      "name": "agent_presence",
      "rows": 0
    },
    {
      "name": "ai_cases",
      "rows": 0
    },
    "…"
  ],
  "backend": "postgres",
  "database": "127.0.0.1/mgservice_apidocs_3006123_1795296536"
}
```

</details>


## Area: `system/deactivated-tickets`

<a id="area-system-deactivated-tickets"></a>

System settings, for administrators: licence, mail, database, logo, announcements, the AI, identity providers and more.

### `GET /api/system/deactivated-tickets`

**List tickets of deactivated people**

Tickets assigned to somebody who is deactivated - by hand or by the
directory sync. Without this they lie with a person who has left, and
nobody's list shows them. Open ones by default; ?done=1 adds the finished.

- **Who may:** Administrators
- **Query parameters:** `done` (string)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/system/deactivated-tickets?done=…' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `tickets` | array |  |
| `people` | array |  |

<details><summary>Example answer</summary>

```json
{
  "tickets": [],
  "people": []
}
```

</details>


## Area: `system/entra`

<a id="area-system-entra"></a>

System settings, for administrators: licence, mail, database, logo, announcements, the AI, identity providers and more.

### `GET /api/system/entra`

**List Microsoft Entra settings**

- **Who may:** Administrators

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/system/entra' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `enabled` | boolean | `false` |
| `tenantId` | string | `""` |
| `clientId` | string | `""` |
| `hasSecret` | boolean | `false` |
| `autoCreate` | boolean | `true` |
| `domainAllowList` | string | `""` |
| `entraOnly` | boolean | `false` |
| `syncEnabled` | boolean | `false` |
| `syncHours` | integer | `12` |
| `deactivateMissing` | boolean | `false` |
| `lastSync` | null | `null` |
| `lastSyncResult` | string | `""` |
| `redirectUri` | string | `"http://localhost/auth/entra/callback"` |

<details><summary>Example answer</summary>

```json
{
  "enabled": false,
  "tenantId": "",
  "clientId": "",
  "hasSecret": false,
  "autoCreate": true,
  "domainAllowList": "",
  "entraOnly": false,
  "syncEnabled": false,
  "syncHours": 12,
  "deactivateMissing": false,
  "lastSync": null,
  "lastSyncResult": "",
  "redirectUri": "http://localhost/auth/entra/callback"
}
```

</details>

### `PUT /api/system/entra`

**Change Microsoft Entra settings**

- **Who may:** Administrators
- **JSON body:** `clientSecret`, `clearSecret`, `autoCreate`, `entraOnly`, `syncEnabled`, `syncHours`, `deactivateMissing`, `enabled`, `tenantId`, `clientId`, `domainAllowList`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/system/entra' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"clientSecret": "…", "clearSecret": "…", "autoCreate": "…", "entraOnly": "…", "syncEnabled": "…", "syncHours": "…", "deactivateMissing": "…", "enabled": "…"}'
```

**Returns**

The same as `GET /api/system/entra`.

### `POST /api/system/entra/sync`

**Run the sync – Microsoft Entra setting**

- **Who may:** Administrators

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/system/entra/sync' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

JSON.

### `POST /api/system/entra/test`

**Test – Microsoft Entra setting**

Read the tenant's discovery document - proves the tenant exists and that
this server can reach Microsoft.

- **Who may:** Administrators
- **JSON body:** `tenantId`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/system/entra/test' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"tenantId": "…"}'
```

**Returns**

`ok`, `error`, `issuer`, `authorization`, `redirectUri`


## Area: `system/identity`

<a id="area-system-identity"></a>

System settings, for administrators: licence, mail, database, logo, announcements, the AI, identity providers and more.

### `GET /api/system/identity`

**List identity providers**

- **Who may:** Administrators

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/system/identity' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `settings` | object |  |
| `settings.order` | array |  |
| `settings.onlyThroughIdp` | boolean | `false` |
| `providers` | object |  |
| `providers.entra` | object |  |
| `providers.entra.label` | string | `"Microsoft Entra"` |
| `providers.entra.enabled` | boolean | `false` |
| `providers.entra.people` | integer | `0` |
| `providers.google` | object |  |
| `providers.google.label` | string | `"Google Workspace"` |
| `providers.google.enabled` | boolean | `false` |
| `providers.google.autoCreate` | boolean | `true` |
| `providers.google.domainAllowList` | string | `""` |
| `providers.google.syncEnabled` | boolean | `false` |
| `providers.google.syncHours` | integer | `12` |
| `providers.google.deactivateMissing` | boolean | `false` |
| `providers.google.lastSync` | null | `null` |
| `providers.google.lastSyncResult` | string | `""` |
| `providers.google.defaultGroups` | string | `""` |
| `providers.google.clientId` | string | `""` |
| `providers.google.hostedDomain` | string | `""` |
| `providers.google.adminEmail` | string | `""` |
| `providers.google.hasClientSecret` | boolean | `false` |
| `providers.google.hasServiceAccountJson` | boolean | `false` |
| `providers.google.people` | integer | `0` |
| `providers.google.redirectUri` | string | `"http://localhost/auth/google/callback"` |
| `providers.okta` | object |  |
| `providers.okta.label` | string | `"Okta"` |
| `providers.okta.enabled` | boolean | `false` |
| `providers.okta.autoCreate` | boolean | `true` |
| `providers.okta.domainAllowList` | string | `""` |
| `providers.okta.syncEnabled` | boolean | `false` |
| `providers.okta.syncHours` | integer | `12` |
| `providers.okta.deactivateMissing` | boolean | `false` |
| `providers.okta.lastSync` | null | `null` |
| `providers.okta.lastSyncResult` | string | `""` |
| `providers.okta.defaultGroups` | string | `""` |
| `providers.okta.domain` | string | `""` |
| `providers.okta.clientId` | string | `""` |
| `providers.okta.hasClientSecret` | boolean | `false` |

<details><summary>Example answer</summary>

```json
{
  "settings": {
    "order": [
      "entra",
      "ldap",
      "…"
    ],
    "onlyThroughIdp": false
  },
  "providers": {
    "entra": {
      "label": "Microsoft Entra",
      "enabled": false,
      "people": 0
    },
    "google": {
      "label": "Google Workspace",
      "enabled": false,
      "autoCreate": true,
      "domainAllowList": "",
      "syncEnabled": false,
      "syncHours": 12,
      "deactivateMissing": false,
      "lastSync": null,
      "lastSyncResult": "",
      "defaultGroups": "",
      "clientId": "",
      "hostedDomain": "",
      "adminEmail": "",
      "hasClientSecret": false,
      "hasServiceAccountJson": false,
      "people": 0,
      "redirectUri": "http://localhost/auth/google/callback"
    },
    "okta": {
      "label": "Okta",
      "enabled": false,
      "autoCreate": true,
      "domainAllowList": "",
      "syncEnabled": false,
      "syncHours": 12,
      "deactivateMissing": false,
      "lastSync": null,
      "lastSyncResult": "",
      "defaultGroups": "",
      "domain": "",
      "clientId": "",
      "hasClientSecret": false,
      "hasApiToken": false,
      "people": 0,
      "redirectUri": "http://localhost/auth/okta/callback"
    },
    "ldap": {
      "label": "Active Directory",
      "enabled": false,
      "autoCreate": true,
      "domainAllowList": "",
      "syncEnabled": false,
      "syncHours": 12,
      "deactivateMissing": false,
      "lastSync": null,
      "lastSyncResult": "",
      "defaultGroups": "",
      "server": "",
      "startTls": false,
      "verifyCertificate": true,
      "baseDn": "",
      "bindDn": "",
      "loginAttribute": "sAMAccountName",
      "userFilter": "(&(objectCategory=person)(objectClass=user))",
      "groupDn": "",
      "hasBindPassword": false,
      "peo
…
```

</details>

### `PUT /api/system/identity`

**Change identity providers**

The order (whose name and address count when several know a person) and "only through an
identity provider" - for all of them.

- **Who may:** Administrators
- **JSON body:** `order`, `onlyThroughIdp`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/system/identity' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"order": "…", "onlyThroughIdp": "…"}'
```

**Returns**

The same as `GET /api/system/identity`.

### `PUT /api/system/identity/{provider}`

**Change identity provider**

- **Who may:** Administrators
- **Path parameters:** `provider` (string)

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/system/identity/{provider}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

JSON.

### `POST /api/system/identity/{provider}/sync`

**Run the sync – identity provider**

- **Who may:** Administrators
- **Path parameters:** `provider` (string)

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/system/identity/{provider}/sync' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

JSON.

### `POST /api/system/identity/{provider}/test`

**Test – identity provider**

- **Who may:** Administrators
- **Path parameters:** `provider` (string)

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/system/identity/{provider}/test' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`ok`, `lines`


## Area: `system/instance`

<a id="area-system-instance"></a>

System settings, for administrators: licence, mail, database, logo, announcements, the AI, identity providers and more.

### `GET /api/system/instance`

**List instance settings**

Where this installation keeps its things - the questions asked in support.

- **Who may:** Administrators

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/system/instance' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `database` | string | `"PostgreSQL · 127.0.0.1:5432/?"` |
| `backend` | string | `"postgres"` |
| `databaseUser` | string | `"mg"` |
| `reachable` | boolean | `true` |
| `databaseDetail` | string | `"12 issues"` |
| `dataDir` | string | `"/tmp/apidocs-jals_l9y"` |
| `attachments` | string | `"/tmp/apidocs-jals_l9y/attachments"` |
| `changelog` | array |  |

<details><summary>Example answer</summary>

```json
{
  "database": "PostgreSQL · 127.0.0.1:5432/?",
  "backend": "postgres",
  "databaseUser": "mg",
  "reachable": true,
  "databaseDetail": "12 issues",
  "dataDir": "/tmp/apidocs-jals_l9y",
  "attachments": "/tmp/apidocs-jals_l9y/attachments",
  "changelog": [
    [
      "5.1.2",
      [
        "Approving an application link in the browser works with every way this instal…",
        "The Google and Okta sign-ins (/auth/<provider>/start) take next= like the Mic…"
      ]
    ],
    [
      "5.1.1",
      [
        "Application links set up in the browser - no password, no token: \"Link with m…",
        "The Microsoft sign-in (/auth/entra/start) takes next= and comes back there af…"
      ]
    ],
    "…"
  ]
}
```

</details>

### `PUT /api/system/instance/name`

**Change name**

Name this installation, so three open tabs can be told apart.

- **Who may:** Administrators
- **JSON body:** `name`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/system/instance/name' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"name": "…"}'
```

**Returns**

`name`


## Area: `system/intake`

<a id="area-system-intake"></a>

System settings, for administrators: licence, mail, database, logo, announcements, the AI, identity providers and more.

### `GET /api/system/intake`

**Read mail intake**

- **Who may:** Administrators

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/system/intake' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `enabled` | boolean | `false` |
| `useMailConnection` | boolean | `true` |
| `tenantId` | string | `""` |
| `clientId` | string | `""` |
| `mailbox` | string | `""` |
| `folder` | string | `"Inbox"` |
| `processedFolder` | string | `"MGService processed"` |
| `projectKey` | string | `""` |
| `typeId` | null | `null` |
| `intervalMinutes` | integer | `5` |
| `since` | string | `""` |
| `lastRun` | string | `""` |
| `lastResult` | string | `""` |
| `hasSecret` | boolean | `false` |
| `hasImapPassword` | boolean | `false` |
| `transport` | string | `"graph"` |
| `mailConnection` | boolean | `false` |

<details><summary>Example answer</summary>

```json
{
  "enabled": false,
  "useMailConnection": true,
  "tenantId": "",
  "clientId": "",
  "mailbox": "",
  "folder": "Inbox",
  "processedFolder": "MGService processed",
  "projectKey": "",
  "typeId": null,
  "intervalMinutes": 5,
  "since": "",
  "lastRun": "",
  "lastResult": "",
  "hasSecret": false,
  "hasImapPassword": false,
  "transport": "graph",
  "mailConnection": false
}
```

</details>

### `PUT /api/system/intake`

**Change mail intake**

- **Who may:** Administrators
- **JSON body:** `enabled`, `backfillDays`, `projectKey`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/system/intake' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"enabled": "…", "backfillDays": "…", "projectKey": "…"}'
```

**Returns**

The same as `GET /api/system/intake`.

### `GET /api/system/intake/log`

**List log**

- **Who may:** Administrators

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/system/intake/log' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `entries` | array |  |

<details><summary>Example answer</summary>

```json
{
  "entries": []
}
```

</details>

### `DELETE /api/system/intake/log/{eid}`

**Delete log entry**

Release a failed claim, so the next run tries the message again.

- **Who may:** Administrators
- **Path parameters:** `eid` (integer)

**Call**

```bash
curl -s -X DELETE 'http://127.0.0.1:6644/api/system/intake/log/{eid}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`released`

### `POST /api/system/intake/run`

**Run – mail intake**

- **Who may:** Administrators

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/system/intake/run' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`status`, `error`

### `POST /api/system/intake/test`

**Test – mail intake**

- **Who may:** Administrators

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/system/intake/test' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`ok`, `error`


## Area: `system/jsm-import`

<a id="area-system-jsm-import"></a>

System settings, for administrators: licence, mail, database, logo, announcements, the AI, identity providers and more.

### `GET /api/system/jsm-import`

**Read Jira Service Management import**

- **Who may:** Administrators

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/system/jsm-import' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `url` | string | `""` |
| `email` | string | `""` |
| `hasToken` | boolean | `false` |
| `running` | boolean | `false` |

<details><summary>Example answer</summary>

```json
{
  "url": "",
  "email": "",
  "hasToken": false,
  "running": false
}
```

</details>

### `PUT /api/system/jsm-import`

**Change Jira Service Management import**

- **Who may:** Administrators
- **JSON body:** `token`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/system/jsm-import' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"token": "…"}'
```

**Returns**

The same as `GET /api/system/jsm-import`.

### `POST /api/system/jsm-import/customer-check`

**Check the customer – Jira Service Management import**

Which customer every chosen ticket lands with, and why.

- **Who may:** Administrators
- **JSON body:** `keys`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/system/jsm-import/customer-check' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"keys": "…"}'
```

**Returns**

`tickets`

### `POST /api/system/jsm-import/customers/import`

**Import – customer**

Create or link the organisations, then the customers in them.

- **Who may:** Administrators
- **JSON body:** `organisations`, `customers`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/system/jsm-import/customers/import' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"organisations": "…", "customers": "…"}'
```

**Returns**

JSON.

### `POST /api/system/jsm-import/customers/preview`

**Preview – customer**

Organisations and customers of a desk, each with a proposed counterpart.

- **Who may:** Administrators
- **JSON body:** `deskId`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/system/jsm-import/customers/preview' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"deskId": "…"}'
```

**Returns**

`organisations`, `customers`, `localOrganisations`, `id`, `name`

### `POST /api/system/jsm-import/mapping`

**Send mapping**

Everything to map for the chosen tickets, with suggestions.

- **Who may:** Administrators
- **JSON body:** `keys`, `project`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/system/jsm-import/mapping' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"keys": "…", "project": "…"}'
```

**Returns**

`assignees`, `agents`, `id`, `displayName`, `email`, `statuses`, `localStatuses`, `name`, `category`, `types`, `localTypes`, `priorities`, `localPriorities`

### `GET /api/system/jsm-import/progress`

**Read progress**

- **Who may:** Administrators

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/system/jsm-import/progress' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `state` | string | `"idle"` |

<details><summary>Example answer</summary>

```json
{
  "state": "idle"
}
```

</details>

### `POST /api/system/jsm-import/run`

**Run – Jira Service Management import**

- **Who may:** Administrators
- **JSON body:** `keys`, `project`, `assignees`, `statuses`, `types`, `priorities`, `customers`, `comments`, `attachments`, `update`, `fixReporter`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/system/jsm-import/run' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"keys": "…", "project": "…", "assignees": "…", "statuses": "…", "types": "…", "priorities": "…", "customers": "…", "comments": "…"}'
```

**Returns**

JSON.

### `POST /api/system/jsm-import/test`

**Test – Jira Service Management import**

- **Who may:** Administrators

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/system/jsm-import/test' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`me`, `desks`

### `POST /api/system/jsm-import/tickets`

**Create ticket**

- **Who may:** Administrators
- **JSON body:** `deskKey`, `mql`, `limit`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/system/jsm-import/tickets' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"deskKey": "…", "mql": "…", "limit": "…"}'
```

**Returns**

`tickets`


## Area: `system/kb`

<a id="area-system-kb"></a>

System settings, for administrators: licence, mail, database, logo, announcements, the AI, identity providers and more.

### `GET /api/system/kb`

**Read knowledge base**

- **Who may:** Administrators

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/system/kb' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `url` | string | `""` |
| `enabled` | boolean | `false` |
| `lastRun` | null | `null` |
| `lastOk` | null | `null` |
| `pages` | integer | `0` |
| `error` | null | `null` |
| `running` | boolean | `false` |
| `progress` | integer | `0` |
| `everyHours` | integer | `6` |

<details><summary>Example answer</summary>

```json
{
  "url": "",
  "enabled": false,
  "lastRun": null,
  "lastOk": null,
  "pages": 0,
  "error": null,
  "running": false,
  "progress": 0,
  "everyHours": 6
}
```

</details>

### `PUT /api/system/kb`

**Change knowledge base**

- **Who may:** Administrators
- **JSON body:** `url`, `enabled`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/system/kb' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"url": "…", "enabled": "…"}'
```

**Returns**

The same as `GET /api/system/kb`.

### `POST /api/system/kb/reindex`

**Rebuild the index – knowledge base**

Read the knowledge base now - in the background; the page asks for progress.

- **Who may:** Administrators

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/system/kb/reindex' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

JSON.

### `GET /api/system/kb/search`

**Read search**

- **Who may:** Administrators
- **Query parameters:** `q` (string, default "")

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/system/kb/search?q=…' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `results` | array |  |

<details><summary>Example answer</summary>

```json
{
  "results": []
}
```

</details>


## Area: `system/license`

<a id="area-system-license"></a>

System settings, for administrators: licence, mail, database, logo, announcements, the AI, identity providers and more.

### `GET /api/system/license`

**Read licence**

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/system/license' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `licensed` | boolean | `true` |
| `reason` | string | `"ok"` |
| `message` | string | `"No licence has been entered."` |
| `valid` | boolean | `true` |
| `seats` | object |  |
| `seats.users` | integer | `6` |
| `seats.allowed` | null | `null` |
| `seats.grace` | integer | `2` |
| `seats.over` | integer | `0` |
| `seats.blocked` | boolean | `false` |

<details><summary>Example answer</summary>

```json
{
  "licensed": true,
  "reason": "ok",
  "message": "No licence has been entered.",
  "valid": true,
  "seats": {
    "users": 6,
    "allowed": null,
    "grace": 2,
    "over": 0,
    "blocked": false
  }
}
```

</details>

### `PUT /api/system/license`

**Change licence**

- **Who may:** Administrators
- **JSON body:** `key`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/system/license' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"key": "…"}'
```

**Returns**

The same as `GET /api/system/license`.

### `DELETE /api/system/license`

**Delete licence**

Take the licence out. The instance drops to read only at once.

Kept as its own endpoint rather than as an empty save: removing a licence is
a decision of its own, and it should read like one in the log.

- **Who may:** Administrators

**Call**

```bash
curl -s -X DELETE 'http://127.0.0.1:6644/api/system/license' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

The same as `GET /api/system/license`.


## Area: `system/mail`

<a id="area-system-mail"></a>

System settings, for administrators: licence, mail, database, logo, announcements, the AI, identity providers and more.

### `GET /api/system/mail`

**List mail settings**

- **Who may:** Administrators

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/system/mail' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `enabled` | boolean | `false` |
| `tenantId` | string | `""` |
| `clientId` | string | `""` |
| `sender` | string | `""` |
| `fromName` | string | `"MGService"` |
| `hasSecret` | boolean | `false` |
| `replyTo` | string | `""` |
| `footer` | string | `""` |
| `transport` | string | `"graph"` |
| `smtpHost` | string | `""` |
| `smtpPort` | string | `""` |
| `smtpSecurity` | string | `"starttls"` |
| `smtpUser` | string | `""` |
| `hasSmtpPassword` | boolean | `false` |

<details><summary>Example answer</summary>

```json
{
  "enabled": false,
  "tenantId": "",
  "clientId": "",
  "sender": "",
  "fromName": "MGService",
  "hasSecret": false,
  "replyTo": "",
  "footer": "",
  "transport": "graph",
  "smtpHost": "",
  "smtpPort": "",
  "smtpSecurity": "starttls",
  "smtpUser": "",
  "hasSmtpPassword": false
}
```

</details>

### `PUT /api/system/mail`

**Change mail settings**

- **Who may:** Administrators

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/system/mail' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

The same as `GET /api/system/mail`.

### `POST /api/system/mail/test`

**Test – mail setting**

Send one message to the person asking, so the setup can be checked.

- **Who may:** Administrators
- **JSON body:** `to`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/system/mail/test' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"to": "…"}'
```

**Returns**

`sent`, `enabled`


## Area: `system/mail-queue`

<a id="area-system-mail-queue"></a>

System settings, for administrators: licence, mail, database, logo, announcements, the AI, identity providers and more.

### `GET /api/system/mail-queue`

**List mail queue**

What is waiting, what went and what failed - newest first.

- **Who may:** Administrators
- **Query parameters:** `status` (string)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/system/mail-queue?status=…' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `queue` | array |  |
| `enabled` | boolean | `false` |
| `sender` | string | `""` |

<details><summary>Example answer</summary>

```json
{
  "queue": [],
  "enabled": false,
  "sender": ""
}
```

</details>


## Area: `system/portal`

<a id="area-system-portal"></a>

System settings, for administrators: licence, mail, database, logo, announcements, the AI, identity providers and more.

### `PUT /api/system/portal`

**Change customer portal**

- **Who may:** Administrators
- **JSON body:** `signup`, `title`, `loginLink`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/system/portal' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"signup": "…", "title": "…", "loginLink": "…"}'
```

**Returns**

JSON.


## Area: `third-party`

<a id="area-third-party"></a>

### `GET /api/third-party`

**Read third party**

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/third-party' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `product` | string | `"mgservice5"` |
| `version` | string | `"5.1.2"` |
| `made` | string | `""` |
| `components` | array |  |
| `components[].name` | string | `"Barlow (font)"` |
| `components[].version` | string | `""` |
| `components[].kind` | string | `"Font"` |
| `components[].url` | string | `""` |
| `components[].licences` | array |  |
| `components[].description` | string | `""` |
| `components[].texts` | array |  |
| `components[].files` | array |  |
| `source` | string | `"installation"` |

<details><summary>Example answer</summary>

```json
{
  "product": "mgservice5",
  "version": "5.1.2",
  "made": "",
  "components": [
    {
      "name": "Barlow (font)",
      "version": "",
      "kind": "Font",
      "url": "",
      "licences": [
        "OFL-1.1"
      ],
      "description": "",
      "texts": [
        {
          "file": "LICENSE-barlow-condensed.txt",
          "text": "Copyright 2017 The Barlow Project Authors (https://github.com/jpt/barlow) Bar…"
        }
      ],
      "files": [
        "barlow-condensed-600.woff2",
        "barlow-condensed-700.woff2"
      ]
    },
    {
      "name": "blinker",
      "version": "1.9.0",
      "kind": "Python package",
      "url": "https://pypi.org/project/blinker/",
      "licences": [
        "MIT License"
      ],
      "description": "",
      "texts": [
        {
          "file": "LICENSE.txt",
          "text": "Copyright 2010 Jason Kirtland\n\nPermission is hereby granted, free of charge, …"
        }
      ]
    },
    "…"
  ],
  "source": "installation"
}
```

</details>


## Area: `timeclock`

<a id="area-timeclock"></a>

Working times: clocking in, on a break and out; corrections by an administrator; the export.

### `GET /api/timeclock`

**List working times**

The state of the people asked about. Everybody may look; only their own
state can they change.

- **Who may:** Anybody signed in
- **Query parameters:** `users` (string), `day` (string)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/timeclock?users=…&day=…' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `people` | array |  |
| `people[].user` | object |  |
| `people[].state` | string | `"out"` |
| `people[].since` | null | `null` |
| `people[].worked` | integer | `0` |
| `people[].paused` | integer | `0` |
| `people[].isMe` | boolean | `true` |
| `day` | string | `"2026-11-21"` |

<details><summary>Example answer</summary>

```json
{
  "people": [
    {
      "user": {
        "id": 6,
        "displayName": "Administrator",
        "avatarColor": "#007FA0"
      },
      "state": "out",
      "since": null,
      "worked": 0,
      "paused": 0,
      "isMe": true
    }
  ],
  "day": "2026-11-21"
}
```

</details>

### `POST /api/timeclock`

**Create clock entry**

Clock in, take a break, clock out - for oneself and nobody else.

- **Who may:** Anybody signed in
- **JSON body:** `kind`, `note`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/timeclock' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"kind": "…", "note": "…"}'
```

**Returns**

The same as `GET /api/timeclock`.

### `POST /api/timeclock/ask`

**Ask – clock entry**

Should this person be asked to clock in - once per sign-in.

The flag is set when a session begins and taken away the first time it is
read, so a reload does not ask again. Kept on the server rather than in the
browser: a second tab is the same sign-in and should not ask twice either.

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/timeclock/ask' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`ask`, `kind`, `since`, `sinceDay`, `state`

### `POST /api/timeclock/close-day`

**Close the day – clock entry**

Close a day somebody left open, at the time they name.

Their own entry only, and only a moment that lies between where the day
started and now: a stamp before the start would make a negative day, one in
the future a day that has not happened.

- **Who may:** Anybody signed in
- **JSON body:** `at`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/timeclock/close-day' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"at": "…"}'
```

**Returns**

`ok`, `nothing`, `at`

### `POST /api/timeclock/manual`

**Add by hand – clock entry**

An entry that was never punched - somebody forgot, or the day was fixed
up afterwards.

- **Who may:** Administrators
- **JSON body:** `userId`, `kind`, `at`, `note`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/timeclock/manual' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"userId": "…", "kind": "…", "at": "…", "note": "…"}'
```

**Returns**

`id`

### `GET /api/timeclock/states`

**List states**

Everybody's state in one answer, for the dots on the avatars.

One query for the whole screen: the last event of the day per person, read
with a window function where the database has one and by hand where it does
not - a request per avatar would be absurd.

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/timeclock/states' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `states` | object |  |
| `states.2` | string | `"out"` |
| `states.3` | string | `"out"` |
| `states.4` | string | `"out"` |
| `states.5` | string | `"out"` |
| `states.1` | string | `"out"` |
| `states.6` | string | `"out"` |
| `day` | string | `"2026-11-21"` |

<details><summary>Example answer</summary>

```json
{
  "states": {
    "2": "out",
    "3": "out",
    "4": "out",
    "5": "out",
    "1": "out",
    "6": "out"
  },
  "day": "2026-11-21"
}
```

</details>

### `PUT /api/timeclock/{eid}`

**Change clock entry**

Put an entry right. Who corrected it and when is kept with it.

- **Who may:** Administrators
- **Path parameters:** `eid` (integer)
- **JSON body:** `kind`, `at`, `note`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/timeclock/{eid}' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"kind": "…", "at": "…", "note": "…"}'
```

**Returns**

`id`, `kind`, `at`

### `DELETE /api/timeclock/{eid}`

**Delete clock entry**

- **Who may:** Administrators
- **Path parameters:** `eid` (integer)

**Call**

```bash
curl -s -X DELETE 'http://127.0.0.1:6644/api/timeclock/{eid}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`deleted`


## Area: `uploads`

<a id="area-uploads"></a>

Big files in pieces: begin, send piece by piece, ask how far it got, cancel.

### `POST /api/uploads`

**Create upload**

Begin a big file in pieces: its name and size, checked against the limit first.

- **Who may:** Anybody signed in
- **JSON body:** `filename`, `size`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/uploads' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"filename": "…", "size": "…"}'
```

**Returns**

JSON.

### `GET /api/uploads/{uid}`

**Read upload**

How far a big file has got - asked before a piece is sent again.

- **Who may:** Anybody signed in
- **Path parameters:** `uid` (string)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/uploads/{uid}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

JSON.

### `DELETE /api/uploads/{uid}`

**Delete upload**

A big file given up: its pieces go at once.

- **Who may:** Anybody signed in
- **Path parameters:** `uid` (string)

**Call**

```bash
curl -s -X DELETE 'http://127.0.0.1:6644/api/uploads/{uid}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

The same as `GET /api/uploads/{uid}`.

### `PUT /api/uploads/{uid}/{index}`

**Change upload**

One piece of a big file, in order.

- **Who may:** Anybody signed in
- **Path parameters:** `uid` (string), `index` (integer)

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/uploads/{uid}/{index}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

JSON.


## Area: `users`

<a id="area-users"></a>

People: listing, creating, changing, deactivating - and the people to choose from in a field.

### `GET /api/users`

**List people**

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/users' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `[].id` | integer | `6` |
| `[].username` | string | `"admin"` |
| `[].displayName` | string | `"Administrator"` |
| `[].email` | string | `""` |
| `[].avatarColor` | string | `"#007FA0"` |
| `[].isAdmin` | boolean | `true` |
| `[].active` | boolean | `true` |
| `[].clockPrompt` | boolean | `false` |
| `[].avatarUrl` | null | `null` |
| `[].hasPassword` | boolean | `true` |
| `[].mustChangePassword` | boolean | `false` |
| `[].lastLogin` | string | `"2026-11-21T21:28:57Z"` |
| `[].passkeys` | integer | `0` |
| `[].locked` | boolean | `false` |

<details><summary>Example answer</summary>

```json
[
  {
    "id": 6,
    "username": "admin",
    "displayName": "Administrator",
    "email": "",
    "avatarColor": "#007FA0",
    "isAdmin": true,
    "active": true,
    "clockPrompt": false,
    "avatarUrl": null,
    "hasPassword": true,
    "mustChangePassword": false,
    "lastLogin": "2026-11-21T21:28:57Z",
    "passkeys": 0,
    "locked": false
  },
  {
    "id": 4,
    "username": "jnovak",
    "displayName": "Jan Novak",
    "email": "jan.novak@example.invalid",
    "avatarColor": "#5243AA",
    "isAdmin": false,
    "active": true,
    "clockPrompt": false,
    "avatarUrl": null,
    "hasPassword": false,
    "mustChangePassword": false,
    "lastLogin": null,
    "passkeys": 0,
    "locked": false
  },
  "…"
]
```

</details>

### `POST /api/users`

**Create person**

- **Who may:** Administrators
- **JSON body:** `username`, `displayName`, `withPassword`, `password`, `email`, `avatarColor`, `isAdmin`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/users' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"username": "…", "displayName": "…", "withPassword": "…", "password": "…", "email": "…", "avatarColor": "…", "isAdmin": "…"}'
```

**Returns**

`user`, `password`

### `PUT /api/users/{uid}`

**Change person**

- **Who may:** Anybody signed in
- **Path parameters:** `uid` (integer)
- **JSON body:** `clockPrompt`, `isAdmin`, `active`, `username`, `displayName`, `email`, `avatarColor`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/users/{uid}' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"clockPrompt": "…", "isAdmin": "…", "active": "…", "username": "…", "displayName": "…", "email": "…", "avatarColor": "…"}'
```

**Returns**

JSON.

### `DELETE /api/users/{uid}`

**Delete person**

- **Who may:** Administrators
- **Path parameters:** `uid` (integer)
- **JSON body:** `confirm`

**Call**

```bash
curl -s -X DELETE 'http://127.0.0.1:6644/api/users/{uid}' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"confirm": "…"}'
```

**Returns**

`confirm`, `username`, `wrote`, `deleted`

### `POST /api/users/{uid}/password`

**Send password (person)**

- **Who may:** Administrators
- **Path parameters:** `uid` (integer)
- **JSON body:** `password`, `mustChange`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/users/{uid}/password' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"password": "…", "mustChange": "…"}'
```

**Returns**

`password`, `user`

### `DELETE /api/users/{uid}/password`

**Delete password (person)**

- **Who may:** Administrators
- **Path parameters:** `uid` (integer)

**Call**

```bash
curl -s -X DELETE 'http://127.0.0.1:6644/api/users/{uid}/password' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`ok`

### `POST /api/users/{uid}/unlock`

**Unlock – person**

- **Who may:** Administrators
- **Path parameters:** `uid` (integer)

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/users/{uid}/unlock' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`ok`


## Area: `webhooks`

<a id="area-webhooks"></a>

Webhooks: addresses told about events, and what was sent to them.

### `GET /api/webhooks`

**List webhooks**

- **Who may:** Administrators

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/webhooks' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `webhooks` | array |  |
| `events` | object |  |
| `events.issue.created` | string | `"Issue created"` |
| `events.issue.transitioned` | string | `"Status changed"` |
| `events.issue.assigned` | string | `"Assignee changed"` |
| `events.issue.updated` | string | `"Any field changed"` |
| `events.issue.deleted` | string | `"Issue deleted"` |
| `events.issue.deleting` | string | `"Issue is about to be deleted"` |
| `events.comment.added` | string | `"Comment added by an agent"` |
| `events.customer.commented` | string | `"Customer replied"` |
| `events.issue.escalated` | string | `"Customer escalated"` |
| `events.worklog.added` | string | `"Work logged"` |
| `events.attachment.added` | string | `"Attachment added"` |
| `events.customer.attached` | string | `"Customer uploaded an attachment"` |
| `events.issue.inactive` | string | `"No activity for a while"` |

<details><summary>Example answer</summary>

```json
{
  "webhooks": [],
  "events": {
    "issue.created": "Issue created",
    "issue.transitioned": "Status changed",
    "issue.assigned": "Assignee changed",
    "issue.updated": "Any field changed",
    "issue.deleted": "Issue deleted",
    "issue.deleting": "Issue is about to be deleted",
    "comment.added": "Comment added by an agent",
    "customer.commented": "Customer replied",
    "issue.escalated": "Customer escalated",
    "worklog.added": "Work logged",
    "attachment.added": "Attachment added",
    "customer.attached": "Customer uploaded an attachment",
    "issue.inactive": "No activity for a while"
  }
}
```

</details>

### `POST /api/webhooks`

**Create webhook**

- **Who may:** Administrators
- **JSON body:** `url`, `name`, `enabled`, `format`, `projectId`, `events`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/webhooks' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"url": "…", "name": "…", "enabled": "…", "format": "…", "projectId": "…", "events": "…"}'
```

**Returns**

`id`

### `PUT /api/webhooks/{wid}`

**Change webhook**

- **Who may:** Administrators
- **Path parameters:** `wid` (integer)
- **JSON body:** `name`, `url`, `enabled`, `format`, `projectId`, `events`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/webhooks/{wid}' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"name": "…", "url": "…", "enabled": "…", "format": "…", "projectId": "…", "events": "…"}'
```

**Returns**

`ok`

### `DELETE /api/webhooks/{wid}`

**Delete webhook**

- **Who may:** Administrators
- **Path parameters:** `wid` (integer)

**Call**

```bash
curl -s -X DELETE 'http://127.0.0.1:6644/api/webhooks/{wid}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`deleted`

### `POST /api/webhooks/{wid}/test`

**Test – webhook**

- **Who may:** Administrators
- **Path parameters:** `wid` (integer)

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/webhooks/{wid}/test' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`ok`, `detail`


## Area: `workflows`

<a id="area-workflows"></a>

Workflows: statuses and the transitions between them, with their conditions.

### `GET /api/workflows`

**List workflows**

- **Who may:** Anybody signed in

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/workflows' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `[].id` | integer | `1` |
| `[].name` | string | `"Service desk workflow"` |
| `[].description` | string | `"Waiting for support, in progress, waiting for customer, res` |
| `[].isDefault` | boolean | `true` |
| `[].created` | string | `"2026-11-21T21:28:57Z"` |
| `[].projectCount` | integer | `2` |
| `[].statusCount` | integer | `7` |
| `[].transitionCount` | integer | `9` |

<details><summary>Example answer</summary>

```json
[
  {
    "id": 1,
    "name": "Service desk workflow",
    "description": "Waiting for support, in progress, waiting for customer, resolved.",
    "isDefault": true,
    "created": "2026-11-21T21:28:57Z",
    "projectCount": 2,
    "statusCount": 7,
    "transitionCount": 9
  }
]
```

</details>

### `POST /api/workflows`

**Create workflow**

- **Who may:** Administrators
- **JSON body:** `name`, `description`, `copyFrom`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/workflows' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"name": "…", "description": "…", "copyFrom": "…"}'
```

**Returns**

The same as `GET /api/workflows`.

### `GET /api/workflows/{wid}`

**Read workflow**

- **Who may:** Anybody signed in
- **Path parameters:** `wid` (integer)

**Call**

```bash
curl -s -X GET 'http://127.0.0.1:6644/api/workflows/{wid}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

| Field | Type | Example |
|---|---|---|
| `id` | integer | `1` |
| `name` | string | `"Service desk workflow"` |
| `description` | string | `"Waiting for support, in progress, waiting for customer, res` |
| `isDefault` | boolean | `true` |
| `created` | string | `"2026-11-21T21:28:57Z"` |
| `projectCount` | integer | `2` |
| `statuses` | array |  |
| `statuses[].id` | integer | `1` |
| `statuses[].name` | string | `"Waiting for support"` |
| `statuses[].category` | string | `"todo"` |
| `statuses[].position` | integer | `0` |
| `statuses[].initial` | boolean | `true` |
| `statuses[].x` | null | `null` |
| `statuses[].y` | null | `null` |
| `transitions` | array |  |
| `transitions[].id` | integer | `1` |
| `transitions[].name` | string | `"Start work"` |
| `transitions[].description` | string | `""` |
| `transitions[].fromStatusId` | integer | `1` |
| `transitions[].toStatusId` | integer | `2` |
| `transitions[].fromName` | string | `"Waiting for support"` |
| `transitions[].toName` | string | `"In Progress"` |
| `transitions[].rules` | object |  |
| `projects` | array |  |
| `projects[].workflow` | object |  |
| `projects[].id` | integer | `1` |
| `projects[].key` | string | `"ITS"` |
| `projects[].name` | string | `"IT Service Desk"` |
| `projects[].description` | string | `"Internal IT: accounts, devices, access and outages."` |
| `projects[].type` | string | `"service"` |
| `projects[].avatarColor` | string | `"#0052CC"` |
| `projects[].lead` | object |  |
| `projects[].issueCount` | integer | `7` |
| `projects[].doneCount` | integer | `1` |
| `projects[].created` | string | `"2026-08-23T21:28:57Z"` |
| `projects[].iconUrl` | null | `null` |
| `projects[].may` | object |  |
| `ruleCatalogue` | object |  |
| `ruleCatalogue.conditionRoles` | object |  |
| `ruleCatalogue.conditionRoles.assignee` | string | `"The assignee of the issue"` |

<details><summary>Example answer</summary>

```json
{
  "id": 1,
  "name": "Service desk workflow",
  "description": "Waiting for support, in progress, waiting for customer, resolved.",
  "isDefault": true,
  "created": "2026-11-21T21:28:57Z",
  "projectCount": 2,
  "statuses": [
    {
      "id": 1,
      "name": "Waiting for support",
      "category": "todo",
      "position": 0,
      "initial": true,
      "x": null,
      "y": null
    },
    {
      "id": 2,
      "name": "In Progress",
      "category": "inprogress",
      "position": 1,
      "initial": false,
      "x": null,
      "y": null
    },
    "…"
  ],
  "transitions": [
    {
      "id": 1,
      "name": "Start work",
      "description": "",
      "fromStatusId": 1,
      "toStatusId": 2,
      "fromName": "Waiting for support",
      "toName": "In Progress",
      "rules": {
        "conditions": [],
        "validators": [],
        "postFunctions": []
      }
    },
    {
      "id": 2,
      "name": "Ask the customer",
      "description": "",
      "fromStatusId": 2,
      "toStatusId": 3,
      "fromName": "In Progress",
      "toName": "Waiting for customer",
      "rules": {
        "conditions": [],
        "validators": [],
        "postFunctions": []
      }
    },
    "…"
  ],
  "projects": [
    {
      "workflow": {
        "id": 1,
        "name": "Service desk workflow"
      },
      "id": 1,
      "key": "ITS",
      "name": "IT Service Desk",
      "description": "Internal IT: accounts, devices, access and outages.",
      "type": "service",
      "avatarColor": "#0052CC",
      "lead": {
        "id": 1,
        "username": "mkoch",
        "displayName": "Marie Koch",
        "email": "marie.koch@example.invalid",
        "avatarColor": "#0052CC",
        "isAdmin": true,
        "active": true,
        "clockPrompt": false,
    
…
```

</details>

### `PUT /api/workflows/{wid}`

**Change workflow**

- **Who may:** Administrators
- **Path parameters:** `wid` (integer)
- **JSON body:** `name`, `description`, `initialStatusId`, `layout`, `statusIds`, `transitions`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/workflows/{wid}' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"name": "…", "description": "…", "initialStatusId": "…", "layout": "…", "statusIds": "…", "transitions": "…"}'
```

**Returns**

The same as `GET /api/workflows/{wid}`.

### `DELETE /api/workflows/{wid}`

**Delete workflow**

- **Who may:** Administrators
- **Path parameters:** `wid` (integer)

**Call**

```bash
curl -s -X DELETE 'http://127.0.0.1:6644/api/workflows/{wid}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`deleted`

### `POST /api/workflows/{wid}/duplicate`

**Duplicate – workflow**

A copy with the same statuses and transitions, attached to no project.

- **Who may:** Administrators
- **Path parameters:** `wid` (integer)
- **JSON body:** `name`

**Call**

```bash
curl -s -X POST 'http://127.0.0.1:6644/api/workflows/{wid}/duplicate' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"name": "…"}'
```

**Returns**

JSON.


## Area: `worklogs`

<a id="area-worklogs"></a>

Worklogs: changing and deleting. New ones are logged on the issue.

### `PUT /api/worklogs/{wid}`

**Change worklog**

Put a booking right - the time, the day or the note.

One's own always; somebody else's only for an administrator, the same rule
the deletion below follows.

- **Who may:** Anybody signed in
- **Path parameters:** `wid` (integer)
- **JSON body:** `seconds`, `timeSpent`, `started`, `comment`

**Call**

```bash
curl -s -X PUT 'http://127.0.0.1:6644/api/worklogs/{wid}' \
  -H 'Authorization: Bearer $TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"seconds": "…", "timeSpent": "…", "started": "…", "comment": "…"}'
```

**Returns**

`id`, `seconds`, `started`

### `DELETE /api/worklogs/{wid}`

**Delete worklog**

- **Who may:** Anybody signed in
- **Path parameters:** `wid` (integer)

**Call**

```bash
curl -s -X DELETE 'http://127.0.0.1:6644/api/worklogs/{wid}' \
  -H 'Authorization: Bearer $TOKEN'
```

**Returns**

`deleted`

