-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathopenapi.yaml
More file actions
831 lines (831 loc) · 32.2 KB
/
openapi.yaml
File metadata and controls
831 lines (831 loc) · 32.2 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
openapi: 3.1.0
info:
title: Formbricks Hub API
description: "Feedback record storage service for the Formbricks ecosystem.\n\n\U0001F4DA Full Documentation: https://hub.formbricks.com\n\U0001F680 Quick Start: https://hub.formbricks.com/quickstart\n\U0001F50C Connector Ecosystem: Coming soon"
contact:
name: Formbricks Team
url: https://formbricks.com
email: support@formbricks.com
license:
name: Apache-2.0
url: https://www.apache.org/licenses/LICENSE-2.0
version: 1.0.0
servers:
- url: http://0.0.0.0:8080
description: API server
paths:
/v1/feedback-records:
get:
tags:
- Feedback Records
summary: List feedback records with filters
description: Lists feedback records with optional filters and pagination
operationId: list-feedback-records
parameters:
- name: tenant_id
in: query
description: Filter by tenant ID (for multi-tenant deployments)
explode: false
schema:
type: string
description: Filter by tenant ID (for multi-tenant deployments)
- name: response_id
in: query
description: Filter by response ID (get all answers from one submission)
explode: false
schema:
type: string
description: Filter by response ID (get all answers from one submission)
- name: source_type
in: query
description: Filter by source type
explode: false
schema:
type: string
description: Filter by source type
- name: source_id
in: query
description: Filter by source ID
explode: false
schema:
type: string
description: Filter by source ID
- name: field_type
in: query
description: Filter by field type
explode: false
schema:
type: string
description: Filter by field type
- name: user_identifier
in: query
description: Filter by user identifier
explode: false
schema:
type: string
description: Filter by user identifier
- name: since
in: query
description: Filter by collected_at >= since (ISO 8601 format)
explode: false
schema:
type: string
description: Filter by collected_at >= since (ISO 8601 format)
- name: until
in: query
description: Filter by collected_at <= until (ISO 8601 format)
explode: false
schema:
type: string
description: Filter by collected_at <= until (ISO 8601 format)
- name: limit
in: query
description: Number of results to return (max 1000)
explode: false
schema:
type: integer
description: Number of results to return (max 1000)
format: int64
default: 100
minimum: 1
maximum: 1000
- name: offset
in: query
description: Number of results to skip
explode: false
schema:
type: integer
description: Number of results to skip
format: int64
default: 0
minimum: 0
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ListFeedbackRecordsOutputBody'
default:
description: Error
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorModel'
post:
tags:
- Feedback Records
summary: Create a new feedback record
description: Creates a new feedback record data point
operationId: create-feedback-record
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CreateFeedbackRecordInputBody'
required: true
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/FeedbackRecordData'
default:
description: Error
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorModel'
delete:
tags:
- Feedback Records
summary: Bulk delete feedback records by user identifier
description: Permanently deletes all feedback record data points matching the specified user_identifier. This endpoint supports GDPR Article 17 (Right to Erasure) requests.
operationId: bulk-delete-feedback-records
parameters:
- name: user_identifier
in: query
description: Delete all records matching this user identifier (required)
explode: false
schema:
type: string
description: Delete all records matching this user identifier (required)
minLength: 1
- name: tenant_id
in: query
description: Filter by tenant ID (optional, for multi-tenant deployments)
explode: false
schema:
type: string
description: Filter by tenant ID (optional, for multi-tenant deployments)
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/BulkDeleteFeedbackRecordsOutputBody'
default:
description: Error
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorModel'
/v1/feedback-records/{id}:
get:
tags:
- Feedback Records
summary: Get a feedback record by ID
description: Retrieves a single feedback record data point by its UUID
operationId: get-feedback-record
parameters:
- name: id
in: path
description: Feedback Record ID (UUID)
required: true
schema:
type: string
description: Feedback Record ID (UUID)
format: uuid
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/FeedbackRecordData'
default:
description: Error
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorModel'
delete:
tags:
- Feedback Records
summary: Delete a feedback record
description: Permanently deletes a feedback record data point
operationId: delete-feedback-record
parameters:
- name: id
in: path
description: Feedback Record ID (UUID)
required: true
schema:
type: string
description: Feedback Record ID (UUID)
format: uuid
responses:
"204":
description: No Content
default:
description: Error
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorModel'
patch:
tags:
- Feedback Records
summary: Update a feedback record
description: Updates specific fields of a feedback record data point
operationId: update-feedback-record
parameters:
- name: id
in: path
description: Feedback Record ID (UUID)
required: true
schema:
type: string
description: Feedback Record ID (UUID)
format: uuid
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateFeedbackRecordInputBody'
required: true
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/FeedbackRecordData'
default:
description: Error
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorModel'
/v1/feedback-records/search:
get:
tags:
- Feedback Records
summary: Search feedback records using semantic search
description: Performs vector similarity search on feedback record data using OpenAI embeddings. Only returns text records that have been embedded.
operationId: search-feedback-records
parameters:
- name: query
in: query
description: Natural language search query
required: true
explode: false
schema:
type: string
description: Natural language search query
examples:
- pricing feedback
minLength: 1
maxLength: 1000
example: pricing feedback
- name: limit
in: query
description: Maximum number of results to return
explode: false
schema:
type: integer
description: Maximum number of results to return
format: int64
default: 10
minimum: 1
maximum: 100
- name: source_type
in: query
description: Filter by source type (e.g., survey, review)
explode: false
schema:
type: string
description: Filter by source type (e.g., survey, review)
examples:
- survey
example: survey
- name: since
in: query
description: Filter by collection date (ISO 8601)
explode: false
schema:
type: string
description: Filter by collection date (ISO 8601)
examples:
- "2024-01-01T00:00:00Z"
example: "2024-01-01T00:00:00Z"
- name: until
in: query
description: Filter by collection date (ISO 8601)
explode: false
schema:
type: string
description: Filter by collection date (ISO 8601)
examples:
- "2024-12-31T23:59:59Z"
example: "2024-12-31T23:59:59Z"
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/SearchOutputBody'
default:
description: Error
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorModel'
components:
schemas:
BulkDeleteFeedbackRecordsOutputBody:
type: object
additionalProperties: false
properties:
$schema:
type: string
description: A URL to the JSON Schema for this object.
format: uri
examples:
- http://0.0.0.0:8080/schemas/BulkDeleteFeedbackRecordsOutputBody.json
readOnly: true
deleted_count:
type: integer
description: Number of records deleted
format: int64
message:
type: string
description: Human-readable status message
required:
- deleted_count
- message
CreateFeedbackRecordInputBody:
type: object
additionalProperties: false
properties:
$schema:
type: string
description: A URL to the JSON Schema for this object.
format: uri
examples:
- http://0.0.0.0:8080/schemas/CreateFeedbackRecordInputBody.json
readOnly: true
collected_at:
type: string
description: When the feedback was collected (defaults to now)
format: date-time
field_id:
type: string
description: Identifier for the question/field
examples:
- q1
minLength: 1
maxLength: 255
field_label:
type: string
description: The actual question text
examples:
- How satisfied are you?
field_type:
type: string
description: 'Field type: text (enrichable), categorical, nps, csat, ces, rating, number, boolean, date'
examples:
- rating
enum:
- text
- categorical
- nps
- csat
- ces
- rating
- number
- boolean
- date
minLength: 1
maxLength: 255
language:
type: string
description: ISO language code
examples:
- en
maxLength: 10
metadata:
type: object
description: User agent, device, location, referrer, tags, etc.
additionalProperties: {}
response_id:
type: string
description: Groups multiple answers from a single submission/session
examples:
- resp-abc-123
maxLength: 255
source_id:
type: string
description: Reference to survey/form/ticket ID
examples:
- survey-123
source_name:
type: string
description: Human-readable name
examples:
- Q1 NPS Survey
source_type:
type: string
description: Type of feedback source (e.g., survey, review, feedback_form)
examples:
- survey
minLength: 1
maxLength: 255
tenant_id:
type: string
description: Tenant/organization identifier for multi-tenancy
examples:
- org-123
maxLength: 255
user_identifier:
type: string
description: Anonymous ID or email hash
examples:
- user-abc-123
value_boolean:
type: boolean
description: For yes/no questions
examples:
- true
value_date:
type: string
description: For date responses
format: date-time
value_json:
type: object
description: For complex responses like multiple choice arrays
additionalProperties: {}
value_number:
type: number
description: For ratings, NPS scores, numeric responses
format: double
examples:
- 9
value_text:
type: string
description: For open-ended text responses
examples:
- Great service!
required:
- source_type
- field_id
- field_type
ErrorDetail:
type: object
additionalProperties: false
properties:
location:
type: string
description: Where the error occurred, e.g. 'body.items[3].tags' or 'path.thing-id'
message:
type: string
description: Error message text
value:
description: The value at the given location
ErrorModel:
type: object
additionalProperties: false
properties:
$schema:
type: string
description: A URL to the JSON Schema for this object.
format: uri
examples:
- http://0.0.0.0:8080/schemas/ErrorModel.json
readOnly: true
detail:
type: string
description: A human-readable explanation specific to this occurrence of the problem.
examples:
- Property foo is required but is missing.
errors:
type: array
description: Optional list of individual error details
items:
$ref: '#/components/schemas/ErrorDetail'
instance:
type: string
description: A URI reference that identifies the specific occurrence of the problem.
format: uri
examples:
- https://example.com/error-log/abc123
status:
type: integer
description: HTTP status code
format: int64
examples:
- 400
title:
type: string
description: A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
examples:
- Bad Request
type:
type: string
description: A URI reference to human-readable documentation for the error.
format: uri
default: about:blank
examples:
- https://example.com/errors/example
FeedbackRecordData:
type: object
additionalProperties: false
properties:
$schema:
type: string
description: A URL to the JSON Schema for this object.
format: uri
examples:
- http://0.0.0.0:8080/schemas/FeedbackRecordData.json
readOnly: true
collected_at:
type: string
description: When the feedback was collected
format: date-time
created_at:
type: string
description: When this record was created
format: date-time
emotion:
type: string
description: 'AI-detected emotion: joy, anger, frustration, sadness, neutral'
field_id:
type: string
description: Identifier for the question/field
field_label:
type: string
description: The actual question text
field_type:
type: string
description: Type of field
id:
type: string
description: UUIDv7 primary key
language:
type: string
description: ISO language code
metadata:
type: object
description: Additional context
additionalProperties: {}
response_id:
type: string
description: Groups answers from a single submission
sentiment:
type: string
description: 'AI-detected sentiment: positive, negative, neutral'
sentiment_score:
type: number
description: Sentiment intensity from -1 (negative) to +1 (positive)
format: double
source_id:
type: string
description: Reference to survey/form/ticket ID
source_name:
type: string
description: Human-readable name
source_type:
type: string
description: Type of feedback source
tenant_id:
type: string
description: Tenant/organization identifier
topics:
type: array
description: Key topics extracted by AI
items:
type: string
updated_at:
type: string
description: When this record was last updated
format: date-time
user_identifier:
type: string
description: User identifier
value_boolean:
type: boolean
description: Boolean response
value_date:
type: string
description: Date response
format: date-time
value_json:
type: object
description: Complex response
additionalProperties: {}
value_number:
type: number
description: Numeric response
format: double
value_text:
type: string
description: Text response
required:
- id
- collected_at
- created_at
- updated_at
- source_type
- field_id
- field_type
ListFeedbackRecordsOutputBody:
type: object
additionalProperties: false
properties:
$schema:
type: string
description: A URL to the JSON Schema for this object.
format: uri
examples:
- http://0.0.0.0:8080/schemas/ListFeedbackRecordsOutputBody.json
readOnly: true
data:
type: array
description: List of feedback records
items:
$ref: '#/components/schemas/FeedbackRecordData'
limit:
type: integer
description: Limit used in query
format: int64
offset:
type: integer
description: Offset used in query
format: int64
total:
type: integer
description: Total count of feedback records matching filters
format: int64
required:
- data
- total
- limit
- offset
SearchOutputBody:
type: object
additionalProperties: false
properties:
$schema:
type: string
description: A URL to the JSON Schema for this object.
format: uri
examples:
- http://0.0.0.0:8080/schemas/SearchOutputBody.json
readOnly: true
count:
type: integer
description: Number of results returned
format: int64
query:
type: string
description: The search query that was executed
results:
type: array
description: Search results ordered by relevance
items:
$ref: '#/components/schemas/SearchResultItem'
required:
- results
- query
- count
SearchResultItem:
type: object
additionalProperties: false
properties:
collected_at:
type: string
description: When the feedback was collected
format: date-time
created_at:
type: string
description: When this record was created
format: date-time
emotion:
type: string
description: 'AI-detected emotion: joy, anger, frustration, sadness, neutral'
field_id:
type: string
description: Identifier for the question/field
field_label:
type: string
description: The actual question text
field_type:
type: string
description: Type of field
id:
type: string
description: UUIDv7 primary key
language:
type: string
description: ISO language code
metadata:
type: object
description: Additional context
additionalProperties: {}
response_id:
type: string
description: Groups answers from a single submission
sentiment:
type: string
description: 'AI-detected sentiment: positive, negative, neutral'
sentiment_score:
type: number
description: Sentiment intensity from -1 (negative) to +1 (positive)
format: double
similarity_score:
type: number
description: Cosine similarity score (0-1, higher is more similar)
format: double
source_id:
type: string
description: Reference to survey/form/ticket ID
source_name:
type: string
description: Human-readable name
source_type:
type: string
description: Type of feedback source
tenant_id:
type: string
description: Tenant/organization identifier
topics:
type: array
description: Key topics extracted by AI
items:
type: string
updated_at:
type: string
description: When this record was last updated
format: date-time
user_identifier:
type: string
description: User identifier
value_boolean:
type: boolean
description: Boolean response
value_date:
type: string
description: Date response
format: date-time
value_json:
type: object
description: Complex response
additionalProperties: {}
value_number:
type: number
description: Numeric response
format: double
value_text:
type: string
description: Text response
required:
- similarity_score
- id
- collected_at
- created_at
- updated_at
- source_type
- field_id
- field_type
UpdateFeedbackRecordInputBody:
type: object
additionalProperties: false
properties:
$schema:
type: string
description: A URL to the JSON Schema for this object.
format: uri
examples:
- http://0.0.0.0:8080/schemas/UpdateFeedbackRecordInputBody.json
readOnly: true
language:
type: string
description: Update language
metadata:
type: object
description: Update metadata
additionalProperties: {}
user_identifier:
type: string
description: Update user identifier
value_boolean:
type: boolean
description: Update boolean response
value_date:
type: string
description: Update date response
format: date-time
value_json:
type: object
description: Update complex response
additionalProperties: {}
value_number:
type: number
description: Update numeric response
format: double
value_text:
type: string
description: Update text response