Facts
application/x-www-form-urlencoded application/json Arguments
Required arguments
tokenstringRequiredAuthentication token bearing required scopes. Tokens should be passed as an HTTP Authorization header or alternatively, as a POST parameter.
xxxx-xxxxxxxxx-xxxxchannelstringRequiredChannel, private group, or DM channel to send message to. Can be an encoded ID, or a name. See below for more details.
post_atintegerRequiredUnix timestamp representing the future time the message should post to Slack.
299876400Optional arguments
as_userbooleanOptionalSet to true to post the message as the authed user, instead of as a bot. Defaults to false. Cannot be used by new Slack apps. See chat.postMessage.
trueattachmentsstringOptionalA JSON-based array of structured attachments, presented as a URL-encoded string.
[{"pretext": "pre-hello", "text": "text-world"}]blocksstringOptionalA JSON-based array of structured blocks, presented as a URL-encoded string.
[{"type": "section", "text": {"type": "plain_text", "text": "Hello world"}}]link_namesbooleanOptionalFind and link user groups. No longer supports linking individual users; use syntax shown in Mentioning Users instead.
truemarkdown_textstringOptionalAccepts message text formatted in markdown. This argument should not be used in conjunction with blocks or text. Limit this field to 12,000 characters.
**This is bold text**parsestringOptionalChange how messages are treated. See chat.postMessage.
none fullfullreply_broadcastbooleanOptionalUsed in conjunction with thread_ts and indicates whether reply should be made visible to everyone in the channel or conversation. Defaults to false.
truetextstringOptionalHow this field works and whether it is required depends on other fields you use in your API call. See below for more detail.
Hello worldthread_tsstringOptionalProvide another message's ts value to make this message a reply. Avoid using a reply's ts value; use its parent instead.
unfurl_linksbooleanOptionalPass true to enable unfurling of primarily text-based content.
trueunfurl_mediabooleanOptionalPass false to disable unfurling of media content.
falsemetadataOptionalJSON object with event_type and event_payload fields, presented as a URL-encoded string. Metadata you post to Slack is accessible to any app or user who is a member of that workspace.
{"event_type": "task_created", "event_payload": { "id": "11223", "title": "Redesign Homepage"}}Usage info
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
Typical success response
{
"ok": true,
"channel": "C123ABC456",
"scheduled_message_id": "Q1298393284",
"post_at": "1562180400",
"message": {
"text": "Here's a message for you in the future",
"username": "ecto1",
"bot_id": "B123ABC456",
"attachments": [
{
"text": "This is an attachment",
"id": 1,
"fallback": "This is an attachment's fallback"
}
],
"type": "delayed_message",
"subtype": "bot_message"
}
}
Typical error response if the post_at is invalid (ex. in the past or too far into the future)
{
"ok": false,
"error": "time_in_past"
}
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.
Errors
This table lists the expected errors that this method could return. However, other errors can be returned in the case where the service is down or other unexpected factors affect processing. Callers should always check the value of the ok parameter in the response.
access_deniedAccess to a resource specified in the request is denied.
accesslimitedAccess to this method is limited on the current network
account_inactiveAuthentication token is for a deleted user or workspace when using a bot token.
channel_not_foundValue passed for channel was invalid.
deprecated_endpointThe endpoint has been deprecated.
ekm_access_deniedAdministrators have suspended the ability to post a message.
enterprise_is_restrictedThe method cannot be called from an Enterprise.
fatal_errorThe server could not complete your operation(s) without encountering a catastrophic error. It's possible some aspect of the operation succeeded before the error was raised.
internal_errorThe server could not complete your operation(s) without encountering an error, likely due to a transient issue on our end. It's possible some aspect of the operation succeeded before the error was raised.
invalid_arg_nameThe method was passed an argument whose name falls outside the bounds of accepted or expected values. This includes very long names and names with non-alphanumeric characters other than _. If you get this error, it is typically an indication that you have made a very malformed API call.
invalid_argumentsThe method was called with invalid arguments.
invalid_array_argThe method was passed an array as an argument. Please only input valid strings.
invalid_authSome aspect of authentication cannot be validated. Either the provided token is invalid or the request originates from an IP address disallowed from making the request.
invalid_blocksBlocks submitted with this message are not valid
invalid_blocks_formatThe blocks is not a valid JSON object or doesn't match the Block Kit syntax.
invalid_charsetThe method was called via a POST request, but the charset specified in the Content-Type header was invalid. Valid charset names are: utf-8 iso-8859-1.
invalid_form_dataThe method was called via a POST request with Content-Type application/x-www-form-urlencoded or multipart/form-data, but the form data was either missing or syntactically invalid.
invalid_metadata_formatInvalid metadata format provided
invalid_metadata_schemaInvalid metadata schema provided
invalid_post_typeThe method was called via a POST request, but the specified Content-Type was invalid. Valid types are: application/json application/x-www-form-urlencoded multipart/form-data text/plain.
invalid_timevalue passed for post_time was invalid.
invalid_tokenThe passed token is invalid or not supported by this method.
is_archivedChannel has been archived.
markdown_text_conflictMarkdown text cannot be used in conjunction with blocks or text argument.
message_limit_exceededMembers on this team are sending too many messages. For more details, see https://slack.com/help/articles/115002422943-Usage-limits-for-free-workspaces
metadata_must_be_sent_from_appMessage metadata can only be posted or updated using an app-level token
metadata_too_largeMetadata exceeds size limit
method_deprecatedThe method has been deprecated.
