Skip to content

Generated type for PinsListResponse is missing message in Item #2316

@tnsardesai

Description

@tnsardesai

Packages:

Select all that apply:

  • @slack/web-api
  • @slack/rtm-api
  • @slack/webhooks
  • @slack/oauth
  • @slack/socket-mode
  • @slack/types
  • I don't know

Reproducible in:

The Slack SDK version

"slack/bolt": "^4.4.0" which uses "@slack/web-api": "^7.9.3"

Node.js runtime version

v24

OS info

ProductName: macOS
ProductVersion: 15.5
BuildVersion: 24F74
Darwin Kernel Version 24.5.0: Tue Apr 22 19:54:25 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T6020

Steps to reproduce:

Item type is defined at

export interface Item {
comment?: string;
created?: number;
created_by?: string;
file?: File;
type?: string;
}

But according to https://api.slack.com/methods/pins.list there should be a message object available too (at least when type === "message")

Expected result:

Expected type to be

export interface Item {
  comment?: string;
  created?: number;
  created_by?: string;
  file?: File;
  type?: string;
  message?: Message;
}

Actual result:

I am getting the correct response like

items: [
  {
    type: 'message',
    created: 1753489389,
    created_by: 'U0123456789',
    channel: 'C0123456789',
    message: [Object]
  }
]

I am working around with

for (const pin of pinedMessages.items ?? []) {
  if (pin.type === "message") {
    const message = 'message' in pin ? pin.message : undefined;
    if (message) {
      console.log(message);
    }
  }
}

Requirements

For general questions/issues about Slack API platform or its server-side, could you submit questions at https://my.slack.com/help/requests/new instead. 🙇

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions