Skip to content
Support

Create a new feedback record

POST/v1/feedback-records

Creates a new feedback record data point

Body ParametersExpand Collapse
field_id: string

Identifier for the question/field. NULL bytes not allowed.

minLength1
maxLength255
field_type: "text" or "categorical" or "nps" or 6 more

Field type: text (enrichable), categorical, nps, csat, ces, rating, number, boolean, date

minLength1
maxLength255
Accepts one of the following:
"text"
"categorical"
"nps"
"csat"
"ces"
"rating"
"number"
"boolean"
"date"
source_type: string

Type of feedback source (e.g., survey, review, feedback_form). NULL bytes not allowed.

minLength1
maxLength255
submission_id: string

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.

minLength1
maxLength255
tenant_id: string

Tenant/organization identifier for multi-tenancy. Required.

minLength1
maxLength255
collected_at: optional string

When the feedback was collected (defaults to now). Must be between 1970-01-01 and 2080-12-31.

formatdate-time
field_group_id: optional string

Stable identifier grouping related fields (for ranking, matrix, grid questions). NULL bytes not allowed.

maxLength255
field_group_label: optional string

Human-readable question text for the group

field_label: optional string

The actual question text

language: optional string

ISO language code. NULL bytes not allowed.

maxLength10
metadata: optional map[unknown]

User agent, device, location, referrer, tags, etc. NULL bytes (\x00 or \u0000) are not allowed in JSON keys or values.

source_id: optional string

Reference to survey/form/ticket ID

source_name: optional string

Human-readable name

user_id: optional string

User ID (e.g., anonymous ID or email hash)

value_boolean: optional boolean

For yes/no questions

value_date: optional string

For date responses. Must be between 1970-01-01 and 2080-12-31.

formatdate-time
value_number: optional number

For ratings, NPS scores, numeric responses. Must be between -1e15 and +1e15.

formatdouble
minimum-1000000000000000
maximum1000000000000000
value_text: optional string

For open-ended text responses. Omit or null if not applicable. NULL bytes not allowed when present.

ReturnsExpand Collapse
FeedbackRecordData = object { id, collected_at, created_at, 20 more }
id: string

UUIDv7 primary key

formatuuid
collected_at: string

When the feedback was collected

formatdate-time
created_at: string

When this record was created

formatdate-time
field_id: string

Identifier for the question/field

field_type: "text" or "categorical" or "nps" or 6 more

Type of field

Accepts one of the following:
"text"
"categorical"
"nps"
"csat"
"ces"
"rating"
"number"
"boolean"
"date"
source_type: string

Type of feedback source

submission_id: string

Identifier for the logical submission this record belongs to (required).

tenant_id: string

Tenant/organization identifier. NULL bytes not allowed.

updated_at: string

When this record was last updated

formatdate-time
field_group_id: optional string

Stable identifier grouping related fields (for ranking, matrix, grid questions)

field_group_label: optional string

Human-readable question text for the group

field_label: optional string

The actual question text

language: optional string

ISO language code. NULL bytes not allowed.

metadata: optional map[unknown]

Additional context

source_id: optional string

Reference to survey/form/ticket ID

source_name: optional string

Human-readable name

translation_lang_key: optional string

BCP-47 target locale that value_text_translated was produced in (language enrichment). Read-only; absent until the record is enriched.

maxLength35
user_id: optional string

User ID (e.g., anonymous ID or email hash)

value_boolean: optional boolean

Boolean response

value_date: optional string

Date response

formatdate-time
value_number: optional number

Numeric response

formatdouble
value_text: optional string

Text response. NULL bytes not allowed.

value_text_translated: optional string

value_text translated into the tenant's configured target language (language enrichment). Read-only; absent until the record is enriched.

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"
    }
  ]
}