Reorder Gallery Media - API v2.4 - CoastSnap - SPOTTERON

Reorder gallery media

Updates the orderWeight of one or more media within a gallery. Only media that should change their order need to be included — all other media retain their existing order weight. The gallery must belong to a spot the authenticated user is authorized to edit.

Endpoint: https://www.spotteron.com/api/v2.4/galleries/{gallery_id}/media/order
Authentication: Bearer token
Method: POST
Content-Type: application/json
Return format: JSON

Request body:
Name Required Type Info
data[][id] true INTEGER The id of the medium to update.
data[][attributes][orderWeight] true FLOAT The new order weight for the medium. Lower values appear first. Values do not have to be contiguous — e.g. 1, 2, 3 or 0.5, 1.5 are both valid.

Example request

curl -X POST "https://www.spotteron.com/api/v2.4/galleries/7/media/order" \
  -H "Authorization: Bearer <TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "data": [
      { "id": 12, "attributes": { "orderWeight": 1 } },
      { "id": 15, "attributes": { "orderWeight": 2 } },
      { "id": 13, "attributes": { "orderWeight": 3 } }
    ]
  }'

Example Response

Returns an empty success response.