Corsair
PluginsSlack

Slack API Endpoints

Complete reference for all Slack API endpoints

The Slack plugin provides full access to Slack's API through a typed interface. All endpoints are organized by resource type and automatically handle authentication, rate limiting, and error handling.

New to Corsair? Learn about core concepts like API access, authentication, and error handling before diving into specific endpoints.

Full Implementation: For the complete, up-to-date list of all endpoints and their implementations, see the Slack plugin source code on GitHub.

Channels

Manage channels, conversations, and direct messages.

random

channels.random

Get a random channel from the workspace.

const channel = await corsair.slack.api.channels.random({});

Parameters: None


create

channels.create

Create a new public or private channel.

const result = await corsair.slack.api.channels.create({
    name: "project-updates",
    is_private: false, 
});

Parameters:

NameTypeRequiredDescription
namestringYesName of the channel to create
is_privatebooleanNoWhether the channel should be private
team_idstringNoTeam ID (for Enterprise Grid)

list

channels.list

List all channels in the workspace.

const channels = await corsair.slack.api.channels.list({
    exclude_archived: true,
    limit: 100,
});

Parameters:

NameTypeRequiredDescription
exclude_archivedbooleanNoExclude archived channels
typesstringNoMix and match channel types (e.g., "public_channel,private_channel")
team_idstringNoTeam ID (for Enterprise Grid)
cursorstringNoPagination cursor
limitnumberNoNumber of channels to return (default: 100, max: 1000)

get

channels.get

Get information about a specific channel.

const channel = await corsair.slack.api.channels.get({
    channel: "C1234567890",
    include_num_members: true,
});

Parameters:

NameTypeRequiredDescription
channelstringYesChannel ID
include_localebooleanNoInclude locale information
include_num_membersbooleanNoInclude member count

archive

channels.archive

Archive a channel.

await corsair.slack.api.channels.archive({
    channel: "C1234567890",
});

Parameters:

NameTypeRequiredDescription
channelstringYesChannel ID to archive

unarchive

channels.unarchive

Unarchive a channel.

await corsair.slack.api.channels.unarchive({
    channel: "C1234567890",
});

Parameters:

NameTypeRequiredDescription
channelstringYesChannel ID to unarchive

close

channels.close

Close a direct message or multi-party direct message.

await corsair.slack.api.channels.close({
    channel: "D1234567890",
});

Parameters:

NameTypeRequiredDescription
channelstringYesChannel ID to close

open

channels.open

Open or resume a direct message or multi-party direct message.

const dm = await corsair.slack.api.channels.open({
    users: "U1234567890,U0987654321",
});

Parameters:

NameTypeRequiredDescription
channelstringNoResume a conversation by supplying an im or mpim ID
usersstringNoComma-separated list of user IDs
prevent_creationbooleanNoDon't create a new channel if one doesn't exist
return_imbooleanNoReturn an IM channel instead of opening it

getHistory

channels.getHistory

Fetch conversation history for a channel.

const history = await corsair.slack.api.channels.getHistory({
    channel: "C1234567890",
    limit: 50,
});

Parameters:

NameTypeRequiredDescription
channelstringYesChannel ID
lateststringNoEnd of time range (timestamp)
oldeststringNoStart of time range (timestamp)
inclusivebooleanNoInclude messages with latest/oldest timestamps
include_all_metadatabooleanNoInclude all metadata
cursorstringNoPagination cursor
limitnumberNoNumber of messages to return (default: 100, max: 1000)

getReplies

channels.getReplies

Retrieve a thread of messages posted to a channel.

const replies = await corsair.slack.api.channels.getReplies({
    channel: "C1234567890",
    ts: "1234567890.123456", 
});

Parameters:

NameTypeRequiredDescription
channelstringYesChannel ID
tsstringYesTimestamp of the parent message
lateststringNoEnd of time range
oldeststringNoStart of time range
inclusivebooleanNoInclude messages with latest/oldest timestamps
include_all_metadatabooleanNoInclude all metadata
cursorstringNoPagination cursor
limitnumberNoNumber of messages to return

invite

channels.invite

Invite a user to a channel.

await corsair.slack.api.channels.invite({
    channel: "C1234567890",
    users: "U1234567890",
});

Parameters:

