update_user_email_domains

UserEmailDomainManagementApi.update_user_email_domains(role_id, update_user_email_domains_request=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)

Update allowed user email domains

Replaces the allow-listed email domains. Requires system-settings.manage. Send Domains as a string array; each entry is stripped and joined with commas. An empty array, or a joined value longer than 4000 characters, returns IPV-1015. Omitting Domains keeps the current list and still overwrites LastModifiedBy. Extra body keys are ignored. UserId in the body is overwritten with the caller. Not idempotent for the modifier metadata even if the list is unchanged.

Parameters:
  • role_id (str) – Amorphic role ID the request is authorized against. Must be a role the user belongs to. Used for permission checks and audit logs. (required)

  • update_user_email_domains_request (UpdateUserEmailDomainsRequest)

  • _request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.

  • _request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.

  • _content_type (str, Optional) – force content-type for the request.

  • _headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.

  • _host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.

Return type:

UpdateUserEmailDomainsResponse

Returns:

Returns the result object.

Request and Response Examples

HTTP: PUT /user-domains

Request

Request / response example

{
  "Domains": [
    "example.com",
    "corp.example.com"
  ]
}

Success (HTTP 200)

Fixed Message after the store is updated.

Updated

{
  "Message": "Successfully updated user domains."
}

Errors

Documented error codes: AUTH-1001, AUTH-1030, IPV-1015, RTE-1001, EMF-1001.

HTTP 400

AUTH-1001 missing role_id. AUTH-1030 missing system-settings.manage. IPV-1015 when Domains is empty or the joined list exceeds 4000 characters.

Missing permission

{
  "Message": "AUTH-1030 - User is not authorized to update the user email domains due to the following missing permission(s) - {'system-settings': ['manage']}"
}

Empty or too long Domains

{
  "Message": "IPV-1015 - Invalid parameter - Domains, size must be between 1 and 4000 chars(inclusive)."
}

HTTP 500

Uncaught Exception formatted as RTE-1001 via EMF-1001, including a missing or invalid JSON body.

Uncaught Exception

{
  "Message": "RTE-1001 - Expecting value: line 1 column 1 (char 0)."
}