---
title: "Rewrite a column's card order in one transaction"
method: POST
path: "/projects/{id}/cards/rebalance"
---

# Rewrite a column's card order in one transaction

`POST /projects/{id}/cards/rebalance`

## Request

- Base URL: `https://craaft.io/api/v1`
- URL: `https://craaft.io/api/v1/projects/{id}/cards/rebalance`
- Auth: HTTP bearer

Renumbers the listed cards onto `column` with positions 1, 2, 3, …
in request order. Sized for a real column (up to 10 000 ids), not
an import batch - the board uses this when a drop can no longer
find a representable midpoint between two neighbours. All ids must
already belong to this board (`404` otherwise). Within-board
column changes are recorded to each card's activity log. All-or-
nothing; no notification emails. Body limit 1 MiB.

## Request body

- object
  - `ids` string[], required
  - `column` string, required: Target column.key

## Response `200`

Rewritten cards, in request order

- BulkCardsResponse
  - `cards` Card[], required: Affected cards, in request order
    - `id` string, uuid, required
    - `projectId` string, uuid, required
    - `column` string, required
    - `title` string, required
    - `description` string: Full body on GET /cards/{id}, PATCH, create, and /detail. Omitted from GET /projects/{id}/cards and lean SSE card.updated events (position-only moves).
    - `position` number, required
    - `dueDate` string, date-time, nullable
    - `assignedUserId` string, uuid, nullable
    - `assignedUserName` string, nullable
    - `size` integer, nullable: Optional integer size estimate; null when unset
    - `priority` 'low' | 'medium' | 'high' | 'urgent' | 'null', nullable
    - `createdBy` string, uuid, nullable
    - `createdByName` string, nullable
    - `updatedBy` string, uuid, nullable
    - `updatedByName` string, nullable
    - `attachmentCount` integer
    - `checklistDone` integer: Completed checklist items (denormalized count)
    - `checklistTotal` integer: Total checklist items (denormalized count)
    - `tags` string[]
    - `following` boolean: Whether the authenticated caller follows this card
    - `createdAt` string, date-time, required
    - `updatedAt` string, date-time, required

## Other responses

- `400`: Missing fields or too many items
- `404`: A referenced card isn't on this board or isn't accessible
- `422`: The target column no longer exists

---

[API](https://skmtc.dev/craaft/apis/craaft-api.md) · [All operations](https://skmtc.dev/craaft/apis/craaft-api/llms.txt) · [OpenAPI document](https://skmtc.dev/craaft/apis/craaft-api/revisions/3a1e9d30d7dc?raw)
