diff --git a/REST-API.md b/REST-API.md index 7d25288..e5eae31 100644 --- a/REST-API.md +++ b/REST-API.md @@ -44,6 +44,7 @@ When calling a production Wekan server, ensure it is running via HTTPS and has a | HTTP Method | Url | Short Description | | :--- | :--- | :--- | | `POST` | `/api/boards/:boardId/lists/:listId/cards` | [Add a card to a list, board, and swimlane.](#add-card-to-list-board-swimlane) | +| `PUT` | `/api/boards/:boardId/lists/:fromListId/cards/:cardId` | [Update a card.](#update-a-card) | --- @@ -464,7 +465,7 @@ curl -H "Authorization: Bearer t7iYB86mXoLfP_XsMegxF41oKT7iiA9lDYiKVtXcctl" \ # Add Card to List-Board-Swimlane -| URL / Code Link | Requires Admin Auth | HTTP Method | +| API URL / Code Link | Requires Admin Auth | HTTP Method | | :--- | :--- | :--- | | [/api/boards/:boardId/lists/:listId/cards](https://github.com/wekan/wekan/blob/c115046a7c86b30ab5deb8762d3ef7a5ea3f4f90/models/cards.js#L487) | `yes` | `POST` | @@ -480,4 +481,27 @@ The new card's ID is returned in the format: ```json { "_id": "W9m9YxQKT6zZrKzRW" -} \ No newline at end of file +} +``` + +# Update a card +You can change (any of) the card's title, list, and description. + +| API URL / Code Link | Requires Admin Auth | HTTP Method | +| :--- | :--- | :--- | +| [/api/boards/:boardId/lists/:fromListId/cards/:cardId](https://github.com/wekan/wekan/blob/c115046a7c86b30ab5deb8762d3ef7a5ea3f4f90/models/cards.js#L520) | `yes` | `PUT` | + +```shell +curl -H "Authorization: Bearer t7iYB86mXoLfP_XsMegxF41oKT7iiA9lDYiKVtXcctl" \ + -H "Content-type:application/json" \ + -X PUT \ + http://localhost:3000/api/boards/YRgy7Ku6uLFv2pYwZ/lists/PgTuf6sFJsaxto5dC/cards:cardId \ + -d '{ "title": "New title text", "listId": "New destination listId", "description": "New description text" }' +``` +## Result example +The card's ID is returned in the format: +```json +{ + "_id": "W9m9YxQKT6zZrKzRW" +} +``` \ No newline at end of file