Create a new feedback record
Creates a new feedback record data point
Body Parameters
Identifier for the question/field. NULL bytes not allowed.
Type of feedback source (e.g., survey, review, feedback_form). NULL bytes not allowed.
Identifier for the logical submission this record belongs to (tenant-scoped). Required. Enables grouping multi-field submissions and idempotent ingestion. Unique per (tenant_id, submission_id, field_id). If a record has no logical submission, use e.g. field_id.
Tenant/organization identifier for multi-tenancy. Required.
When the feedback was collected (defaults to now). Must be between 1970-01-01 and 2080-12-31.
Stable identifier grouping related fields (for ranking, matrix, grid questions). NULL bytes not allowed.
Human-readable question text for the group
The actual question text
ISO language code. NULL bytes not allowed.
Arbitrary context for this record, stored as JSON and returned with equivalent values (key order and number formatting are normalized): the dimensions you want to slice a dashboard by, such as channel, device, browser, OS, country, referrer, campaign, plan or tags. Values may be strings, numbers, booleans, null, or nested objects and arrays.
Use snake_case keys and keep them stable across records, since a key is what a dashboard groups by: customer_tier, not a mix of customerTier and tier. Numbers keep full precision in storage (unlike value_number, which is a float64), so a large integer id round-trips exactly through this API — though a JavaScript client will still lose precision above 2^53 when it parses the response.
Nothing here is redacted. Metadata is not sent to the LLM or embedding enrichment providers, unlike value_text — but it is included in the feedback_record.created and feedback_record.updated webhook payloads, so it reaches whatever URL a tenant has configured. Erasure covers metadata, with one precondition worth knowing: DELETE /v1/feedback-records matches on user_id and hard-deletes the whole row, metadata included — so a record written without a user_id cannot be reached that way. Set user_id on anything you may later have to erase.
Three kinds of content are rejected with 400, because none of them can be stored: invalid UTF-8; NULL bytes or unpaired UTF-16 surrogates, in keys or values; and numbers outside the storable numeric range.
Reference to survey/form/ticket ID
Human-readable name
User ID (e.g., anonymous ID or email hash)
For yes/no questions
For date responses. Must be between 1970-01-01 and 2080-12-31.
Stable id of the selected option in the source system (e.g. a survey choice id or matrix column id), stored alongside value_text so selected-choice answers keep a durable identity across label edits and languages. Opaque to Hub (not validated). Null for free-text/"other" answers, non-choice fields, and sources without option ids. NULL bytes not allowed when present.
For ratings, NPS scores, numeric responses. Must be between -1e15 and +1e15.
For open-ended text responses. Omit or null if not applicable. NULL bytes not allowed when present.
Returns
Create a new feedback record
curl http://localhost:8080/v1/feedback-records \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $HUB_API_KEY" \
-d '{
"field_id": "q1",
"field_type": "rating",
"source_type": "survey",
"submission_id": "550e8400-e29b-41d4-a716-446655440000",
"tenant_id": "org-123"
}'{
"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"
}{
"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"
}
]
}Returns Examples
{
"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"
}{
"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"
}
]
}