CREATE ORGANIZATION USER

Creates a new organization user.

See also:

ALTER ORGANIZATION USER , DROP ORGANIZATION USER , SHOW ORGANIZATION USERS

Syntax

CREATE ORGANIZATION USER [ IF NOT EXISTS ] <name>
  [ objectProperties ]

Where:

objectProperties ::=
  EMAIL = '<string>'
  LOGIN_NAME = '<string>'
  DISPLAY_NAME = '<string>'
  FIRST_NAME = '<string>'
  MIDDLE_NAME = '<string>'
  LAST_NAME = '<string>'
  TYPE = { PERSON | SERVICE }
  COMMENT = '<string>'

Required parameters

name

Identifier for the organization user; must be unique for your organization.

The identifier must start with an alphabetic character and cannot contain spaces or special characters unless the entire identifier string is enclosed in double quotes (for example, "My object"). Identifiers enclosed in double quotes are also case sensitive.

For more information, see Identifier requirements.

EMAIL = 'string'

Email address of the user.

Optional parameters

LOGIN_NAME = 'string'

Name that the user enters to log into the system. Login names for users must be unique across your entire organization. It cannot match the login name in a regular account that tries to import the organization user.

A login name can be any string, including spaces and non-alphanumeric characters, such as exclamation points (!), percent signs (%), and asterisks (*); however, if the string contains spaces or non-alphanumeric characters, it must be enclosed in single or double quotes. Login names are always case insensitive.

Snowflake allows specifying different user and login names to enable using common identifiers (for example, email addresses) for login.

Default: User’s name/identifier (that is, if no value is specified, the value specified for name is used as the login name)

DISPLAY_NAME = 'string'

Name displayed for the user in the Snowflake web interface.

Default: User’s name/identifier (that is, if no value is specified, the value specified for name is used as the display name)

FIRST_NAME = 'string' ,
MIDDLE_NAME = string ,
LAST_NAME = 'string'

First, middle, and last name of the user.

Default: NULL

TYPE = { PERSON | SERVICE }

Specifies whether the organization user represents a person or a service.

PERSON

Organization user is a human user who can interact with Snowflake.

SERVICE

Organization user is a service or application that interacts with Snowflake without human interaction.

For the characteristics of each type of user, including the authentication methods that a service user can use, see Types of users.

PERSON and SERVICE are the only types that an organization user can have. Types that are valid for a user in a regular account but not for an organization user, such as SERVICE_AGENT and LEGACY_SERVICE, are rejected.

The type determines which existing users the organization user can be linked to, and is applied to the user objects that Snowflake creates when the organization user is imported into a regular account. For more information, see Organization user types.

You can’t change the type after you create the organization user. The ALTER ORGANIZATION USER command doesn’t accept the TYPE property.

Default: PERSON

COMMENT = 'string'

Description of the user.

Access control requirements

A role used to execute this operation must have the following privileges at a minimum:

PrivilegeObjectNotes
CREATE ORGANIZATION USERACCOUNTBy default, only the GLOBALORGADMIN and USERADMIN system roles in the organization account have this privilege.

For instructions on creating a custom role with a specified set of privileges, see Creating custom roles.

For general information about roles and privilege grants for performing SQL actions on securable objects, see Overview of Access Control.

Examples

Create an organization user and set the EMAIL property. Because the TYPE property isn’t specified, the organization user is a PERSON user:

CREATE ORGANIZATION USER joe EMAIL = 'joe.davis@example.com';

Create an organization user for a service that runs in more than one account:

CREATE ORGANIZATION USER etl_pipeline
  EMAIL = 'data-platform@example.com'
  TYPE = SERVICE;

When an account administrator imports an organization user group that contains etl_pipeline, the user object created in the regular account is also a SERVICE user. If a service user named etl_pipeline already exists in the account, the administrator can link it to the organization user by calling SYSTEM$LINK_ORGANIZATION_USER, because both users are SERVICE users:

SELECT SYSTEM$LINK_ORGANIZATION_USER('etl_pipeline', 'etl_pipeline');