-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yml
More file actions
1081 lines (1018 loc) · 32.1 KB
/
openapi.yml
File metadata and controls
1081 lines (1018 loc) · 32.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.1.0
info:
title: "@webhouse/cms API"
version: "0.2.9"
description: |
Headless CMS REST API.
**Public endpoints** (content, schema, manifest) are unauthenticated.
**Admin endpoints** require a `cms-session` cookie (JWT) or `X-CMS-Service-Token` header.
### Authentication
- **Session cookie:** Login via `POST /api/auth/login` → sets `cms-session` httpOnly cookie
- **Service token:** Set `X-CMS-Service-Token: {CMS_JWT_SECRET}` header for machine-to-machine calls (heartbeat, cron)
### Field-level AI lock
`_fieldMeta` is not included in standard document responses.
Use the dedicated `/_fieldMeta` endpoints to read and manipulate lock state.
servers:
- url: http://localhost:3000
description: Local dev
- url: "{baseUrl}"
description: Custom
variables:
baseUrl:
default: http://localhost:3000
tags:
- name: Content
description: CRUD operations on documents
- name: FieldMeta
description: Field-level lock and AI-provenance metadata
- name: Schema
description: Collection JSON Schemas (read-only)
- name: Manifest
description: CMS configuration and manifest
- name: Auth
description: Authentication (login, logout, session)
- name: Admin
description: Admin operations (profile, team, config, deploy)
- name: Scheduler
description: Heartbeat, scheduled tasks, calendar feed
- name: Media
description: File upload, media library, serving
- name: AI
description: AI generation, rewriting, agents, curation
- name: MCP
description: Model Context Protocol servers (public + admin)
# ---------------------------------------------------------------------------
# Reusable components
# ---------------------------------------------------------------------------
components:
parameters:
collection:
name: collection
in: path
required: true
schema:
type: string
example: posts
description: Navn på collection som defineret i cms.config.ts
slug:
name: slug
in: path
required: true
schema:
type: string
example: hello-world
description: Dokumentets URL-slug
fieldPath:
name: fieldPath
in: path
required: true
schema:
type: string
example: title
description: Feltnavnet der skal låses/åbnes
status:
name: status
in: query
schema:
$ref: "#/components/schemas/DocumentStatus"
description: Filtrer på status
limit:
name: limit
in: query
schema:
type: integer
minimum: 1
example: 20
description: Maks antal dokumenter i svaret
offset:
name: offset
in: query
schema:
type: integer
minimum: 0
example: 0
description: Antal dokumenter at springe over (pagination)
orderBy:
name: orderBy
in: query
schema:
type: string
example: createdAt
description: Felt at sortere på (createdAt, updatedAt, eller et data-felt)
order:
name: order
in: query
schema:
type: string
enum: [asc, desc]
default: desc
description: Sorteringsretning
tags:
name: tags
in: query
schema:
type: string
example: "typescript,cms"
description: Komma-separeret liste af tags at filtrere på (AND logik)
schemas:
DocumentStatus:
type: string
enum: [draft, published, archived]
FieldMeta:
type: object
description: |
Per-felt metadata. Beskriver om feltet er låst og/eller AI-genereret.
`lockedBy` angiver hvem der låste feltet — er den sat, vil AI-writes blive afvist.
properties:
lockedBy:
type: string
enum: [user, ai, import]
description: Hvem der har låst feltet
lockedAt:
type: string
format: date-time
description: ISO-timestamp for hvornår feltet blev låst
userId:
type: string
description: ID på brugeren der låste feltet (audit trail)
reason:
type: string
description: Human-readable årsag til låsning (f.eks. "user-edit", "import", "manual-lock")
aiGenerated:
type: boolean
description: Om feltets nuværende indhold er AI-genereret
aiGeneratedAt:
type: string
format: date-time
description: ISO-timestamp for hvornår AI genererede indholdet
aiModel:
type: string
description: AI-modellen der genererede indholdet (f.eks. "claude-sonnet-4-6")
DocumentFieldMeta:
type: object
description: Map fra feltnavn til FieldMeta
additionalProperties:
$ref: "#/components/schemas/FieldMeta"
example:
title:
lockedBy: user
lockedAt: "2024-06-01T10:00:00Z"
userId: user-abc
reason: user-edit
aiGenerated: true
aiGeneratedAt: "2024-05-31T09:00:00Z"
aiModel: claude-sonnet-4-6
content:
aiGenerated: true
aiGeneratedAt: "2024-05-31T09:00:00Z"
aiModel: claude-sonnet-4-6
Document:
type: object
required: [id, slug, collection, status, data, createdAt, updatedAt]
properties:
id:
type: string
description: Unik dokument-ID (nanoid)
example: V1StGXR8_Z5jdHi6B-myT
slug:
type: string
description: URL-venligt slug (unikt inden for collection)
example: hello-world
collection:
type: string
example: posts
status:
$ref: "#/components/schemas/DocumentStatus"
data:
type: object
description: Dokumentets felt-data (fri form, defineret af collection-schema)
additionalProperties: true
example:
title: Hello World
content: "# Min første post"
createdAt:
type: string
format: date-time
updatedAt:
type: string
format: date-time
locale:
type: string
description: BCP 47 locale tag (e.g. "en", "da")
example: en
translationOf:
type: string
description: Slug of the source document (for translations)
example: hello-world
publishAt:
type: string
format: date-time
description: Scheduled publish timestamp (ISO)
description: |
`_fieldMeta` returneres **ikke** i dette objekt.
Brug `GET /{collection}/{slug}/_fieldMeta` for at hente det.
DocumentList:
type: object
required: [documents, total]
properties:
documents:
type: array
items:
$ref: "#/components/schemas/Document"
total:
type: integer
description: Samlet antal dokumenter (uanset limit/offset)
CreateDocumentBody:
type: object
required: [data]
properties:
slug:
type: string
description: Valgfrit. Autogenereres fra title-felt hvis udeladt.
status:
$ref: "#/components/schemas/DocumentStatus"
data:
type: object
additionalProperties: true
UpdateDocumentBody:
type: object
properties:
slug:
type: string
status:
$ref: "#/components/schemas/DocumentStatus"
data:
type: object
additionalProperties: true
description: Felter merges med eksisterende data (partial update)
locale:
type: string
description: BCP 47 locale tag
translationOf:
type: string
description: Slug of source document
publishAt:
type: string
format: date-time
description: Schedule publish at this time (null to clear)
LockFieldBody:
type: object
properties:
userId:
type: string
description: ID på den bruger der udfører låsningen (audit trail)
reason:
type: string
description: Årsag til manuel låsning
example: sensitive-copy
LockAllBody:
type: object
properties:
userId:
type: string
description: ID på den bruger der udfører bulk-låsningen
ErrorResponse:
type: object
required: [error]
properties:
error:
type: string
responses:
NotFound:
description: Dokument eller collection ikke fundet
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
BadRequest:
description: Ugyldig input
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
# ---------------------------------------------------------------------------
# Root
# ---------------------------------------------------------------------------
paths:
/:
get:
summary: API info
operationId: getInfo
tags: [Content]
responses:
"200":
description: Navn, version og API-prefix
content:
application/json:
schema:
type: object
properties:
name:
type: string
example: "@webhouse/cms"
version:
type: string
example: "0.1.0"
api:
type: string
example: /api
# ---------------------------------------------------------------------------
# Content
# ---------------------------------------------------------------------------
/api/content/{collection}:
get:
summary: List dokumenter
operationId: listDocuments
tags: [Content]
parameters:
- $ref: "#/components/parameters/collection"
- $ref: "#/components/parameters/status"
- $ref: "#/components/parameters/limit"
- $ref: "#/components/parameters/offset"
- $ref: "#/components/parameters/orderBy"
- $ref: "#/components/parameters/order"
- $ref: "#/components/parameters/tags"
responses:
"200":
description: Pagineret liste af dokumenter (uden _fieldMeta)
content:
application/json:
schema:
$ref: "#/components/schemas/DocumentList"
"404":
$ref: "#/components/responses/NotFound"
post:
summary: Opret dokument
operationId: createDocument
tags: [Content]
parameters:
- $ref: "#/components/parameters/collection"
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/CreateDocumentBody"
responses:
"201":
description: Oprettet dokument (uden _fieldMeta)
content:
application/json:
schema:
$ref: "#/components/schemas/Document"
"400":
$ref: "#/components/responses/BadRequest"
/api/content/{collection}/{slug}:
get:
summary: Hent dokument
operationId: getDocument
tags: [Content]
parameters:
- $ref: "#/components/parameters/collection"
- $ref: "#/components/parameters/slug"
responses:
"200":
description: Dokument (uden _fieldMeta)
content:
application/json:
schema:
$ref: "#/components/schemas/Document"
"404":
$ref: "#/components/responses/NotFound"
put:
summary: Opdater dokument
operationId: updateDocument
tags: [Content]
description: |
Felter i `data` merges med eksisterende data (shallow merge).
Felter der er låst af en bruger vil **ikke** blive overskrevet —
kaldet sker med `actor: user`, så eksisterende user-locks respekteres ikke her.
Brug `/_fieldMeta`-endpoints til at styre locks manuelt.
parameters:
- $ref: "#/components/parameters/collection"
- $ref: "#/components/parameters/slug"
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/UpdateDocumentBody"
responses:
"200":
description: Opdateret dokument (uden _fieldMeta)
content:
application/json:
schema:
$ref: "#/components/schemas/Document"
"400":
$ref: "#/components/responses/BadRequest"
"404":
$ref: "#/components/responses/NotFound"
delete:
summary: Slet dokument
operationId: deleteDocument
tags: [Content]
parameters:
- $ref: "#/components/parameters/collection"
- $ref: "#/components/parameters/slug"
responses:
"200":
description: Slettet
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
"400":
$ref: "#/components/responses/BadRequest"
"404":
$ref: "#/components/responses/NotFound"
# ---------------------------------------------------------------------------
# FieldMeta
# ---------------------------------------------------------------------------
/api/content/{collection}/{slug}/_fieldMeta:
get:
summary: Hent field metadata
operationId: getFieldMeta
tags: [FieldMeta]
description: |
Returnerer `_fieldMeta` for dokumentet: lock-state og AI-provenance pr. felt.
Denne information er stripet fra alle standard GET-responses.
parameters:
- $ref: "#/components/parameters/collection"
- $ref: "#/components/parameters/slug"
responses:
"200":
description: Field metadata map
content:
application/json:
schema:
$ref: "#/components/schemas/DocumentFieldMeta"
"404":
$ref: "#/components/responses/NotFound"
/api/content/{collection}/{slug}/_fieldMeta/lock-all:
put:
summary: Lås alle AI-genererede felter
operationId: lockAllFields
tags: [FieldMeta]
description: Sætter `lockedBy: user` på alle felter der har `aiGenerated: true`.
parameters:
- $ref: "#/components/parameters/collection"
- $ref: "#/components/parameters/slug"
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/LockAllBody"
responses:
"200":
description: Opdateret field metadata map
content:
application/json:
schema:
$ref: "#/components/schemas/DocumentFieldMeta"
"400":
$ref: "#/components/responses/BadRequest"
"404":
$ref: "#/components/responses/NotFound"
/api/content/{collection}/{slug}/_fieldMeta/unlock-all:
put:
summary: Fjern alle locks
operationId: unlockAllFields
tags: [FieldMeta]
description: Fjerner `lockedBy`, `lockedAt`, `userId` og `reason` fra alle felter. AI-genererings-metadata bevares.
parameters:
- $ref: "#/components/parameters/collection"
- $ref: "#/components/parameters/slug"
responses:
"200":
description: Opdateret field metadata map
content:
application/json:
schema:
$ref: "#/components/schemas/DocumentFieldMeta"
"400":
$ref: "#/components/responses/BadRequest"
"404":
$ref: "#/components/responses/NotFound"
/api/content/{collection}/{slug}/_fieldMeta/{fieldPath}/lock:
put:
summary: Lås enkelt felt manuelt
operationId: lockField
tags: [FieldMeta]
description: |
Sætter `lockedBy: user` på det angivne felt.
Fremtidige AI-writes til dette felt vil blive afvist.
parameters:
- $ref: "#/components/parameters/collection"
- $ref: "#/components/parameters/slug"
- $ref: "#/components/parameters/fieldPath"
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/LockFieldBody"
responses:
"200":
description: Opdateret FieldMeta for det låste felt
content:
application/json:
schema:
$ref: "#/components/schemas/FieldMeta"
"400":
$ref: "#/components/responses/BadRequest"
"404":
$ref: "#/components/responses/NotFound"
/api/content/{collection}/{slug}/_fieldMeta/{fieldPath}/unlock:
put:
summary: Fjern lock fra enkelt felt
operationId: unlockField
tags: [FieldMeta]
description: |
Fjerner `lockedBy`, `lockedAt`, `userId` og `reason` fra feltet.
AI-genererings-metadata (`aiGenerated`, `aiModel` osv.) bevares intakt.
parameters:
- $ref: "#/components/parameters/collection"
- $ref: "#/components/parameters/slug"
- $ref: "#/components/parameters/fieldPath"
responses:
"200":
description: Opdateret FieldMeta for det åbnede felt
content:
application/json:
schema:
$ref: "#/components/schemas/FieldMeta"
"400":
$ref: "#/components/responses/BadRequest"
"404":
$ref: "#/components/responses/NotFound"
# ---------------------------------------------------------------------------
# Schema
# ---------------------------------------------------------------------------
/api/schema:
get:
summary: Hent alle collection-schemas
operationId: listSchemas
tags: [Schema]
responses:
"200":
description: Alle collections med JSON Schema
content:
application/json:
schema:
type: object
properties:
collections:
type: array
items:
type: object
properties:
name:
type: string
label:
type: string
slug:
type: string
jsonSchema:
type: object
description: JSON Schema for collectionens data-felter
blocks:
type: array
items:
type: object
/api/schema/{collection}:
get:
summary: Hent schema for én collection
operationId: getSchema
tags: [Schema]
parameters:
- $ref: "#/components/parameters/collection"
responses:
"200":
description: Collection med JSON Schema
content:
application/json:
schema:
type: object
properties:
name:
type: string
label:
type: string
jsonSchema:
type: object
"404":
$ref: "#/components/responses/NotFound"
# ---------------------------------------------------------------------------
# Manifest
# ---------------------------------------------------------------------------
/api/manifest:
get:
summary: Get CMS manifest
operationId: getManifest
tags: [Manifest]
description: Returns full CMS configuration (collections, build config, storage type, etc.)
responses:
"200":
description: CMS manifest
content:
application/json:
schema:
type: object
description: Serialized CmsConfig
# ---------------------------------------------------------------------------
# Auth
# ---------------------------------------------------------------------------
/api/auth/login:
post:
summary: Log in
operationId: login
tags: [Auth]
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [email, password]
properties:
email: { type: string, example: "admin@example.com" }
password: { type: string, example: "my-password" }
responses:
"200":
description: Login successful — sets cms-session cookie
content:
application/json:
schema:
type: object
properties:
ok: { type: boolean }
email: { type: string }
name: { type: string }
"401":
description: Invalid credentials
/api/auth/logout:
post:
summary: Log out
operationId: logout
tags: [Auth]
responses:
"200":
description: Session cookie cleared
/api/auth/me:
get:
summary: Get current user
operationId: getMe
tags: [Auth]
responses:
"200":
description: Authenticated user profile (or user: null)
content:
application/json:
schema:
type: object
properties:
user:
type: object
nullable: true
properties:
id: { type: string }
email: { type: string }
name: { type: string }
role: { type: string, enum: [admin, editor, viewer] }
siteRole: { type: string, nullable: true }
zoom: { type: integer }
/api/auth/setup:
get:
summary: Check if initial setup is needed
operationId: checkSetup
tags: [Auth]
responses:
"200":
content:
application/json:
schema:
type: object
properties:
hasUsers: { type: boolean }
post:
summary: Create first admin account
operationId: setupAdmin
tags: [Auth]
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [email, password, name]
properties:
email: { type: string }
password: { type: string, minLength: 8 }
name: { type: string }
responses:
"200":
description: Account created — sets cms-session cookie
"403":
description: Setup already complete
# ---------------------------------------------------------------------------
# Scheduler & Heartbeat
# ---------------------------------------------------------------------------
/api/cms/heartbeat:
get:
summary: Run all pending scheduled tasks
operationId: heartbeat
tags: [Scheduler]
description: |
Executes all pending scheduled tasks immediately:
1. Publish/unpublish documents past their scheduled date
2. Run due AI agents
3. Run tools scheduler (backup, link check)
4. Update calendar snapshot
Designed to be called by an external cron (macOS crontab, GitHub Actions,
or any uptime monitor) to keep scheduled tasks running even when the
CMS admin has no interactive traffic.
**Auth:** Requires `X-CMS-Service-Token` header matching `CMS_JWT_SECRET`.
responses:
"200":
description: Tasks executed
content:
application/json:
schema:
type: object
properties:
ok: { type: boolean }
durationMs: { type: integer, example: 1234 }
ran:
type: array
items: { type: string }
example: ["published: 2 doc(s)", "backup: completed", "snapshot: updated"]
errors:
type: array
items: { type: string }
timestamp: { type: string, format: date-time }
"401":
description: Missing or invalid service token
/api/cms/scheduled/calendar.ics:
get:
summary: iCalendar feed of scheduled events
operationId: calendarFeed
tags: [Scheduler]
description: |
Returns an iCalendar (.ics) feed with all scheduled publish/unpublish events,
upcoming backups, and link checks. Subscribe from Apple Calendar, Google Calendar, etc.
**Auth:** Token-based via `?token=` query parameter (HMAC of user ID).
parameters:
- name: token
in: query
required: true
schema: { type: string }
description: HMAC token for calendar access
- name: org
in: query
schema: { type: string }
description: Organization ID
- name: site
in: query
schema: { type: string }
description: Site ID
responses:
"200":
description: iCalendar feed
content:
text/calendar:
schema:
type: string
"401":
description: Invalid token
# ---------------------------------------------------------------------------
# Media
# ---------------------------------------------------------------------------
/api/upload:
post:
summary: Upload file
operationId: uploadFile
tags: [Media]
description: Upload a file to the media library. Supports images, audio, documents, SVG.
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
properties:
file:
type: string
format: binary
folder:
type: string
description: Target folder (e.g. "images", "audio")
responses:
"200":
description: Upload successful
content:
application/json:
schema:
type: object
properties:
url: { type: string, example: "/uploads/images/photo.jpg" }
filename: { type: string }
size: { type: integer }
/api/media:
get:
summary: List media files
operationId: listMedia
tags: [Media]
responses:
"200":
description: All media files with metadata
content:
application/json:
schema:
type: object
properties:
files:
type: array
items:
type: object
properties:
name: { type: string }
url: { type: string }
folder: { type: string }
size: { type: integer }
type: { type: string, enum: [image, audio, document, svg] }
# ---------------------------------------------------------------------------
# AI Agents
# ---------------------------------------------------------------------------
/api/cms/agents:
get:
summary: List AI agents
operationId: listAgents
tags: [AI]
responses:
"200":
description: All agent configurations
post:
summary: Create AI agent
operationId: createAgent
tags: [AI]
responses:
"201":
description: Agent created
/api/cms/agents/{id}/run:
post:
summary: Run AI agent
operationId: runAgent
tags: [AI]
description: Execute an agent with a prompt. Results go to curation queue or publish directly based on autonomy setting.
parameters:
- name: id
in: path
required: true
schema: { type: string }
requestBody:
content:
application/json:
schema:
type: object
properties:
prompt: { type: string }
collection: { type: string }
responses:
"200":
description: Agent execution result
# ---------------------------------------------------------------------------
# Curation
# ---------------------------------------------------------------------------
/api/cms/curation:
get:
summary: List curation queue
operationId: listCuration
tags: [AI]
description: AI-generated content waiting for human review.
parameters:
- name: stats
in: query
schema: { type: boolean }
description: Include queue statistics
responses:
"200":
description: Queue items
/api/cms/curation/{id}/approve:
post:
summary: Approve curation item
operationId: approveCuration
tags: [AI]
parameters:
- name: id
in: path
required: true
schema: { type: string }
responses:
"200":
description: Item approved and published/drafted
/api/cms/curation/{id}/reject:
post:
summary: Reject curation item
operationId: rejectCuration
tags: [AI]
parameters:
- name: id
in: path
required: true
schema: { type: string }
responses:
"200":
description: Item rejected
# ---------------------------------------------------------------------------
# Admin
# ---------------------------------------------------------------------------
/api/admin/profile:
post:
summary: Update user profile
operationId: updateProfile
tags: [Admin]
description: Update name, email, password, zoom, or last active site.
requestBody:
content:
application/json:
schema:
type: object
properties: