Skip to content
Support

Update a feedback record

client.feedbackRecords.update(stringid, FeedbackRecordUpdateParams { language, metadata, user_id, 5 more } body, RequestOptionsoptions?): FeedbackRecordData { id, collected_at, created_at, 24 more }
PATCH/v1/feedback-records/{id}

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.

ParametersExpand Collapse
id: string

Feedback Record ID (UUID)

formatuuid
body: FeedbackRecordUpdateParams { language, metadata, user_id, 5 more }
language?: string

Update language. NULL bytes not allowed.

maxLength10
metadata?: Record<string, unknown> | null

Replaces the stored metadata object wholesale — it is not merged, so send every key you want to keep or the omitted ones are lost. See the create operation for the value rules and key conventions, including the same 400 rejections (invalid UTF-8, NULL bytes, unpaired surrogates, out-of-range numbers).

user_id?: string

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

maxLength255
value_boolean?: boolean

Update boolean response

value_date?: string

Update date response. Must be between 1970-01-01 and 2080-12-31.

formatdate-time
value_id?: string

Update the stable id of the selected option in the source system (e.g. a survey choice id), stored alongside value_text for durable option identity. Opaque to Hub. NULL bytes not allowed.

maxLength255
value_number?: number

Update numeric response. Must be between -1e15 and +1e15.

formatdouble
minimum-1000000000000000
maximum1000000000000000
value_text?: string

Update text response. NULL bytes not allowed.

maxLength30000
ReturnsExpand Collapse
FeedbackRecordData { id, collected_at, created_at, 24 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" | "categorical" | "nps" | 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
emotions?: Array<"joy" | "anger" | "sadness" | 3 more>

Emotions inferred from value_text (emotion enrichment); multi-label from a fixed set. Read-only; absent until the record is enriched, and never an empty array.

Accepts one of the following:
"joy"
"anger"
"sadness"
"fear"
"surprise"
"disgust"
field_group_id?: string

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

field_group_label?: string

Human-readable question text for the group

field_label?: string

The actual question text

language?: string

ISO language code. NULL bytes not allowed.

metadata?: unknown | Array<unknown> | string | 2 more | null

Arbitrary context stored with this record, returned with equivalent values (key order is normalized, and so are number exponents — 1e2 reads back as 100). Omitted when the record has no metadata; a record explicitly stored with a JSON null returns null. An object is the supported shape and the only one the request schemas accept. The wider union is for reading: the column stores whatever JSON was written, so a record created before that convention can return an array or a scalar, and an object-only response schema would make a generated client reject it.

Accepts one of the following:
unknown
Array<unknown>
string
number
boolean
sentiment?: "very_negative" | "negative" | "neutral" | 3 more

Sentiment polarity inferred from value_text (sentiment enrichment). Read-only; absent until the record is enriched.

Accepts one of the following:
"very_negative"
"negative"
"neutral"
"positive"
"very_positive"
"mixed"
sentiment_score?: number

Signed sentiment polarity from -1.0 (very negative) to 1.0 (very positive) (sentiment enrichment). Read-only; absent until the record is enriched.

formatdouble
minimum-1
maximum1
source_id?: string

Reference to survey/form/ticket ID

source_name?: string

Human-readable name

translation_lang_key?: 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?: string

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

value_boolean?: boolean

Boolean response

value_date?: string

Date response

formatdate-time
value_id?: string

Stable id of the selected option in the source system (e.g. a survey choice id), stored alongside value_text for durable option identity. Opaque to Hub. Absent for free-text/non-choice answers. NULL bytes not allowed.

value_number?: number

Numeric response

formatdouble
value_text?: string

Text response. NULL bytes not allowed.

value_text_translated?: string

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

Update a feedback record

import FormbricksHub from '@formbricks/hub';

const client = new FormbricksHub({
  apiKey: process.env['HUB_API_KEY'], // This is the default and can be omitted
});

const feedbackRecordData = await client.feedbackRecords.update(
  '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
  { value_text: 'Updated feedback text' },
);

console.log(feedbackRecordData.id);
{
  "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"
    ]
  }
}
{
  "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"
  }
}
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-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"
    ]
  }
}
{
  "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"
  }
}