Skip to main content

chat.scheduleMessage method

Usage info

Bug alert

Messages scheduled with chat.scheduleMessage will not post if the metadata parameter is used.

This method schedules a message for delivery to a public channel, private channel, or direct message (DM) conversation at a specified time in the future. Messages scheduled through this method can be seen by calling the chat.scheduledMessages.list API method.

The text, blocks and attachments fields

The usage of the text field changes depending on whether you're using blocks. If you're using blocks, this is used as a fallback string to display in notifications. If you aren't, this is the main body text of the message. It can be formatted as plain text, or with mrkdwn.

Restrictions

You will only be able to schedule a message up to 120 days into the future. If you specify a post_at timestamp beyond this limit, you’ll receive a time_too_far error response. Additionally, you cannot schedule more than 30 messages to post within a 5-minute window to the same channel. Exceeding this will result in a restricted_too_many error.

Response

The response includes the scheduled_message_id assigned to your message. Use it with the chat.deleteScheduledMessage API method to delete the message before it is sent.

For details on formatting, usage in threads, and rate limiting, refer to the chat.postMessage API method documentation.

Channels

You must specify a public channel, private channel, or DM conversation with the channel argument. Each one behaves slightly differently based on the authenticated user's permissions and additional arguments:

Post to a channel

You can either pass the channel's name (#general) or the encoded ID (C123ABC456) and the message will be posted to that channel. The channel's ID can be retrieved through the conversations.list API method.

Post to a DM

Pass the DM conversation's channel ID (D123ABC456) or a user's ID (U123ABC456) as the value of channel to post to that DM conversation.

The DM conversation's channel ID can be retrieved by calling the conversations.list API method. Use the types parameters to return only im conversations. You may receive a channel_not_found error if your app doesn't have permission to enter into an direct message with the intended user.