Skip to content

Post an image as the bot

POST
/api/v3/organizations/{organisation}/ai/slack-bots/{botId}/files
curl --request POST \
--url https://dashboard.quantcdn.io/api/v3/organizations/example/ai/slack-bots/example/files \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "channel": "example", "threadTs": "example", "content": "example", "filename": "example", "title": "example", "altText": "example", "text": "example" }'

The bot uploads one image in an allowed channel or thread, with an attribution line that shows your name. The type comes from the bytes: PNG, JPEG, GIF or WebP, at most 4 MiB decoded. Counts as one write. Needs the explicit ai:slack scope, use_ai_services and a verified email.

organisation
required
string

The organisation machine name

botId
required
string
/^[a-zA-Z0-9_-]+$/
Idempotency-Key
string
>= 8 characters <= 128 characters

8-128 visible ASCII characters. The same key and body within 10 minutes returns the first result and does not upload again.

Media typeapplication/json
object
channel
required
string
/^[CG][A-Z0-9]{8,}$/
threadTs

Absent: a root post

string
/^\d{10}\.\d{6}$/
content
required

The image, base64 (standard alphabet, no whitespace, no data: prefix). 1 byte to 4 MiB decoded.

string
filename

Default screenshot.. The extension must match the image type (png, jpg, jpeg, gif, webp).

string
/^[A-Za-z0-9._-]{1,100}$/
title
string
>= 1 characters <= 200 characters
altText
string
>= 1 characters <= 1000 characters
text

Caption. Same mention rules as a message.

string
>= 1 characters <= 3000 characters
Examplegenerated
{
"channel": "example",
"threadTs": "example",
"content": "example",
"filename": "example",
"title": "example",
"altText": "example",
"text": "example"
}

Uploaded

Media typeapplication/json
object
channel
string
threadTs
string
nullable
fileId
string
permalink
string
nullable
Examplegenerated
{
"channel": "example",
"threadTs": "example",
"fileId": "example",
"permalink": "example"
}

INVALID_REQUEST: the body is not a JSON object, has an unknown field or a field that is not valid, the content is not a PNG, JPEG, GIF or WebP image or is larger than 4 MiB, or the Idempotency-Key is not valid

Media typeapplication/json
object
message
required

Error message

string
error
required

Error flag

boolean
error
required

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.

boolean
code
required
string
message
required
string
retryable
required
boolean
slackError

The Slack error string. Only with code SLACK_ERROR.

string
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

Media typeapplication/json
object
message
required

Error message

string
error
required

Error flag

boolean
error
required

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.

boolean
code
required
string
message
required
string
retryable
required
boolean
slackError

The Slack error string. Only with code SLACK_ERROR.

string
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

Media typeapplication/json
object
message
required

Error message

string
error
required

Error flag

boolean
error
required

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.

boolean
code
required
string
message
required
string
retryable
required
boolean
slackError

The Slack error string. Only with code SLACK_ERROR.

string
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

Media typeapplication/json
object
message
required

Error message

string
error
required

Error flag

boolean
error
required

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.

boolean
code
required
string
message
required
string
retryable
required
boolean
slackError

The Slack error string. Only with code SLACK_ERROR.

string
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

Media typeapplication/json
object
message
required

Error message

string
error
required

Error flag

boolean
error
required

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.

boolean
code
required
string
message
required
string
retryable
required
boolean
slackError

The Slack error string. Only with code SLACK_ERROR.

string
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.

Media typeapplication/json
object
message
required

Error message

string
error
required

Error flag

boolean
error
required

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.

boolean
code
required
string
message
required
string
retryable
required
boolean
slackError

The Slack error string. Only with code SLACK_ERROR.

string
Example
{
"message": "The requested resource was not found",
"error": true,
"code": "CHANNEL_NOT_ALLOWED",
"slackError": "not_in_channel"
}
Retry-After
integer

SLACK_ERROR. slackError carries the Slack error string.

Media typeapplication/json
object
message
required

Error message

string
error
required

Error flag

boolean
error
required

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.

boolean
code
required
string
message
required
string
retryable
required
boolean
slackError

The Slack error string. Only with code SLACK_ERROR.

string
Example
{
"message": "The requested resource was not found",
"error": true,
"code": "CHANNEL_NOT_ALLOWED",
"slackError": "not_in_channel"
}