triqai 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1923 @@
1
+ openapi: 3.1.0
2
+ info:
3
+ title: Triqai Transaction Enrichment API
4
+ version: 1.1.9
5
+ description: |
6
+ The Triqai API provides transaction enrichment capabilities for financial applications.
7
+
8
+ ## Authentication
9
+
10
+ All API endpoints require an API key in the `X-API-Key` header.
11
+
12
+ ## Rate Limiting
13
+
14
+ Per-organization limits use a token bucket (RPS) plus a concurrent in-flight cap.
15
+ Headers may include:
16
+ - `X-RateLimit-Limit`
17
+ - `X-RateLimit-Remaining`
18
+ - `X-RateLimit-Reset`
19
+ - `X-RateLimit-Scope` (`rps` or `concurrency`)
20
+ - `X-RateLimit-Concurrency-Limit`
21
+ - `X-RateLimit-Concurrency-Remaining`
22
+
23
+ `Retry-After` is returned in **seconds** on throttled responses.
24
+
25
+ ## Idempotency
26
+
27
+ You can supply `Idempotency-Key` (or `X-Idempotency-Key`) to make retries safer.
28
+ Keys must match `^[a-zA-Z0-9_-]{1,64}$`.
29
+ Reusing a key returns `409`:
30
+ - `state=completed`: request with this key already finished
31
+ - `state=in_progress`: request with this key is still processing (`Retry-After` included)
32
+ contact:
33
+ name: Triqai Contact
34
+ url: https://triqai.com/contact
35
+ license:
36
+ name: Proprietary
37
+ url: https://triqai.com/terms
38
+
39
+ servers:
40
+ - url: https://api.triqai.com
41
+ description: Production
42
+
43
+ security:
44
+ - ApiKeyAuth: []
45
+
46
+ tags:
47
+ - name: Health
48
+ - name: API
49
+ - name: Transactions
50
+ - name: Categories
51
+ - name: Entities
52
+ - name: Issue Reports
53
+
54
+ paths:
55
+ /:
56
+ get:
57
+ tags:
58
+ - Health
59
+ summary: Root health check
60
+ description: Returns the same health payload as `/health`.
61
+ operationId: getRoot
62
+ security: []
63
+ responses:
64
+ '200':
65
+ description: Service is healthy
66
+ content:
67
+ application/json:
68
+ schema:
69
+ $ref: '#/components/schemas/HealthResponse'
70
+
71
+ /health:
72
+ get:
73
+ tags:
74
+ - Health
75
+ summary: Health check
76
+ operationId: getHealth
77
+ security: []
78
+ responses:
79
+ '200':
80
+ description: Service is healthy
81
+ content:
82
+ application/json:
83
+ schema:
84
+ $ref: '#/components/schemas/HealthResponse'
85
+
86
+ /v1:
87
+ get:
88
+ tags:
89
+ - API
90
+ summary: API info
91
+ operationId: getApiInfo
92
+ responses:
93
+ '200':
94
+ description: API version and endpoint map
95
+ content:
96
+ application/json:
97
+ schema:
98
+ $ref: '#/components/schemas/ApiInfoResponse'
99
+ '401':
100
+ $ref: '#/components/responses/Unauthorized'
101
+ '403':
102
+ $ref: '#/components/responses/Forbidden'
103
+
104
+ /v1/transactions/enrich:
105
+ post:
106
+ tags:
107
+ - Transactions
108
+ summary: Enrich transaction
109
+ description: Enriches a transaction and returns structured transaction + entity data.
110
+ operationId: enrichTransaction
111
+ parameters:
112
+ - name: force
113
+ in: query
114
+ required: false
115
+ description: Bypass cached result when true.
116
+ schema:
117
+ type: boolean
118
+ default: false
119
+ - name: Idempotency-Key
120
+ in: header
121
+ required: false
122
+ description: Optional idempotency key. `X-Idempotency-Key` is also accepted and must match when both are sent.
123
+ schema:
124
+ type: string
125
+ minLength: 1
126
+ maxLength: 64
127
+ pattern: '^[a-zA-Z0-9_-]{1,64}$'
128
+ requestBody:
129
+ required: true
130
+ content:
131
+ application/json:
132
+ schema:
133
+ $ref: '#/components/schemas/EnrichRequest'
134
+ examples:
135
+ expense:
136
+ summary: Basic expense enrichment
137
+ value:
138
+ title: 'AMAZON MKTPLACE PMTS AMZN.COM/BILL WA'
139
+ country: 'US'
140
+ type: 'expense'
141
+ income:
142
+ summary: Basic income enrichment
143
+ value:
144
+ title: 'PAYPAL REFUND EBAY INC'
145
+ country: 'US'
146
+ type: 'income'
147
+ with_prefilled_merchant:
148
+ summary: Pre-fill known merchant to skip AI extraction
149
+ value:
150
+ title: 'SQ *STARBUCKS #1234 AMSTERDAM'
151
+ country: 'NL'
152
+ type: 'expense'
153
+ options:
154
+ merchant:
155
+ name: 'Starbucks'
156
+ with_prefilled_location:
157
+ summary: Pre-fill known location context
158
+ value:
159
+ title: 'SQ *STARBUCKS #1234 AMSTERDAM'
160
+ country: 'NL'
161
+ type: 'expense'
162
+ options:
163
+ merchant:
164
+ name: 'Starbucks'
165
+ location:
166
+ cityName: 'Amsterdam'
167
+ with_filters:
168
+ summary: Skip intermediary and location extraction
169
+ value:
170
+ title: 'PAYPAL *NETFLIX.COM'
171
+ country: 'US'
172
+ type: 'expense'
173
+ options:
174
+ filters:
175
+ noIntermediary: true
176
+ noLocation: true
177
+ responses:
178
+ '200':
179
+ description: Enrichment completed
180
+ content:
181
+ application/json:
182
+ schema:
183
+ $ref: '#/components/schemas/EnrichSuccessResponse'
184
+ '401':
185
+ $ref: '#/components/responses/Unauthorized'
186
+ '402':
187
+ $ref: '#/components/responses/InsufficientCredits'
188
+ '403':
189
+ $ref: '#/components/responses/Forbidden'
190
+ '409':
191
+ $ref: '#/components/responses/DuplicateRequest'
192
+ '422':
193
+ $ref: '#/components/responses/ValidationError'
194
+ '429':
195
+ $ref: '#/components/responses/RateLimited'
196
+ '499':
197
+ $ref: '#/components/responses/ClientDisconnected'
198
+ '500':
199
+ $ref: '#/components/responses/InternalError'
200
+ '503':
201
+ $ref: '#/components/responses/ServiceUnavailable'
202
+ '504':
203
+ $ref: '#/components/responses/GatewayTimeout'
204
+
205
+ /v1/transactions:
206
+ get:
207
+ tags:
208
+ - Transactions
209
+ summary: List transactions
210
+ operationId: listTransactions
211
+ parameters:
212
+ - name: page
213
+ in: query
214
+ required: false
215
+ schema:
216
+ type: integer
217
+ minimum: 1
218
+ default: 1
219
+ - name: size
220
+ in: query
221
+ required: false
222
+ schema:
223
+ type: integer
224
+ minimum: 1
225
+ maximum: 100
226
+ default: 25
227
+ - name: startDate
228
+ in: query
229
+ required: false
230
+ description: Inclusive lower bound (ISO 8601 timestamp)
231
+ schema:
232
+ type: string
233
+ format: date-time
234
+ - name: endDate
235
+ in: query
236
+ required: false
237
+ description: Inclusive upper bound (ISO 8601 timestamp)
238
+ schema:
239
+ type: string
240
+ format: date-time
241
+ responses:
242
+ '200':
243
+ description: Paginated transactions
244
+ content:
245
+ application/json:
246
+ schema:
247
+ $ref: '#/components/schemas/TransactionListResponse'
248
+ '401':
249
+ $ref: '#/components/responses/Unauthorized'
250
+ '403':
251
+ $ref: '#/components/responses/Forbidden'
252
+ '422':
253
+ $ref: '#/components/responses/ValidationError'
254
+ '429':
255
+ $ref: '#/components/responses/RateLimited'
256
+ '500':
257
+ $ref: '#/components/responses/InternalError'
258
+
259
+ /v1/transactions/{id}:
260
+ get:
261
+ tags:
262
+ - Transactions
263
+ summary: Get transaction
264
+ operationId: getTransaction
265
+ parameters:
266
+ - $ref: '#/components/parameters/IdPath'
267
+ responses:
268
+ '200':
269
+ description: Transaction detail
270
+ content:
271
+ application/json:
272
+ schema:
273
+ $ref: '#/components/schemas/TransactionDetailResponse'
274
+ '401':
275
+ $ref: '#/components/responses/Unauthorized'
276
+ '403':
277
+ $ref: '#/components/responses/Forbidden'
278
+ '404':
279
+ $ref: '#/components/responses/NotFound'
280
+ '422':
281
+ $ref: '#/components/responses/ValidationError'
282
+ '429':
283
+ $ref: '#/components/responses/RateLimited'
284
+ '500':
285
+ $ref: '#/components/responses/InternalError'
286
+
287
+ delete:
288
+ tags:
289
+ - Transactions
290
+ summary: Delete transaction
291
+ operationId: deleteTransaction
292
+ parameters:
293
+ - $ref: '#/components/parameters/IdPath'
294
+ responses:
295
+ '200':
296
+ description: Transaction deleted
297
+ content:
298
+ application/json:
299
+ schema:
300
+ $ref: '#/components/schemas/DeleteTransactionResponse'
301
+ '401':
302
+ $ref: '#/components/responses/Unauthorized'
303
+ '403':
304
+ $ref: '#/components/responses/Forbidden'
305
+ '404':
306
+ $ref: '#/components/responses/NotFound'
307
+ '422':
308
+ $ref: '#/components/responses/ValidationError'
309
+ '429':
310
+ $ref: '#/components/responses/RateLimited'
311
+ '500':
312
+ $ref: '#/components/responses/InternalError'
313
+
314
+ /v1/categories:
315
+ get:
316
+ tags:
317
+ - Categories
318
+ summary: List categories
319
+ operationId: listCategories
320
+ responses:
321
+ '200':
322
+ description: Category reference list
323
+ content:
324
+ application/json:
325
+ schema:
326
+ $ref: '#/components/schemas/CategoryListResponse'
327
+ '401':
328
+ $ref: '#/components/responses/Unauthorized'
329
+ '403':
330
+ $ref: '#/components/responses/Forbidden'
331
+ '429':
332
+ $ref: '#/components/responses/RateLimited'
333
+ '500':
334
+ $ref: '#/components/responses/InternalError'
335
+
336
+ /v1/merchants/{id}:
337
+ get:
338
+ tags:
339
+ - Entities
340
+ summary: Get merchant
341
+ operationId: getMerchant
342
+ parameters:
343
+ - $ref: '#/components/parameters/IdPath'
344
+ responses:
345
+ '200':
346
+ description: Merchant found
347
+ content:
348
+ application/json:
349
+ schema:
350
+ $ref: '#/components/schemas/MerchantResponse'
351
+ '401':
352
+ $ref: '#/components/responses/Unauthorized'
353
+ '403':
354
+ $ref: '#/components/responses/Forbidden'
355
+ '404':
356
+ $ref: '#/components/responses/NotFound'
357
+ '422':
358
+ $ref: '#/components/responses/ValidationError'
359
+ '429':
360
+ $ref: '#/components/responses/RateLimited'
361
+ '500':
362
+ $ref: '#/components/responses/InternalError'
363
+
364
+ /v1/locations/{id}:
365
+ get:
366
+ tags:
367
+ - Entities
368
+ summary: Get location
369
+ operationId: getLocation
370
+ parameters:
371
+ - $ref: '#/components/parameters/IdPath'
372
+ responses:
373
+ '200':
374
+ description: Location found
375
+ content:
376
+ application/json:
377
+ schema:
378
+ $ref: '#/components/schemas/LocationResponse'
379
+ '401':
380
+ $ref: '#/components/responses/Unauthorized'
381
+ '403':
382
+ $ref: '#/components/responses/Forbidden'
383
+ '404':
384
+ $ref: '#/components/responses/NotFound'
385
+ '422':
386
+ $ref: '#/components/responses/ValidationError'
387
+ '429':
388
+ $ref: '#/components/responses/RateLimited'
389
+ '500':
390
+ $ref: '#/components/responses/InternalError'
391
+
392
+ /v1/intermediaries/{id}:
393
+ get:
394
+ tags:
395
+ - Entities
396
+ summary: Get intermediary
397
+ operationId: getIntermediary
398
+ parameters:
399
+ - $ref: '#/components/parameters/IdPath'
400
+ responses:
401
+ '200':
402
+ description: Intermediary found
403
+ content:
404
+ application/json:
405
+ schema:
406
+ $ref: '#/components/schemas/IntermediaryResponse'
407
+ '401':
408
+ $ref: '#/components/responses/Unauthorized'
409
+ '403':
410
+ $ref: '#/components/responses/Forbidden'
411
+ '404':
412
+ $ref: '#/components/responses/NotFound'
413
+ '422':
414
+ $ref: '#/components/responses/ValidationError'
415
+ '429':
416
+ $ref: '#/components/responses/RateLimited'
417
+ '500':
418
+ $ref: '#/components/responses/InternalError'
419
+
420
+ /v1/report-issue:
421
+ post:
422
+ tags:
423
+ - Issue Reports
424
+ summary: Create issue report
425
+ operationId: createIssueReport
426
+ requestBody:
427
+ required: true
428
+ content:
429
+ application/json:
430
+ schema:
431
+ $ref: '#/components/schemas/ReportIssueRequest'
432
+ responses:
433
+ '201':
434
+ description: Issue report created
435
+ content:
436
+ application/json:
437
+ schema:
438
+ $ref: '#/components/schemas/IssueReportResponse'
439
+ '401':
440
+ $ref: '#/components/responses/Unauthorized'
441
+ '403':
442
+ $ref: '#/components/responses/Forbidden'
443
+ '404':
444
+ $ref: '#/components/responses/NotFound'
445
+ '422':
446
+ $ref: '#/components/responses/ValidationError'
447
+ '429':
448
+ $ref: '#/components/responses/RateLimited'
449
+ '500':
450
+ $ref: '#/components/responses/InternalError'
451
+
452
+ get:
453
+ tags:
454
+ - Issue Reports
455
+ summary: List issue reports
456
+ operationId: listIssueReports
457
+ parameters:
458
+ - name: page
459
+ in: query
460
+ required: false
461
+ schema:
462
+ type: integer
463
+ minimum: 1
464
+ default: 1
465
+ - name: size
466
+ in: query
467
+ required: false
468
+ schema:
469
+ type: integer
470
+ minimum: 1
471
+ maximum: 100
472
+ default: 25
473
+ - name: status
474
+ in: query
475
+ required: false
476
+ schema:
477
+ $ref: '#/components/schemas/IssueReportStatus'
478
+ - name: transaction_id
479
+ in: query
480
+ required: false
481
+ schema:
482
+ type: string
483
+ format: uuid
484
+ responses:
485
+ '200':
486
+ description: Paginated issue reports
487
+ content:
488
+ application/json:
489
+ schema:
490
+ $ref: '#/components/schemas/IssueReportListResponse'
491
+ '401':
492
+ $ref: '#/components/responses/Unauthorized'
493
+ '403':
494
+ $ref: '#/components/responses/Forbidden'
495
+ '422':
496
+ $ref: '#/components/responses/ValidationError'
497
+ '429':
498
+ $ref: '#/components/responses/RateLimited'
499
+ '500':
500
+ $ref: '#/components/responses/InternalError'
501
+
502
+ /v1/report-issue/{id}:
503
+ get:
504
+ tags:
505
+ - Issue Reports
506
+ summary: Get issue report
507
+ operationId: getIssueReport
508
+ parameters:
509
+ - $ref: '#/components/parameters/IdPath'
510
+ responses:
511
+ '200':
512
+ description: Issue report detail
513
+ content:
514
+ application/json:
515
+ schema:
516
+ $ref: '#/components/schemas/IssueReportResponse'
517
+ '401':
518
+ $ref: '#/components/responses/Unauthorized'
519
+ '403':
520
+ $ref: '#/components/responses/Forbidden'
521
+ '404':
522
+ $ref: '#/components/responses/NotFound'
523
+ '422':
524
+ $ref: '#/components/responses/ValidationError'
525
+ '429':
526
+ $ref: '#/components/responses/RateLimited'
527
+ '500':
528
+ $ref: '#/components/responses/InternalError'
529
+
530
+ components:
531
+ securitySchemes:
532
+ ApiKeyAuth:
533
+ type: apiKey
534
+ in: header
535
+ name: X-API-Key
536
+ description: Public API key
537
+
538
+ parameters:
539
+ IdPath:
540
+ name: id
541
+ in: path
542
+ required: true
543
+ schema:
544
+ type: string
545
+ format: uuid
546
+
547
+ schemas:
548
+ ResponseMeta:
549
+ type: object
550
+ required:
551
+ - generatedAt
552
+ - requestId
553
+ - version
554
+ properties:
555
+ generatedAt:
556
+ type: string
557
+ format: date-time
558
+ requestId:
559
+ type: string
560
+ version:
561
+ type: string
562
+ additionalProperties: true
563
+
564
+ PaginationMeta:
565
+ allOf:
566
+ - $ref: '#/components/schemas/ResponseMeta'
567
+ - type: object
568
+ required:
569
+ - page
570
+ - size
571
+ - total
572
+ - totalPages
573
+ properties:
574
+ page:
575
+ type: integer
576
+ size:
577
+ type: integer
578
+ total:
579
+ type: integer
580
+ totalPages:
581
+ type: integer
582
+
583
+ ErrorDetails:
584
+ type: object
585
+ properties:
586
+ fieldErrors:
587
+ type: object
588
+ additionalProperties:
589
+ type: array
590
+ items:
591
+ type: string
592
+ additionalProperties: true
593
+
594
+ ErrorObject:
595
+ type: object
596
+ required:
597
+ - code
598
+ - message
599
+ properties:
600
+ code:
601
+ type: string
602
+ message:
603
+ type: string
604
+ details:
605
+ $ref: '#/components/schemas/ErrorDetails'
606
+
607
+ ErrorResponse:
608
+ type: object
609
+ required:
610
+ - success
611
+ - error
612
+ - meta
613
+ properties:
614
+ success:
615
+ type: boolean
616
+ enum: [false]
617
+ error:
618
+ $ref: '#/components/schemas/ErrorObject'
619
+ meta:
620
+ $ref: '#/components/schemas/ResponseMeta'
621
+
622
+ DuplicateRequestErrorResponse:
623
+ type: object
624
+ required:
625
+ - success
626
+ - error
627
+ properties:
628
+ success:
629
+ type: boolean
630
+ enum: [false]
631
+ error:
632
+ type: object
633
+ required:
634
+ - code
635
+ - message
636
+ - details
637
+ properties:
638
+ code:
639
+ type: string
640
+ enum: [DUPLICATE_REQUEST]
641
+ message:
642
+ type: string
643
+ details:
644
+ type: object
645
+ required: [requestId]
646
+ properties:
647
+ requestId:
648
+ type: string
649
+ state:
650
+ type: string
651
+ enum: [in_progress, completed]
652
+ retryAfterSeconds:
653
+ type: integer
654
+ minimum: 1
655
+
656
+ ClientDisconnectedErrorResponse:
657
+ type: object
658
+ required:
659
+ - success
660
+ - error
661
+ properties:
662
+ success:
663
+ type: boolean
664
+ enum: [false]
665
+ error:
666
+ type: object
667
+ required:
668
+ - code
669
+ - message
670
+ properties:
671
+ code:
672
+ type: string
673
+ enum: [CLIENT_DISCONNECTED]
674
+ message:
675
+ type: string
676
+
677
+ HealthResponse:
678
+ type: object
679
+ required:
680
+ - success
681
+ - data
682
+ - meta
683
+ properties:
684
+ success:
685
+ type: boolean
686
+ enum: [true]
687
+ data:
688
+ type: object
689
+ required:
690
+ - status
691
+ - service
692
+ - version
693
+ properties:
694
+ status:
695
+ type: string
696
+ enum: [healthy]
697
+ service:
698
+ type: string
699
+ version:
700
+ type: string
701
+ meta:
702
+ $ref: '#/components/schemas/ResponseMeta'
703
+
704
+ ApiInfoResponse:
705
+ type: object
706
+ required:
707
+ - success
708
+ - data
709
+ - meta
710
+ properties:
711
+ success:
712
+ type: boolean
713
+ enum: [true]
714
+ data:
715
+ type: object
716
+ required:
717
+ - version
718
+ - endpoints
719
+ properties:
720
+ version:
721
+ type: string
722
+ enum: [v1]
723
+ endpoints:
724
+ type: object
725
+ required:
726
+ - transactions
727
+ - categories
728
+ - merchants
729
+ - locations
730
+ - intermediaries
731
+ - reportIssue
732
+ properties:
733
+ transactions:
734
+ type: string
735
+ example: /v1/transactions
736
+ categories:
737
+ type: string
738
+ example: /v1/categories
739
+ merchants:
740
+ type: string
741
+ example: /v1/merchants/{id}
742
+ locations:
743
+ type: string
744
+ example: /v1/locations/{id}
745
+ intermediaries:
746
+ type: string
747
+ example: /v1/intermediaries/{id}
748
+ reportIssue:
749
+ type: string
750
+ example: /v1/report-issue
751
+ meta:
752
+ $ref: '#/components/schemas/ResponseMeta'
753
+
754
+ EnrichRequest:
755
+ type: object
756
+ required:
757
+ - title
758
+ - country
759
+ - type
760
+ properties:
761
+ title:
762
+ type: string
763
+ minLength: 1
764
+ maxLength: 256
765
+ description: Raw transaction description from the bank statement.
766
+ country:
767
+ type: string
768
+ pattern: '^[A-Za-z]{2}$'
769
+ description: |
770
+ ISO 3166-1 alpha-2 country code (e.g., US, GB, DE).
771
+ Both upper and lowercase are accepted; the API normalizes to uppercase.
772
+ type:
773
+ $ref: '#/components/schemas/TransactionType'
774
+ options:
775
+ $ref: '#/components/schemas/EnrichRequestOptions'
776
+
777
+ EnrichRequestOptions:
778
+ type: object
779
+ description: |
780
+ Optional enrichment controls. Use `filters` to skip specific entity types,
781
+ or pre-fill known entity data to improve accuracy and reduce latency.
782
+
783
+ **Mutual exclusivity:** a filter flag (e.g. `noMerchant`) cannot be combined with
784
+ pre-filled data for the same entity type.
785
+ properties:
786
+ filters:
787
+ $ref: '#/components/schemas/EnrichmentFilterOptions'
788
+ merchant:
789
+ $ref: '#/components/schemas/PrefilledMerchant'
790
+ location:
791
+ $ref: '#/components/schemas/PrefilledLocation'
792
+ intermediaries:
793
+ type: array
794
+ description: Up to 5 pre-filled intermediary entries.
795
+ maxItems: 5
796
+ items:
797
+ $ref: '#/components/schemas/PrefilledIntermediary'
798
+ allOf:
799
+ - if:
800
+ required: [filters]
801
+ properties:
802
+ filters:
803
+ type: object
804
+ required: [noMerchant]
805
+ properties:
806
+ noMerchant:
807
+ const: true
808
+ then:
809
+ not:
810
+ required: [merchant]
811
+ properties:
812
+ merchant:
813
+ type: object
814
+ anyOf:
815
+ - required: [id]
816
+ - required: [name]
817
+ - required: [domain]
818
+ - if:
819
+ required: [filters]
820
+ properties:
821
+ filters:
822
+ type: object
823
+ required: [noIntermediary]
824
+ properties:
825
+ noIntermediary:
826
+ const: true
827
+ then:
828
+ not:
829
+ required: [intermediaries]
830
+ properties:
831
+ intermediaries:
832
+ type: array
833
+ minItems: 1
834
+ - if:
835
+ required: [filters]
836
+ properties:
837
+ filters:
838
+ type: object
839
+ required: [noLocation]
840
+ properties:
841
+ noLocation:
842
+ const: true
843
+ then:
844
+ not:
845
+ required: [location]
846
+ properties:
847
+ location:
848
+ type: object
849
+ anyOf:
850
+ - required: [cityName]
851
+ - required: [physicalLocation]
852
+ - required: [coordinates]
853
+ - required: [streetName]
854
+ - required: [storeNumber]
855
+
856
+ EnrichmentFilterOptions:
857
+ type: object
858
+ description: Disable extraction of specific entity types from the transaction title.
859
+ properties:
860
+ noMerchant:
861
+ type: boolean
862
+ description: When `true`, merchant extraction is skipped entirely.
863
+ noIntermediary:
864
+ type: boolean
865
+ description: When `true`, intermediary (payment processor) extraction is skipped.
866
+ noLocation:
867
+ type: boolean
868
+ description: When `true`, location extraction is skipped.
869
+
870
+ PrefilledMerchant:
871
+ type: object
872
+ description: |
873
+ Supply known merchant data to bypass or augment merchant extraction.
874
+ When `id` is provided, the merchant is resolved by primary key (returns 422 if not found).
875
+ `name` and `domain` perform best-effort lookups and fall through gracefully.
876
+ properties:
877
+ id:
878
+ type: string
879
+ format: uuid
880
+ description: Existing Triqai merchant UUID.
881
+ name:
882
+ type: string
883
+ description: Merchant display name for lookup.
884
+ domain:
885
+ type: string
886
+ description: Merchant domain (e.g. `starbucks.com`).
887
+
888
+ PrefilledLocation:
889
+ type: object
890
+ description: Supply known location context to improve enrichment accuracy.
891
+ properties:
892
+ cityName:
893
+ type: string
894
+ description: City name where the transaction occurred.
895
+ physicalLocation:
896
+ type: boolean
897
+ description: Whether the transaction happened at a physical location.
898
+ coordinates:
899
+ type: object
900
+ description: GPS coordinates of the transaction.
901
+ required:
902
+ - lat
903
+ - lng
904
+ properties:
905
+ lat:
906
+ type: number
907
+ minimum: -90
908
+ maximum: 90
909
+ lng:
910
+ type: number
911
+ minimum: -180
912
+ maximum: 180
913
+ streetName:
914
+ type: string
915
+ description: Street name of the transaction location.
916
+ storeNumber:
917
+ type: string
918
+ description: Store or branch number.
919
+
920
+ PrefilledIntermediary:
921
+ type: object
922
+ description: |
923
+ Supply known intermediary (payment processor) data.
924
+ When `id` is provided, the intermediary is resolved by primary key (returns 422 if not found).
925
+ `name` and `domain` perform best-effort lookups.
926
+ properties:
927
+ id:
928
+ type: string
929
+ format: uuid
930
+ description: Existing Triqai intermediary UUID.
931
+ name:
932
+ type: string
933
+ description: Intermediary display name for lookup.
934
+ domain:
935
+ type: string
936
+ description: Intermediary domain (e.g. `paypal.com`).
937
+ anyOf:
938
+ - required: [id]
939
+ - required: [name]
940
+ - required: [domain]
941
+
942
+ TransactionType:
943
+ type: string
944
+ enum: [expense, income]
945
+
946
+ EnrichmentErrorCode:
947
+ type: string
948
+ enum:
949
+ - location_timeout
950
+ - merchant_scrape_failed
951
+ - processor_lookup_failed
952
+ - rate_limited
953
+ - internal_error
954
+ - title_dissection_failed
955
+
956
+ ConfidenceWithReasons:
957
+ type: object
958
+ required:
959
+ - value
960
+ - reasons
961
+ properties:
962
+ value:
963
+ type: integer
964
+ minimum: 0
965
+ maximum: 100
966
+ reasons:
967
+ type: array
968
+ items:
969
+ type: string
970
+
971
+ CategoryCode:
972
+ type: object
973
+ required:
974
+ - mcc
975
+ - sic
976
+ - naics
977
+ properties:
978
+ mcc:
979
+ type: integer
980
+ sic:
981
+ type: integer
982
+ naics:
983
+ type: integer
984
+
985
+ Category:
986
+ type: object
987
+ required:
988
+ - name
989
+ - code
990
+ properties:
991
+ name:
992
+ type: string
993
+ code:
994
+ $ref: '#/components/schemas/CategoryCode'
995
+
996
+ CategoryStructure:
997
+ type: object
998
+ required:
999
+ - primary
1000
+ - secondary
1001
+ - tertiary
1002
+ - confidence
1003
+ properties:
1004
+ primary:
1005
+ $ref: '#/components/schemas/Category'
1006
+ secondary:
1007
+ oneOf:
1008
+ - $ref: '#/components/schemas/Category'
1009
+ - type: 'null'
1010
+ tertiary:
1011
+ oneOf:
1012
+ - $ref: '#/components/schemas/Category'
1013
+ - type: 'null'
1014
+ confidence:
1015
+ $ref: '#/components/schemas/ConfidenceWithReasons'
1016
+
1017
+ SubscriptionType:
1018
+ type: string
1019
+ enum:
1020
+ - streaming
1021
+ - software
1022
+ - news
1023
+ - fitness
1024
+ - mobile
1025
+ - gaming
1026
+ - utilities
1027
+ - other
1028
+
1029
+ Subscription:
1030
+ type: object
1031
+ required:
1032
+ - recurring
1033
+ - type
1034
+ properties:
1035
+ recurring:
1036
+ type: boolean
1037
+ type:
1038
+ oneOf:
1039
+ - $ref: '#/components/schemas/SubscriptionType'
1040
+ - type: 'null'
1041
+
1042
+ TransactionChannel:
1043
+ type: string
1044
+ enum:
1045
+ - in_store
1046
+ - online
1047
+ - mobile_app
1048
+ - atm
1049
+ - bank_transfer
1050
+ - unknown
1051
+
1052
+ Coordinates:
1053
+ type: object
1054
+ required:
1055
+ - latitude
1056
+ - longitude
1057
+ properties:
1058
+ latitude:
1059
+ type: number
1060
+ format: double
1061
+ longitude:
1062
+ type: number
1063
+ format: double
1064
+
1065
+ StructuredAddress:
1066
+ type: object
1067
+ required:
1068
+ - street
1069
+ - city
1070
+ - state
1071
+ - postalCode
1072
+ - country
1073
+ - countryName
1074
+ - coordinates
1075
+ - timezone
1076
+ properties:
1077
+ street:
1078
+ type: string
1079
+ city:
1080
+ type: string
1081
+ state:
1082
+ type: string
1083
+ postalCode:
1084
+ type: string
1085
+ country:
1086
+ type: string
1087
+ countryName:
1088
+ type: string
1089
+ coordinates:
1090
+ $ref: '#/components/schemas/Coordinates'
1091
+ timezone:
1092
+ type: string
1093
+
1094
+ MerchantData:
1095
+ type: object
1096
+ required:
1097
+ - id
1098
+ - name
1099
+ - alias
1100
+ - icon
1101
+ - color
1102
+ - website
1103
+ - domain
1104
+ properties:
1105
+ id:
1106
+ type: string
1107
+ format: uuid
1108
+ name:
1109
+ type: string
1110
+ alias:
1111
+ type: array
1112
+ items:
1113
+ type: string
1114
+ keywords:
1115
+ type: array
1116
+ description: Search keywords associated with this merchant. May be absent.
1117
+ items:
1118
+ type: string
1119
+ icon:
1120
+ oneOf:
1121
+ - type: string
1122
+ format: uri
1123
+ - type: 'null'
1124
+ description:
1125
+ type: string
1126
+ description: Brief description of the merchant. May be absent.
1127
+ color:
1128
+ oneOf:
1129
+ - type: string
1130
+ - type: 'null'
1131
+ website:
1132
+ oneOf:
1133
+ - type: string
1134
+ format: uri
1135
+ - type: 'null'
1136
+ domain:
1137
+ oneOf:
1138
+ - type: string
1139
+ - type: 'null'
1140
+
1141
+ LocationRating:
1142
+ type: object
1143
+ required:
1144
+ - average
1145
+ - count
1146
+ - source
1147
+ properties:
1148
+ average:
1149
+ type: number
1150
+ count:
1151
+ type: integer
1152
+ source:
1153
+ type: string
1154
+
1155
+ LocationData:
1156
+ type: object
1157
+ required:
1158
+ - id
1159
+ - name
1160
+ - formatted
1161
+ - phoneNumber
1162
+ - structured
1163
+ properties:
1164
+ id:
1165
+ type: string
1166
+ format: uuid
1167
+ name:
1168
+ type: string
1169
+ description: Location display name (store/branch name).
1170
+ formatted:
1171
+ type: string
1172
+ description: Human-readable formatted address string.
1173
+ phoneNumber:
1174
+ oneOf:
1175
+ - type: string
1176
+ - type: 'null'
1177
+ description: Phone number if available.
1178
+ website:
1179
+ oneOf:
1180
+ - type: string
1181
+ format: uri
1182
+ - type: 'null'
1183
+ description: Location-specific website URL. May be absent.
1184
+ priceRange:
1185
+ oneOf:
1186
+ - type: string
1187
+ - type: 'null'
1188
+ description: Price range indicator (e.g. "$", "$$"). May be absent.
1189
+ rating:
1190
+ oneOf:
1191
+ - $ref: '#/components/schemas/LocationRating'
1192
+ - type: 'null'
1193
+ description: User rating data from external sources. May be absent.
1194
+ structured:
1195
+ $ref: '#/components/schemas/StructuredAddress'
1196
+
1197
+ IntermediaryData:
1198
+ type: object
1199
+ required:
1200
+ - id
1201
+ - name
1202
+ - icon
1203
+ - description
1204
+ - color
1205
+ - website
1206
+ - domain
1207
+ properties:
1208
+ id:
1209
+ type: string
1210
+ format: uuid
1211
+ name:
1212
+ type: string
1213
+ icon:
1214
+ oneOf:
1215
+ - type: string
1216
+ format: uri
1217
+ - type: 'null'
1218
+ description:
1219
+ oneOf:
1220
+ - type: string
1221
+ - type: 'null'
1222
+ color:
1223
+ oneOf:
1224
+ - type: string
1225
+ - type: 'null'
1226
+ website:
1227
+ oneOf:
1228
+ - type: string
1229
+ format: uri
1230
+ - type: 'null'
1231
+ domain:
1232
+ oneOf:
1233
+ - type: string
1234
+ - type: 'null'
1235
+
1236
+ IntermediaryRecord:
1237
+ allOf:
1238
+ - $ref: '#/components/schemas/IntermediaryData'
1239
+ - type: object
1240
+ required:
1241
+ - role
1242
+ properties:
1243
+ role:
1244
+ type: string
1245
+
1246
+ PersonData:
1247
+ type: object
1248
+ required:
1249
+ - displayName
1250
+ properties:
1251
+ displayName:
1252
+ type: string
1253
+
1254
+ EntityResult:
1255
+ type: object
1256
+ required:
1257
+ - type
1258
+ - role
1259
+ - confidence
1260
+ - data
1261
+ properties:
1262
+ type:
1263
+ type: string
1264
+ enum: [merchant, location, intermediary, person]
1265
+ role:
1266
+ type: string
1267
+ confidence:
1268
+ $ref: '#/components/schemas/ConfidenceWithReasons'
1269
+ data:
1270
+ oneOf:
1271
+ - $ref: '#/components/schemas/MerchantData'
1272
+ - $ref: '#/components/schemas/LocationData'
1273
+ - $ref: '#/components/schemas/IntermediaryData'
1274
+ - $ref: '#/components/schemas/PersonData'
1275
+
1276
+ TransactionData:
1277
+ type: object
1278
+ required:
1279
+ - category
1280
+ - subscription
1281
+ - channel
1282
+ - confidence
1283
+ properties:
1284
+ category:
1285
+ $ref: '#/components/schemas/CategoryStructure'
1286
+ subscription:
1287
+ $ref: '#/components/schemas/Subscription'
1288
+ channel:
1289
+ $ref: '#/components/schemas/TransactionChannel'
1290
+ confidence:
1291
+ $ref: '#/components/schemas/ConfidenceWithReasons'
1292
+
1293
+ EnrichmentData:
1294
+ type: object
1295
+ required:
1296
+ - transaction
1297
+ - entities
1298
+ properties:
1299
+ transaction:
1300
+ $ref: '#/components/schemas/TransactionData'
1301
+ entities:
1302
+ type: array
1303
+ items:
1304
+ $ref: '#/components/schemas/EntityResult'
1305
+
1306
+ EnrichMeta:
1307
+ allOf:
1308
+ - $ref: '#/components/schemas/ResponseMeta'
1309
+ - type: object
1310
+ required:
1311
+ - categoryVersion
1312
+ properties:
1313
+ categoryVersion:
1314
+ type: string
1315
+ transactionId:
1316
+ type: string
1317
+ format: uuid
1318
+ description: Stable transaction row ID for this enrichment request (when persisted).
1319
+ errors:
1320
+ type: array
1321
+ items:
1322
+ $ref: '#/components/schemas/EnrichmentErrorCode'
1323
+
1324
+ EnrichSuccessResponse:
1325
+ type: object
1326
+ required:
1327
+ - success
1328
+ - partial
1329
+ - data
1330
+ - meta
1331
+ properties:
1332
+ success:
1333
+ type: boolean
1334
+ enum: [true]
1335
+ partial:
1336
+ type: boolean
1337
+ data:
1338
+ $ref: '#/components/schemas/EnrichmentData'
1339
+ meta:
1340
+ $ref: '#/components/schemas/EnrichMeta'
1341
+
1342
+ TransactionRecord:
1343
+ type: object
1344
+ required:
1345
+ - id
1346
+ - raw
1347
+ - country
1348
+ - direction
1349
+ - status
1350
+ - partial
1351
+ - errors
1352
+ - processingTimeMs
1353
+ - createdAt
1354
+ properties:
1355
+ id:
1356
+ type: string
1357
+ format: uuid
1358
+ raw:
1359
+ type: string
1360
+ country:
1361
+ oneOf:
1362
+ - type: string
1363
+ - type: 'null'
1364
+ direction:
1365
+ $ref: '#/components/schemas/TransactionType'
1366
+ status:
1367
+ type: string
1368
+ enum: [pending, success, partial, error]
1369
+ partial:
1370
+ type: boolean
1371
+ errors:
1372
+ type: array
1373
+ items:
1374
+ type: string
1375
+ processingTimeMs:
1376
+ oneOf:
1377
+ - type: integer
1378
+ - type: 'null'
1379
+ createdAt:
1380
+ type: string
1381
+ format: date-time
1382
+
1383
+ EnrichedTransaction:
1384
+ allOf:
1385
+ - $ref: '#/components/schemas/TransactionRecord'
1386
+ - type: object
1387
+ properties:
1388
+ transaction:
1389
+ $ref: '#/components/schemas/TransactionData'
1390
+ entities:
1391
+ type: array
1392
+ items:
1393
+ $ref: '#/components/schemas/EntityResult'
1394
+
1395
+ TransactionPagination:
1396
+ type: object
1397
+ required:
1398
+ - page
1399
+ - size
1400
+ - total
1401
+ - totalPages
1402
+ properties:
1403
+ page:
1404
+ type: integer
1405
+ size:
1406
+ type: integer
1407
+ total:
1408
+ type: integer
1409
+ totalPages:
1410
+ type: integer
1411
+
1412
+ TransactionListResponse:
1413
+ type: object
1414
+ required:
1415
+ - success
1416
+ - data
1417
+ - meta
1418
+ properties:
1419
+ success:
1420
+ type: boolean
1421
+ enum: [true]
1422
+ data:
1423
+ type: object
1424
+ required:
1425
+ - transactions
1426
+ - pagination
1427
+ properties:
1428
+ transactions:
1429
+ type: array
1430
+ items:
1431
+ $ref: '#/components/schemas/EnrichedTransaction'
1432
+ pagination:
1433
+ $ref: '#/components/schemas/TransactionPagination'
1434
+ meta:
1435
+ $ref: '#/components/schemas/ResponseMeta'
1436
+
1437
+ TransactionDetailResponse:
1438
+ type: object
1439
+ required:
1440
+ - success
1441
+ - data
1442
+ - meta
1443
+ properties:
1444
+ success:
1445
+ type: boolean
1446
+ enum: [true]
1447
+ data:
1448
+ type: object
1449
+ required:
1450
+ - transaction
1451
+ properties:
1452
+ transaction:
1453
+ $ref: '#/components/schemas/EnrichedTransaction'
1454
+ meta:
1455
+ $ref: '#/components/schemas/ResponseMeta'
1456
+
1457
+ DeleteTransactionResponse:
1458
+ type: object
1459
+ required:
1460
+ - success
1461
+ - data
1462
+ - meta
1463
+ properties:
1464
+ success:
1465
+ type: boolean
1466
+ enum: [true]
1467
+ data:
1468
+ type: object
1469
+ required:
1470
+ - deleted
1471
+ - transactionId
1472
+ properties:
1473
+ deleted:
1474
+ type: boolean
1475
+ enum: [true]
1476
+ transactionId:
1477
+ type: string
1478
+ format: uuid
1479
+ meta:
1480
+ $ref: '#/components/schemas/ResponseMeta'
1481
+
1482
+ CategoryInfo:
1483
+ type: object
1484
+ required:
1485
+ - name
1486
+ - type
1487
+ - level
1488
+ - parent
1489
+ - description
1490
+ properties:
1491
+ name:
1492
+ type: string
1493
+ type:
1494
+ type: string
1495
+ enum: [income, expense, transfer]
1496
+ level:
1497
+ type: integer
1498
+ enum: [1, 2, 3]
1499
+ parent:
1500
+ oneOf:
1501
+ - type: string
1502
+ - type: 'null'
1503
+ description:
1504
+ type: string
1505
+ mcc:
1506
+ type: integer
1507
+ sic:
1508
+ type: integer
1509
+ naics:
1510
+ type: integer
1511
+
1512
+ CategoryListMeta:
1513
+ allOf:
1514
+ - $ref: '#/components/schemas/ResponseMeta'
1515
+ - type: object
1516
+ required:
1517
+ - categoryVersion
1518
+ properties:
1519
+ categoryVersion:
1520
+ type: string
1521
+
1522
+ CategoryListResponse:
1523
+ type: object
1524
+ required:
1525
+ - success
1526
+ - data
1527
+ - meta
1528
+ properties:
1529
+ success:
1530
+ type: boolean
1531
+ enum: [true]
1532
+ data:
1533
+ type: object
1534
+ required:
1535
+ - categories
1536
+ - total
1537
+ properties:
1538
+ categories:
1539
+ type: array
1540
+ items:
1541
+ $ref: '#/components/schemas/CategoryInfo'
1542
+ total:
1543
+ type: integer
1544
+ meta:
1545
+ $ref: '#/components/schemas/CategoryListMeta'
1546
+
1547
+ MerchantResponse:
1548
+ type: object
1549
+ required:
1550
+ - success
1551
+ - data
1552
+ - meta
1553
+ properties:
1554
+ success:
1555
+ type: boolean
1556
+ enum: [true]
1557
+ data:
1558
+ type: object
1559
+ required:
1560
+ - merchant
1561
+ properties:
1562
+ merchant:
1563
+ $ref: '#/components/schemas/MerchantData'
1564
+ meta:
1565
+ $ref: '#/components/schemas/ResponseMeta'
1566
+
1567
+ LocationResponse:
1568
+ type: object
1569
+ required:
1570
+ - success
1571
+ - data
1572
+ - meta
1573
+ properties:
1574
+ success:
1575
+ type: boolean
1576
+ enum: [true]
1577
+ data:
1578
+ type: object
1579
+ required:
1580
+ - location
1581
+ properties:
1582
+ location:
1583
+ $ref: '#/components/schemas/LocationData'
1584
+ meta:
1585
+ $ref: '#/components/schemas/ResponseMeta'
1586
+
1587
+ IntermediaryResponse:
1588
+ type: object
1589
+ required:
1590
+ - success
1591
+ - data
1592
+ - meta
1593
+ properties:
1594
+ success:
1595
+ type: boolean
1596
+ enum: [true]
1597
+ data:
1598
+ type: object
1599
+ required:
1600
+ - intermediary
1601
+ properties:
1602
+ intermediary:
1603
+ $ref: '#/components/schemas/IntermediaryData'
1604
+ meta:
1605
+ $ref: '#/components/schemas/ResponseMeta'
1606
+
1607
+ EnrichmentFieldPath:
1608
+ type: string
1609
+ enum:
1610
+ - transaction
1611
+ - transaction.category
1612
+ - transaction.category.primary
1613
+ - transaction.category.primary.name
1614
+ - transaction.category.primary.code
1615
+ - transaction.category.primary.code.mcc
1616
+ - transaction.category.primary.code.sic
1617
+ - transaction.category.primary.code.naics
1618
+ - transaction.category.secondary
1619
+ - transaction.category.secondary.name
1620
+ - transaction.category.secondary.code
1621
+ - transaction.category.secondary.code.mcc
1622
+ - transaction.category.secondary.code.sic
1623
+ - transaction.category.secondary.code.naics
1624
+ - transaction.category.tertiary
1625
+ - transaction.category.tertiary.name
1626
+ - transaction.category.tertiary.code
1627
+ - transaction.category.tertiary.code.mcc
1628
+ - transaction.category.tertiary.code.sic
1629
+ - transaction.category.tertiary.code.naics
1630
+ - transaction.category.confidence
1631
+ - transaction.subscription
1632
+ - transaction.subscription.recurring
1633
+ - transaction.subscription.type
1634
+ - transaction.channel
1635
+ - transaction.confidence
1636
+ - entities
1637
+ - entities.merchant
1638
+ - entities.merchant.data
1639
+ - entities.merchant.data.name
1640
+ - entities.merchant.data.icon
1641
+ - entities.merchant.data.website
1642
+ - entities.merchant.data.description
1643
+ - entities.location
1644
+ - entities.location.data
1645
+ - entities.location.data.name
1646
+ - entities.location.data.formatted
1647
+ - entities.location.data.structured
1648
+ - entities.location.data.structured.city
1649
+ - entities.location.data.structured.country
1650
+ - entities.intermediary
1651
+ - entities.intermediary.data
1652
+ - entities.intermediary.data.name
1653
+ - entities.intermediary.data.icon
1654
+ - entities.person
1655
+ - entities.person.data
1656
+ - entities.person.data.displayName
1657
+
1658
+ IssueReportStatus:
1659
+ type: string
1660
+ enum: [pending, reviewing, resolved, dismissed]
1661
+
1662
+ ReportIssueRequest:
1663
+ type: object
1664
+ required:
1665
+ - transaction_id
1666
+ - description
1667
+ - fields
1668
+ properties:
1669
+ transaction_id:
1670
+ type: string
1671
+ format: uuid
1672
+ description:
1673
+ type: string
1674
+ minLength: 1
1675
+ maxLength: 2000
1676
+ fields:
1677
+ type: array
1678
+ minItems: 1
1679
+ maxItems: 50
1680
+ items:
1681
+ $ref: '#/components/schemas/EnrichmentFieldPath'
1682
+
1683
+ IssueReport:
1684
+ type: object
1685
+ required:
1686
+ - id
1687
+ - transactionId
1688
+ - description
1689
+ - fields
1690
+ - status
1691
+ - statusMessage
1692
+ - createdAt
1693
+ - updatedAt
1694
+ properties:
1695
+ id:
1696
+ type: string
1697
+ format: uuid
1698
+ transactionId:
1699
+ type: string
1700
+ format: uuid
1701
+ description:
1702
+ type: string
1703
+ fields:
1704
+ type: array
1705
+ items:
1706
+ type: string
1707
+ status:
1708
+ $ref: '#/components/schemas/IssueReportStatus'
1709
+ statusMessage:
1710
+ oneOf:
1711
+ - type: string
1712
+ - type: 'null'
1713
+ createdAt:
1714
+ type: string
1715
+ format: date-time
1716
+ updatedAt:
1717
+ type: string
1718
+ format: date-time
1719
+
1720
+ IssueReportResponse:
1721
+ type: object
1722
+ required:
1723
+ - success
1724
+ - data
1725
+ - meta
1726
+ properties:
1727
+ success:
1728
+ type: boolean
1729
+ enum: [true]
1730
+ data:
1731
+ type: object
1732
+ required:
1733
+ - issueReport
1734
+ properties:
1735
+ issueReport:
1736
+ $ref: '#/components/schemas/IssueReport'
1737
+ meta:
1738
+ $ref: '#/components/schemas/ResponseMeta'
1739
+
1740
+ IssueReportListResponse:
1741
+ type: object
1742
+ required:
1743
+ - success
1744
+ - data
1745
+ - meta
1746
+ properties:
1747
+ success:
1748
+ type: boolean
1749
+ enum: [true]
1750
+ data:
1751
+ type: array
1752
+ items:
1753
+ $ref: '#/components/schemas/IssueReport'
1754
+ meta:
1755
+ $ref: '#/components/schemas/PaginationMeta'
1756
+
1757
+ responses:
1758
+ Unauthorized:
1759
+ description: Authentication failed or missing credentials
1760
+ content:
1761
+ application/json:
1762
+ schema:
1763
+ $ref: '#/components/schemas/ErrorResponse'
1764
+ example:
1765
+ success: false
1766
+ error:
1767
+ code: authentication_error
1768
+ message: API key is required
1769
+ meta:
1770
+ generatedAt: '2026-02-16T00:00:00Z'
1771
+ requestId: 'f353ca91-4fc5-49f2-9b9e-304f83d11914'
1772
+ version: '1.1.2'
1773
+
1774
+ Forbidden:
1775
+ description: Authenticated but not authorized
1776
+ content:
1777
+ application/json:
1778
+ schema:
1779
+ $ref: '#/components/schemas/ErrorResponse'
1780
+ example:
1781
+ success: false
1782
+ error:
1783
+ code: authorization_error
1784
+ message: Access denied
1785
+ meta:
1786
+ generatedAt: '2026-02-16T00:00:00Z'
1787
+ requestId: 'f353ca91-4fc5-49f2-9b9e-304f83d11914'
1788
+ version: '1.1.2'
1789
+
1790
+ ValidationError:
1791
+ description: Request validation failed
1792
+ content:
1793
+ application/json:
1794
+ schema:
1795
+ $ref: '#/components/schemas/ErrorResponse'
1796
+ example:
1797
+ success: false
1798
+ error:
1799
+ code: validation_error
1800
+ message: Validation failed
1801
+ details:
1802
+ fieldErrors:
1803
+ title:
1804
+ - Title is required
1805
+ meta:
1806
+ generatedAt: '2026-02-16T00:00:00Z'
1807
+ requestId: 'f353ca91-4fc5-49f2-9b9e-304f83d11914'
1808
+ version: '1.1.2'
1809
+
1810
+ NotFound:
1811
+ description: Resource not found
1812
+ content:
1813
+ application/json:
1814
+ schema:
1815
+ $ref: '#/components/schemas/ErrorResponse'
1816
+
1817
+ InsufficientCredits:
1818
+ description: Insufficient credits
1819
+ content:
1820
+ application/json:
1821
+ schema:
1822
+ $ref: '#/components/schemas/ErrorResponse'
1823
+ example:
1824
+ success: false
1825
+ error:
1826
+ code: insufficient_credits
1827
+ message: Insufficient credits
1828
+ meta:
1829
+ generatedAt: '2026-02-16T00:00:00Z'
1830
+ requestId: 'f353ca91-4fc5-49f2-9b9e-304f83d11914'
1831
+ version: '1.1.2'
1832
+
1833
+ DuplicateRequest:
1834
+ description: Duplicate idempotent request (completed or in-progress)
1835
+ headers:
1836
+ Retry-After:
1837
+ schema:
1838
+ type: integer
1839
+ description: Present when `details.state=in_progress`; value is in seconds.
1840
+ content:
1841
+ application/json:
1842
+ schema:
1843
+ $ref: '#/components/schemas/DuplicateRequestErrorResponse'
1844
+
1845
+ RateLimited:
1846
+ description: Rate limit exceeded
1847
+ headers:
1848
+ X-RateLimit-Limit:
1849
+ schema:
1850
+ type: integer
1851
+ description: Requests per second (sustained rate)
1852
+ X-RateLimit-Remaining:
1853
+ schema:
1854
+ type: integer
1855
+ description: Current token-bucket capacity available
1856
+ X-RateLimit-Reset:
1857
+ schema:
1858
+ type: string
1859
+ format: date-time
1860
+ description: Timestamp when token bucket refills
1861
+ X-RateLimit-Scope:
1862
+ schema:
1863
+ type: string
1864
+ enum: [rps, concurrency]
1865
+ description: Active limiting dimension
1866
+ X-RateLimit-Concurrency-Limit:
1867
+ schema:
1868
+ type: integer
1869
+ description: Max concurrent requests for the org
1870
+ X-RateLimit-Concurrency-Remaining:
1871
+ schema:
1872
+ type: integer
1873
+ description: Remaining concurrent request slots
1874
+ Retry-After:
1875
+ schema:
1876
+ type: integer
1877
+ description: Seconds until retry is allowed
1878
+ content:
1879
+ application/json:
1880
+ schema:
1881
+ $ref: '#/components/schemas/ErrorResponse'
1882
+ example:
1883
+ success: false
1884
+ error:
1885
+ code: rate_limited
1886
+ message: Rate limit exceeded
1887
+ meta:
1888
+ generatedAt: '2026-02-16T00:00:00Z'
1889
+ requestId: 'f353ca91-4fc5-49f2-9b9e-304f83d11914'
1890
+ version: '1.1.2'
1891
+
1892
+ ClientDisconnected:
1893
+ description: Client closed request before completion
1894
+ content:
1895
+ application/json:
1896
+ schema:
1897
+ $ref: '#/components/schemas/ClientDisconnectedErrorResponse'
1898
+
1899
+ InternalError:
1900
+ description: Internal server error
1901
+ content:
1902
+ application/json:
1903
+ schema:
1904
+ $ref: '#/components/schemas/ErrorResponse'
1905
+
1906
+ ServiceUnavailable:
1907
+ description: Service temporarily unavailable
1908
+ headers:
1909
+ Retry-After:
1910
+ schema:
1911
+ type: integer
1912
+ description: Seconds until retry is allowed
1913
+ content:
1914
+ application/json:
1915
+ schema:
1916
+ $ref: '#/components/schemas/ErrorResponse'
1917
+
1918
+ GatewayTimeout:
1919
+ description: Upstream timeout
1920
+ content:
1921
+ application/json:
1922
+ schema:
1923
+ $ref: '#/components/schemas/ErrorResponse'