Skip to content

feat(web-api): add admin.analytics.members.activity method - #2873

Draft
lukegalbraithrussell wants to merge 1 commit into
mainfrom
feat-admin-analytics-members-activity
Draft

lukegalbraithrussell wants to merge 1 commit into
mainfrom
feat-admin-analytics-members-activity

Conversation

@lukegalbraithrussell

@lukegalbraithrussell lukegalbraithrussell commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This pull request adds the admin.analytics.members.activity method to @slack/web-api.

  • client.admin.analytics.members.activity() returns activity metrics for each member of an organization or workspace for one day. All of its arguments are optional (date, team_id, member_types, user_ids, limit, and cursor), so it binds with bindApiCallWithOptionalArgument. member_types is typed with the method's member type values.
  • It needs an org-level user token with admin.analytics:read.
  • AdminAnalyticsMembersActivityResponse is generated with scripts/code_generator.rb from the json-logs sample for this method in java-slack-sdk, feat: add admin.analytics.members.activity method java-slack-sdk#1716. Running the generator also rewrote 10 unrelated response files that have drifted from java-slack-sdk's samples, and those changes are left out.
  • Adds type tests and a minor changeset.

This pull request is independent of #2874, which adds admin.analytics.members.metadata, so either one can be reviewed and merged first. Whichever merges second needs a rebase, since both edit admin.analytics in methods.ts and the request types.

Testing

With an org admin's user token that has admin.analytics:read:

  1. Call client.admin.analytics.members.activity() and confirm the response has date, available_date_range, members, and total_count.
  2. Call it with date set to a day in available_date_range and user_ids set to an array of member IDs, and confirm only those members are returned.
  3. Call it with limit: 3 and follow response_metadata.next_cursor until it's empty.

Live check: these calls ran against an Enterprise developer sandbox with this branch's built WebClient. date returns the requested day, user_ids and member_types as arrays filter the results, and limit: 3 with cursor pages through every member with no repeats. WebClient sends arrays as JSON strings, and the method accepts that as well as comma-separated values.

Requirements

🤖 Generated with Claude Code

Co-authored-by: Claude <svc-devxp-claude@slack-corp.com>
@changeset-bot

changeset-bot Bot commented Nov 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: cb9a433

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@slack/web-api Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov

codecov Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.63%. Comparing base (ada1acd) to head (cb9a433).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2873      +/-   ##
==========================================
+ Coverage   94.48%   94.63%   +0.15%     
==========================================
  Files          68       68              
  Lines       10906    10918      +12     
  Branches      697      700       +3     
==========================================
+ Hits        10304    10332      +28     
+ Misses        572      561      -11     
+ Partials       30       25       -5     
Flag Coverage Δ
cli-hooks 94.39% <100.00%> (+0.01%) ⬆️
cli-test 94.39% <100.00%> (+0.01%) ⬆️
logger 94.39% <100.00%> (+0.01%) ⬆️
oauth 94.39% <100.00%> (+0.01%) ⬆️
socket-mode 94.39% <100.00%> (+0.01%) ⬆️
web-api 94.39% <100.00%> (+0.01%) ⬆️
webhook 94.39% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant