| name | trello-api-3-card-management |
| description | Sub-skill of trello-api: 3. Card Management. |
| version | 1.0.0 |
| category | business |
| type | reference |
| scripts_exempt | true |
3. Card Management
3. Card Management
REST API - Cards:
curl -s "https://api.trello.com/1/lists/LIST_ID/cards?key=$TRELLO_API_KEY&token=$TRELLO_TOKEN" | jq
curl -s "https://api.trello.com/1/cards/CARD_ID?key=$TRELLO_API_KEY&token=$TRELLO_TOKEN" | jq
curl -s -X POST "https://api.trello.com/1/cards" \
-d "key=$TRELLO_API_KEY" \
-d "token=$TRELLO_TOKEN" \
-d "idList=LIST_ID" \
-d "name=Implement feature X" \
-d "desc=Detailed description of the feature" \
-d "pos=top" \
-d "due=2025-01-30T12:00:00.000Z" \
-d "dueComplete=false" \
-d "idMembers=MEMBER_ID1,MEMBER_ID2" \
-d "idLabels=LABEL_ID1,LABEL_ID2" | jq
curl -s -X PUT "https://api.trello.com/1/cards/CARD_ID" \
-d "key=$TRELLO_API_KEY" \
-d "token=$TRELLO_TOKEN" \
-d "name=Updated card name" \
-d "desc=Updated description" \
-d "due=2025-02-15" | jq
curl -s -X PUT "https://api.trello.com/1/cards/CARD_ID" \
-d "key=$TRELLO_API_KEY" \
-d "token=$TRELLO_TOKEN" \
-d "idList=NEW_LIST_ID" | jq
curl -s -X PUT "https://api.trello.com/1/cards/CARD_ID" \
-d "key=$TRELLO_API_KEY" \
-d "token=$TRELLO_TOKEN" \
-d "idBoard=NEW_BOARD_ID" \
-d "idList=NEW_LIST_ID" | jq
curl -s -X PUT "https://api.trello.com/1/cards/CARD_ID" \
-d "key=$TRELLO_API_KEY" \
-d "token=$TRELLO_TOKEN" \
-d "closed=true" | jq
curl -s -X DELETE "https://api.trello.com/1/cards/CARD_ID?key=$TRELLO_API_KEY&token=$TRELLO_TOKEN"
curl -s -X POST "https://api.trello.com/1/cards/CARD_ID/actions/comments" \
-d "key=$TRELLO_API_KEY" \
-d "token=$TRELLO_TOKEN" \
-d "text=This is a comment on the card" | jq
curl -s -X POST "https://api.trello.com/1/cards/CARD_ID/attachments" \
-d "key=$TRELLO_API_KEY" \
-d "token=$TRELLO_TOKEN" \
-d "url=https://example.com/file.pdf" \
-d "name=Important Document" | jq
Python SDK - Cards:
from trello import TrelloClient
from datetime import datetime, timedelta
import os
client = TrelloClient(
api_key=os.environ["TRELLO_API_KEY"],
token=os.environ["TRELLO_TOKEN"]
)
board = client.get_board("BOARD_ID")
target_list = board.get_list("LIST_ID")
new_card = target_list.add_card(
name="Complete API integration",
desc="Full description of the task with acceptance criteria",
labels=None,
due="2025-02-01",
source=None,
position="top"
)
print(f"Created card: {new_card.id}")
card = client.get_card("CARD_ID")
print(f"Card: {card.name}")
print(f"Description: {card.description}")
print(f"Due: {card.due_date}")
card.set_name("Updated: Complete API integration")
card.set_description("Updated description with more details")
due_date = datetime.now() + timedelta(days=7)
card.set_due(due_date)
card.set_due_complete()
labels = board.get_labels()
for label in labels:
if label.name == :
card.add_label(label)
members = board.get_members()
member members:
member.username == :
card.add_member(member)
card.comment()
checklist = card.add_checklist(
title=,
items=[, , , ]
)
done_list = board.get_list()
card.change_list(done_list.)
card.set_closed()
card.set_closed()
card.delete()