Sample - Slack Web API
POST/admin.users.invite

Invite a user to a workspace

Invites a user to a workspace. Supply team_id, email, and at least one channel in channel_ids, then optionally configure the invite message, guest status, resend behavior, and account expiration. Use a token with the admin.users:write scope to authorize the invitation.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

1 parameter · 9 body fields
tokenstringrequired
Authentication token with the `admin.users:write` scope.

Workspace invitation details submitted as form data.

team_idstringrequired
The ID (`T1234`) of the workspace.
emailstringrequired
The email address of the person to invite.
channel_idsstringrequired
A comma-separated list of `channel_id`s for this user to join. At least one channel is required.
custom_messagestringoptional
An optional message to send to the user in the invite email.
real_namestringoptional
Full name of the user.
resendbooleanoptional
Allow this invite to be resent in the future if a user has not signed up yet. (default: false)
is_restrictedbooleanoptional
Is this user a multi-channel guest user? (default: false)
is_ultra_restrictedbooleanoptional
Is this user a single channel guest user? (default: false)
guest_expiration_tsstringoptional
Timestamp when guest account should be disabled. Only include this timestamp if you are inviting a guest user and you want their account to expire on a certain date.

2 status codes
200Returns an object with `ok` set to true when the invitation is created.
okbooleanrequired
Allowed:true
defaultReturns an object with `ok` set to false when the request cannot be completed.
okbooleanrequired
Allowed:false

Error handling

The request must include team_id, email, and channel_ids, with at least one channel identifier in channel_ids. token must have the admin.users:write scope; resend, is_restricted, and is_ultra_restricted default to false when omitted.