Skip to content

Slack: Invites users to a channel

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

← Conversations operations · Get started

Operation slack.conversations_invite

Provider route: POST /conversations.invite. 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"]["invite"]>[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.invite(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.invite(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
bodyobjectRequired within parent
body.channelstringRequired within parentThe ID of the public or private channel to invite user(s) to.
body.forcebooleanOptionalWhen set to `true` and multiple user IDs are provided, continue inviting the valid ones while disregarding invalid IDs. Defaults to `false`.
body.usersstringRequired within parentA comma separated list of user IDs. Up to 1000 users may be listed.

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.invite method
channelModelOptionalExpand Renames a conversation — response body — channel
okbooleanRequired within parentMust equal: true

Referenced models: Renames a conversation — response body — channel

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_invite. Catalog operation: conversations_invite. 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", "channels:write.invites", "groups:write", "groups:write.invites", "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.