Skip to content

feat(web-api): add admin.analytics.members.metadata method - #2874

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

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

Conversation

@lukegalbraithrussell

@lukegalbraithrussell lukegalbraithrussell commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

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

  • client.admin.analytics.members.metadata() returns profile metadata for each member of an organization or workspace: names, title, email addresses, workspaces, and SCIM profile attributes. All of its arguments are optional (include_deactivated_since, team_id, member_types, query, limit, and cursor), so it binds with bindApiCallWithOptionalArgument. member_types is typed with the method's member type values.
  • It's the companion of admin.analytics.members.activity, added in feat(web-api): add admin.analytics.members.activity method #2873, which returns members by ID only. Join the two on user_id.
  • It needs an org-level user token with admin.analytics:read.
  • AdminAnalyticsMembersMetadataResponse is generated with scripts/code_generator.rb from the json-logs sample for this method in java-slack-sdk, feat: add admin.analytics.members.metadata method java-slack-sdk#1717. workspaces is a map of workspace ID to name, so it's typed { [key: string]: string }. 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 #2873, 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.metadata() and confirm each member has user_id and profile fields like real_name and email.
  2. Call it with query set to part of a member's name and confirm only matching 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. query returns only matching members, member_types as an array filters the results, include_deactivated_since is accepted, and limit: 3 with cursor pages through every member with no repeats.

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: 3d053cd

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.49%. Comparing base (ada1acd) to head (3d053cd).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2874      +/-   ##
==========================================
+ Coverage   94.48%   94.49%   +0.01%     
==========================================
  Files          68       68              
  Lines       10906    10918      +12     
  Branches      697      697              
==========================================
+ Hits        10304    10317      +13     
- Misses        572      573       +1     
+ Partials       30       28       -2     
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