NameTypeRequiredDescription
channelstringYesChannel ID
usersstringYesComma-separated list of user IDs
forcebooleanNoForce invite even if channel is archived

join

channels.join

Join an existing channel.

await corsair.slack.api.channels.join({
    channel: "C1234567890",
});

Parameters:

NameTypeRequiredDescription
channelstringYesChannel ID or name

kick

channels.kick

Remove a user from a channel.

await corsair.slack.api.channels.kick({
    channel: "C1234567890",
    user: "U1234567890",
});

Parameters:

NameTypeRequiredDescription
channelstringYesChannel ID
userstringYesUser ID to remove

leave

channels.leave

Leave a channel.

await corsair.slack.api.channels.leave({
    channel: "C1234567890",
});

Parameters:

NameTypeRequiredDescription
channelstringYesChannel ID to leave

getMembers

channels.getMembers

Retrieve members of a channel.

const members = await corsair.slack.api.channels.getMembers({
    channel: "C1234567890",
    limit: 100,
});

Parameters:

NameTypeRequiredDescription
channelstringYesChannel ID
cursorstringNoPagination cursor
limitnumberNoNumber of members to return

rename

channels.rename

Rename a channel.

await corsair.slack.api.channels.rename({
    channel: "C1234567890",
    name: "new-channel-name",
});

Parameters:

NameTypeRequiredDescription
channelstringYesChannel ID
namestringYesNew channel name

setPurpose

channels.setPurpose

Set the purpose for a channel.

await corsair.slack.api.channels.setPurpose({
    channel: "C1234567890",
    purpose: "Discuss project updates",
});

Parameters:

NameTypeRequiredDescription
channelstringYesChannel ID
purposestringYesNew purpose text

setTopic

channels.setTopic

Set the topic for a channel.

await corsair.slack.api.channels.setTopic({
    channel: "C1234567890",
    topic: "Weekly standup notes",
});

Parameters:

NameTypeRequiredDescription
channelstringYesChannel ID
topicstringYesNew topic text

Messages

Send, update, delete, and search messages.

post

messages.post

Send a message to a channel.

await corsair.slack.api.messages.post({
    channel: "C1234567890",
    text: "Hello, world!",
});

With blocks:

await corsair.slack.api.messages.post({
    channel: "C1234567890",
    blocks: [ 
        { 
            type: "section", 
            text: { 
                type: "mrkdwn", 
                text: "*Hello* from Corsair!"
            } 
        } 
    ] 
});

Parameters:

NameTypeRequiredDescription
channelstringYesChannel ID
textstringNoMessage text (required if no blocks)
blocksarrayNoBlock Kit blocks
attachmentsarrayNoMessage attachments (legacy)
thread_tsstringNoTimestamp of parent message (for threads)
reply_broadcastbooleanNoBroadcast thread reply to channel
parse'full' | 'none'NoParsing mode
link_namesbooleanNoFind and link user names
unfurl_linksbooleanNoEnable link unfurling
unfurl_mediabooleanNoEnable media unfurling
mrkdwnbooleanNoEnable markdown formatting
as_userbooleanNoPost as the authenticated user
icon_emojistringNoEmoji to use as icon
icon_urlstringNoURL to image for icon
usernamestringNoBot's username
metadataobjectNoEvent metadata

update

messages.update

Update an existing message.

await corsair.slack.api.messages.update({
    channel: "C1234567890",
    ts: "1234567890.123456",
    text: "Updated message text",
});

Parameters:

NameTypeRequiredDescription
channelstringYesChannel ID
tsstringYesTimestamp of message to update
textstringNoNew message text
blocksarrayNoNew Block Kit blocks
attachmentsarrayNoNew attachments
parse'full' | 'none'NoParsing mode
link_namesbooleanNoFind and link user names
as_userbooleanNoUpdate as the authenticated user
file_idsstring[]NoFile IDs to attach
reply_broadcastbooleanNoBroadcast thread reply to channel
metadataobjectNoEvent metadata

delete

messages.delete

Delete a message.

await corsair.slack.api.messages.delete({
    channel: "C1234567890",
    ts: "1234567890.123456",
});

Parameters:

NameTypeRequiredDescription
channelstringYesChannel ID
tsstringYesTimestamp of message to delete
as_userbooleanNoDelete as the authenticated user

