forked from Fluxora-Org/Fluxora-Backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yaml
More file actions
1181 lines (1137 loc) · 36.4 KB
/
Copy pathopenapi.yaml
File metadata and controls
1181 lines (1137 loc) · 36.4 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: Fluxora HTTP API
version: 0.1.0
description: |
Fluxora Backend: Off-chain companion to the streaming contract.
Presents operator-grade reliability with predictable HTTP semantics, durable views of chain-derived data,
and explicit failure behavior when dependencies are unhealthy.
## Security Header Baseline
Fluxora applies Helmet at the Express boundary so every HTTP response carries a consistent
browser-facing security-header baseline, including `Content-Security-Policy`,
`Strict-Transport-Security`, `X-Content-Type-Options`, `X-Frame-Options`, and
`Referrer-Policy`. The service also suppresses the `X-Powered-By` header.
These headers are transport invariants for public clients, authenticated partners,
administrators, and internal workers that traverse the HTTP surface. They do not replace
authentication, authorization, TLS termination, or proxy hardening.
## Trust Boundaries
- **Public Internet Clients**: Read-only access to stream listings and health checks
- **Authenticated Partners**: Create and manage streams with idempotency guarantees
- **Administrators**: Full access including internal indexer endpoints
- **Internal Workers**: Indexer endpoints for chain state synchronization
## Failure Modes & Client-Visible Behavior
- **Invalid Input (400)**: Malformed addresses, negative amounts, oversized payloads
- **Unauthorized (401)**: Missing or invalid authentication token
- **Forbidden (403)**: Insufficient permissions for the requested operation
- **Conflict (409)**: Duplicate submission detected (idempotency key collision)
- **Payload Too Large (413)**: Request exceeds 256 KiB limit
- **Service Unavailable (503)**: Dependency outage (database, Stellar RPC, workers)
- **Internal Server Error (500)**: Unexpected error; check logs with requestId
contact:
name: Fluxora Team
license:
name: MIT
servers:
- url: http://localhost:3000
description: Local development
- url: https://api.fluxora.example.com
description: Production
paths:
/:
get:
summary: API root information
operationId: getRoot
tags:
- System
responses:
'200':
description: API metadata
content:
application/json:
schema:
$ref: '#/components/schemas/RootResponse'
/health:
get:
summary: Health check endpoint
operationId: getHealth
tags:
- System
description: |
Returns the health status of the service and its dependencies.
Used by load balancers and monitoring systems.
Returns 503 during graceful shutdown.
responses:
'200':
description: Service is healthy or degraded
content:
application/json:
schema:
$ref: '#/components/schemas/HealthResponse'
'503':
description: Service is shutting down
content:
application/json:
schema:
$ref: '#/components/schemas/HealthResponse'
/health/ready:
get:
summary: Readiness probe
operationId: getHealthReady
tags:
- System
description: |
Returns 200 if all dependencies are healthy and service is ready to accept traffic.
Returns 503 if any dependency is unhealthy or service is shutting down.
responses:
'200':
description: Service is ready
content:
application/json:
schema:
$ref: '#/components/schemas/ReadinessResponse'
'503':
description: Service is not ready
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/health/live:
get:
summary: Liveness probe
operationId: getHealthLive
tags:
- System
description: |
Returns detailed health report for all dependencies.
responses:
'200':
description: Detailed health report
content:
application/json:
schema:
$ref: '#/components/schemas/LivenessResponse'
'500':
description: Failed to get health report
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/api/admin/status/read-only:
get:
summary: Read-only admin feature-flag status
operationId: getAdminStatusReadOnly
tags:
- Admin
description: |
Returns non-sensitive operational pause flags without requiring
admin credentials. This endpoint is read-only and does not expose
reindex internals or mutation capabilities.
responses:
'200':
description: Current pause-flag state
content:
application/json:
schema:
type: object
required:
- pauseFlags
properties:
pauseFlags:
type: object
required:
- streamCreation
- ingestion
properties:
streamCreation:
type: boolean
description: Whether creation of new streams is paused.
ingestion:
type: boolean
description: Whether chain ingestion/indexing is paused.
/api/auth/session:
post:
summary: Create authentication session
operationId: createSession
tags:
- Auth
description: |
Issues a JWT token for authenticated access to privileged endpoints.
In this iteration, any valid Stellar address can obtain a session.
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- address
properties:
address:
type: string
description: Stellar public key
pattern: '^G[A-Z2-7]{55}$'
example: GBBD47UZQ5CYVVEUVRYNQZX3G5KRZTAYF5XSVS2UKMCCWW5LJJLXNVQX
role:
type: string
enum: [operator, viewer]
default: viewer
description: User role for authorization
responses:
'200':
description: Session created successfully
content:
application/json:
schema:
$ref: '#/components/schemas/SessionResponse'
'400':
description: Invalid request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/api/streams:
post:
summary: Create a new stream
operationId: createStream
tags:
- Streams
security:
- BearerAuth: []
parameters:
- name: Idempotency-Key
in: header
required: true
description: |
Unique key that makes this request idempotent. Clients MUST supply a
fresh value per logical operation and MUST reuse the same value when
retrying after a network failure.
**Format**: 1–128 characters; allowed charset: `[A-Za-z0-9:_-]`.
UUID v4 is recommended but any value matching the charset is accepted.
**Behaviour**:
- Same key + same body → 201 (cached response, `Idempotency-Replayed: true`)
- Same key + different body → 409 CONFLICT
- Missing or malformed key → 400 VALIDATION_ERROR
**Security**: The key value is never echoed in error response bodies
or server logs to prevent accidental secret leakage.
schema:
type: string
minLength: 1
maxLength: 128
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateStreamRequest'
responses:
'201':
description: |
Stream created (or replayed from cache).
Check `Idempotency-Replayed` response header and `meta.idempotencyReplayed`
to distinguish a fresh creation from a cached replay.
headers:
Idempotency-Key:
description: Echoes the key supplied by the client.
schema:
type: string
Idempotency-Replayed:
description: |
`true` when the response was served from the idempotency cache;
`false` on first creation.
schema:
type: string
enum: ['true', 'false']
content:
application/json:
schema:
$ref: '#/components/schemas/StreamResponse'
'400':
description: |
Invalid request. Common causes:
- Missing or malformed `Idempotency-Key` header
- Invalid JSON body
- Invalid Stellar address format
- Non-string amount field (must be decimal string)
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: Missing or invalid authentication token
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'409':
description: |
Idempotency-Key collision — the same key was previously used with a
different request body. Use a new Idempotency-Key or retry with the
original body.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'413':
description: Request body exceeds 256 KiB limit
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'422':
description: |
Unprocessable entity — one or more Stellar addresses in the request
body do not exist on-chain. The stream cannot be created because it
would never match an on-chain event.
The `details.missingAddresses` array lists every address that was
not found. Addresses that could not be verified due to an RPC outage
are omitted (the request is allowed through in that case).
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/ErrorResponse'
- type: object
properties:
error:
type: object
properties:
details:
type: object
properties:
missingAddresses:
type: array
items:
type: string
pattern: '^G[A-Z2-7]{55}$'
example:
- 'GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN'
'503':
description: Service unavailable (database, Stellar RPC, or idempotency store down)
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
get:
summary: List streams with cursor pagination and indexed filters
operationId: listStreams
tags:
- Streams
parameters:
- name: limit
in: query
required: false
description: Number of streams to return (1-100, default 20)
schema:
type: integer
minimum: 1
maximum: 100
default: 20
- name: cursor
in: query
required: false
description: |
Opaque pagination cursor returned in `next_cursor` from a previous
response. Encodes the last seen stream id (base64url). Omit for
the first page.
schema:
type: string
- name: include_total
in: query
required: false
description: |
When true, include a `total` field in the response reflecting the
current count of matching streams. This is a point-in-time snapshot
and is not guaranteed to be consistent with the cursor position.
schema:
type: boolean
default: false
- name: status
in: query
required: false
description: Filter by stream status (uses the status index).
schema:
type: string
enum: [scheduled, active, paused, completed, cancelled]
- name: sender
in: query
required: false
description: Filter by sender Stellar address (uses the sender_address index).
schema:
type: string
- name: recipient
in: query
required: false
description: Filter by recipient Stellar address (uses the recipient_address index).
schema:
type: string
responses:
'200':
description: Cursor-paginated list of streams
content:
application/json:
schema:
$ref: '#/components/schemas/StreamListResponse'
'400':
description: Invalid query parameters
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'503':
description: Service unavailable
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/api/streams/{streamId}:
get:
summary: Get stream details
operationId: getStream
tags:
- Streams
parameters:
- name: streamId
in: path
required: true
description: Stream identifier (format: stream-{timestamp}-{random})
schema:
type: string
responses:
'200':
description: Stream details
content:
application/json:
schema:
$ref: '#/components/schemas/StreamResponse'
'404':
description: Stream not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'503':
description: Service unavailable
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
delete:
summary: Cancel a stream
operationId: cancelStream
tags:
- Streams
security:
- BearerAuth: []
parameters:
- name: streamId
in: path
required: true
description: Stream identifier
schema:
type: string
responses:
'200':
description: Stream cancelled successfully
content:
application/json:
schema:
$ref: '#/components/schemas/CancelStreamResponse'
'401':
description: Missing or invalid authentication token
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Stream not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'409':
description: Stream already cancelled or completed
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/internal/indexer/sync:
post:
summary: Trigger indexer synchronization
operationId: triggerIndexerSync
tags:
- Internal
security:
- BearerAuth: []
description: |
Internal endpoint for workers to synchronize chain state.
Requires admin authentication.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
ledgerSequence:
type: integer
description: Stellar ledger sequence number
required:
- ledgerSequence
responses:
'202':
description: Sync accepted and queued
content:
application/json:
schema:
$ref: '#/components/schemas/AcceptedResponse'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: Forbidden (insufficient permissions)
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'413':
description: Request body exceeds 256 KiB limit
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/internal/indexer/events/replay:
get:
summary: Cursor-based event replay from the event store
operationId: replayIndexerEvents
tags:
- Internal
description: |
Returns a page of stored contract events starting strictly after the
supplied `afterEventId` cursor, ordered by `(ledger ASC, eventId ASC)`.
Consumers advance the replay window by passing the returned `nextCursor`
value as `afterEventId` on the next request. Omit `afterEventId` to
start from the beginning of the store.
Amount fields in event payloads follow the decimal-string serialization
policy — they are never coerced to numbers.
## Trust Boundaries
- Public internet clients may not call this route.
- Authenticated internal workers may replay events for audit and
catch-up purposes only.
## Failure Modes
- An unknown `afterEventId` is treated as "cursor past end of store"
and returns an empty event list (not a 404).
- `limit` is silently capped at 1000.
parameters:
- name: x-indexer-worker-token
in: header
required: true
description: Internal worker authentication token
schema:
type: string
- name: afterEventId
in: query
required: false
description: |
Exclusive cursor. Only events that come strictly after this
eventId (in ledger-ascending order) are returned.
Omit to start from the beginning of the store.
schema:
type: string
- name: fromLedger
in: query
required: false
description: Only return events at or after this ledger (inclusive).
schema:
type: integer
minimum: 0
- name: toledger
in: query
required: false
description: Only return events at or before this ledger (inclusive).
schema:
type: integer
minimum: 0
- name: contractId
in: query
required: false
description: Filter by Soroban contract ID.
schema:
type: string
- name: topic
in: query
required: false
description: Filter by event topic (e.g. `stream.created`).
schema:
type: string
- name: limit
in: query
required: false
description: Maximum events per page (default 100, max 1000).
schema:
type: integer
minimum: 1
maximum: 1000
default: 100
responses:
'200':
description: Cursor-paginated event page
content:
application/json:
schema:
$ref: '#/components/schemas/EventReplayResponse'
'401':
description: Missing or invalid internal worker credentials
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
components:
schemas:
ResponseMeta:
type: object
required:
- timestamp
properties:
timestamp:
type: string
format: date-time
description: ISO-8601 timestamp of the response
example: '2024-01-01T12:00:00.000Z'
requestId:
type: string
description: Opaque request identifier for log correlation
example: 550e8400-e29b-41d4-a716-446655440000
RootResponse:
type: object
required:
- success
- data
- meta
properties:
success:
type: boolean
enum: [true]
data:
type: object
properties:
name:
type: string
example: Fluxora API
version:
type: string
example: 0.1.0
docs:
type: string
example: Programmable treasury streaming on Stellar.
meta:
$ref: '#/components/schemas/ResponseMeta'
HealthResponse:
type: object
required:
- success
- data
- meta
properties:
success:
type: boolean
enum: [true]
data:
type: object
properties:
status:
type: string
enum: [ok, degraded, shutting_down]
description: Overall service health
example: ok
service:
type: string
example: fluxora-backend
network:
type: string
description: Stellar network (testnet, public, etc.)
example: testnet
contractAddresses:
type: object
description: Deployed contract addresses
example: {}
timestamp:
type: string
format: date-time
example: '2024-01-01T12:00:00.000Z'
indexer:
type: object
properties:
status:
type: string
enum: [ok, stalled, starting, unknown]
meta:
$ref: '#/components/schemas/ResponseMeta'
ReadinessResponse:
type: object
required:
- success
- data
- meta
properties:
success:
type: boolean
enum: [true]
data:
type: object
properties:
report:
type: object
description: Detailed readiness report
meta:
$ref: '#/components/schemas/ResponseMeta'
LivenessResponse:
type: object
required:
- success
- data
- meta
properties:
success:
type: boolean
enum: [true]
data:
type: object
properties:
report:
type: object
description: Detailed liveness report
meta:
$ref: '#/components/schemas/ResponseMeta'
SessionResponse:
type: object
required:
- success
- data
- meta
properties:
success:
type: boolean
enum: [true]
data:
type: object
properties:
token:
type: string
description: JWT token for authentication
example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
user:
type: object
properties:
address:
type: string
example: GBBD47UZQ5CYVVEUVRYNQZX3G5KRZTAYF5XSVS2UKMCCWW5LJJLXNVQX
role:
type: string
example: operator
meta:
$ref: '#/components/schemas/ResponseMeta'
CreateStreamRequest:
type: object
required:
- sender
- recipient
- depositAmount
- ratePerSecond
- startTime
properties:
sender:
type: string
description: |
Stellar public key of the sender.
Must start with 'G' followed by exactly 55 base32 characters [A-Z2-7].
Total length: 56 characters.
pattern: '^G[A-Z2-7]{55}$'
example: GBBD47UZQ5CYVVEUVRYNQZX3G5KRZTAYF5XSVS2UKMCCWW5LJJLXNVQX
recipient:
type: string
description: |
Stellar public key of the recipient.
Must start with 'G' followed by exactly 55 base32 characters [A-Z2-7].
Total length: 56 characters.
pattern: '^G[A-Z2-7]{55}$'
example: GBRPYHIL2CI3WHZDTOOQFC6EB4KJJGUJJBBX7XNLG5DBNVQWDADUZSQX
depositAmount:
type: string
description: |
Total amount to deposit in stroops (1 XLM = 10,000,000 stroops).
Must be a non-negative decimal string.
Must be >= ratePerSecond (minimum 1 second of streaming).
Max: 9223372036854775807 stroops (~922 million XLM).
pattern: '^\d+(\.\d+)?$'
example: '1000000000'
ratePerSecond:
type: string
description: |
Streaming rate in stroops per second.
Must be a positive decimal string.
pattern: '^\d+(\.\d+)?$'
example: '100000'
startTime:
type: integer
description: |
Unix timestamp (seconds) when streaming begins.
Must be in the future or within the last hour.
example: 1704067200
Stream:
type: object
description: |
A durable, PostgreSQL-backed stream record.
All monetary amounts are decimal strings - never numbers.
required:
- id
- sender
- recipient
- depositAmount
- ratePerSecond
- startTime
- endTime
- status
properties:
id:
type: string
description: |
Unique stream identifier derived from SHA-256 of request content.
Format: stream-{64-char-hex}-{eventIndex}
example: stream-a3f1c2d...0c-0
sender:
type: string
description: |
Sender Stellar public key (G + 55 base32 chars).
pattern: '^G[A-Z2-7]{55}$'
example: GBBD47UZQ5CYVVEUVRYNQZX3G5KRZTAYF5XSVS2UKMCCWW5LJJLXNVQX
recipient:
type: string
description: |
Recipient Stellar public key (G + 55 base32 chars).
pattern: '^G[A-Z2-7]{55}$'
example: GBRPYHIL2CI3WHZDTOOQFC6EB4KJJGUJJBBX7XNLG5DBNVQWDADUZSQX
depositAmount:
type: string
description: Total deposit as a decimal string (never a number).
pattern: '^[+-]?[0-9]+(\.[0-9]+)?$'
example: '1000'
ratePerSecond:
type: string
description: Streaming rate per second as a decimal string.
pattern: '^[+-]?[0-9]+(\.[0-9]+)?$'
example: '10'
startTime:
type: integer
description: Stream start time (Unix epoch seconds).
example: 1700000000
endTime:
type: integer
description: Stream end time (Unix epoch seconds). 0 = indefinite.
example: 0
status:
type: string
enum:
- active
- paused
- completed
- cancelled
description: Current stream status.
example: active
StreamResponse:
type: object
required:
- streams
- has_more
- next_cursor
properties:
streams:
type: array
items:
$ref: '#/components/schemas/Stream'
has_more:
type: boolean
description: Whether more pages are available.
example: true
next_cursor:
type: string
nullable: true
description: |
Opaque cursor for the next page. Always present in the response.
`null` when `has_more` is false (no further pages).
Pass as the `cursor` query parameter on the next request.
example: eyJ2IjoxLCJsYXN0SWQiOiJzdHJlYW0tYWJjLTAifQ
total:
type: integer
nullable: true
description: Total count (only present when include_total=true).
example: 42
StreamListResponse:
type: object
required:
- success
- data
- meta
properties:
success:
type: boolean
enum: [true]
data:
type: object
required:
- streams
- has_more
- next_cursor
properties:
streams:
type: array
items:
$ref: '#/components/schemas/Stream'
has_more:
type: boolean
description: Whether more streams are available.
example: false
next_cursor:
type: string
nullable: true
description: |
Opaque cursor for the next page. Always present.
`null` when there are no further pages.
Encodes the `id` of the last stream on the current page
using keyset (`WHERE id > $cursor ORDER BY id ASC`) semantics.
example: null
total:
type: integer
nullable: true
description: Total number of streams (only if include_total=true).
example: null
meta:
$ref: '#/components/schemas/ResponseMeta'
CancelStreamResponse:
type: object
required:
- success
- data
- meta
properties:
success:
type: boolean
enum: [true]
data:
type: object
properties:
message:
type: string
example: Stream cancelled
id:
type: string
example: stream-1704067200-abc12
meta:
$ref: '#/components/schemas/ResponseMeta'
AcceptedResponse:
type: object
required:
- success
- data
- meta
properties:
success:
type: boolean
enum: [true]
data:
type: object
properties:
status:
type: string
example: queued
meta:
$ref: '#/components/schemas/ResponseMeta'
EventReplayResponse:
type: object
required:
- success
- data
- meta
description: |
Response envelope for the cursor-based event replay endpoint.
Amount fields inside `events[].payload` are always decimal strings.
properties: