Slack.Web.Admin.Auth.Policy (SlackKit v1.0.0-alpha.0)

View Source

Summary

Functions

Assign entities to a particular authentication policy.

Fetch all the entities assigned to a particular authentication policy by name.

Remove specified entities from a specified authentication policy.

Functions

assign_entities(entity_ids, entity_type, policy_name, optional_params \\ %{})

Assign entities to a particular authentication policy.

API reference

Rate limit: Tier 4: 100+ per minute
Scopes:

View on docs.slack.dev ↗

Required Params

  • entity_ids - Array of IDs to assign to the policy. ex: ['U12345','U27345']
  • entity_type - The type of entity to assign to the policy. Currently, USER is supported.
  • policy_name - The name of the authentication policy to assign the entities to. Currently, email_password is the only policy that may be used with this method. ex: email_password

Errors the API can return:

  • admin_unauthorized - The token provided doesn't have permission to revoke a session.
  • entity_not_found - At least one entity_id was not found.
  • feature_not_enabled - This method is only available for Enterprise organizations.
  • not_an_admin - This method is only accessible by Org Owners and Admins.
  • over_max_entity_limit - The number of entities assigned to this policy has reached its upper limit.
  • policy_not_found - The policy name doesn't match any of the existing org policies.
  • unknown_method - This method is currently not available.

See the Common Errors guide for errors returned by every Web API method.

get_entities(policy_name, optional_params \\ %{})

Fetch all the entities assigned to a particular authentication policy by name.

API reference

Rate limit: Tier 4: 100+ per minute
Scopes:

View on docs.slack.dev ↗

Required Params

  • policy_name - The name of the policy to fetch entities for. Currently, email_password is the only policy that may be used with this method. ex: email_password

Optional Params

  • cursor - Set cursor to next_cursor returned by the previous call to list items in the next page. ex: 5c3e53d5
  • entity_type - The type of entity to assign to the policy. Currently, USER is supported.
  • limit - The maximum number of items to return. Must be between 1 and 1000, both inclusive. ex: 100

Errors the API can return:

  • feature_not_enabled - This method is only available for Enterprise organizations.
  • invalid_cursor - The cursor passed was invalid.
  • not_an_admin - This method is only accessible by Org Owners and Admins.
  • policy_not_found - The policy_name could not be found.

See the Common Errors guide for errors returned by every Web API method.

remove_entities(entity_ids, entity_type, policy_name, optional_params \\ %{})

Remove specified entities from a specified authentication policy.

API reference

Rate limit: Tier 4: 100+ per minute
Scopes:

View on docs.slack.dev ↗

Required Params

  • entity_ids - Encoded IDs of the entities you'd like to remove from the policy. ex: ['U1234']
  • entity_type - The type of entity to assign to the policy. Currently, USER is supported.
  • policy_name - The name of the policy to remove entities from. Currently, email_password is the only policy that may be used with this method. ex: email_password

Errors the API can return:

  • entity_not_found - At least one entity_id was not found
  • feature_not_enabled - This method is only available to Enterprise customers.
  • not_an_admin - This method is only accessible by Org Owners and Admins.
  • policy_not_found - The policy_name could not be found.

See the Common Errors guide for errors returned by every Web API method.