messages.getPermalink

Get a permalink URL for a message.

const result = await corsair.slack.api.messages.getPermalink({
    channel: "C1234567890",
    message_ts: "1234567890.123456",
});

console.log(result.permalink);

Parameters:

NameTypeRequiredDescription
channelstringYesChannel ID
message_tsstringYesMessage timestamp

messages.search

Search for messages matching a query.

const results = await corsair.slack.api.messages.search({
    query: "important announcement",
    sort: "timestamp",
    sort_dir: "desc",
});

Parameters:

NameTypeRequiredDescription
querystringYesSearch query
sort'score' | 'timestamp'NoSort results by relevance or time
sort_dir'asc' | 'desc'NoSort direction
highlightbooleanNoHighlight matching terms
team_idstringNoTeam ID (for Enterprise Grid)
cursorstringNoPagination cursor
limitnumberNoNumber of results to return
pagenumberNoPage number (legacy pagination)
countnumberNoNumber per page (legacy pagination)

Users

Access user profiles, presence, and information.

list

users.list

List all users in the workspace.

const users = await corsair.slack.api.users.list({
    limit: 100,
});

Parameters:

NameTypeRequiredDescription
include_localebooleanNoInclude user locale
team_idstringNoTeam ID (for Enterprise Grid)
cursorstringNoPagination cursor
limitnumberNoNumber of users to return

get

users.get

Get information about a user.

const user = await corsair.slack.api.users.get({
    user: "U1234567890",
});

Parameters:

NameTypeRequiredDescription
userstringYesUser ID
include_localebooleanNoInclude user locale

getProfile

users.getProfile

Get a user's profile information.

const profile = await corsair.slack.api.users.getProfile({
    user: "U1234567890",
});

Parameters:

NameTypeRequiredDescription
userstringNoUser ID (defaults to authenticated user)
include_labelsbooleanNoInclude profile field labels

updateProfile

users.updateProfile

Update a user's profile.

await corsair.slack.api.users.updateProfile({
    user: "U1234567890",
    profile: {
        status_text: "In a meeting",
        status_emoji: ":calendar:",
    },
});

Parameters:

NameTypeRequiredDescription
profileobjectNoProfile object with fields to update
userstringNoUser ID (defaults to authenticated user)
namestringNoProfile field name to update
valuestringNoProfile field value

getPresence

users.getPresence

Get a user's presence status.

const presence = await corsair.slack.api.users.getPresence({
    user: "U1234567890",
});

Parameters:

NameTypeRequiredDescription
userstringNoUser ID (defaults to authenticated user)

Files

Upload, list, and retrieve files.

upload

files.upload

Upload a file to Slack.

await corsair.slack.api.files.upload({
    channels: "C1234567890",
    content: "File content here",
    filename: "document.txt",
    title: "Important Document",
});

Parameters:

NameTypeRequiredDescription
channelsstringNoComma-separated channel IDs
contentstringNoFile contents
fileunknownNoFile object
filenamestringNoFilename
filetypestringNoFile type identifier
initial_commentstringNoInitial comment about the file
thread_tsstringNoThread timestamp
titlestringNoTitle of the file

list

files.list

List files uploaded to the workspace.

const files = await corsair.slack.api.files.list({
    channel: "C1234567890",
    types: "images,pdfs",
});

Parameters:

NameTypeRequiredDescription
channelstringNoFilter by channel ID
userstringNoFilter by user ID
typesstringNoFilter by file type (comma-separated)
ts_fromstringNoFilter files created after this timestamp
ts_tostringNoFilter files created before this timestamp
show_files_hidden_by_limitbooleanNoShow files hidden by limit
team_idstringNoTeam ID (for Enterprise Grid)
pagenumberNoPage number
countnumberNoNumber per page

get

files.get

Get information about a file.

const file = await corsair.slack.api.files.get({
    file: "F1234567890",
});

Parameters:

NameTypeRequiredDescription
filestringYesFile ID
cursorstringNoPagination cursor
limitnumberNoNumber of items to return
pagenumberNoPage number
countnumberNoNumber per page

Reactions

Add and remove emoji reactions.

add

reactions.add

Add a reaction to a message.

