Reorder Collections

Reorder Collections

This endpoint updates the display order of collections within a project.

Endpoint

[POST]

/collections/reorder

Permissions

This endpoint requires a token with the admin ability.

Headers

NameRequiredDescription
AcceptYesSpecifies the response content type. Must be application/json.
AuthorizationYesRequired. Must be a Bearer token with admin scope.
project-idYesThe unique identifier for the project.

Body Parameters

NameTypeRequiredDescription
collectionsarrayYesAn array of collection order objects.
collections.*.uuidstringYesThe UUID of the collection.
collections.*.orderintegerYesThe new display order (0-based).

Example Requests

axios.post('https://your-domain.com/api/collections/reorder', {
    collections: [
        { uuid: 'd8f7b5c1-e4a3-4b21-8e9f-a9c1e2b3d4f5', order: 0 },
        { uuid: 'a1b2c3d4-e5f6-7890-1234-567890abcdef', order: 1 },
        { uuid: 'f9e8d7c6-b5a4-3210-fedc-ba9876543210', order: 2 }
    ]
}, {
    headers: {
        'Accept': 'application/json',
        'Authorization': 'Bearer YOUR_API_TOKEN',
        'project-id': 'YOUR_PROJECT_UUID'
    }
});
use Illuminate\Support\Facades\Http;
 
$response = Http::withToken('YOUR_API_TOKEN')->withHeaders([
    'Accept' => 'application/json',
    'project-id' => 'YOUR_PROJECT_UUID'
])->post('https://your-domain.com/api/collections/reorder', [
    'collections' => [
        ['uuid' => 'd8f7b5c1-...', 'order' => 0],
        ['uuid' => 'a1b2c3d4-...', 'order' => 1],
        ['uuid' => 'f9e8d7c6-...', 'order' => 2],
    ]
]);
curl -X POST "https://your-domain.com/api/collections/reorder" \
     -H "Accept: application/json" \
     -H "Authorization: Bearer YOUR_API_TOKEN" \
     -H "project-id: YOUR_PROJECT_UUID" \
     -H "Content-Type: application/json" \
     -d '{
         "collections": [
             { "uuid": "d8f7b5c1-...", "order": 0 },
             { "uuid": "a1b2c3d4-...", "order": 1 }
         ]
     }'

Responses

200: Success

{
    "message": "Collections reordered successfully."
}

403: Forbidden

Returned if the API token does not have the admin ability.

{
    "message": "API token doesn't have the right abilities!"
}

Search documentation

Find guides and reference pages