v1

latestOpenAPI 3.0.0Creative Commons Attribution 3.02026-07-1375137252.2 KB
users

Creates a new user in a Cloud SQL instance.

post/v1/projects/{project}/instances/{instance}/users

Path parameters

projectstring required

Project ID of the project that contains the instance.

instancestring required

Database instance ID. This does not include the project ID.

Request body

hoststring

Optional. The host from which the user can connect. For insert operations, host defaults to an empty string. For update operations, host is specified as part of the request URL. The host name cannot be updated after insertion. For a MySQL instance, it's required; for a PostgreSQL or SQL Server instance, it's optional.

type'BUILT_IN' | 'CLOUD_IAM_USER' | 'CLOUD_IAM_SERVICE_ACCOUNT' | 'CLOUD_IAM_GROUP' | 'CLOUD_IAM_GROUP_USER' | 'CLOUD_IAM_GROUP_SERVICE_ACCOUNT' | 'CLOUD_IAM_WORKFORCE_IDENTITY' | 'ENTRAID_USER'

The user type. It determines the method to authenticate the user during login. The default is the database's built-in user type.

databaseRolesstring[]

Optional. Role memberships of the user

iamStatus'IAM_STATUS_UNSPECIFIED' | 'INACTIVE' | 'ACTIVE'

Indicates if a group is active or inactive for IAM database authentication.

passwordstring

The password for the user.

instancestring

The name of the Cloud SQL instance. This does not include the project ID. Can be omitted for update because it is already specified on the URL.

kindstring

This is always sql#user.

dualPasswordType'DUAL_PASSWORD_TYPE_UNSPECIFIED' | 'NO_MODIFY_DUAL_PASSWORD' | 'NO_DUAL_PASSWORD' | 'DUAL_PASSWORD'

Dual password status for the user.

namestring

The name of the user in the Cloud SQL instance. Can be omitted for update because it is already specified in the URL.

etagstring

This field is deprecated and will be removed from a future version of the API.

projectstring

The project ID of the project containing the Cloud SQL database. The Google apps domain is prefixed if applicable. Can be omitted for update because it is already specified on the URL.

iamEmailstring

Optional. The full email for an IAM user. For normal database users, this will not be filled. Only applicable to MySQL database users.

Response

Successful response