Post a message as the bot
const url = 'https://dashboard.quantcdn.io/api/v3/organizations/example/ai/slack-bots/example/messages';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"channel":"example","threadTs":"example","text":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://dashboard.quantcdn.io/api/v3/organizations/example/ai/slack-bots/example/messages \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "channel": "example", "threadTs": "example", "text": "example" }'The bot posts the text in an allowed channel, with an attribution line that shows your name. The bot does not answer the post. Mentions keep only the <@U…> form (at most 10 users); other control forms show as text. Needs the explicit ai:slack scope, use_ai_services and a verified email.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The organisation machine name
Header Parameters
Section titled “Header Parameters”8-128 visible ASCII characters. An empty Idempotency-Key header is refused with 400 INVALID_REQUEST. The same key and body within 10 minutes returns the first result and does not post again.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Absent: a root post
1-8000 characters after trim
Examplegenerated
{ "channel": "example", "threadTs": "example", "text": "example"}Responses
Section titled “Responses”Posted
object
Examplegenerated
{ "channel": "example", "ts": "example", "threadTs": "example", "permalink": "example"}INVALID_REQUEST: the body is not a JSON object, has an unknown field or a field that is not valid, or the Idempotency-Key is not valid (an empty Idempotency-Key header is not valid)
object
Error message
Error flag
Thin proxy for the Slack bot API: list API-enabled bots, read channel messages and threads, and post as the bot. The portal validates the request, requires a verified email, calls the platform and passes its status and body through. The platform owns the bot, channel and rate-limit rules and their error codes.
Only the values that SlackBotApiRequest returns go to the platform, never raw input. The activity entry (ai_slack_api) never holds message text.
The Slack error string. Only with code SLACK_ERROR.
Example
{ "message": "The requested resource was not found", "error": true, "code": "CHANNEL_NOT_ALLOWED", "slackError": "not_in_channel"}Invalid or expired token
SCOPE_REQUIRED, EMAIL_NOT_VERIFIED, IDENTITY_REQUIRED, CHANNEL_NOT_ALLOWED, USER_NOT_ALLOWED, PERMISSION_DENIED, or AI is off for the organisation
object
Error message
Error flag
Thin proxy for the Slack bot API: list API-enabled bots, read channel messages and threads, and post as the bot. The portal validates the request, requires a verified email, calls the platform and passes its status and body through. The platform owns the bot, channel and rate-limit rules and their error codes.
Only the values that SlackBotApiRequest returns go to the platform, never raw input. The activity entry (ai_slack_api) never holds message text.
The Slack error string. Only with code SLACK_ERROR.
Example
{ "message": "The requested resource was not found", "error": true, "code": "CHANNEL_NOT_ALLOWED", "slackError": "not_in_channel"}BOT_NOT_FOUND, or NOT_FOUND when the Slack bot API is not enabled
object
Error message
Error flag
Thin proxy for the Slack bot API: list API-enabled bots, read channel messages and threads, and post as the bot. The portal validates the request, requires a verified email, calls the platform and passes its status and body through. The platform owns the bot, channel and rate-limit rules and their error codes.
Only the values that SlackBotApiRequest returns go to the platform, never raw input. The activity entry (ai_slack_api) never holds message text.
The Slack error string. Only with code SLACK_ERROR.
Example
{ "message": "The requested resource was not found", "error": true, "code": "CHANNEL_NOT_ALLOWED", "slackError": "not_in_channel"}BOT_INACTIVE, or REQUEST_IN_PROGRESS (retryable) while the first call with this Idempotency-Key runs
object
Error message
Error flag
Thin proxy for the Slack bot API: list API-enabled bots, read channel messages and threads, and post as the bot. The portal validates the request, requires a verified email, calls the platform and passes its status and body through. The platform owns the bot, channel and rate-limit rules and their error codes.
Only the values that SlackBotApiRequest returns go to the platform, never raw input. The activity entry (ai_slack_api) never holds message text.
The Slack error string. Only with code SLACK_ERROR.
Example
{ "message": "The requested resource was not found", "error": true, "code": "CHANNEL_NOT_ALLOWED", "slackError": "not_in_channel"}IDEMPOTENCY_KEY_MISMATCH: the Idempotency-Key was used with a different body
object
Error message
Error flag
Thin proxy for the Slack bot API: list API-enabled bots, read channel messages and threads, and post as the bot. The portal validates the request, requires a verified email, calls the platform and passes its status and body through. The platform owns the bot, channel and rate-limit rules and their error codes.
Only the values that SlackBotApiRequest returns go to the platform, never raw input. The activity entry (ai_slack_api) never holds message text.
The Slack error string. Only with code SLACK_ERROR.
Example
{ "message": "The requested resource was not found", "error": true, "code": "CHANNEL_NOT_ALLOWED", "slackError": "not_in_channel"}RATE_LIMITED. See the Retry-After header.
object
Error message
Error flag
Thin proxy for the Slack bot API: list API-enabled bots, read channel messages and threads, and post as the bot. The portal validates the request, requires a verified email, calls the platform and passes its status and body through. The platform owns the bot, channel and rate-limit rules and their error codes.
Only the values that SlackBotApiRequest returns go to the platform, never raw input. The activity entry (ai_slack_api) never holds message text.
The Slack error string. Only with code SLACK_ERROR.
Example
{ "message": "The requested resource was not found", "error": true, "code": "CHANNEL_NOT_ALLOWED", "slackError": "not_in_channel"}Headers
Section titled “Headers”SLACK_ERROR. slackError carries the Slack error string.
object
Error message
Error flag
Thin proxy for the Slack bot API: list API-enabled bots, read channel messages and threads, and post as the bot. The portal validates the request, requires a verified email, calls the platform and passes its status and body through. The platform owns the bot, channel and rate-limit rules and their error codes.
Only the values that SlackBotApiRequest returns go to the platform, never raw input. The activity entry (ai_slack_api) never holds message text.
The Slack error string. Only with code SLACK_ERROR.
Example
{ "message": "The requested resource was not found", "error": true, "code": "CHANNEL_NOT_ALLOWED", "slackError": "not_in_channel"}