-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yaml
More file actions
2515 lines (2410 loc) · 67.1 KB
/
openapi.yaml
File metadata and controls
2515 lines (2410 loc) · 67.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: Numen AI-First Headless CMS API
version: 1.0.0
description: |
REST API for the Numen AI-First Headless CMS by byte5.
## Authentication
Authenticated endpoints require a Bearer token issued via Sanctum.
Include it as: `Authorization: Bearer <token>`
## Rate Limiting
Rate limit headers are included in all throttled responses:
- `X-RateLimit-Limit` — maximum requests per window
- `X-RateLimit-Remaining` — requests remaining in current window
- `Retry-After` — seconds until window resets (only on 429)
| Endpoint group | Limit |
|---------------------------|---------------|
| Content delivery (GET) | 60 req/min |
| Pages (GET) | 60 req/min |
| Component types (GET) | 30 req/min |
| Briefs POST | 10 req/min |
servers:
- url: /api/v1
description: Current API version
components:
securitySchemes:
sanctumToken:
type: http
scheme: bearer
description: Sanctum personal access token
schemas:
Error:
type: object
properties:
error:
type: string
example: Page not found
required: [error]
ValidationError:
type: object
properties:
message:
type: string
example: The given data was invalid.
errors:
type: object
additionalProperties:
type: array
items:
type: string
example:
title: ["The title field is required."]
PaginationLinks:
type: object
properties:
first:
type: string
example: /api/v1/content?page=1
last:
type: string
example: /api/v1/content?page=5
prev:
type: string
nullable: true
next:
type: string
nullable: true
PaginationMeta:
type: object
properties:
current_page:
type: integer
example: 1
from:
type: integer
example: 1
last_page:
type: integer
example: 5
per_page:
type: integer
example: 20
to:
type: integer
example: 20
total:
type: integer
example: 87
ContentItem:
type: object
properties:
id:
type: string
format: uuid
slug:
type: string
example: my-blog-post
status:
type: string
enum: [draft, published, archived]
example: published
locale:
type: string
example: en
published_at:
type: string
format: date-time
nullable: true
title:
type: string
example: My Blog Post
excerpt:
type: string
nullable: true
example: A short summary of the article.
body:
type: object
description: Structured content body (JSON)
nullable: true
seo_score:
type: number
format: float
nullable: true
example: 82.5
content_type:
type: object
nullable: true
properties:
slug:
type: string
example: blog_post
label:
type: string
example: Blog Post
media_assets:
type: array
items:
type: object
properties:
id:
type: string
format: uuid
url:
type: string
alt:
type: string
nullable: true
created_at:
type: string
format: date-time
updated_at:
type: string
format: date-time
PageComponent:
type: object
properties:
id:
type: string
format: uuid
type:
type: string
example: hero_banner
sort_order:
type: integer
example: 1
data:
type: object
description: Component-specific field data
example:
heading: Welcome to Numen
subheading: AI-powered content at your fingertips
wysiwyg_override:
type: string
nullable: true
description: Raw HTML override for WYSIWYG editing
ai_generated:
type: boolean
example: true
PageSummary:
type: object
properties:
id:
type: string
format: uuid
slug:
type: string
example: homepage
title:
type: string
example: Home
meta:
type: object
nullable: true
example:
description: Welcome to our site
og_image: /images/og.png
updated_at:
type: string
format: date-time
PageDetail:
allOf:
- $ref: '#/components/schemas/PageSummary'
- type: object
properties:
components:
type: array
items:
$ref: '#/components/schemas/PageComponent'
ComponentDefinition:
type: object
properties:
type:
type: string
example: hero_banner
label:
type: string
example: Hero Banner
description:
type: string
nullable: true
example: Full-width hero section with heading and CTA
schema:
type: object
description: Field definitions — keys are field names, values are field types
example:
heading: string
subheading: string
cta_label: string
cta_url: string
image_url: string
vue_template:
type: string
nullable: true
description: Raw HTML/Vue template with {{ field }} interpolations
is_builtin:
type: boolean
example: false
created_by:
type: string
enum: [system, human, ai_agent]
example: ai_agent
Brief:
type: object
properties:
id:
type: string
format: uuid
space_id:
type: string
format: uuid
title:
type: string
example: Q1 Product Launch Blog Post
description:
type: string
nullable: true
content_type_slug:
type: string
example: blog_post
target_keywords:
type: array
items:
type: string
nullable: true
example: [headless CMS, AI content]
requirements:
type: array
items:
type: string
nullable: true
reference_urls:
type: array
items:
type: string
nullable: true
target_locale:
type: string
example: en
nullable: true
persona_id:
type: string
format: uuid
nullable: true
priority:
type: string
enum: [low, normal, high, urgent]
example: normal
nullable: true
status:
type: string
enum: [pending, processing, completed, failed]
example: pending
source:
type: string
example: manual
pipeline_run:
type: object
nullable: true
created_at:
type: string
format: date-time
updated_at:
type: string
format: date-time
PipelineRun:
type: object
properties:
id:
type: string
format: uuid
status:
type: string
enum: [pending, running, paused_for_review, completed, failed]
example: running
current_stage:
type: string
example: seo_optimization
brief:
type: object
nullable: true
content:
type: object
nullable: true
generation_logs:
type: array
items:
type: object
properties:
id:
type: string
format: uuid
model:
type: string
example: claude-sonnet-4-6
purpose:
type: string
example: content_generation
input_tokens:
type: integer
output_tokens:
type: integer
cost_usd:
type: number
format: float
created_at:
type: string
format: date-time
updated_at:
type: string
format: date-time
Persona:
type: object
properties:
id:
type: string
format: uuid
name:
type: string
example: Tech Enthusiast
description:
type: string
nullable: true
tone:
type: string
nullable: true
example: Informative and enthusiastic
is_active:
type: boolean
example: true
created_at:
type: string
format: date-time
AnalyticsCostRow:
type: object
properties:
date:
type: string
format: date
example: "2026-03-06"
model:
type: string
example: claude-sonnet-4-6
purpose:
type: string
example: content_generation
calls:
type: integer
example: 42
total_input_tokens:
type: integer
example: 125000
total_output_tokens:
type: integer
example: 48000
total_cost:
type: number
format: float
example: 0.87
Webhook:
type: object
properties:
id:
type: string
format: ulid
space_id:
type: string
format: uuid
url:
type: string
format: uri
events:
type: array
items:
type: string
example: [content.published, pipeline.completed]
is_active:
type: boolean
secret:
type: string
description: Only returned on creation/rotation. Store securely.
headers:
type: object
nullable: true
batch_mode:
type: boolean
batch_timeout:
type: integer
created_at:
type: string
format: date-time
updated_at:
type: string
format: date-time
WebhookDelivery:
type: object
properties:
id:
type: string
format: ulid
webhook_id:
type: string
format: ulid
event_id:
type: string
event_type:
type: string
example: content.published
payload_hash:
type: string
status:
type: string
enum: [pending, delivered, abandoned]
http_status:
type: integer
nullable: true
response_body:
type: string
nullable: true
description: First 4KB of HTTP response
attempt_number:
type: integer
scheduled_at:
type: string
format: date-time
delivered_at:
type: string
format: date-time
nullable: true
created_at:
type: string
format: date-time
MediaAsset:
type: object
properties:
id:
type: string
example: asset-uuid-123
filename:
type: string
example: hero-image.jpg
mime_type:
type: string
example: image/jpeg
size_bytes:
type: integer
example: 524288
width:
type: integer
example: 1920
height:
type: integer
example: 1080
title:
type: string
description:
type: string
alt_text:
type: string
tags:
type: array
items:
type: string
url:
type: string
format: uri
folder_id:
type: string
nullable: true
created_at:
type: string
format: date-time
updated_at:
type: string
format: date-time
required:
- id
- filename
- mime_type
- size_bytes
- url
MediaFolder:
type: object
properties:
id:
type: string
name:
type: string
parent_id:
type: string
nullable: true
asset_count:
type: integer
created_at:
type: string
format: date-time
updated_at:
type: string
format: date-time
MediaCollection:
type: object
properties:
id:
type: string
name:
type: string
description:
type: string
type:
type: string
enum: [manual, smart]
rules:
type: object
nullable: true
items:
type: array
items:
$ref: '#/components/schemas/MediaAsset'
item_count:
type: integer
created_at:
type: string
format: date-time
paths:
# ─── Content Delivery (Public, 60 req/min) ────────────────────────────────
/content:
get:
operationId: listContent
summary: List published content
description: Returns paginated published content. No authentication required.
tags: [Content]
parameters:
- name: locale
in: query
schema:
type: string
example: en
description: Filter by locale
- name: type
in: query
schema:
type: string
example: blog_post
description: Filter by content type slug
- name: tag
in: query
schema:
type: string
example: ai,cms
description: Comma-separated tags to filter by (AND logic)
- name: sort
in: query
schema:
type: string
default: -published_at
enum: [published_at, -published_at, created_at, -created_at, updated_at, -updated_at, title, -title]
description: Sort column. Prefix with `-` for descending order.
- name: per_page
in: query
schema:
type: integer
minimum: 1
maximum: 100
default: 20
responses:
'200':
description: Paginated list of published content
headers:
X-RateLimit-Limit:
schema:
type: integer
description: Requests allowed per minute
X-RateLimit-Remaining:
schema:
type: integer
description: Requests remaining in current window
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/ContentItem'
links:
$ref: '#/components/schemas/PaginationLinks'
meta:
$ref: '#/components/schemas/PaginationMeta'
example:
data:
- id: "018e1234-5678-7abc-def0-123456789abc"
slug: my-blog-post
status: published
locale: en
published_at: "2026-03-01T10:00:00Z"
title: My Blog Post
excerpt: A short summary.
seo_score: 82.5
content_type:
slug: blog_post
label: Blog Post
media_assets: []
meta:
current_page: 1
last_page: 5
per_page: 20
total: 87
'429':
description: Rate limit exceeded
headers:
Retry-After:
schema:
type: integer
/content/{slug}:
get:
operationId: getContent
summary: Get content by slug
description: Returns a single published content item. No authentication required.
tags: [Content]
parameters:
- name: slug
in: path
required: true
schema:
type: string
example: my-blog-post
- name: locale
in: query
schema:
type: string
default: en
responses:
'200':
description: Content item
content:
application/json:
schema:
type: object
properties:
data:
$ref: '#/components/schemas/ContentItem'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'429':
description: Rate limit exceeded
/content/type/{type}:
get:
operationId: listContentByType
summary: List content by type
description: Returns paginated published content filtered by content type slug. No authentication required.
tags: [Content]
parameters:
- name: type
in: path
required: true
schema:
type: string
example: blog_post
- name: per_page
in: query
schema:
type: integer
minimum: 1
maximum: 100
default: 20
responses:
'200':
description: Paginated list of content of the given type
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/ContentItem'
links:
$ref: '#/components/schemas/PaginationLinks'
meta:
$ref: '#/components/schemas/PaginationMeta'
'429':
description: Rate limit exceeded
# ─── Pages (Public, 60 req/min) ───────────────────────────────────────────
/pages:
get:
operationId: listPages
summary: List published pages
description: Returns all published pages (summary view, no components). No authentication required.
tags: [Pages]
responses:
'200':
description: List of published pages
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/PageSummary'
example:
data:
- id: "018e1234-5678-7abc-def0-000000000001"
slug: homepage
title: Home
meta:
description: Welcome to Numen
updated_at: "2026-03-01T09:00:00Z"
'429':
description: Rate limit exceeded
/pages/{slug}:
get:
operationId: getPage
summary: Get page by slug
description: |
Returns a page with all its components. Dynamic data is injected at request time:
- `stats_row` components receive live database statistics
- `content_list` components receive recent published content
No authentication required.
tags: [Pages]
parameters:
- name: slug
in: path
required: true
schema:
type: string
example: homepage
responses:
'200':
description: Page with components
content:
application/json:
schema:
type: object
properties:
data:
$ref: '#/components/schemas/PageDetail'
example:
data:
slug: homepage
title: Home
meta:
description: Welcome to Numen
components:
- id: "018e1234-0001-0001-0001-000000000001"
type: hero_banner
sort_order: 1
data:
heading: AI-Powered Content
subheading: Built for developers
wysiwyg_override: null
ai_generated: true
'404':
description: Page not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'429':
description: Rate limit exceeded
# ─── Component Types (Public GET 30 req/min, Auth POST/PUT) ───────────────
/component-types:
get:
operationId: listComponentTypes
summary: List all component types
description: Returns all available component types — builtin and custom. No authentication required.
tags: [Component Types]
responses:
'200':
description: List of component type definitions
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/ComponentDefinition'
example:
data:
- type: hero_banner
label: Hero Banner
description: Full-width hero with heading and CTA
schema:
heading: string
subheading: string
cta_label: string
cta_url: string
vue_template: null
is_builtin: true
created_by: system
'429':
description: Rate limit exceeded
post:
operationId: createComponentType
summary: Register a new component type
description: |
Allows AI agents or admins to register a brand-new component type at runtime.
The type becomes immediately available for use in pages and content blocks.
**Authentication required.**
tags: [Component Types]
security:
- sanctumToken: []
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [type, label, schema]
properties:
type:
type: string
pattern: '^[a-z][a-z0-9_]*$'
example: pricing_table
description: Unique snake_case identifier
label:
type: string
maxLength: 120
example: Pricing Table
description:
type: string
nullable: true
example: A table comparing pricing tiers
schema:
type: object
description: Field definitions — keys are field names, values are field type strings
example:
title: string
tiers: array
vue_template:
type: string
nullable: true
description: Vue/HTML template with {{ field }} interpolations
created_by:
type: string
enum: [human, ai_agent]
default: ai_agent
responses:
'201':
description: Component type created
content:
application/json:
schema:
type: object
properties:
data:
$ref: '#/components/schemas/ComponentDefinition'
'401':
description: Unauthenticated
'422':
description: Validation error
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'
/component-types/{type}:
get:
operationId: getComponentType
summary: Get a single component type
description: Returns the definition for a specific component type (builtin or custom). No authentication required.
tags: [Component Types]
parameters:
- name: type
in: path
required: true
schema:
type: string
example: hero_banner
responses:
'200':
description: Component type definition
content:
application/json:
schema:
type: object
properties:
data:
$ref: '#/components/schemas/ComponentDefinition'
'404':
description: Component type not found
'429':
description: Rate limit exceeded
put:
operationId: updateComponentType
summary: Update a custom component type
description: |
Update the label, description, schema, or template of an existing custom component type.
Builtin types cannot be modified.
**Authentication required.**
tags: [Component Types]
security:
- sanctumToken: []
parameters:
- name: type
in: path
required: true
schema:
type: string
example: pricing_table
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
label:
type: string
maxLength: 120
description:
type: string
nullable: true
schema:
type: object
vue_template: