totask Card API Documentation
Card Routes
All card-related endpoints are prefixed with /card
.
Create Card
Endpoint: POST /card/create
Description: Creates a new card.
Request Body:
{
"name": "Card Name",
"list": "list_id"
}
Response:
- 201 Created
Get card by List
Endpoint: GET /card/cardsOf/:listId
Description: Retrieves card by list ID.
Response:
- 200 OKjson
{ "results": [ ... ], "page": 1, "limit": 10, "totalPages": 1, "totalResults": 1 }
Get Card by ID
Endpoint: GET /card/:cardId
Description: Retrieves a card by ID.
Response:
- 200 OKjson
{ "_id": "card_id", "name": "Card Name", ... }
Update Card by ID
Endpoint: PUT /card/:cardId
Description: Updates a card by ID.
Request Body:
{
"name": "New Card Name"
}
Response:
- 200 OKjson
{ "_id": "card_id", "name": "New Card Name", ... }
Delete Card by ID
Endpoint: DELETE /card/:cardId
Description: Deletes a card by ID.
Response:
- 200 OK
Update Card Dates
Endpoint: PUT /card/dates/:cardId
Description: Updates start and end dates of a card.
Request Body:
{
"startDate": "YYYY-MM-DD",
"endDate": "YYYY-MM-DD"
}
Response:
- 200 OK
Update Card Title
Endpoint: PUT /card/title/:cardId
Description: Updates the title of a card.
Request Body:
{
"title": "New Title"
}
Response:
- 200 OK
Update Card Description
Endpoint: PUT /card/description/:cardId
Description: Updates the description of a card.
Request Body:
{
"description": "New Description"
}
Response:
- 200 OK
Update Card Completion Status
Endpoint: PUT /card/isComplete/:cardId
Description: Updates the completion status of a card.
Request Body:
{
"isComplete": true
}
Response:
- 200 OK
Update Card Assignees
Endpoint: PUT /card/assignees/:cardId
Description: Updates the assignees of a card.
Request Body:
{
"assignees": ["user_id1", "user_id2"]
}
Response:
- 200 OK
Add Checklist to Card
Endpoint: PUT /card/addChecklist/:cardId
Description: Adds a checklist to a card.
Request Body:
{
"name": "Checklist Name",
"items": ["item1", "item2"]
}
Response:
- 200 OK
Delete Checklist from Card
Endpoint: PUT /card/removeChecklist/:cardId
Description: Deletes the checklist from a card.
Response:
- 200 OK
Update Labels of Card
Endpoint: PUT /card/labels/:cardId
Description: Updates the labels of a card.
Request Body:
{
"labels": ["label1", "label2"]
}
Response:
- 200 OK
Update Cover of Card
Endpoint: PUT /card/cover/:cardId
Description: Updates the cover image of a card.
Request Body: (Multipart Form Data)
file
: Image file
Response:
- 200 OK
Delete Cover of Card
Endpoint: PUT /card/deleteCover/:cardId
Description: Deletes the cover image of a card.
Response:
- 200 OK
Add Attachments to Card
Endpoint: PUT /card/attachments/:cardId
Description: Adds attachments to a card.
Request Body: (Multipart Form Data)
files
: Array of attachment files (max 5)
Response:
- 200 OK
Delete Attachment from Card
Endpoint: PUT /card/deleteAttachment/:cardId
Description: Deletes an attachment from a card.
Request Body:
{
"attachmentToDelete": "attachment_id"
}
Response:
- 200 OK .