PUT /cards/{id}/move
Description
Moves cards to a specified position
This route processes an HTTP PUT request sent to the cards/{id}/move endpoint.
Path parameters
The following parameter is included in the request URL:
| Name | Type | Description |
|---|---|---|
id | number | Required. The ID of the card to move. If moving multiple cards, set the id to 0. |
When moving multiple cards, ensure the id is set to 0. If it’s set to any other value, only the card with that specific id will be moved.
Payload
The server expects a JSON object with these properties:
| Name | Type | Description |
|---|---|---|
id | number | Required. The ID of the card being moved. |
columnId | number | Required. The ID of the column where the card will be placed. |
rowId | number | Required. The ID of the row where the card will be placed. |
before | number | Optional. The ID of the card before which the moved card should be inserted. |
batch | object | Required for multiselect. An array of card objects being moved. |
Example:
{
"id": 4,
"columnId": 2,
"rowId": 1,
"before": "7"
}
When moving multiple cards, the batch property should include an array of all the card objects being moved:
{
"batch": [
{
"id": 2,
"columnId": 1,
"rowId": 1,
"before": "1"
},
{
"id": 7,
"columnId": 1,
"rowId": 1,
"before": "1"
}
]
}
Response
The server responds with a JSON object containing the card ID if a single card was moved, or with an ID of 0 if multiple cards were moved.
Example:
{
"id": 4
}
{
"id": 0
}
The HTTP status code indicates whether the request was successful (response.status == 200) or encountered an error (response.status == 500).
Related articles: Working with server