Skip to content

Slack: Opens or resumes a direct message or multi-person direct message

Slack conversations.open: arguments, response, policy and SDK examples.

← Conversations operations · Get started

Operation slack.conversations_open

Provider route: POST /conversations.open. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/slack with npm, or alter-sdk-slack with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { SlackIntegration } from "@alter-ai/slack";
async function execute(input: Parameters<SlackIntegration["conversations"]["open"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new SlackIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.conversations.open(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_slack import SlackIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = SlackIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.conversations.open(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
bodyobjectOptional
body.channelstringOptionalResume a conversation by supplying an `im` or `mpim`‘s ID. Or provide the `users` field instead.
body.prevent_creationbooleanOptionalDo not create a direct message or multi-person direct message. This is used to see if there is an existing dm or mpdm.
body.return_imbooleanOptionalBoolean, indicates you want the full IM channel definition in the response.
body.usersstringOptionalComma separated lists of users. If only one user is included, this creates a 1:1 DM. The ordering of the users is preserved whenever a multi-person direct message is returned. Supply a `channel` when not supplying `users`.

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$objectRootSchema for successful response from conversations.open method when opening channels, ims, mpims
already_openbooleanOptional
channelJSONOptional
channel (anyOf 1)ModelAlternativeExpand Renames a conversation — response body — channel
channel (anyOf 2)objectAlternative
channel (anyOf 2).createdstringOptional
channel (anyOf 2).idstringOptional
channel (anyOf 2).is_imbooleanOptional
channel (anyOf 2).is_openbooleanOptional
channel (anyOf 2).last_readstringOptional
channel (anyOf 2).latestModelOptionalExpand Sends a message to a channel — response body — message
channel (anyOf 2).unread_countJSONOptional
channel (anyOf 2).unread_count (anyOf 1)numberAlternative
channel (anyOf 2).unread_count (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
channel (anyOf 2).unread_count_displayJSONOptional
channel (anyOf 2).unread_count_display (anyOf 1)numberAlternative
channel (anyOf 2).unread_count_display (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
channel (anyOf 2).userstringOptional
no_opbooleanOptional
okbooleanRequired within parentMust equal: true

Referenced models: Renames a conversation — response body — channel, Sends a message to a channel — response body — message

11 more schemas are linked from the tables above, on the schema pages.

Sends a message to a channel — response body — message
FieldTypePresenceDescription and constraints
$objectRoot
attachmentsarrayOptional
attachments[]objectEach item
attachments[].fallbackstringOptional
attachments[].idJSONOptional
attachments[].id (anyOf 1)integerAlternative
attachments[].id (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
attachments[].image_bytesJSONOptional
attachments[].image_bytes (anyOf 1)integerAlternative
attachments[].image_bytes (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
attachments[].image_heightJSONOptional
attachments[].image_height (anyOf 1)integerAlternative
attachments[].image_height (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
attachments[].image_urlstringOptional
attachments[].image_widthJSONOptional
attachments[].image_width (anyOf 1)integerAlternative
attachments[].image_width (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
blocksModelOptionalExpand Sends a message to a channel — response body — message blocks
bot_idJSONOptional
bot_id (anyOf 1)stringAlternative
bot_id (anyOf 2)nullAlternative
bot_profileModelOptionalExpand Sends a message to a channel — response body — message bot profile
client_msg_idstringOptional
commentModelOptionalExpand Sends a message to a channel — response body — message comment
display_as_botbooleanOptional
fileModelOptionalExpand Gets information about a file — response body — file
filesarrayOptional
files[]ModelEach itemExpand Gets information about a file — response body — file
iconsobjectOptional
icons.emojistringOptional
icons.image_64stringOptionalFormat: uri
inviterstringOptional
is_delayed_messagebooleanOptional
is_introbooleanOptional
is_starredbooleanOptional
last_readstringOptional
latest_replystringOptional
namestringOptional
old_namestringOptional
parent_user_idstringOptional
permalinkstringOptionalFormat: uri
pinned_toarrayOptional
pinned_to[]stringEach item
purposestringOptional
reactionsarrayOptional
reactions[]ModelEach itemExpand Gets information about a file — response body — file reactions item
reply_countJSONOptional
reply_count (anyOf 1)integerAlternative
reply_count (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
reply_usersarrayOptional
reply_users[]stringEach item
reply_users_countJSONOptional
reply_users_count (anyOf 1)integerAlternative
reply_users_count (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
source_teamstringOptional
subscribedbooleanOptional
subtypestringOptional
teamstringOptional
textstringOptional
thread_tsstringOptional
topicstringOptional
tsstringOptional
typestringOptional
unread_countJSONOptional
unread_count (anyOf 1)integerAlternative
unread_count (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
uploadbooleanOptional
userstringOptional
user_profileModelOptionalExpand Sends a message to a channel — response body — message user profile
user_teamstringOptional
usernamestringOptional

Referenced models: Sends a message to a channel — response body — message blocks, Sends a message to a channel — response body — message bot profile, Sends a message to a channel — response body — message comment, Gets information about a file — response body — file, Gets information about a file — response body — file reactions item, Sends a message to a channel — response body — message user profile

Gets information about the current team — response body — team
FieldTypePresenceDescription and constraints
$objectRoot
archivedbooleanOptional
avatar_base_urlstringOptionalFormat: uri
createdJSONOptional
created (anyOf 1)integerAlternative
created (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
date_createJSONOptional
date_create (anyOf 1)integerAlternative
date_create (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
deletedbooleanOptional
descriptionJSONOptional
description (anyOf 1)nullAlternative
description (anyOf 2)stringAlternative
discoverableJSONOptional
discoverable (anyOf 1)nullAlternative
discoverable (anyOf 2)stringAlternative
domainstringOptional
email_domainstringOptional
enterprise_idstringOptional
enterprise_namestringOptional
external_org_migrationsModelOptionalExpand Gets information about the current team — response body — team external org migrations
has_compliance_exportbooleanOptional
iconModelOptionalExpand Gets information about the current team — response body — team icon
idstringOptional
is_assignedbooleanOptional
is_enterpriseJSONOptional
is_enterprise (anyOf 1)integerAlternative
is_enterprise (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
is_over_storage_limitbooleanOptional
limit_tsJSONOptional
limit_ts (anyOf 1)integerAlternative
limit_ts (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
localestringOptional
messages_countJSONOptional
messages_count (anyOf 1)integerAlternative
messages_count (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
msg_edit_window_minsJSONOptional
msg_edit_window_mins (anyOf 1)integerAlternative
msg_edit_window_mins (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
namestringOptional
over_integrations_limitbooleanOptional
over_storage_limitbooleanOptional
pay_prod_curstringOptional
planstringOptionalKnown values: "" (empty string), std, plus, compliance, enterprise
primary_ownerModelOptionalExpand Gets information about the current team — response body — team primary owner
sso_providerobjectOptional
sso_provider.labelstringOptional
sso_provider.namestringOptional
sso_provider.typestringOptional

Referenced models: Gets information about the current team — response body — team external org migrations, Gets information about the current team — response body — team icon, Gets information about the current team — response body — team primary owner

SDK function policy ID: slack.conversations_open. Catalog operation: conversations_open. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Required provider scopes: ["channels:manage", "groups:write", "im:write", "mpim:write"]

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.