Update NPS label
PUT
/nps/{id}/label
const url = 'https://app.surveyrock.com/api/v1/nps/example/label';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"setName":"default","positionName":"example","index":0,"newText":"example","updatedAt":1}'};
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/nps/example/label \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "setName": "default", "positionName": "example", "index": 0, "newText": "example", "updatedAt": 1 }'Update an NPS label using the canonical labelSets schema
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string
NPS element ID
Request Bodyrequired
Section titled “Request Bodyrequired”Label update data
Media typeapplication/json
object
setName
string
positionName
required
Label position (left, center, right)
string
index
integer
newText
required
string
updatedAt
integer
Responses
Section titled “Responses”Label updated successfully
Media typeapplication/json
object
success
boolean
data
object
elementId
string
setName
string
positionName
string
labelIndex
integer
newText
string
updatedAt
integer
meta
Standard response metadata
object
timestamp
Response timestamp in ISO 8601 format
string format: date-time
version
API version
string
requestId
Unique request identifier
string
Example
{ "success": true, "meta": { "version": "3.0" }}Conflict - optimistic lock failure
Media typeapplication/json
Standard error response format
object
success
boolean
error
object
code
Stable, snake_case domain code – see ApiErrorHandler::EXCEPTION_MAP and DomainException
string
message
Human-readable error message
string
suggestion
Imperative recovery hint for this domain code – see ApiErrorHandler::DOMAIN_CODE_SUGGESTIONS
string
retryable
Whether retrying the identical request might succeed without any change on the caller’s end
boolean
details
Additional, code-specific error details
object
meta
Standard response metadata
object
timestamp
Response timestamp in ISO 8601 format
string format: date-time
version
API version
string
requestId
Unique request identifier
string
Example
{ "success": false, "error": { "code": "survey_not_found" }, "meta": { "version": "3.0" }}