- HTTP request
- Path parameters
- Query parameters
- Request body
- Response body
- Authorization scopes
- Try it!
Creates a User in an instance. The server assigns the User ID.
user.roles can be empty or contain only SIGNER, which is ACTIVE immediately. ADMIN and POLICY_AUTHOR need Admin approval, so this method cannot grant them. A request with either fails with INVALID_ARGUMENT. To grant them, a client creates the User and then calls users.enableRole.
The first Admins of an instance are the exception. While fewer than 2 active Admins have an authorizationKey, a caller can create Users with roles set to [ADMIN] and an empty authorizationKey. The caller does not need to be a User. Each created User starts with empty roles and ADMIN in PENDING_ACTIVE, and activates ADMIN by setting their own key with users.patch. When 2 Admins have a key, this setup ends: ADMIN cannot be granted here, and any remaining setup Users have ADMIN set to DISABLED (though they can still set their own key with users.patch). Until the setup ends, other calls that need ADMIN fail with FAILED_PRECONDITION.
Returns the following error codes:
- INVALID_ARGUMENT:
useris malformed. For example,principalis empty,teamis set withoutSIGNERor missing with it, orauthorizationKeydoes not parse. During the setup of the first Admins, a request forADMINalso fails ifauthorizationKeyis set. - ALREADY_EXISTS: A User with the same
principalalready exists, orrequestIdwas already used for a different User. - FAILED_PRECONDITION:
teamdoes not exist in the instance, or the request needsADMINand fewer than 2 active Admins have anauthorizationKey.
HTTP request
POST https://mpc.googleapis.com/v1beta/{parent=projects/*/locations/*/instances/*}/users
The URL uses gRPC Transcoding syntax.
Path parameters
| Parameters | |
|---|---|
parent |
Required. The instance to create the User in. Format: projects/{project}/locations/{location}/instances/{instance} It takes the form |
Query parameters
| Parameters | |
|---|---|
requestId |
Optional. An idempotency key. The server generates User IDs, so a client must set this field to retry a users.create request safely. If an earlier request with the same Must be a UUID4 and not the zero UUID. |
Request body
The request body contains an instance of User.
Response body
If successful, the response body contains a newly created instance of User.
Authorization scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/cloud-platform
For more information, see the Authentication Overview.