Skip to main content
PUT
Set survey block order

Authorizations

next-auth.session-token
string
cookie
required

NextAuth session JWT cookie. Development: often next-auth.session-token. Production (HTTPS): often __Secure-next-auth.session-token. Send the cookie your browser receives after sign-in.

Path Parameters

surveyId
string<cuid2>
required

Survey identifier.

Body

application/json
order
string[]
required

Every current block id, exactly once, in the desired order. Ids are trimmed before use, so an id that is empty or whitespace-only is a 400, as is a list of more than 1000 ids. A missing, unknown or repeated id is a 422 — repeats are reported as duplicate_identifier rather than rejected by the schema, so the response names the offending entry, and a dropped block cannot pass unnoticed, which is what makes this safer than resending the blocks.

Required array length: 1 - 1000 elements
Required string length: 1 - 128
expectedUpdatedAt
string<date-time>

Optimistic-concurrency precondition: the survey's updatedAt from your last read. If the survey changed since, the write is rejected with 409.

Response

Order applied (or already matching); returns the full survey resource.

data
object
required

The three fields every SurveyListItem and SurveyResource carries, merged into both via allOf. All required, always present.