Repository navigation
Expand file tree
/
Copy pathopenapi.yaml
More file actions
4613 lines (4592 loc) · 218 KB
/
Copy pathopenapi.yaml
File metadata and controls
4613 lines (4592 loc) · 218 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: Formbricks Hub API
description: |
Feedback record storage and webhook delivery for the Formbricks ecosystem.
Store feedback records and subscribe to events via webhooks (Standard Webhooks).
Webhook payloads are described by WebhookDeliveryPayload; use the signing_key to verify requests.
A JSON request body is a single object (a JSON null is read as an empty object) whose member names
match the documented spelling exactly; they are case-sensitive. A member spelled any other way, or a
member name repeated within any object (free-form members such as metadata included), is rejected
with 400 naming the member in invalid_params. Data after the object is rejected with 400 too, with
the cause in the problem detail. A tenant_id in a request body may not contain U+FFFD, which the decoder
substitutes for invalid UTF-8 and unpaired surrogates; such a value is rejected with 400.
An operation that takes query parameters rejects one it does not declare with 400, naming it in
invalid_params, rather than ignoring it: an ignored filter returns more records than the caller
asked for, with a 200 that looks right. A repeatable parameter is sent once per value
(source_type=a&source_type=b); the indexed form (source_type[0]=a) is rejected the same way,
since it can decode to a different filter (a gap in the indexes becomes an empty value). A
single-valued parameter given more than once, and a query string that is not well formed (a ";"
separator, a broken percent escape, reported under the name "query"), are rejected with 400 too.
An empty filter value is no constraint: ?source_type= is the same request as omitting
source_type (an empty tenant_id is never read as "no tenant"). Hub
releases up to 0.14.1 ignored unknown parameters, accepted the indexed form, kept the first of
repeated single values, and read an empty value of a repeatable string filter as a filter on "".
Self-hosted Hub servers advertise their deployed base URL from PUBLIC_BASE_URL so generated SDK clients
can point to the correct Hub instance.
Full Documentation: https://hub.formbricks.com
Quick Start: https://hub.formbricks.com/quickstart
contact:
name: Formbricks Team
url: https://formbricks.com
email: hola@formbricks.com
license:
name: Apache-2.0
url: https://www.apache.org/licenses/LICENSE-2.0
version: 1.3.0
servers:
- url: "{scheme}://{host}{basePath}"
description: Deployed Formbricks Hub instance (self-hosted or Formbricks Cloud)
variables:
scheme:
default: http
enum:
- http
- https
description: URL scheme for the Hub instance
host:
default: localhost:8080
description: Public hostname and optional port for the Hub instance
basePath:
default: ""
description: Optional reverse-proxy path prefix, for example /hub
- url: https://hub-internal.formbricks.com
description: Formbricks staging Hub server
- url: https://app.formbricks.com
description: Formbricks Cloud
- url: https://staging.app.formbricks.com
description: Formbricks Cloud (staging)
- url: http://localhost:8080
description: Local development server
tags:
- name: Health
description: Health check endpoints
- name: Feedback Records
description: Feedback record CRUD and search
- name: Webhooks
description: Webhook subscription management
- name: Tenant Data
description: Tenant-scoped data purge operations
- name: Tenant Settings
description: Tenant-scoped enrichment settings
- name: Taxonomy
description: Automatic topic/subtopic taxonomy generation, run history, tree browsing, and node edits
- name: Enrichment Status
description: Tenant-scoped enrichment progress (translation, sentiment, emotions)
security:
- ApiKeyAuth: []
paths:
/health:
get:
tags:
- Health
summary: Health check
description: Returns OK if the service is running
operationId: health-check
security: [] # No authentication required for health check
responses:
"200":
description: Service is healthy
content:
text/plain:
schema:
type: string
example: "OK"
/v1/feedback-records:
get:
tags:
- Feedback Records
summary: List feedback records with filters
description: Lists feedback records for a required tenant_id with optional additional filters and pagination
operationId: list-feedback-records
parameters:
- $ref: '#/components/parameters/FeedbackRecordsTenantId'
- $ref: '#/components/parameters/FeedbackRecordsSubmissionId'
- $ref: '#/components/parameters/FeedbackRecordsSourceType'
- $ref: '#/components/parameters/FeedbackRecordsSourceId'
- $ref: '#/components/parameters/FeedbackRecordsFieldId'
- $ref: '#/components/parameters/FeedbackRecordsFieldGroupId'
- $ref: '#/components/parameters/FeedbackRecordsFieldType'
- $ref: '#/components/parameters/FeedbackRecordsValueId'
- $ref: '#/components/parameters/FeedbackRecordsUserId'
- $ref: '#/components/parameters/FeedbackRecordsSourceName'
- $ref: '#/components/parameters/FeedbackRecordsLanguage'
- $ref: '#/components/parameters/FeedbackRecordsSince'
- $ref: '#/components/parameters/FeedbackRecordsUntil'
- $ref: '#/components/parameters/FeedbackRecordsCreatedSince'
- $ref: '#/components/parameters/FeedbackRecordsCreatedUntil'
- $ref: '#/components/parameters/FeedbackRecordsUpdatedSince'
- $ref: '#/components/parameters/FeedbackRecordsUpdatedUntil'
- $ref: '#/components/parameters/FeedbackRecordsValueNumberMin'
- $ref: '#/components/parameters/FeedbackRecordsValueNumberMax'
- $ref: '#/components/parameters/FeedbackRecordsValueDateMin'
- $ref: '#/components/parameters/FeedbackRecordsValueDateMax'
- $ref: '#/components/parameters/FeedbackRecordsSentiment'
- $ref: '#/components/parameters/FeedbackRecordsEmotions'
- $ref: '#/components/parameters/FeedbackRecordsSentimentScoreMin'
- $ref: '#/components/parameters/FeedbackRecordsSentimentScoreMax'
- $ref: '#/components/parameters/FeedbackRecordsHasSentiment'
- $ref: '#/components/parameters/FeedbackRecordsHasEmotions'
- $ref: '#/components/parameters/FeedbackRecordsHasTranslation'
- name: sort
in: query
description: |
Column to order by. Defaults to collected_at. collected_at and created_at never
change. updated_at does, so it is accepted only with order=asc: ascending, a
record that changes while you page normally moves ahead of the cursor and is
returned again (upsert it by id); descending, every such record would land behind
the cursor and be lost, so that combination is a 400. Ascending still misses a
write that started before the cursor's position and commits after it; the next
run picks it up when its updated_since is the previous run's start minus an
overlap. Use sort=updated_at&order=asc with updated_since and updated_until for
incremental extraction, both derived from the Date header of one request made
at the run's start (see the filtering and sorting guide): every page is one
ordered index range.
schema:
type: string
default: collected_at
enum:
- collected_at
- created_at
- updated_at
- name: order
in: query
description: Sort direction. Defaults to desc, so sort=updated_at needs order=asc given explicitly. Rows tied on the sort column are ordered by id ascending.
schema:
type: string
default: desc
enum:
- asc
- desc
- name: limit
in: query
description: Number of results to return (max 1000)
schema:
type: integer
description: Number of results to return (max 1000)
format: int64
default: 100
minimum: 1
maximum: 1000
- name: cursor
in: query
description: |
Omit for the first page. For the next page, use the exact value from the previous response's next_cursor.
Opaque (base64-encoded); keyset pagination.
A cursor is a position within one specific ordering. Presenting it with a different
sort or order returns 400 — restart pagination without a cursor instead. A cursor
issued before sort control existed records no ordering; it is treated as a position
in the default collected_at/desc listing and is accepted only there.
schema:
type: string
example: "eyJ0IjoiMjAyNC0wMS0xNVQxMDozMDowMFoiLCJpIjoiMDE4ZTEyMzQtNTY3OC05YWJjLWRlZjAtMTIzNDU2Nzg5YWJjIn0="
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ListFeedbackRecordsOutputBody'
examples:
basic:
summary: Basic list response
value:
data:
- id: "018e1234-5678-9abc-def0-123456789abc"
collected_at: "2024-01-15T10:30:00Z"
created_at: "2024-01-15T10:30:00Z"
updated_at: "2024-01-15T10:30:00Z"
source_type: "survey"
field_id: "q1"
field_type: "rating"
field_label: "How satisfied are you?"
value_number: 9
source_id: "survey-123"
source_name: "Q1 NPS Survey"
user_id: "user-abc-123"
tenant_id: "org-123"
submission_id: "550e8400-e29b-41d4-a716-446655440000"
limit: 100
"400":
description: |
Bad Request. Returned for a query parameter this operation does not declare (or
sends in the indexed form, or repeats when it takes one value), a malformed query
string, an unknown enum value (sentiment, emotions, field_type, sort, order), an inverted range
whose *_min/*_since exceeds its *_max/*_until, a malformed cursor, or a cursor
issued for a different sort/order.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorModel'
examples:
inverted_range:
summary: A range filter supplied backwards
value:
type: "https://hub.formbricks.com/problems/validation"
title: "Validation Error"
status: 400
code: "validation"
detail: "One or more request parameters are invalid"
request_id: "0190a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5b"
invalid_params:
- name: "sentiment_score_min"
reason: "must be less than or equal to sentiment_score_max"
cursor_sort_mismatch:
summary: A cursor carried across a change of ordering
value:
type: "https://hub.formbricks.com/problems/validation"
title: "Validation Error"
status: 400
code: "validation"
detail: "One or more request parameters are invalid"
request_id: "0190a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5b"
invalid_params:
- name: "cursor"
reason: "was issued for a different sort/order; restart pagination without a cursor, or keep sort and order unchanged"
unknown_parameter:
summary: A misspelled filter, rejected rather than ignored
value:
type: "https://hub.formbricks.com/problems/validation"
title: "Validation Error"
status: 400
code: "validation"
detail: "One or more request parameters are invalid"
request_id: "0190a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5b"
invalid_params:
- name: "updatd_since"
reason: "is not a recognized query parameter for this operation"
"401":
description: Unauthorized (missing or invalid API key)
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorModel'
default:
description: Error
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorModel'
examples:
validation_error:
summary: Validation error
value:
type: "https://hub.formbricks.com/problems/validation"
title: "Validation Error"
status: 400
code: "validation"
detail: "One or more request parameters are invalid"
instance: "/v1/feedback-records"
request_id: "0190a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5b"
invalid_params:
- name: "tenant_id"
reason: "is required"
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'
examples:
rating:
summary: Rating feedback
value:
source_type: "survey"
field_id: "q1"
field_type: "rating"
field_label: "How satisfied are you?"
value_number: 9
source_id: "survey-123"
source_name: "Q1 NPS Survey"
user_id: "user-abc-123"
tenant_id: "org-123"
submission_id: "550e8400-e29b-41d4-a716-446655440000"
language: "en"
text:
summary: Text feedback
value:
source_type: "survey"
field_id: "q2"
field_type: "text"
field_label: "What can we improve?"
value_text: "Great service! Keep it up."
source_id: "survey-123"
source_name: "Q1 NPS Survey"
user_id: "user-abc-123"
tenant_id: "org-123"
submission_id: "550e8400-e29b-41d4-a716-446655440000"
language: "en"
nps:
summary: NPS score
value:
source_type: "survey"
field_id: "nps"
field_type: "nps"
field_label: "How likely are you to recommend us?"
value_number: 8
source_id: "survey-123"
source_name: "NPS Survey"
user_id: "user-abc-123"
tenant_id: "org-123"
submission_id: "550e8400-e29b-41d4-a716-446655440000"
language: "en"
boolean:
summary: Boolean feedback
value:
source_type: "survey"
field_id: "q3"
field_type: "boolean"
field_label: "Would you use our service again?"
value_boolean: true
source_id: "survey-123"
source_name: "Q1 NPS Survey"
user_id: "user-abc-123"
tenant_id: "org-123"
submission_id: "550e8400-e29b-41d4-a716-446655440000"
language: "en"
ranking:
summary: Ranking question item
value:
source_type: "survey"
field_id: "feature_priority__reports"
field_type: "number"
field_label: "Reports"
field_group_id: "feature_priority"
field_group_label: "Rank these features by importance"
value_number: 1
source_id: "survey-123"
source_name: "Feature Priority Survey"
user_id: "user-abc-123"
tenant_id: "org-123"
submission_id: "550e8400-e29b-41d4-a716-446655440000"
metadata:
question_type: "ranking"
total_items: 3
matrix:
summary: Matrix rating item
value:
source_type: "survey"
field_id: "feature_satisfaction__ease_of_use"
field_type: "rating"
field_label: "Ease of Use"
field_group_id: "feature_satisfaction"
field_group_label: "Rate your satisfaction with each feature"
value_number: 4
source_id: "survey-123"
source_name: "Feature Satisfaction Survey"
user_id: "user-abc-123"
tenant_id: "org-123"
submission_id: "550e8400-e29b-41d4-a716-446655440000"
metadata:
question_type: "matrix"
required: true
responses:
"201":
description: Created
content:
application/json:
schema:
$ref: '#/components/schemas/FeedbackRecordData'
examples:
created:
summary: Created feedback record
value:
id: "018e1234-5678-9abc-def0-123456789abc"
collected_at: "2024-01-15T10:30:00Z"
created_at: "2024-01-15T10:30:00Z"
updated_at: "2024-01-15T10:30:00Z"
source_type: "survey"
field_id: "q1"
field_type: "rating"
field_label: "How satisfied are you?"
value_number: 9
source_id: "survey-123"
source_name: "Q1 NPS Survey"
user_id: "user-abc-123"
tenant_id: "org-123"
submission_id: "550e8400-e29b-41d4-a716-446655440000"
language: "en"
links:
GetCreatedRecord:
operationId: get-feedback-record
parameters:
id: '$response.body#/id'
description: Retrieve the created feedback record by ID
UpdateCreatedRecord:
operationId: update-feedback-record
parameters:
id: '$response.body#/id'
description: Update the created feedback record by ID
DeleteCreatedRecord:
operationId: delete-feedback-record
parameters:
id: '$response.body#/id'
description: Delete the created feedback record by ID
"400":
description: Bad Request (e.g. validation error)
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorModel'
examples:
invalid_field_type:
summary: Invalid field_type enum
value:
type: "https://hub.formbricks.com/problems/validation"
title: "Validation Error"
status: 400
code: "validation"
detail: "One or more request parameters are invalid"
instance: "/v1/feedback-records"
request_id: "0190a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5b"
invalid_params:
- name: "field_type"
reason: "has invalid value \"textt\"; must be one of: text, categorical, nps, csat, ces, rating, number, boolean, date"
"413":
description: Request body exceeds the maximum allowed size.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorModel'
"409":
description: |
Conflict. Either a duplicate tenant_id/submission_id/field_id (code `conflict`, terminal),
or a tenant data purge is in progress for this tenant (code `tenant_write_conflict`,
retryable – retry after the purge completes).
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorModel'
default:
description: Error
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorModel'
delete:
tags:
- Feedback Records
summary: Delete feedback records by user ID
description: |
Permanently deletes feedback record data points for the specified user_id/data subject.
Omit tenant_id to delete that user_id across all tenants for GDPR Article 17 (Right to Erasure)
requests. Provide tenant_id to restrict deletion to that tenant only. Derived embeddings for deleted
feedback records are removed by database cascade. The operation is idempotent; repeated calls return
deleted_count 0 after matching records have already been deleted.
operationId: delete-feedback-records-by-user
parameters:
- name: user_id
in: query
description: Delete records matching this user ID (required). NULL bytes not allowed.
required: true
schema:
type: string
description: Delete records matching this user ID (required). NULL bytes not allowed.
minLength: 1
maxLength: 255
pattern: '^[^\x00]*$'
example: "user-abc-123"
- name: tenant_id
in: query
description: Optional tenant scope. Omit this parameter to delete all records matching user_id across tenants; provide it to delete only records for this tenant. Empty strings and NULL bytes are not allowed.
schema:
type: string
description: Optional tenant scope. Omit this parameter to delete all records matching user_id across tenants; provide it to delete only records for this tenant. Empty strings and NULL bytes are not allowed.
minLength: 1
maxLength: 255
pattern: '^[^\x00]*$'
example: "org-123"
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/DeleteFeedbackRecordsByUserOutputBody'
examples:
success:
summary: Successful feedback records delete by user
value:
deleted_count: 42
message: "Successfully deleted 42 feedback records"
"400":
description: Bad Request (e.g. validation error on query parameters)
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorModel'
"409":
description: |
Conflict (code `tenant_write_conflict`) – the erasure could not be serialized: either a
tenant data purge is in progress for a tenant holding records for this user, or the user's
records changed mid-deletion (drift guard). No records were deleted. The conflict is
transient; retry the request.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorModel'
default:
description: Error
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorModel'
/v1/feedback-records/count:
get:
tags:
- Feedback Records
summary: Count feedback records
description: Returns the total number of feedback records matching the given filters. Supports the same query parameters as the list endpoint.
operationId: count-feedback-records
parameters:
- $ref: '#/components/parameters/FeedbackRecordsTenantId'
- $ref: '#/components/parameters/FeedbackRecordsSubmissionId'
- $ref: '#/components/parameters/FeedbackRecordsSourceType'
- $ref: '#/components/parameters/FeedbackRecordsSourceId'
- $ref: '#/components/parameters/FeedbackRecordsFieldId'
- $ref: '#/components/parameters/FeedbackRecordsFieldGroupId'
- $ref: '#/components/parameters/FeedbackRecordsFieldType'
- $ref: '#/components/parameters/FeedbackRecordsValueId'
- $ref: '#/components/parameters/FeedbackRecordsUserId'
- $ref: '#/components/parameters/FeedbackRecordsSourceName'
- $ref: '#/components/parameters/FeedbackRecordsLanguage'
- $ref: '#/components/parameters/FeedbackRecordsSince'
- $ref: '#/components/parameters/FeedbackRecordsUntil'
- $ref: '#/components/parameters/FeedbackRecordsCreatedSince'
- $ref: '#/components/parameters/FeedbackRecordsCreatedUntil'
- $ref: '#/components/parameters/FeedbackRecordsUpdatedSince'
- $ref: '#/components/parameters/FeedbackRecordsUpdatedUntil'
- $ref: '#/components/parameters/FeedbackRecordsValueNumberMin'
- $ref: '#/components/parameters/FeedbackRecordsValueNumberMax'
- $ref: '#/components/parameters/FeedbackRecordsValueDateMin'
- $ref: '#/components/parameters/FeedbackRecordsValueDateMax'
- $ref: '#/components/parameters/FeedbackRecordsSentiment'
- $ref: '#/components/parameters/FeedbackRecordsEmotions'
- $ref: '#/components/parameters/FeedbackRecordsSentimentScoreMin'
- $ref: '#/components/parameters/FeedbackRecordsSentimentScoreMax'
- $ref: '#/components/parameters/FeedbackRecordsHasSentiment'
- $ref: '#/components/parameters/FeedbackRecordsHasEmotions'
- $ref: '#/components/parameters/FeedbackRecordsHasTranslation'
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/CountFeedbackRecordsOutputBody'
"400":
description: |
Bad Request. Returned for a query parameter this operation does not declare
(sort, order, limit and cursor included: they belong to the list, and cannot change a
count), an unknown enum value (sentiment, emotions, field_type), an inverted range
whose *_min/*_since exceeds its *_max/*_until, or a missing or blank tenant_id.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorModel'
examples:
inverted_range:
summary: A range filter supplied backwards
value:
type: "https://hub.formbricks.com/problems/validation"
title: "Validation Error"
status: 400
code: "validation"
detail: "One or more request parameters are invalid"
request_id: "0190a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5b"
invalid_params:
- name: "sentiment_score_min"
reason: "must be less than or equal to sentiment_score_max"
"401":
description: Unauthorized (missing or invalid API key)
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorModel'
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, including its read-time assignment in the active directory taxonomy. The taxonomy field is null if the lookup is temporarily unavailable.
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/FeedbackRecordDetailData'
"400":
description: Bad Request (e.g. invalid UUID)
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorModel'
"404":
description: Not Found
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorModel'
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
"400":
description: Bad Request (e.g. invalid UUID)
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorModel'
"404":
description: Not Found
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorModel'
"409":
description: |
Conflict – a tenant data purge is in progress for this record's tenant
(code `tenant_write_conflict`); retry after the purge completes.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorModel'
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.
Changing `value_text` clears the server-generated enrichment fields computed from it
(`sentiment`, `sentiment_score`, `emotions`, `value_text_translated`,
`translation_lang_key`) and queues re-enrichment; changing `language` clears and
re-queues the translation pair only. The response reflects the cleared state — the
fields are absent until the asynchronous re-enrichment completes.
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'
examples:
update_text:
summary: Update text value
value:
value_text: "Updated feedback text"
update_number:
summary: Update numeric value
value:
value_number: 10
update_metadata:
summary: Update metadata
value:
metadata:
tags:
- "important"
- "follow-up"
priority: "high"
update_user:
summary: Update user ID
value:
user_id: "user-xyz-789"
required: true
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/FeedbackRecordData'
examples:
updated:
summary: Updated feedback record
value:
id: "018e1234-5678-9abc-def0-123456789abc"
collected_at: "2024-01-15T10:30:00Z"
created_at: "2024-01-15T10:30:00Z"
updated_at: "2024-01-15T11:00:00Z"
source_type: "survey"
field_id: "q1"
field_type: "rating"
field_label: "How satisfied are you?"
value_number: 10
source_id: "survey-123"
source_name: "Q1 NPS Survey"
user_id: "user-abc-123"
tenant_id: "org-123"
submission_id: "550e8400-e29b-41d4-a716-446655440000"
language: "en"
metadata:
tags:
- "important"
- "follow-up"
"400":
description: Bad Request (e.g. invalid UUID, validation error)
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorModel'
"413":
description: Request body exceeds the maximum allowed size.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorModel'
"404":
description: Not Found
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorModel'
"409":
description: |
Conflict – a tenant data purge is in progress for this record's tenant
(code `tenant_write_conflict`); retry after the purge completes.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorModel'
default:
description: Error
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorModel'
examples:
not_found:
summary: Record not found
value:
type: "https://hub.formbricks.com/problems/not-found"
title: "Not Found"
status: 404
code: "not_found"
detail: "feedback record not found"
instance: "/v1/feedback-records/018e1234-5678-9abc-def0-123456789abc"
request_id: "0190a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5b"
details:
resource_type: "feedback record"
validation_error:
summary: Validation error
value:
type: "https://hub.formbricks.com/problems/validation"
title: "Validation Error"
status: 400
code: "validation"
detail: "One or more request parameters are invalid"
instance: "/v1/feedback-records/018e1234-5678-9abc-def0-123456789abc"
request_id: "0190a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5b"
invalid_params:
- name: "value_text"
reason: "must not contain NULL bytes"
/v1/feedback-records/search/semantic:
post:
tags:
- Feedback Records
summary: Semantic search over feedback records
description: |
Embeds the search query and returns feedback record IDs with similarity scores (cosine, 0..1).
**Only available when embeddings are configured** (EMBEDDING_PROVIDER and EMBEDDING_MODEL set).
Supported providers: openai, google (Gemini Developer API / Google AI Studio), google-gemini (Gemini Enterprise Agent Platform API).
When embeddings are disabled, this endpoint returns 503 Service Unavailable.
Request body must include query and tenant_id (required for tenant isolation).
operationId: semantic-search-feedback-records
parameters:
- name: limit
in: query
description: Number of results to return (default 10, max 100). Consistent with list endpoints.
schema:
type: integer
default: 10
minimum: 1
maximum: 100
- name: cursor
in: query
description: |
Omit for the first page. For the next page, use the exact value from the previous response's next_cursor.
Opaque (base64-encoded); keyset pagination.
schema:
type: string
example: "eyJkIjowLjEsImkiOiIwMThlMTIzNC01Njc4LTlhYmMtZGVmMC0xMTExMTExMTExMTEifQ=="
- name: min_score
in: query
description: Minimum similarity score (0..1); only results with score >= min_score are returned. Default 0.7 to reduce noise.
schema:
type: number
format: float
minimum: 0
maximum: 1
default: 0.7
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/SemanticSearchInputBody'
example:
query: "What do users think about login speed?"
tenant_id: "org-123"
required: true
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/SemanticSearchResponse'
"400":
description: Bad Request (e.g. missing tenant_id, empty query, or invalid cursor)
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorModel'
"413":
description: Request body exceeds the maximum allowed size.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorModel'
"503":
description: Service Unavailable (embeddings are not configured)
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorModel'
default:
description: Error
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorModel'
/v1/feedback-records/{id}/similar:
get:
tags:
- Feedback Records
summary: Get similar feedback records
description: |
Returns feedback record IDs and similarity scores for records similar to the given one (by embedding).
**Only available when embeddings are configured** (EMBEDDING_PROVIDER and EMBEDDING_MODEL set).
Supported providers: openai, google (Gemini Developer API / Google AI Studio), google-gemini (Gemini Enterprise Agent Platform API).
When embeddings are disabled, this endpoint returns 503 Service Unavailable.
Hub derives the tenant from the source feedback record and scopes the nearest-neighbor search to that tenant.
operationId: similar-feedback-records
parameters:
- name: id
in: path
description: Feedback record ID (UUID)
required: true
schema:
type: string
format: uuid
example: "018e1234-5678-9abc-def0-123456789abc"
- name: limit
in: query
description: Number of results to return (default 10, max 100). Consistent with list endpoints.
schema:
type: integer
default: 10
minimum: 1
maximum: 100
- name: cursor
in: query
description: |
Omit for the first page. For the next page, use the exact value from the previous response's next_cursor.
Opaque (base64-encoded); keyset pagination.
schema:
type: string
example: "eyJkIjowLjEsImkiOiIwMThlMTIzNC01Njc4LTlhYmMtZGVmMC0xMTExMTExMTExMTEifQ=="
- name: min_score
in: query
description: Minimum similarity score (0..1); only results with score >= min_score are returned. Default 0.7 to reduce noise.
schema:
type: number
format: float
minimum: 0
maximum: 1
default: 0.7
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/SemanticSearchResponse'
"400":
description: Bad Request (e.g. invalid cursor)
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorModel'
"404":
description: Not Found (feedback record has no embedding for the current model, or source record has no tenant)
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorModel'
"503":
description: Service Unavailable (embeddings are not configured)
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorModel'
default:
description: Error
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorModel'
/v1/webhooks:
get:
tags:
- Webhooks
summary: List webhooks
description: Lists webhook endpoints with optional filters and pagination