Skip to content

feat(web-api): add slackLists methods - #1772

Merged
srtaalej merged 6 commits into
mainfrom
ale-feat-web-api-lists
Nov 19, 2025
Merged

feat(web-api): add slackLists methods#1772
srtaalej merged 6 commits into
mainfrom
ale-feat-web-api-lists

Conversation

@srtaalej

@srtaalejsrtaalej commented Oct 27, 2025

Copy link
Copy Markdown
Contributor

Summary

This PR adds the following slackLists methods to the slack_sdk:
access.delete, access.set, create, download.get, download.start,
items.create, items.delete, items.deleteMultiple, items.info,
items.list, items.update, update


Testing

▶️ expand test example
# create a new listlist_create_response=app.client.slackLists_create(
name="Test List - SlackLists API",
description_blocks=[
{
"type": "rich_text",
"elements": [
{
"type": "rich_text_section",
"elements": [
{"type": "text", "text": "List to keep track of tasks!"}
],
}
],
}
],
schema=[
{
"key": "task_name",
"name": "Task Name",
"type": "text",
"is_primary_column": True,
},
{
"key": "due_date",
"name": "Due Date",
"type": "date",
},
{
"key": "status",
"name": "Status",
"type": "select",
"options": {
"choices": [
{"value": "not_started", "label": "Not Started", "color": "red"},
{"value": "in_progress", "label": "In Progress", "color": "yellow"},
{"value": "completed", "label": "Completed", "color": "green"},
]
},
},
{
"key": "assignee",
"name": "Assignee",
"type": "user",
},
],
)
# retrieve column ids from create responsekey_to_id= {
col["key"]: col["id"]
forcolinlist_create_response["list_metadata"]["schema"]
}
task_name_col_id=key_to_id["task_name"]
list_id=list_create_response["list_id"]
# set list access permissionslist_access=app.client.slackLists_access_set(
list_id=list_id,
access_level="write",
user_ids=["U09G4FG3TRN"],
)
# create several list itemsitem_response_1=app.client.slackLists_items_create(
list_id=list_id,
initial_fields=[
{
"column_id": task_name_col_id,
"rich_text": [
{
"type": "rich_text",
"elements": [
{
"type": "rich_text_section",
"elements": [{"type": "text", "text": "CLI app unlink command"}],
}
],
}
],
}
],
)
item_response_2=app.client.slackLists_items_create(list_id=list_id)
item_response_3=app.client.slackLists_items_create(list_id=list_id)
item_response_4=app.client.slackLists_items_create(list_id=list_id)
item_response_5=app.client.slackLists_items_create(list_id=list_id)
item_id_1=item_response_1["item"]["id"]
item_id_2=item_response_2["item"]["id"]
item_id_3=item_response_3["item"]["id"]
item_id_4=item_response_4["item"]["id"]
item_id_5=item_response_5["item"]["id"]
# delete specific list itemsitem_delete3_response=app.client.slackLists_items_delete(
list_id=list_id,
id=item_id_3,
)
item_delete4_5_response=app.client.slackLists_items_deleteMultiple(
list_id=list_id,
ids=[item_id_4, item_id_5],
)
# retrieve info for a single list itemitem_info=app.client.slackLists_items_info(
list_id=list_id,
id=item_id_1,
include_is_subscribed=True,
)
# retrieve all list itemsitems_list=app.client.slackLists_items_list(
list_id=list_id,
limit=50,
archived=False,
)
# download list datadownload_start_response=app.client.slackLists_download_start(
list_id=list_id,
include_archived=False,
)
download_get_response=app.client.slackLists_download_get(
list_id=list_id,
job_id=download_start_response["job_id"],
)
# update an existing list itemupdate_item_response=app.client.slackLists_items_update(
list_id=list_id,
cells=[
{
"column_id": task_name_col_id,
"rich_text": [
{
"type": "rich_text",
"elements": [
{
"type": "rich_text_section",
"elements": [{"type": "text", "text": "Updated text"}],
}
],
}
],
"row_id": item_id_1,
}
],
)
# update list metadataupdate_list_response=app.client.slackLists_update(
id=list_id,
name="Test List - UPDATED",
description_blocks=[
{
"type": "rich_text",
"elements": [
{
"type": "rich_text_section",
"elements": [
{"type": "text", "text": "This list has been updated via API"}
],
}
],
}
],
todo_mode=False,
)
# remove access for the test userlist_access_delete=app.client.slackLists_access_delete(
list_id=list_id,
user_ids=["U09G4FG3TRN"],
)

