Skip to content

Get element details

GET
/elements/{id}
curl --request GET \
--url https://app.surveyrock.com/api/v1/elements/example \
--header 'Authorization: Bearer <token>'

Get single element with proper authorization. Returns element details including settings, question text, and metadata. The response carries the resource’s ETag, as the ETag header and as meta.etag; send it back as If-Match on an update. A retired element (a question its author deleted after it had answers, kept so the answers stay in the results) is still returned, with retired true and retired_at set, so the element id in a result can always be resolved. The element list leaves retired elements out, and every write to one is a 404.

id
required
string
>= 16 characters <= 16 characters

Element ID

Element details

Media typeapplication/json
object
success
boolean
data

Survey element (question) full details

object
id

Element ID

string
>= 16 characters <= 16 characters
surveyId

Survey ID

string
>= 16 characters <= 16 characters
pageId

Page ID

string
>= 16 characters <= 16 characters
type

Element type enum value

integer
sortOrder

Display order within page

integer
questionText

Question text

string
nullable
helpText

Help text

string
nullable
createdAt
string format: date-time
updatedAt
string format: date-time
retired

True for a question its author deleted after it had answers. It is kept so the answers stay in the results, is left out of the element list, and every write to it is a 404.

boolean
settings

Element configuration settings

object
typeSettings

Question type specific settings

object
responseValidation

Response validation rules

object
statements

Element statements (for matrix, slider, etc.)

Array<object>

Element statement (row in matrix questions)

object
id

Statement ID

string
>= 16 characters <= 16 characters
text

Statement text

string
sortOrder

Display order

integer
isLocked

Whether statement is locked in position

boolean
isHidden

Whether statement is hidden

boolean
isNA

Whether statement is N/A option

boolean
choices

Element choices (for multiple choice, etc.)

Array<object>

Element choice (option in multiple choice questions)

object
id

Choice ID

string
>= 16 characters <= 16 characters
sortOrder

Display order

integer
details

Choice metadata

object
text

Choice text

string
imageUrl

Choice image URL

string
nullable
value

Choice value

string
nullable
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
etag

The resource’s ETag, on a read, create or update of a survey, element, rating or NPS question, distributor or contact. The same value as the ETag response header. Treat it as opaque and send it back as If-Match on the next update.

string
Example
{
"success": true,
"meta": {
"version": "3.0"
}
}
ETag
string
Example
"element:abc123:1790690123456789"

The resource’s current version, as a strong validator. Opaque: send it back unchanged as If-Match. Also returned as meta.etag in the body, for a client that only sees the body.

Bad request - invalid element ID

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
etag

The resource’s ETag, on a read, create or update of a survey, element, rating or NPS question, distributor or contact. The same value as the ETag response header. Treat it as opaque and send it back as If-Match on the next update.

string
Example
{
"success": false,
"error": {
"code": "survey_not_found"
},
"meta": {
"version": "3.0"
}
}

Unauthorized - invalid or missing token

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
etag

The resource’s ETag, on a read, create or update of a survey, element, rating or NPS question, distributor or contact. The same value as the ETag response header. Treat it as opaque and send it back as If-Match on the next update.

string
Example
{
"success": false,
"error": {
"code": "survey_not_found"
},
"meta": {
"version": "3.0"
}
}

Forbidden - access denied to element

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
etag

The resource’s ETag, on a read, create or update of a survey, element, rating or NPS question, distributor or contact. The same value as the ETag response header. Treat it as opaque and send it back as If-Match on the next update.

string
Example
{
"success": false,
"error": {
"code": "survey_not_found"
},
"meta": {
"version": "3.0"
}
}

Element not found

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
etag

The resource’s ETag, on a read, create or update of a survey, element, rating or NPS question, distributor or contact. The same value as the ETag response header. Treat it as opaque and send it back as If-Match on the next update.

string
Example
{
"success": false,
"error": {
"code": "survey_not_found"
},
"meta": {
"version": "3.0"
}
}