pinakes/docs/api/notes.md
NotAShelf 934691c0f9
docs: auto-generate API route documentation
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Id0d1f9769b7ccdbf83d5fa78adef62e46a6a6964
2026-03-22 22:04:52 +03:00

142 lines
2.5 KiB
Markdown

# Notes
Markdown notes link graph
## Endpoints
### GET /api/v1/media/{id}/backlinks
Get backlinks (incoming links) to a media item.
GET /api/v1/media/{id}/backlinks
**Authentication:** Required (Bearer JWT)
#### Parameters
| Name | In | Required | Description |
|------|----|----------|-------------|
| `id` | path | Yes | Media item ID |
#### Responses
| Status | Description |
|--------|-------------|
| 200 | Backlinks |
| 401 | Unauthorized |
| 404 | Not found |
| 500 | Internal server error |
---
### GET /api/v1/media/{id}/outgoing-links
Get outgoing links from a media item.
GET /api/v1/media/{id}/outgoing-links
**Authentication:** Required (Bearer JWT)
#### Parameters
| Name | In | Required | Description |
|------|----|----------|-------------|
| `id` | path | Yes | Media item ID |
#### Responses
| Status | Description |
|--------|-------------|
| 200 | Outgoing links |
| 401 | Unauthorized |
| 404 | Not found |
| 500 | Internal server error |
---
### POST /api/v1/media/{id}/reindex-links
Re-extract links from a media item.
POST /api/v1/media/{id}/reindex-links
**Authentication:** Required (Bearer JWT)
#### Parameters
| Name | In | Required | Description |
|------|----|----------|-------------|
| `id` | path | Yes | Media item ID |
#### Responses
| Status | Description |
|--------|-------------|
| 200 | Links reindexed |
| 401 | Unauthorized |
| 404 | Not found |
| 500 | Internal server error |
---
### GET /api/v1/notes/graph
Get graph data for visualization.
GET /api/v1/notes/graph?center={uuid}&depth={n}
**Authentication:** Required (Bearer JWT)
#### Parameters
| Name | In | Required | Description |
|------|----|----------|-------------|
| `center` | query | No | Center node ID |
| `depth` | query | No | Traversal depth (max 5, default 2) |
#### Responses
| Status | Description |
|--------|-------------|
| 200 | Graph data |
| 401 | Unauthorized |
| 500 | Internal server error |
---
### POST /api/v1/notes/resolve-links
Resolve all unresolved links in the database.
POST /api/v1/notes/resolve-links
**Authentication:** Required (Bearer JWT)
#### Responses
| Status | Description |
|--------|-------------|
| 200 | Links resolved |
| 401 | Unauthorized |
| 500 | Internal server error |
---
### GET /api/v1/notes/unresolved-count
Get count of unresolved links.
GET /api/v1/notes/unresolved-count
**Authentication:** Required (Bearer JWT)
#### Responses
| Status | Description |
|--------|-------------|
| 200 | Unresolved link count |
| 401 | Unauthorized |
| 500 | Internal server error |
---