Slack.Web.Admin.Users (SlackKit v0.25.0-alpha.0)

View Source

Summary

Functions

Add an Enterprise user to a workspace.

Fetches the expiration timestamp for a guest

List users on a workspace

Remove a user from a workspace.

Set an existing regular user or owner to be a workspace or org admin.

Set an existing regular user or admin to be a workspace or org owner.

Set an existing guest user, admin user, or owner to be a regular user.

Functions

assign(team_id, user_id, optional_params \\ %{})

Add an Enterprise user to a workspace.

Required Params

  • team_id - The ID (T1234) of the workspace.
  • user_id - The ID of the user to add to the workspace.

Optional Params

  • channel_ids - Comma separated values of channel IDs to add user in the new workspace. ex: C123,C3456
  • is_restricted - True if user should be added to the workspace as a guest. ex: true
  • is_ultra_restricted - True if user should be added to the workspace as a single-channel guest. ex: true

Errors the API can return:

  • token_revoked - Authentication token is for a deleted user or workspace or the app has been removed when using a user token.
  • invalid_arg_name - The method was passed an argument whose name falls outside the bounds of accepted or expected values. This includes very long names and names with non-alphanumeric characters other than _. If you get this error, it is typically an indication that you have made a very malformed API call.
  • two_factor_setup_required - Two factor setup is required.
  • feature_not_enabled - The Admin APIs feature is not enabled for this team
  • invalid_form_data - The method was called via a POST request with Content-Type application/x-www-form-urlencoded or multipart/form-data, but the form data was either missing or syntactically invalid.
  • invalid_post_type - The method was called via a POST request, but the specified Content-Type was invalid. Valid types are: application/json application/x-www-form-urlencoded multipart/form-data text/plain.
  • fatal_error - The server could not complete your operation(s) without encountering a catastrophic error. It's possible some aspect of the operation succeeded before the error was raised.
  • deprecated_endpoint - The endpoint has been deprecated.
  • ratelimited - The request has been ratelimited. Refer to the Retry-After header for when to retry the request.
  • ekm_access_denied - Administrators have suspended the ability to post a message.
  • service_unavailable - The service is temporarily unavailable
  • invalid_role_for_user - The requested status is incompatible with the user's role on another workspace.
  • user_not_found - user_id was not found.
  • team_access_not_granted - The token used is not granted the specific workspace access required to complete this request.
  • invalid_arguments - The method was called with invalid arguments.
  • user_already_team_member - The given user is already active on the given team.
  • invalid_array_arg - The method was passed an array as an argument. Please only input valid strings.
  • request_timeout - The method was called via a POST request, but the POST data was either missing or truncated.
  • team_not_found - `team_id was not found.
  • account_inactive - Authentication token is for a deleted user or workspace when using a bot token.
  • user_is_bot - The given user is a bot from an app. This api only works with humans.
  • not_authed - No authentication token provided.
  • internal_error - The server could not complete your operation(s) without encountering an error, likely due to a transient issue on our end. It's possible some aspect of the operation succeeded before the error was raised.
  • enterprise_is_restricted - The method cannot be called from an Enterprise.
  • no_permission - The workspace token used in this request does not have the permissions necessary to complete the request. Make sure your app is a member of the conversation it's attempting to post a message to.
  • access_denied - Access to a resource specified in the request is denied.
  • team_added_to_org - The workspace associated with your request is currently undergoing migration to an Enterprise Organization. Web API and other platform operations will be intermittently unavailable until the transition is complete.
  • missing_scope - The token used is not granted the specific scope permissions required to complete this request.
  • missing_post_type - The method was called via a POST request and included a data payload, but the request did not include a Content-Type header.
  • accesslimited - Access to this method is limited on the current network
  • invited_user_not_created - The invited user could not be created.
  • not_an_admin - This method wasn't called by an admin.
  • token_expired - Authentication token has expired
  • invited_user_not_reactivated - The invited user could not be reactivated.
  • invitor_cannot_see_channel - The invitor is not part of one or many channels that the user was requested to be added to
  • invalid_charset - The method was called via a POST request, but the charset specified in the Content-Type header was invalid. Valid charset names are: utf-8 iso-8859-1.
  • method_deprecated - The method has been deprecated.
  • not_allowed_token_type - The token type used in this request is not allowed.
  • org_login_required - The workspace is undergoing an enterprise migration and will not be available until migration is complete.
  • invalid_auth - Some aspect of authentication cannot be validated. Either the provided token is invalid or the request originates from an IP address disallowed from making the request.

get_expiration(optional_params \\ %{})

Fetches the expiration timestamp for a guest

Optional Params

  • target_team - If an org token is passed in and this team is on the org, it will operate on the workspace level on the specified team. Otherwise it will operate on the org or team in context. ex: T123ABC456
  • user_id - The ID of the guest user to get the expiration for. ex: U123ABC456

Errors the API can return:

  • user_is_not_guest - The user is not a guest
  • token_revoked - Authentication token is for a deleted user or workspace or the app has been removed when using a user token.
  • invalid_arg_name - The method was passed an argument whose name falls outside the bounds of accepted or expected values. This includes very long names and names with non-alphanumeric characters other than _. If you get this error, it is typically an indication that you have made a very malformed API call.
  • two_factor_setup_required - Two factor setup is required.
  • invalid_form_data - The method was called via a POST request with Content-Type application/x-www-form-urlencoded or multipart/form-data, but the form data was either missing or syntactically invalid.
  • invalid_post_type - The method was called via a POST request, but the specified Content-Type was invalid. Valid types are: application/json application/x-www-form-urlencoded multipart/form-data text/plain.
  • target_team_not_on_org - Target team specified is not on the org in context
  • fatal_error - The server could not complete your operation(s) without encountering a catastrophic error. It's possible some aspect of the operation succeeded before the error was raised.
  • deprecated_endpoint - The endpoint has been deprecated.
  • ratelimited - The request has been ratelimited. Refer to the Retry-After header for when to retry the request.
  • ekm_access_denied - Administrators have suspended the ability to post a message.
  • service_unavailable - The service is temporarily unavailable
  • user_not_found - User not found
  • team_access_not_granted - The token used is not granted the specific workspace access required to complete this request.
  • not_permitted - This action is not permitted
  • invalid_arguments - The method was called with invalid arguments.
  • invalid_array_arg - The method was passed an array as an argument. Please only input valid strings.
  • no_perms - User does not have appropriate permissions.
  • request_timeout - The method was called via a POST request, but the POST data was either missing or truncated.
  • team_not_found - Team not found
  • account_inactive - Authentication token is for a deleted user or workspace when using a bot token.
  • not_authed - No authentication token provided.
  • internal_error - The server could not complete your operation(s) without encountering an error, likely due to a transient issue on our end. It's possible some aspect of the operation succeeded before the error was raised.
  • enterprise_is_restricted - The method cannot be called from an Enterprise.
  • no_permission - The workspace token used in this request does not have the permissions necessary to complete the request. Make sure your app is a member of the conversation it's attempting to post a message to.
  • access_denied - Access to a resource specified in the request is denied.
  • team_added_to_org - The workspace associated with your request is currently undergoing migration to an Enterprise Organization. Web API and other platform operations will be intermittently unavailable until the transition is complete.
  • paid_teams_only - This feature is only accessible to paid teams
  • missing_scope - The token used is not granted the specific scope permissions required to complete this request.
  • missing_post_type - The method was called via a POST request and included a data payload, but the request did not include a Content-Type header.
  • accesslimited - Access to this method is limited on the current network
  • token_expired - Authentication token has expired
  • invalid_charset - The method was called via a POST request, but the charset specified in the Content-Type header was invalid. Valid charset names are: utf-8 iso-8859-1.
  • method_deprecated - The method has been deprecated.
  • not_allowed_token_type - The token type used in this request is not allowed.
  • org_login_required - The workspace is undergoing an enterprise migration and will not be available until migration is complete.
  • invalid_auth - Some aspect of authentication cannot be validated. Either the provided token is invalid or the request originates from an IP address disallowed from making the request.

invite(channel_ids, email, team_id, optional_params \\ %{})

Invite a user to a workspace.

Required Params

  • channel_ids - A comma-separated list of channel_ids for this user to join. At least one channel is required. ex: C1A2B3C4D,C26Z25Y24
  • email - The email address of the person to invite. ex: joe@email.com
  • team_id - The ID (T1234) of the workspace.

Optional Params

  • custom_message - An optional message to send to the user in the invite email. ex: Come and join our team!
  • email_password_policy_enabled - Allow invited user to sign in via email and password. Only available for Enterprise org teams via admin invite. ex: true
  • guest_expiration_ts - 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. ex: 0123456789.012345
  • is_restricted - Is this user a multi-channel guest user? (default: false)
  • is_ultra_restricted - Is this user a single channel guest user? (default: false)
  • real_name - Full name of the user. ex: {"full_name":"Joe Smith"}
  • resend - Allow this invite to be resent in the future if a user has not signed up yet. Resending can only be done via the UI and has no expiration. (default: false) ex: true

Errors the API can return:

  • failed_to_validate_custom_message - extra_message was invalid.
  • already_in_team - The user is already on the team.
  • invalid_email - Email address was not valid.
  • failed_looking_up_user - We couldn't find the requested user.
  • token_revoked - Authentication token is for a deleted user or workspace or the app has been removed when using a user token.
  • invalid_arg_name - The method was passed an argument whose name falls outside the bounds of accepted or expected values. This includes very long names and names with non-alphanumeric characters other than _. If you get this error, it is typically an indication that you have made a very malformed API call.
  • two_factor_setup_required - Two factor setup is required.
  • failed_to_send_invite - The invite failed to send.
  • feature_not_enabled - The Admin APIs feature is not enabled for this team.
  • invalid_form_data - The method was called via a POST request with Content-Type application/x-www-form-urlencoded or multipart/form-data, but the form data was either missing or syntactically invalid.
  • invalid_post_type - The method was called via a POST request, but the specified Content-Type was invalid. Valid types are: application/json application/x-www-form-urlencoded multipart/form-data text/plain.
  • already_in_team_invited_user - The user has already been invited to the team.
  • fatal_error - The server could not complete your operation(s) without encountering a catastrophic error. It's possible some aspect of the operation succeeded before the error was raised.
  • deprecated_endpoint - The endpoint has been deprecated.
  • ratelimited - The request has been ratelimited. Refer to the Retry-After header for when to retry the request.
  • ekm_access_denied - Administrators have suspended the ability to post a message.
  • service_unavailable - The service is temporarily unavailable
  • team_access_not_granted - The token used is not granted the specific workspace access required to complete this request.
  • failed_to_validate_expiration - expiration_ts was invalid.
  • invalid_arguments - The method was called with invalid arguments.
  • failed_to_validate_channels - channel_ids was invalid.
  • invalid_array_arg - The method was passed an array as an argument. Please only input valid strings.
  • user_disabled - The user is disabled.
  • request_timeout - The method was called via a POST request, but the POST data was either missing or truncated.
  • team_not_found - team_id was not found.
  • account_inactive - Authentication token is for a deleted user or workspace when using a bot token.
  • not_authed - No authentication token provided.
  • internal_error - The server could not complete your operation(s) without encountering an error, likely due to a transient issue on our end. It's possible some aspect of the operation succeeded before the error was raised.
  • enterprise_is_restricted - The method cannot be called from an Enterprise.
  • no_permission - The workspace token used in this request does not have the permissions necessary to complete the request. Make sure your app is a member of the conversation it's attempting to post a message to.
  • access_denied - Access to a resource specified in the request is denied.
  • team_added_to_org - The workspace associated with your request is currently undergoing migration to an Enterprise Organization. Web API and other platform operations will be intermittently unavailable until the transition is complete.
  • missing_scope - The token used is not granted the specific scope permissions required to complete this request.
  • missing_post_type - The method was called via a POST request and included a data payload, but the request did not include a Content-Type header.
  • accesslimited - Access to this method is limited on the current network
  • not_an_admin - The user token does not have admin privileges.
  • token_expired - Authentication token has expired
  • invalid_charset - The method was called via a POST request, but the charset specified in the Content-Type header was invalid. Valid charset names are: utf-8 iso-8859-1.
  • method_deprecated - The method has been deprecated.
  • not_allowed_token_type - The token type used in this request is not allowed.
  • org_login_required - The workspace is undergoing an enterprise migration and will not be available until migration is complete.
  • failed_to_validate_caller - The token calling this method doesn't have permission to invite a user.
  • invalid_auth - Some aspect of authentication cannot be validated. Either the provided token is invalid or the request originates from an IP address disallowed from making the request.
  • failed_to_validate_team - The team calling this method was invalid.

list(optional_params \\ %{})

List users on a workspace

Optional Params

  • cursor - Set cursor to next_cursor returned by the previous call to list items in the next page. ex: 5c3e53d5
  • include_admins - If true, only admin users will be returned (excludes owners). Returns all admins and owners when combined with include_owners. Cannot be used together with only_guests.
  • include_deactivated_user_workspaces - Only applies with org token and no team_id. If true, return workspaces for a user even if they may be deactivated on them. If false, return workspaces for a user only when user is active on them. Default is false.
  • include_owners - If true, only owner users will be returned. Cannot be used together with only_guests.
  • is_active - If true, only active users will be returned. If false, only deactivated users will be returned. Default is true.
  • limit - Limit for how many users to be retrieved per page ex: 50
  • only_guests - If true, returns only guests and their expiration dates that belong to the team_id
  • team_id - The ID (T1234) of a workspace. Filters results to just the specified workspace.

Errors the API can return:

  • invalid_cursor - The passed cursor could not be validated.
  • token_revoked - Authentication token is for a deleted user or workspace or the app has been removed when using a user token.
  • invalid_arg_name - The method was passed an argument whose name falls outside the bounds of accepted or expected values. This includes very long names and names with non-alphanumeric characters other than _. If you get this error, it is typically an indication that you have made a very malformed API call.
  • two_factor_setup_required - Two factor setup is required.
  • feature_not_enabled - The Admin APIs feature is not enabled for this team.
  • invalid_form_data - The method was called via a POST request with Content-Type application/x-www-form-urlencoded or multipart/form-data, but the form data was either missing or syntactically invalid.
  • invalid_post_type - The method was called via a POST request, but the specified Content-Type was invalid. Valid types are: application/json application/x-www-form-urlencoded multipart/form-data text/plain.
  • fatal_error - The server could not complete your operation(s) without encountering a catastrophic error. It's possible some aspect of the operation succeeded before the error was raised.
  • include_deactivated_user_workspaces_invalid - include_deactivated_user_workspaces only applies with org token and no team_id.
  • deprecated_endpoint - The endpoint has been deprecated.
  • ratelimited - The request has been ratelimited. Refer to the Retry-After header for when to retry the request.
  • ekm_access_denied - Administrators have suspended the ability to post a message.
  • service_unavailable - The service is temporarily unavailable
  • team_access_not_granted - The token used is not granted the specific workspace access required to complete this request.
  • invalid_arguments - The passed arguments were invalid.
  • invalid_array_arg - The method was passed an array as an argument. Please only input valid strings.
  • request_timeout - The method was called via a POST request, but the POST data was either missing or truncated.
  • team_not_found - team_id was not found.
  • account_inactive - Authentication token is for a deleted user or workspace when using a bot token.
  • not_authed - No authentication token provided.
  • internal_error - The server could not complete your operation(s) without encountering an error, likely due to a transient issue on our end. It's possible some aspect of the operation succeeded before the error was raised.
  • enterprise_is_restricted - The method cannot be called from an Enterprise.
  • no_permission - The workspace token used in this request does not have the permissions necessary to complete the request. Make sure your app is a member of the conversation it's attempting to post a message to.
  • access_denied - Access to a resource specified in the request is denied.
  • team_added_to_org - The workspace associated with your request is currently undergoing migration to an Enterprise Organization. Web API and other platform operations will be intermittently unavailable until the transition is complete.
  • missing_scope - The token used is not granted the specific scope permissions required to complete this request.
  • missing_post_type - The method was called via a POST request and included a data payload, but the request did not include a Content-Type header.
  • accesslimited - Access to this method is limited on the current network
  • token_expired - Authentication token has expired
  • invalid_charset - The method was called via a POST request, but the charset specified in the Content-Type header was invalid. Valid charset names are: utf-8 iso-8859-1.
  • method_deprecated - The method has been deprecated.
  • not_allowed_token_type - The token type used in this request is not allowed.
  • org_login_required - The workspace is undergoing an enterprise migration and will not be available until migration is complete.
  • invalid_auth - This request could not be authorized.

remove(team_id, user_id, optional_params \\ %{})

Remove a user from a workspace.

Required Params

  • team_id - The ID (T1234) of the workspace.
  • user_id - The ID of the user to remove. ex: W12345678

Errors the API can return:

  • token_revoked - Authentication token is for a deleted user or workspace or the app has been removed when using a user token.
  • invalid_arg_name - The method was passed an argument whose name falls outside the bounds of accepted or expected values. This includes very long names and names with non-alphanumeric characters other than _. If you get this error, it is typically an indication that you have made a very malformed API call.
  • two_factor_setup_required - Two factor setup is required.
  • feature_not_enabled - The Admin APIs feature is not enabled for this team.
  • invalid_form_data - The method was called via a POST request with Content-Type application/x-www-form-urlencoded or multipart/form-data, but the form data was either missing or syntactically invalid.
  • user_already_deleted - The requested user has already been marked as deleted.
  • invalid_post_type - The method was called via a POST request, but the specified Content-Type was invalid. Valid types are: application/json application/x-www-form-urlencoded multipart/form-data text/plain.
  • fatal_error - The server could not complete your operation(s) without encountering a catastrophic error. It's possible some aspect of the operation succeeded before the error was raised.
  • deprecated_endpoint - The endpoint has been deprecated.
  • ratelimited - The request has been ratelimited. Refer to the Retry-After header for when to retry the request.
  • ekm_access_denied - Administrators have suspended the ability to post a message.
  • service_unavailable - The service is temporarily unavailable
  • failed_to_remove_user_from_workspace - Removing this user from the workspace failed.
  • user_not_found - The user was not found.
  • team_access_not_granted - The token used is not granted the specific workspace access required to complete this request.
  • invalid_arguments - The method was called with invalid arguments.
  • cannot_modify_primary_owner - The primary owner cannot be modified.
  • invalid_array_arg - The method was passed an array as an argument. Please only input valid strings.
  • request_timeout - The method was called via a POST request, but the POST data was either missing or truncated.
  • team_not_found - team_id was not found.
  • account_inactive - Authentication token is for a deleted user or workspace when using a bot token.
  • not_authed - No authentication token provided.
  • internal_error - The server could not complete your operation(s) without encountering an error, likely due to a transient issue on our end. It's possible some aspect of the operation succeeded before the error was raised.
  • enterprise_is_restricted - The method cannot be called from an Enterprise.
  • no_permission - The workspace token used in this request does not have the permissions necessary to complete the request. Make sure your app is a member of the conversation it's attempting to post a message to.
  • access_denied - Access to a resource specified in the request is denied.
  • team_added_to_org - The workspace associated with your request is currently undergoing migration to an Enterprise Organization. Web API and other platform operations will be intermittently unavailable until the transition is complete.
  • missing_scope - The token used is not granted the specific scope permissions required to complete this request.
  • missing_post_type - The method was called via a POST request and included a data payload, but the request did not include a Content-Type header.
  • accesslimited - Access to this method is limited on the current network
  • token_expired - Authentication token has expired
  • invalid_charset - The method was called via a POST request, but the charset specified in the Content-Type header was invalid. Valid charset names are: utf-8 iso-8859-1.
  • method_deprecated - The method has been deprecated.
  • invalid_permissions - This method is only accessible by org owners and admins.
  • not_allowed_token_type - The token type used in this request is not allowed.
  • org_login_required - The workspace is undergoing an enterprise migration and will not be available until migration is complete.
  • invalid_auth - The request could not be authorized

set_admin(team_id, user_id, optional_params \\ %{})

Set an existing regular user or owner to be a workspace or org admin.

Required Params

  • team_id - The ID of the workspace or organization. ex: T12345678
  • user_id - The ID of the user to designate as an admin. ex: W12345678

Errors the API can return:

  • failed_to_set_user_to_admin - Designating this user as an admin failed.
  • token_revoked - Authentication token is for a deleted user or workspace or the app has been removed when using a user token.
  • invalid_arg_name - The method was passed an argument whose name falls outside the bounds of accepted or expected values. This includes very long names and names with non-alphanumeric characters other than _. If you get this error, it is typically an indication that you have made a very malformed API call.
  • two_factor_setup_required - Two factor setup is required.
  • feature_not_enabled - The Admin APIs feature is not enabled for this team.
  • invalid_form_data - The method was called via a POST request with Content-Type application/x-www-form-urlencoded or multipart/form-data, but the form data was either missing or syntactically invalid.
  • invalid_post_type - The method was called via a POST request, but the specified Content-Type was invalid. Valid types are: application/json application/x-www-form-urlencoded multipart/form-data text/plain.
  • fatal_error - The server could not complete your operation(s) without encountering a catastrophic error. It's possible some aspect of the operation succeeded before the error was raised.
  • failed_to_set_admin_on_workspaces - Failed to set the user as an admin on all workspaces.
  • deprecated_endpoint - The endpoint has been deprecated.
  • ratelimited - The request has been ratelimited. Refer to the Retry-After header for when to retry the request.
  • ekm_access_denied - Administrators have suspended the ability to post a message.
  • service_unavailable - The service is temporarily unavailable
  • invalid_role_for_user - The user cannot be made into an admin.
  • user_not_found - The user was not found.
  • team_access_not_granted - The token used is not granted the specific workspace access required to complete this request.
  • invalid_arguments - The method was called with invalid arguments.
  • cannot_modify_primary_owner - The primary owner cannot be modified.
  • invalid_array_arg - The method was passed an array as an argument. Please only input valid strings.
  • request_timeout - The method was called via a POST request, but the POST data was either missing or truncated.
  • team_not_found - team_id was not found.
  • account_inactive - Authentication token is for a deleted user or workspace when using a bot token.
  • not_authed - No authentication token provided.
  • internal_error - The server could not complete your operation(s) without encountering an error, likely due to a transient issue on our end. It's possible some aspect of the operation succeeded before the error was raised.
  • enterprise_is_restricted - The method cannot be called from an Enterprise.
  • no_permission - The workspace token used in this request does not have the permissions necessary to complete the request. Make sure your app is a member of the conversation it's attempting to post a message to.
  • access_denied - Access to a resource specified in the request is denied.
  • team_added_to_org - The workspace associated with your request is currently undergoing migration to an Enterprise Organization. Web API and other platform operations will be intermittently unavailable until the transition is complete.
  • missing_scope - The token used is not granted the specific scope permissions required to complete this request.
  • missing_post_type - The method was called via a POST request and included a data payload, but the request did not include a Content-Type header.
  • accesslimited - Access to this method is limited on the current network
  • not_an_admin - This method can only be accessed by org owners and admins.
  • token_expired - Authentication token has expired
  • invalid_charset - The method was called via a POST request, but the charset specified in the Content-Type header was invalid. Valid charset names are: utf-8 iso-8859-1.
  • method_deprecated - The method has been deprecated.
  • invalid_permissions - This method is only accessible by org owners and admins.
  • not_allowed_token_type - The token type used in this request is not allowed.
  • org_login_required - The workspace is undergoing an enterprise migration and will not be available until migration is complete.
  • invalid_auth - Some aspect of authentication cannot be validated. Either the provided token is invalid or the request originates from an IP address disallowed from making the request.

set_expiration(expiration_ts, user_id, optional_params \\ %{})

Set an expiration for a guest user

Required Params

  • expiration_ts - Epoch timestamp in seconds when guest account should be disabled. ex: 1234567890
  • user_id - The ID of the user to set an expiration for. ex: W12345678

Optional Params

  • team_id - The ID (T1234) of the workspace.

Errors the API can return:

  • failed_looking_up_user - We couldn't find the requested user.
  • token_revoked - Authentication token is for a deleted user or workspace or the app has been removed when using a user token.
  • invalid_arg_name - The method was passed an argument whose name falls outside the bounds of accepted or expected values. This includes very long names and names with non-alphanumeric characters other than _. If you get this error, it is typically an indication that you have made a very malformed API call.
  • user_is_not_a_guest - The passed user_id does not belong to a guest user.
  • two_factor_setup_required - Two factor setup is required.
  • feature_not_enabled - The Admin APIs feature is not enabled for this team.
  • invalid_form_data - The method was called via a POST request with Content-Type application/x-www-form-urlencoded or multipart/form-data, but the form data was either missing or syntactically invalid.
  • invalid_post_type - The method was called via a POST request, but the specified Content-Type was invalid. Valid types are: application/json application/x-www-form-urlencoded multipart/form-data text/plain.
  • fatal_error - The server could not complete your operation(s) without encountering a catastrophic error. It's possible some aspect of the operation succeeded before the error was raised.
  • deprecated_endpoint - The endpoint has been deprecated.
  • ratelimited - The request has been ratelimited. Refer to the Retry-After header for when to retry the request.
  • ekm_access_denied - Administrators have suspended the ability to post a message.
  • service_unavailable - The service is temporarily unavailable
  • user_is_deactivated - User has been deactivated.
  • team_id_required_for_enterprise - Team ID required.
  • user_not_found - The user could not be found.
  • team_access_not_granted - The token used is not granted the specific workspace access required to complete this request.
  • failed_to_validate_expiration - expiration_ts was invalid.
  • failed_to_set_expiration - The expiration could not be set for the user.
  • invalid_arguments - The passed arguments were invalid.
  • invalid_array_arg - The method was passed an array as an argument. Please only input valid strings.
  • request_timeout - The method was called via a POST request, but the POST data was either missing or truncated.
  • team_not_found - team_id was not found.
  • account_inactive - Authentication token is for a deleted user or workspace when using a bot token.
  • not_authed - No authentication token provided.
  • internal_error - The server could not complete your operation(s) without encountering an error, likely due to a transient issue on our end. It's possible some aspect of the operation succeeded before the error was raised.
  • enterprise_is_restricted - The method cannot be called from an Enterprise.
  • no_permission - The workspace token used in this request does not have the permissions necessary to complete the request. Make sure your app is a member of the conversation it's attempting to post a message to.
  • access_denied - Access to a resource specified in the request is denied.
  • team_added_to_org - The workspace associated with your request is currently undergoing migration to an Enterprise Organization. Web API and other platform operations will be intermittently unavailable until the transition is complete.
  • missing_scope - The token used is not granted the specific scope permissions required to complete this request.
  • missing_post_type - The method was called via a POST request and included a data payload, but the request did not include a Content-Type header.
  • accesslimited - Access to this method is limited on the current network
  • token_expired - Authentication token has expired
  • invalid_charset - The method was called via a POST request, but the charset specified in the Content-Type header was invalid. Valid charset names are: utf-8 iso-8859-1.
  • method_deprecated - The method has been deprecated.
  • user_is_already_deleted - The user has already been deleted and disabled.
  • not_allowed_token_type - The token type used in this request is not allowed.
  • org_login_required - The workspace is undergoing an enterprise migration and will not be available until migration is complete.
  • failed_to_validate_caller - The token calling this method doesn't have permission to invite a user.
  • invalid_auth - This action could not be authorized.
  • failed_to_validate_team - The team calling this method was invalid.

set_owner(team_id, user_id, optional_params \\ %{})

Set an existing regular user or admin to be a workspace or org owner.

Required Params

  • team_id - The ID of the workspace or organization. ex: T12345678
  • user_id - ID of the user to promote to owner. ex: W12345678

Errors the API can return:

  • not_an_owner - This method can only be accessed by org owners. The app's installing user must retain org owner status for this method to function.
  • token_revoked - Authentication token is for a deleted user or workspace or the app has been removed when using a user token.
  • invalid_arg_name - The method was passed an argument whose name falls outside the bounds of accepted or expected values. This includes very long names and names with non-alphanumeric characters other than _. If you get this error, it is typically an indication that you have made a very malformed API call.
  • two_factor_setup_required - Two factor setup is required.
  • feature_not_enabled - The Admin APIs feature is not enabled for this team.
  • invalid_form_data - The method was called via a POST request with Content-Type application/x-www-form-urlencoded or multipart/form-data, but the form data was either missing or syntactically invalid.
  • invalid_post_type - The method was called via a POST request, but the specified Content-Type was invalid. Valid types are: application/json application/x-www-form-urlencoded multipart/form-data text/plain.
  • fatal_error - The server could not complete your operation(s) without encountering a catastrophic error. It's possible some aspect of the operation succeeded before the error was raised.
  • deprecated_endpoint - The endpoint has been deprecated.
  • ratelimited - The request has been ratelimited. Refer to the Retry-After header for when to retry the request.
  • ekm_access_denied - Administrators have suspended the ability to post a message.
  • service_unavailable - The service is temporarily unavailable
  • invalid_role_for_user - The user cannot be made into an owner.
  • user_not_found - The requested user was not found.
  • team_access_not_granted - The token used is not granted the specific workspace access required to complete this request.
  • invalid_arguments - The method was called with invalid arguments.
  • cannot_modify_primary_owner - The primary owner cannot be modified.
  • invalid_array_arg - The method was passed an array as an argument. Please only input valid strings.
  • request_timeout - The method was called via a POST request, but the POST data was either missing or truncated.
  • team_not_found - team_id was not found.
  • account_inactive - Authentication token is for a deleted user or workspace when using a bot token.
  • not_authed - No authentication token provided.
  • internal_error - The server could not complete your operation(s) without encountering an error, likely due to a transient issue on our end. It's possible some aspect of the operation succeeded before the error was raised.
  • enterprise_is_restricted - The method cannot be called from an Enterprise.
  • failed_to_set_user_to_owner - The change to the user's role failed.
  • no_permission - The workspace token used in this request does not have the permissions necessary to complete the request. Make sure your app is a member of the conversation it's attempting to post a message to.
  • access_denied - Access to a resource specified in the request is denied.
  • team_added_to_org - The workspace associated with your request is currently undergoing migration to an Enterprise Organization. Web API and other platform operations will be intermittently unavailable until the transition is complete.
  • missing_scope - The token used is not granted the specific scope permissions required to complete this request.
  • missing_post_type - The method was called via a POST request and included a data payload, but the request did not include a Content-Type header.
  • accesslimited - Access to this method is limited on the current network
  • not_an_admin - This method can only be accessed by org owners and admins.
  • token_expired - Authentication token has expired
  • invalid_charset - The method was called via a POST request, but the charset specified in the Content-Type header was invalid. Valid charset names are: utf-8 iso-8859-1.
  • method_deprecated - The method has been deprecated.
  • user_must_be_in_workspace - This user must be a member of at least one workspace.
  • failed_to_set_owner_on_workspaces - Failed to set the user as an owner on all workspaces.
  • not_allowed_token_type - The token type used in this request is not allowed.
  • org_login_required - The workspace is undergoing an enterprise migration and will not be available until migration is complete.
  • invalid_auth - Some aspect of authentication cannot be validated. Either the provided token is invalid or the request originates from an IP address disallowed from making the request.
  • not_supported - This is not a supported action.

set_regular(team_id, user_id, optional_params \\ %{})

Set an existing guest user, admin user, or owner to be a regular user.

Required Params

  • team_id - The ID of the workspace or organization. ex: T12345678
  • user_id - The ID of the user to designate as a regular user. ex: W12345678

Errors the API can return:

  • failed_to_set_user_to_regular - Changing a user to a regular member failed.
  • token_revoked - Authentication token is for a deleted user or workspace or the app has been removed when using a user token.
  • invalid_arg_name - The method was passed an argument whose name falls outside the bounds of accepted or expected values. This includes very long names and names with non-alphanumeric characters other than _. If you get this error, it is typically an indication that you have made a very malformed API call.
  • two_factor_setup_required - Two factor setup is required.
  • feature_not_enabled - The Admin APIs feature is not enabled for this team.
  • cannot_set_org_admin_to_regular_at_workspace_level - Org admins cannot be set to regular at the workspace level. Change their user type at the org level instead.
  • invalid_form_data - The method was called via a POST request with Content-Type application/x-www-form-urlencoded or multipart/form-data, but the form data was either missing or syntactically invalid.
  • invalid_post_type - The method was called via a POST request, but the specified Content-Type was invalid. Valid types are: application/json application/x-www-form-urlencoded multipart/form-data text/plain.
  • fatal_error - The server could not complete your operation(s) without encountering a catastrophic error. It's possible some aspect of the operation succeeded before the error was raised.
  • deprecated_endpoint - The endpoint has been deprecated.
  • ratelimited - The request has been ratelimited. Refer to the Retry-After header for when to retry the request.
  • ekm_access_denied - Administrators have suspended the ability to post a message.
  • service_unavailable - The service is temporarily unavailable
  • user_not_found - The requested user was not found.
  • team_access_not_granted - The token used is not granted the specific workspace access required to complete this request.
  • invalid_arguments - The method was called with invalid arguments.
  • cannot_modify_primary_owner - The primary owner cannot be modified.
  • invalid_array_arg - The method was passed an array as an argument. Please only input valid strings.
  • request_timeout - The method was called via a POST request, but the POST data was either missing or truncated.
  • team_not_found - team_id was not found.
  • account_inactive - Authentication token is for a deleted user or workspace when using a bot token.
  • not_authed - No authentication token provided.
  • internal_error - The server could not complete your operation(s) without encountering an error, likely due to a transient issue on our end. It's possible some aspect of the operation succeeded before the error was raised.
  • enterprise_is_restricted - The method cannot be called from an Enterprise.
  • no_permission - The workspace token used in this request does not have the permissions necessary to complete the request. Make sure your app is a member of the conversation it's attempting to post a message to.
  • access_denied - Access to a resource specified in the request is denied.
  • team_added_to_org - The workspace associated with your request is currently undergoing migration to an Enterprise Organization. Web API and other platform operations will be intermittently unavailable until the transition is complete.
  • missing_scope - The token used is not granted the specific scope permissions required to complete this request.
  • missing_post_type - The method was called via a POST request and included a data payload, but the request did not include a Content-Type header.
  • accesslimited - Access to this method is limited on the current network
  • not_an_admin - This method can only be accessed by org owners and admins.
  • token_expired - Authentication token has expired
  • cannot_set_this_guest_to_regular_at_team_level - This guest cannot be set to regular because they are active on multiple workspaces.
  • invalid_charset - The method was called via a POST request, but the charset specified in the Content-Type header was invalid. Valid charset names are: utf-8 iso-8859-1.
  • method_deprecated - The method has been deprecated.
  • not_allowed_token_type - The token type used in this request is not allowed.
  • org_login_required - The workspace is undergoing an enterprise migration and will not be available until migration is complete.
  • invalid_auth - Some aspect of authentication cannot be validated. Either the provided token is invalid or the request originates from an IP address disallowed from making the request.