updateFormsDataByid
Update form data by ID. 🔐 This method requires authorization.
Description
Updates a submitted form data record and resolves to the updated record as an IUpdateFormsData.
Pass the new fields as body.formData, keyed by language code: { formData: { en_US: [...] } }. Unlike postFormsData(), this method doesn't wrap formData by locale for you; a flat array is stored as is, and the record then no longer shows up in getFormsDataByMarker() for that language. Without formData the API returns 400 ("Provide a valid formData").
Only formData is taken from the body; other fields are ignored. The record's time and, for non-rating forms, its author are set from the caller. Only the user who submitted the record can update it; anyone else gets 403.
.updateFormsDataByid(
,
);
Parameters schema
Schema
id(required): number
Form data ID.
example: 1
body: object
Fields to update: formData, keyed by language code. Without formData the API returns 400.
Examples
Minimal example
// 1. auth
const authData = [
{
marker: 'email',
value: 'john@example.com',
},
{
marker: 'password',
value: '123456',
},
];
await AuthProvider.auth('email', {
authData,
});
// 2. update your form data record by id
const result = await FormData.updateFormsDataByid(
1621, // FormData ID.
{
formData: {
en_US: [
{
marker: 'name',
type: 'string',
value: 'John Smith',
},
],
},
},
);
Example response
{
"id": 1621,
"formIdentifier": "test-form",
"time": "2026-10-28T07:18:30.456Z",
"formData": {
"en_US": [
{
"marker": "name",
"type": "string",
"value": "John Smith"
}
]
},
"userIdentifier": "john@example.com",
"entityIdentifier": "blog",
"parentId": null,
"fingerprint": null,
"isUserAdmin": false,
"formModuleId": 2
}
Response schema
Schema: IUpdateFormsData
id: number
ID of the form data record.
example: 12345
formIdentifier: string
Marker of the form.
example: "contact_form"
time: string
Date and time of the submission.
example: "2023-10-01T12:00:00Z"
formData: FormDataType[]
Form fields keyed by language code, for example { en_US: [...] }.
userIdentifier: string
Identifier (login) of the user who submitted the form.
example: "john@example.com"
entityIdentifier: string
Identifier of the entity.
example: "blog"
parentId: null | number
ID of the parent record.
example: null
fingerprint: null | string
Device fingerprint of the sender.
example: null
isUserAdmin: boolean
Whether the record was submitted by an admin.
example: false
formModuleId: number
ID of the form module.
example: 2