Category

  • slack_sdk.web.WebClient (sync/async) (Web API client)

Requirements

  • I've read and understood the Contributing Guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've run python3 -m venv .venv && source .venv/bin/activate && ./scripts/run_validation.sh after making the changes.

@srtaalej
srtaalej requested a review from zimegOctober 27, 2025 16:51
@srtaalejsrtaalej self-assigned this Oct 27, 2025
@srtaalejsrtaalej added enhancement M-T: A feature request for new functionality semver:minor web-client labels Oct 27, 2025
@codecov

codecovBot commented Oct 27, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.86%. Comparing base (e802f17) to head (a51372e).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@ Coverage Diff @@## main #1772 +/- ##
==========================================
+ Coverage 83.68% 83.86% +0.17% 
==========================================
Files 115 115 Lines 12905 13049 +144 ==========================================
+ Hits 10800 10943 +143 - Misses 2105 2106 +1 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@zimegzimeg linked an issue Oct 28, 2025 that may be closed by this pull request
9 tasks

@WilliamBergaminWilliamBergamin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work working on this 💯

Would it be simple to add integration tests in integration_tests/web for these endpoints?

@zimegzimeg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@srtaalej Thanks so much for bringing these methods to the SDK! 🧰 ✨

I'm finding good responses from the server when using these changes so am hoping we can merge this soon, but also left comments around typing that I think are worth consideration.

Overall I'm hoping we can improve our models here in the SDK to expect the various list item schemas, similar to Block Kit. This might not be a blocker for python releases, but we might require such for java and I do think we should aim to keep SDKs aligned in featureset when possible!

Lots of rambles. Please let me know if the other comments seem alright! 👾

@@ -15,7 +15,7 @@
class TestWebClientCoverage(unittest.TestCase):
# 295 endpoints as of September 17, 2025

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🏷️ note: We should update this as well!

Comment threadslack_sdk/web/client.py Outdated
Comment threadslack_sdk/web/client.py
Comment threadslack_sdk/web/client.py Outdated
Comment threadslack_sdk/web/client.py
Comment threadslack_sdk/web/client.py
Comment threadslack_sdk/web/client.py
Comment threadslack_sdk/web/client.py Outdated
srtaalejand others added 2 commits November 11, 2025 18:08
Co-authored-by: Eden Zimbelman <eden.zimbelman@salesforce.com>
@zimeg
zimeg self-requested a review November 18, 2025 18:31
@zimegzimeg mentioned this pull request Nov 18, 2025
15 tasks

@zimegzimeg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@srtaalej LGTM and thanks so much for sharing these testing steps!

Before we merge I left a comment on links and perhaps we update the testing file to be most current, but otherwise 🚢 💨

Comment threadslack_sdk/web/client.py Outdated
@zimegzimeg added this to the 3.39.0 milestone Nov 18, 2025
Co-authored-by: Eden Zimbelman <eden.zimbelman@salesforce.com>
@srtaalej
srtaalej requested a review from a team as a code ownerNovember 19, 2025 15:56
Comment threadslack_sdk/web/async_client.py Outdated

from ..models.attachments import Attachment
from ..models.blocks import Block, RichTextBlock
from ..models.metadata import Metadata

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the tests are flagging these duplicate imports

@srtaalej
srtaalej merged commit c04e899 into mainNov 19, 2025
14 checks passed
@srtaalej
srtaalej deleted the ale-feat-web-api-lists branch November 19, 2025 19:39
@mwbrooks

Copy link
Copy Markdown
Member

Related: slackapi/bolt-python#1401

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancementM-T: A feature request for new functionalitysemver:minorweb-client

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Add support for SlackLists API methods

5 participants

@srtaalej@mwbrooks@zimeg@WilliamBergamin@vegeris