2023/09/18 - Amazon WorkMail - 4 new 12 updated api methods
Changes This release includes four new APIs UpdateUser, UpdateGroup, ListGroupsForEntity and DescribeEntity, along with RemoteUsers and some enhancements to existing APIs.
Updates attibutes in a group.
See also: AWS API Documentation
Request Syntax
client.update_group( OrganizationId='string', GroupId='string', HiddenFromGlobalAddressList=True|False )
string
[REQUIRED]
The identifier for the organization under which the group exists.
string
[REQUIRED]
The identifier for the group to be updated.
The identifier can accept GroupId , Groupname , or email . The following identity formats are available:
Group ID: 12345678-1234-1234-1234-123456789012 or S-1-1-12-1234567890-123456789-123456789-1234
Email address: group@domain.tld
Group name: group
boolean
If enabled, the group is hidden from the global address list.
dict
Response Syntax
{}
Response Structure
(dict) --
Returns basic details about an entity in WorkMail.
See also: AWS API Documentation
Request Syntax
client.describe_entity( OrganizationId='string', Email='string' )
string
[REQUIRED]
The identifier for the organization under which the entity exists.
string
[REQUIRED]
The email under which the entity exists.
dict
Response Syntax
{ 'EntityId': 'string', 'Name': 'string', 'Type': 'GROUP'|'USER'|'RESOURCE' }
Response Structure
(dict) --
EntityId (string) --
The entity ID under which the entity exists.
Name (string) --
Username, GroupName, or ResourceName based on entity type.
Type (string) --
Entity type.
Updates data for the user. To have the latest information, it must be preceded by a DescribeUser call. The dataset in the request should be the one expected when performing another DescribeUser call.
See also: AWS API Documentation
Request Syntax
client.update_user( OrganizationId='string', UserId='string', Role='USER'|'RESOURCE'|'SYSTEM_USER'|'REMOTE_USER', DisplayName='string', FirstName='string', LastName='string', HiddenFromGlobalAddressList=True|False, Initials='string', Telephone='string', Street='string', JobTitle='string', City='string', Company='string', ZipCode='string', Department='string', Country='string', Office='string' )
string
[REQUIRED]
The identifier for the organization under which the user exists.
string
[REQUIRED]
The identifier for the user to be updated.
The identifier can be the UserId , Username , or email . The following identity formats are available:
User ID: 12345678-1234-1234-1234-123456789012 or S-1-1-12-1234567890-123456789-123456789-1234
Email address: user@domain.tld
User name: user
string
Updates the user role.
You cannot pass SYSTEM_USER or RESOURCE .
string
Updates the display name of the user.
string
Updates the user's first name.
string
Updates the user's last name.
boolean
If enabled, the user is hidden from the global address list.
string
Updates the user's initials.
string
Updates the user's contact details.
string
Updates the user's street address.
string
Updates the user's job title.
string
Updates the user's city.
string
Updates the user's company.
string
Updates the user's zipcode.
string
Updates the user's department.
string
Updates the user's country.
string
Updates the user's office.
dict
Response Syntax
{}
Response Structure
(dict) --
Returns all the groups to which an entity belongs.
See also: AWS API Documentation
Request Syntax
client.list_groups_for_entity( OrganizationId='string', EntityId='string', Filters={ 'GroupNamePrefix': 'string' }, NextToken='string', MaxResults=123 )
string
[REQUIRED]
The identifier for the organization under which the entity exists.
string
[REQUIRED]
The identifier for the entity.
The entity ID can accept UserId or GroupID , Username or Groupname , or email .
Entity ID: 12345678-1234-1234-1234-123456789012 or S-1-1-12-1234567890-123456789-123456789-1234
Email address: entity@domain.tld
Entity name: entity
dict
Limit the search results based on the filter criteria.
GroupNamePrefix (string) --
Filters only group names that start with the provided name prefix.
string
The token to use to retrieve the next page of results. The first call does not contain any tokens.
integer
The maximum number of results to return in a single call.
dict
Response Syntax
{ 'Groups': [ { 'GroupId': 'string', 'GroupName': 'string' }, ], 'NextToken': 'string' }
Response Structure
(dict) --
Groups (list) --
The overview of groups in an organization.
(dict) --
The identifier that contains the Group ID and name of a group.
GroupId (string) --
Group ID that matched the group.
GroupName (string) --
Group name that matched the group.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
{'HiddenFromGlobalAddressList': 'boolean'}
Creates a group that can be used in WorkMail by calling the RegisterToWorkMail operation.
See also: AWS API Documentation
Request Syntax
client.create_group( OrganizationId='string', Name='string', HiddenFromGlobalAddressList=True|False )
string
[REQUIRED]
The organization under which the group is to be created.
string
[REQUIRED]
The name of the group.
boolean
If this parameter is enabled, the group will be hidden from the address book.
dict
Response Syntax
{ 'GroupId': 'string' }
Response Structure
(dict) --
GroupId (string) --
The identifier of the group.
{'Description': 'string', 'HiddenFromGlobalAddressList': 'boolean'}
Creates a new WorkMail resource.
See also: AWS API Documentation
Request Syntax
client.create_resource( OrganizationId='string', Name='string', Type='ROOM'|'EQUIPMENT', Description='string', HiddenFromGlobalAddressList=True|False )
string
[REQUIRED]
The identifier associated with the organization for which the resource is created.
string
[REQUIRED]
The name of the new resource.
string
[REQUIRED]
The type of the new resource. The available types are equipment and room .
string
Resource description.
boolean
If this parameter is enabled, the resource will be hidden from the address book.
dict
Response Syntax
{ 'ResourceId': 'string' }
Response Structure
(dict) --
ResourceId (string) --
The identifier of the new resource.
{'FirstName': 'string', 'HiddenFromGlobalAddressList': 'boolean', 'LastName': 'string', 'Role': 'USER | RESOURCE | SYSTEM_USER | REMOTE_USER'}
Creates a user who can be used in WorkMail by calling the RegisterToWorkMail operation.
See also: AWS API Documentation
Request Syntax
client.create_user( OrganizationId='string', Name='string', DisplayName='string', Password='string', Role='USER'|'RESOURCE'|'SYSTEM_USER'|'REMOTE_USER', FirstName='string', LastName='string', HiddenFromGlobalAddressList=True|False )
string
[REQUIRED]
The identifier of the organization for which the user is created.
string
[REQUIRED]
The name for the new user. WorkMail directory user names have a maximum length of 64. All others have a maximum length of 20.
string
[REQUIRED]
The display name for the new user.
string
The password for the new user.
string
The role of the new user.
You cannot pass SYSTEM_USER or RESOURCE role in a single request. When a user role is not selected, the default role of USER is selected.
string
The first name of the new user.
string
The last name of the new user.
boolean
If this parameter is enabled, the user will be hidden from the address book.
dict
Response Syntax
{ 'UserId': 'string' }
Response Structure
(dict) --
UserId (string) --
The identifier for the new user.
{'ForceDelete': 'boolean'}
Deletes an WorkMail organization and all underlying AWS resources managed by WorkMail as part of the organization. You can choose whether to delete the associated directory. For more information, see Removing an organization in the WorkMail Administrator Guide .
See also: AWS API Documentation
Request Syntax
client.delete_organization( ClientToken='string', OrganizationId='string', DeleteDirectory=True|False, ForceDelete=True|False )
string
The idempotency token associated with the request.
This field is autopopulated if not provided.
string
[REQUIRED]
The organization ID.
boolean
[REQUIRED]
If true, deletes the AWS Directory Service directory associated with the organization.
boolean
Deletes a WorkMail organization even if the organization has enabled users.
dict
Response Syntax
{ 'OrganizationId': 'string', 'State': 'string' }
Response Structure
(dict) --
OrganizationId (string) --
The organization ID.
State (string) --
The state of the organization.
{'HiddenFromGlobalAddressList': 'boolean'}
Returns the data available for the group.
See also: AWS API Documentation
Request Syntax
client.describe_group( OrganizationId='string', GroupId='string' )
string
[REQUIRED]
The identifier for the organization under which the group exists.
string
[REQUIRED]
The identifier for the group to be described.
The identifier can accept GroupId , Groupname , or email . The following identity formats are available:
Group ID: 12345678-1234-1234-1234-123456789012 or S-1-1-12-1234567890-123456789-123456789-1234
Email address: group@domain.tld
Group name: group
dict
Response Syntax
{ 'GroupId': 'string', 'Name': 'string', 'Email': 'string', 'State': 'ENABLED'|'DISABLED'|'DELETED', 'EnabledDate': datetime(2015, 1, 1), 'DisabledDate': datetime(2015, 1, 1), 'HiddenFromGlobalAddressList': True|False }
Response Structure
(dict) --
GroupId (string) --
The identifier of the described group.
Name (string) --
The name of the described group.
Email (string) --
The email of the described group.
State (string) --
The state of the user: enabled (registered to WorkMail) or disabled (deregistered or never registered to WorkMail).
EnabledDate (datetime) --
The date and time when a user was registered to WorkMail, in UNIX epoch time format.
DisabledDate (datetime) --
The date and time when a user was deregistered from WorkMail, in UNIX epoch time format.
HiddenFromGlobalAddressList (boolean) --
If the value is set to true , the group is hidden from the address book.
{'InteroperabilityEnabled': 'boolean', 'MigrationAdmin': 'string'}
Provides more information regarding a given organization based on its identifier.
See also: AWS API Documentation
Request Syntax
client.describe_organization( OrganizationId='string' )
string
[REQUIRED]
The identifier for the organization to be described.
dict
Response Syntax
{ 'OrganizationId': 'string', 'Alias': 'string', 'State': 'string', 'DirectoryId': 'string', 'DirectoryType': 'string', 'DefaultMailDomain': 'string', 'CompletedDate': datetime(2015, 1, 1), 'ErrorMessage': 'string', 'ARN': 'string', 'MigrationAdmin': 'string', 'InteroperabilityEnabled': True|False }
Response Structure
(dict) --
OrganizationId (string) --
The identifier of an organization.
Alias (string) --
The alias for an organization.
State (string) --
The state of an organization.
DirectoryId (string) --
The identifier for the directory associated with an WorkMail organization.
DirectoryType (string) --
The type of directory associated with the WorkMail organization.
DefaultMailDomain (string) --
The default mail domain associated with the organization.
CompletedDate (datetime) --
The date at which the organization became usable in the WorkMail context, in UNIX epoch time format.
ErrorMessage (string) --
(Optional) The error message indicating if unexpected behavior was encountered with regards to the organization.
ARN (string) --
The Amazon Resource Name (ARN) of the organization.
MigrationAdmin (string) --
The user ID of the migration admin if migration is enabled for the organization.
InteroperabilityEnabled (boolean) --
Indicates if interoperability is enabled for this organization.
{'Description': 'string', 'HiddenFromGlobalAddressList': 'boolean'}
Returns the data available for the resource.
See also: AWS API Documentation
Request Syntax
client.describe_resource( OrganizationId='string', ResourceId='string' )
string
[REQUIRED]
The identifier associated with the organization for which the resource is described.
string
[REQUIRED]
The identifier of the resource to be described.
The identifier can accept ResourceId , Resourcename , or email . The following identity formats are available:
Resource ID: r-0123456789a0123456789b0123456789
Email address: resource@domain.tld
Resource name: resource
dict
Response Syntax
{ 'ResourceId': 'string', 'Email': 'string', 'Name': 'string', 'Type': 'ROOM'|'EQUIPMENT', 'BookingOptions': { 'AutoAcceptRequests': True|False, 'AutoDeclineRecurringRequests': True|False, 'AutoDeclineConflictingRequests': True|False }, 'State': 'ENABLED'|'DISABLED'|'DELETED', 'EnabledDate': datetime(2015, 1, 1), 'DisabledDate': datetime(2015, 1, 1), 'Description': 'string', 'HiddenFromGlobalAddressList': True|False }
Response Structure
(dict) --
ResourceId (string) --
The identifier of the described resource.
Email (string) --
The email of the described resource.
Name (string) --
The name of the described resource.
Type (string) --
The type of the described resource.
BookingOptions (dict) --
The booking options for the described resource.
AutoAcceptRequests (boolean) --
The resource's ability to automatically reply to requests. If disabled, delegates must be associated to the resource.
AutoDeclineRecurringRequests (boolean) --
The resource's ability to automatically decline any recurring requests.
AutoDeclineConflictingRequests (boolean) --
The resource's ability to automatically decline any conflicting requests.
State (string) --
The state of the resource: enabled (registered to WorkMail), disabled (deregistered or never registered to WorkMail), or deleted.
EnabledDate (datetime) --
The date and time when a resource was enabled for WorkMail, in UNIX epoch time format.
DisabledDate (datetime) --
The date and time when a resource was disabled from WorkMail, in UNIX epoch time format.
Description (string) --
Description of the resource.
HiddenFromGlobalAddressList (boolean) --
If enabled, the resource is hidden from the global address list.
{'City': 'string', 'Company': 'string', 'Country': 'string', 'Department': 'string', 'FirstName': 'string', 'HiddenFromGlobalAddressList': 'boolean', 'Initials': 'string', 'JobTitle': 'string', 'LastName': 'string', 'MailboxDeprovisionedDate': 'timestamp', 'MailboxProvisionedDate': 'timestamp', 'Office': 'string', 'Street': 'string', 'Telephone': 'string', 'UserRole': {'REMOTE_USER'}, 'ZipCode': 'string'}
Provides information regarding the user.
See also: AWS API Documentation
Request Syntax
client.describe_user( OrganizationId='string', UserId='string' )
string
[REQUIRED]
The identifier for the organization under which the user exists.
string
[REQUIRED]
The identifier for the user to be described.
The identifier can be the UserId , Username , or email . The following identity formats are available:
User ID: 12345678-1234-1234-1234-123456789012 or S-1-1-12-1234567890-123456789-123456789-1234
Email address: user@domain.tld
User name: user
dict
Response Syntax
{ 'UserId': 'string', 'Name': 'string', 'Email': 'string', 'DisplayName': 'string', 'State': 'ENABLED'|'DISABLED'|'DELETED', 'UserRole': 'USER'|'RESOURCE'|'SYSTEM_USER'|'REMOTE_USER', 'EnabledDate': datetime(2015, 1, 1), 'DisabledDate': datetime(2015, 1, 1), 'MailboxProvisionedDate': datetime(2015, 1, 1), 'MailboxDeprovisionedDate': datetime(2015, 1, 1), 'FirstName': 'string', 'LastName': 'string', 'HiddenFromGlobalAddressList': True|False, 'Initials': 'string', 'Telephone': 'string', 'Street': 'string', 'JobTitle': 'string', 'City': 'string', 'Company': 'string', 'ZipCode': 'string', 'Department': 'string', 'Country': 'string', 'Office': 'string' }
Response Structure
(dict) --
UserId (string) --
The identifier for the described user.
Name (string) --
The name for the user.
Email (string) --
The email of the user.
DisplayName (string) --
The display name of the user.
State (string) --
The state of a user: enabled (registered to WorkMail) or disabled (deregistered or never registered to WorkMail).
UserRole (string) --
In certain cases, other entities are modeled as users. If interoperability is enabled, resources are imported into WorkMail as users. Because different WorkMail organizations rely on different directory types, administrators can distinguish between an unregistered user (account is disabled and has a user role) and the directory administrators. The values are USER, RESOURCE, SYSTEM_USER, and REMOTE_USER.
EnabledDate (datetime) --
The date and time at which the user was enabled for WorkMailusage, in UNIX epoch time format.
DisabledDate (datetime) --
The date and time at which the user was disabled for WorkMail usage, in UNIX epoch time format.
MailboxProvisionedDate (datetime) --
The date when the mailbox was created for the user.
MailboxDeprovisionedDate (datetime) --
The date when the mailbox was removed for the user.
FirstName (string) --
First name of the user.
LastName (string) --
Last name of the user.
HiddenFromGlobalAddressList (boolean) --
If enabled, the user is hidden from the global address list.
Initials (string) --
Initials of the user.
Telephone (string) --
User's contact number.
Street (string) --
Street where the user is located.
JobTitle (string) --
Job title of the user.
City (string) --
City where the user is located.
Company (string) --
Company of the user.
ZipCode (string) --
Zip code of the user.
Department (string) --
Department of the user.
Country (string) --
Country where the user is located.
Office (string) --
Office where the user is located.
{'Filters': {'NamePrefix': 'string', 'PrimaryEmailPrefix': 'string', 'State': 'ENABLED | DISABLED | DELETED'}}
Returns summaries of the organization's groups.
See also: AWS API Documentation
Request Syntax
client.list_groups( OrganizationId='string', NextToken='string', MaxResults=123, Filters={ 'NamePrefix': 'string', 'PrimaryEmailPrefix': 'string', 'State': 'ENABLED'|'DISABLED'|'DELETED' } )
string
[REQUIRED]
The identifier for the organization under which the groups exist.
string
The token to use to retrieve the next page of results. The first call does not contain any tokens.
integer
The maximum number of results to return in a single call.
dict
Limit the search results based on the filter criteria. Only one filter per request is supported.
NamePrefix (string) --
Filters only groups with the provided name prefix.
PrimaryEmailPrefix (string) --
Filters only groups with the provided primary email prefix.
State (string) --
Filters only groups with the provided state.
dict
Response Syntax
{ 'Groups': [ { 'Id': 'string', 'Email': 'string', 'Name': 'string', 'State': 'ENABLED'|'DISABLED'|'DELETED', 'EnabledDate': datetime(2015, 1, 1), 'DisabledDate': datetime(2015, 1, 1) }, ], 'NextToken': 'string' }
Response Structure
(dict) --
Groups (list) --
The overview of groups for an organization.
(dict) --
The representation of an WorkMail group.
Id (string) --
The identifier of the group.
Email (string) --
The email of the group.
Name (string) --
The name of the group.
State (string) --
The state of the group, which can be ENABLED, DISABLED, or DELETED.
EnabledDate (datetime) --
The date indicating when the group was enabled for WorkMail use.
DisabledDate (datetime) --
The date indicating when the group was disabled from WorkMail use.
NextToken (string) --
The token to use to retrieve the next page of results. The value is "null" when there are no more results to return.
{'Filters': {'NamePrefix': 'string', 'PrimaryEmailPrefix': 'string', 'State': 'ENABLED | DISABLED | DELETED'}}Response
{'Resources': {'Description': 'string'}}
Returns summaries of the organization's resources.
See also: AWS API Documentation
Request Syntax
client.list_resources( OrganizationId='string', NextToken='string', MaxResults=123, Filters={ 'NamePrefix': 'string', 'PrimaryEmailPrefix': 'string', 'State': 'ENABLED'|'DISABLED'|'DELETED' } )
string
[REQUIRED]
The identifier for the organization under which the resources exist.
string
The token to use to retrieve the next page of results. The first call does not contain any tokens.
integer
The maximum number of results to return in a single call.
dict
Limit the resource search results based on the filter criteria. You can only use one filter per request.
NamePrefix (string) --
Filters only resource that start with the entered name prefix .
PrimaryEmailPrefix (string) --
Filters only resource with the provided primary email prefix.
State (string) --
Filters only resource with the provided state.
dict
Response Syntax
{ 'Resources': [ { 'Id': 'string', 'Email': 'string', 'Name': 'string', 'Type': 'ROOM'|'EQUIPMENT', 'State': 'ENABLED'|'DISABLED'|'DELETED', 'EnabledDate': datetime(2015, 1, 1), 'DisabledDate': datetime(2015, 1, 1), 'Description': 'string' }, ], 'NextToken': 'string' }
Response Structure
(dict) --
Resources (list) --
One page of the organization's resource representation.
(dict) --
The representation of a resource.
Id (string) --
The identifier of the resource.
Email (string) --
The email of the resource.
Name (string) --
The name of the resource.
Type (string) --
The type of the resource: equipment or room.
State (string) --
The state of the resource, which can be ENABLED, DISABLED, or DELETED.
EnabledDate (datetime) --
The date indicating when the resource was enabled for WorkMail use.
DisabledDate (datetime) --
The date indicating when the resource was disabled from WorkMail use.
Description (string) --
Resource description.
NextToken (string) --
The token used to paginate through all the organization's resources. While results are still available, it has an associated value. When the last page is reached, the token is empty.
{'Filters': {'DisplayNamePrefix': 'string', 'PrimaryEmailPrefix': 'string', 'State': 'ENABLED | DISABLED | DELETED', 'UsernamePrefix': 'string'}}Response
{'Users': {'UserRole': {'REMOTE_USER'}}}
Returns summaries of the organization's users.
See also: AWS API Documentation
Request Syntax
client.list_users( OrganizationId='string', NextToken='string', MaxResults=123, Filters={ 'UsernamePrefix': 'string', 'DisplayNamePrefix': 'string', 'PrimaryEmailPrefix': 'string', 'State': 'ENABLED'|'DISABLED'|'DELETED' } )
string
[REQUIRED]
The identifier for the organization under which the users exist.
string
The token to use to retrieve the next page of results. The first call does not contain any tokens.
integer
The maximum number of results to return in a single call.
dict
Limit the user search results based on the filter criteria. You can only use one filter per request.
UsernamePrefix (string) --
Filters only users with the provided username prefix.
DisplayNamePrefix (string) --
Filters only users with the provided display name prefix.
PrimaryEmailPrefix (string) --
Filters only users with the provided email prefix.
State (string) --
Filters only users with the provided state.
dict
Response Syntax
{ 'Users': [ { 'Id': 'string', 'Email': 'string', 'Name': 'string', 'DisplayName': 'string', 'State': 'ENABLED'|'DISABLED'|'DELETED', 'UserRole': 'USER'|'RESOURCE'|'SYSTEM_USER'|'REMOTE_USER', 'EnabledDate': datetime(2015, 1, 1), 'DisabledDate': datetime(2015, 1, 1) }, ], 'NextToken': 'string' }
Response Structure
(dict) --
Users (list) --
The overview of users for an organization.
(dict) --
The representation of an WorkMail user.
Id (string) --
The identifier of the user.
Email (string) --
The email of the user.
Name (string) --
The name of the user.
DisplayName (string) --
The display name of the user.
State (string) --
The state of the user, which can be ENABLED, DISABLED, or DELETED.
UserRole (string) --
The role of the user.
EnabledDate (datetime) --
The date indicating when the user was enabled for WorkMail use.
DisabledDate (datetime) --
The date indicating when the user was disabled from WorkMail use.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
{'Description': 'string', 'HiddenFromGlobalAddressList': 'boolean', 'Type': 'ROOM | EQUIPMENT'}
Updates data for the resource. To have the latest information, it must be preceded by a DescribeResource call. The dataset in the request should be the one expected when performing another DescribeResource call.
See also: AWS API Documentation
Request Syntax
client.update_resource( OrganizationId='string', ResourceId='string', Name='string', BookingOptions={ 'AutoAcceptRequests': True|False, 'AutoDeclineRecurringRequests': True|False, 'AutoDeclineConflictingRequests': True|False }, Description='string', Type='ROOM'|'EQUIPMENT', HiddenFromGlobalAddressList=True|False )
string
[REQUIRED]
The identifier associated with the organization for which the resource is updated.
string
[REQUIRED]
The identifier of the resource to be updated.
The identifier can accept ResourceId , Resourcename , or email . The following identity formats are available:
Resource ID: r-0123456789a0123456789b0123456789
Email address: resource@domain.tld
Resource name: resource
string
The name of the resource to be updated.
dict
The resource's booking options to be updated.
AutoAcceptRequests (boolean) --
The resource's ability to automatically reply to requests. If disabled, delegates must be associated to the resource.
AutoDeclineRecurringRequests (boolean) --
The resource's ability to automatically decline any recurring requests.
AutoDeclineConflictingRequests (boolean) --
The resource's ability to automatically decline any conflicting requests.
string
Updates the resource description.
string
Updates the resource type.
boolean
If enabled, the resource is hidden from the global address list.
dict
Response Syntax
{}
Response Structure
(dict) --