Files
zkldi_Tachi/old-docs/docs/api/routes/user-integrations.md
T
zk e363bd2532 docs: migrate from mkdocs to mdbook (#1558)
* docs: migrate from mkdocs to mdbook

- Rename old mkdocs docs/ to old-docs/ for reference
- Set up new docs/ with mdbook (book.toml + src/ tree)
- Mirror full nav structure from mkdocs.yml into SUMMARY.md
- Add Justfile-docs with docs-serve, docs-build, docs-check, docs-install recipes
- Import Justfile-docs from root Justfile
- Rewrite .github/workflows/docs.yml: build step uses taiki-e/install-action
  to install mdbook, split into separate build + deploy jobs, PR builds
  run the check step too

* ci(docs): pin actions to SHAs, install mdbook via release binary

* ci(docs): install mdbook from apt instead of curling a release binary

* dev: replace mkdocs python stack with mdbook in dev image

* ci(docs): apt only works on Debian; restore release binary install for Ubuntu CI

* docs: fix duplicate file entries in SUMMARY.md

* docs: remove docs-install recipe

* docs: remove site-url from book.toml to fix asset loading

* dev: install mdbook from upstream release binary, not Debian apt

The Debian package (0.4.x+ds) strips bundled font assets, leaving the
built site without fonts/fonts.css. Use the upstream tarball (same as CI)
so the theme is complete. Handles x86_64 and aarch64.

* docs: vendor mdbook tarballs in dev/mdbook/, install from there

Dockerfile.dev uses COPY + tar to install the right arch at build time.
CI extracts the x86_64 tarball directly from the checkout.
No network access required for either — and no stripped-fonts Debian package.

* fix: unwritten
2026-05-22 20:43:07 +01:00

111 lines
2.2 KiB
Markdown

# User Integrations
These endpoints are related to a users integrations with external services.
*****
## Retrieve whether this user is authenticated with this kaiType.
`GET /api/v1/users/:userID/integrations/kai/:kaiType`
**Kamaitachi Only**
!!! note
A KaiType is either "flo", "min", or "eag". Since these three services
share backends, they all use the same authentication mechanisms, and share
endpoints like this.
### Permissions
- Self-key: This request must be made using Cookie authentication, which means it cannot be used with API keys.
### Response
| Property | Type | Description |
| :: | :: | :: |
| `authStatus` | boolean | True if the user is authenticated with this kaiType, false if they are not. |
### Example
#### Request
```
GET /api/v1/users/1/integrations/kai/flo
```
#### Response
```js
{
authStatus: false
}
```
*****
## Revoke this user's authentication with this kaiType
`DELETE /api/v1/users/:userID/integrations/kai/:kaiType`
**Kamaitachi Only**
!!! note
A KaiType is either "flo", "min", or "eag". Since these three services
share backends, they all use the same authentication mechanisms, and share
endpoints like this.
### Permissions
- Self-key: This request must be made using Cookie authentication, which means it cannot be used with API keys.
### Parameters
None.
### Response
Empty Object.
*****
## Update a user's access_token and refresh_token from an intermediate code.
`POST /api/v1/users/:userID/integrations/kai/:kaiType/oauth2callback`
**Kamaitachi Only**
!!! info
This is used as part of an [OAuth2 Flow](https://www.digitalocean.com/community/tutorials/an-introduction-to-oauth-2).
The client controls the callback link after authentication with the service, and then POSTs the returned `code` to us.
This part of the flow actually updates the user.
### Permissions
- Self-key
### Parameters
| Property | Type | Description |
| :: | :: | :: |
| `code` | String | The intermediate code to use to get the access_token and refresh_token. |
### Response
Empty object for body. 200 on success, not 200 on failure - status code depending on error.
### Example
#### Request
```js
{
code: "This_Is_An_1nT3rMeDIate_Code"
}
```
#### Response
```js
{}
```