Application API (v1): Add a Card
LeanKit's Application API v1 is deprecated. New integration projects should use our v2 API suite found here: https://success.planview.com/Planview_LeanKit/LeanKit_API/01_v2.
This method has all the same parameters as MoveCard, specifying the board, lane and position where you want to add the new card. The request body contains the JSON for a new card. You must specify a valid TypeId that matches one of the Card Types for your board. See Get Board Identifiers for a listing of valid Card Type Ids and Class Of Service Ids for your board.
Request URL (POST):
https://{accountname}.leankit.com/kanban/api/board/{boardId}/AddCard/lane/{laneId}/position/{position}
Accepted card properties:
Property Name | Type | Notes |
---|---|---|
Title | string | Title of task card |
Description | string | Description of task card |
Size | number | |
TypeId | string | Card type (must be valid task board card type) |
AssignedUserIds | array | Array of user Ids (numbers) |
ClassOfServiceId | number | Id of custom icon |
StartDate | string | Planned Start date. Should be in the date format of the User making the API request |
DueDate | string | Planned Finished date. Should be in the date format of the User making the API request |
IsBlocked | boolean | If value is true, BlockReason is also required. |
BlockReason | string | |
Priority | number | 0: Low, 1: Normal, 2: High, or 3: Critical |
Tags | string | Comma-delimited list of tags |
ExternalCardID | string | |
ExternalSystemName | string | |
ExternalSystemUrl | string |
Sample request:
POST https://myaccount.leankit.com/kanban/api/board/101000/AddCard/lane/101108/position/9999
{ "Title": "My New Card", "Description": "New Description", "TypeId": 101304, "Priority": 0, "Size": 2, "IsBlocked": false, "BlockReason": "", "DueDate": "01/01/2020", "ExternalSystemName": "Tracking", "ExternalSystemUrl": "http://ourcompanycms.com/1234", "Tags": "small,UI", "ClassOfServiceId": 123222, "ExternalCardID": "DSA-111", "AssignedUserIds": [111,1112,2211] }
Sample Response:
ReplyData contains the new Board Version and the ID of the Card that was added.
{ "ReplyCode": 201, "ReplyText": "The Card was successfully added.", "ReplyData": [ { "BoardVersion": 4, "Lane": null, "CardId": 101001 // The ID of the newly-added card } ] }