Update element settings
const url = 'https://app.surveyrock.com/api/v1/elements/example/settings';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"settings":{"typeSettings":{},"responseValidation":{}},"questionText":"example","helpText":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://app.surveyrock.com/api/v1/elements/example/settings \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "settings": { "typeSettings": {}, "responseValidation": {} }, "questionText": "example", "helpText": "example" }'Update element settings using ElementService. Uses the same service as web ElementController to ensure zero duplication.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Element ID
Request Bodyrequired
Section titled “Request Bodyrequired”Element settings update data
object
Element configuration settings
object
Question type specific settings
object
Response validation rules
object
Optional question text update
Optional help text update
Examplegenerated
{ "settings": { "typeSettings": {}, "responseValidation": {} }, "questionText": "example", "helpText": "example"}Responses
Section titled “Responses”Element settings updated successfully
object
object
object
Standard response metadata
object
Response timestamp in ISO 8601 format
API version
Unique request identifier
Example
{ "success": true, "meta": { "version": "3.0" }}Bad request - invalid data
Standard error response format
object
object
Stable, snake_case domain code – see ApiErrorHandler::EXCEPTION_MAP and DomainException
Human-readable error message
Imperative recovery hint for this domain code – see ApiErrorHandler::DOMAIN_CODE_SUGGESTIONS
Whether retrying the identical request might succeed without any change on the caller’s end
Additional, code-specific error details
object
Standard response metadata
object
Response timestamp in ISO 8601 format
API version
Unique request identifier
Example
{ "success": false, "error": { "code": "survey_not_found" }, "meta": { "version": "3.0" }}Unauthorized - invalid or missing token
Standard error response format
object
object
Stable, snake_case domain code – see ApiErrorHandler::EXCEPTION_MAP and DomainException
Human-readable error message
Imperative recovery hint for this domain code – see ApiErrorHandler::DOMAIN_CODE_SUGGESTIONS
Whether retrying the identical request might succeed without any change on the caller’s end
Additional, code-specific error details
object
Standard response metadata
object
Response timestamp in ISO 8601 format
API version
Unique request identifier
Example
{ "success": false, "error": { "code": "survey_not_found" }, "meta": { "version": "3.0" }}Forbidden - access denied to element
Standard error response format
object
object
Stable, snake_case domain code – see ApiErrorHandler::EXCEPTION_MAP and DomainException
Human-readable error message
Imperative recovery hint for this domain code – see ApiErrorHandler::DOMAIN_CODE_SUGGESTIONS
Whether retrying the identical request might succeed without any change on the caller’s end
Additional, code-specific error details
object
Standard response metadata
object
Response timestamp in ISO 8601 format
API version
Unique request identifier
Example
{ "success": false, "error": { "code": "survey_not_found" }, "meta": { "version": "3.0" }}Element not found
Standard error response format
object
object
Stable, snake_case domain code – see ApiErrorHandler::EXCEPTION_MAP and DomainException
Human-readable error message
Imperative recovery hint for this domain code – see ApiErrorHandler::DOMAIN_CODE_SUGGESTIONS
Whether retrying the identical request might succeed without any change on the caller’s end
Additional, code-specific error details
object
Standard response metadata
object
Response timestamp in ISO 8601 format
API version
Unique request identifier
Example
{ "success": false, "error": { "code": "survey_not_found" }, "meta": { "version": "3.0" }}Validation failed
Validation error response with field-specific errors
object
object
Field-specific validation errors
object
Standard response metadata
object
Response timestamp in ISO 8601 format
API version
Unique request identifier
Example
{ "success": false, "error": { "code": "validation_failed", "message": "Validation failed", "suggestion": "Fix the fields listed in details and re-submit.", "retryable": false }, "meta": { "version": "3.0" }}