await corsair.slack.api.reactions.add({
    channel: "C1234567890",
    timestamp: "1234567890.123456",
    name: "thumbsup", 
});

Parameters:

NameTypeRequiredDescription
channelstringYesChannel ID
timestampstringYesMessage timestamp
namestringYesReaction emoji name (without colons)

remove

reactions.remove

Remove a reaction from a message.

await corsair.slack.api.reactions.remove({
    channel: "C1234567890",
    timestamp: "1234567890.123456",
    name: "thumbsup",
});

Parameters:

NameTypeRequiredDescription
namestringYesReaction emoji name (without colons)
channelstringNoChannel ID
timestampstringNoMessage timestamp
filestringNoFile ID
file_commentstringNoFile comment ID

get

reactions.get

Get reactions for a message, file, or file comment.

const reactions = await corsair.slack.api.reactions.get({
    channel: "C1234567890",
    timestamp: "1234567890.123456",
});

Parameters:

NameTypeRequiredDescription
channelstringNoChannel ID
timestampstringNoMessage timestamp
filestringNoFile ID
file_commentstringNoFile comment ID
fullbooleanNoReturn full user objects

Stars

Star and unstar items.

add

stars.add

Star a message, file, or file comment.

await corsair.slack.api.stars.add({
    channel: "C1234567890",
    timestamp: "1234567890.123456",
});

Parameters:

NameTypeRequiredDescription
channelstringNoChannel ID
timestampstringNoMessage timestamp
filestringNoFile ID
file_commentstringNoFile comment ID

remove

stars.remove

Remove a star from a message, file, or file comment.

await corsair.slack.api.stars.remove({
    channel: "C1234567890",
    timestamp: "1234567890.123456",
});

Parameters:

NameTypeRequiredDescription
channelstringNoChannel ID
timestampstringNoMessage timestamp
filestringNoFile ID
file_commentstringNoFile comment ID

list

stars.list

List starred items.

const stars = await corsair.slack.api.stars.list({
    limit: 100,
});

Parameters:

NameTypeRequiredDescription
team_idstringNoTeam ID (for Enterprise Grid)
cursorstringNoPagination cursor
limitnumberNoNumber of items to return
pagenumberNoPage number
countnumberNoNumber per page

User Groups

Create and manage user groups.

create

userGroups.create

Create a new user group.

await corsair.slack.api.userGroups.create({
    name: "engineering",
    description: "Engineering team members",
    handle: "eng",
});

Parameters:

NameTypeRequiredDescription
namestringYesUser group name
channelsstringNoComma-separated channel IDs
descriptionstringNoGroup description
handlestringNoMention handle (@handle)
include_countbooleanNoInclude member count
team_idstringNoTeam ID (for Enterprise Grid)

update

userGroups.update

Update an existing user group.

await corsair.slack.api.userGroups.update({
    userGroup: "S1234567890",
    name: "product-engineering",
    description: "Updated description",
});

Parameters:

NameTypeRequiredDescription
userGroupstringYesUser group ID
namestringNoNew name
channelsstringNoComma-separated channel IDs
descriptionstringNoNew description
handlestringNoNew mention handle
include_countbooleanNoInclude member count
team_idstringNoTeam ID (for Enterprise Grid)

list

userGroups.list

List all user groups.

const groups = await corsair.slack.api.userGroups.list({
    include_users: true,
});

Parameters:

NameTypeRequiredDescription
include_countbooleanNoInclude member count
include_disabledbooleanNoInclude disabled groups
include_usersbooleanNoInclude user IDs
team_idstringNoTeam ID (for Enterprise Grid)

enable

userGroups.enable

Enable a user group.

await corsair.slack.api.userGroups.enable({
    userGroup: "S1234567890",
});

Parameters:

NameTypeRequiredDescription
userGroupstringYesUser group ID
include_countbooleanNoInclude member count
team_idstringNoTeam ID (for Enterprise Grid)

disable

userGroups.disable

Disable a user group.

await corsair.slack.api.userGroups.disable({
    userGroup: "S1234567890",
});

Parameters:

NameTypeRequiredDescription
userGroupstringYesUser group ID
include_countbooleanNoInclude member count
team_idstringNoTeam ID (for Enterprise Grid)