UserService · UserService_CreateUser
Access
The first account bootstraps the instance administrator. Later anonymous registration follows the instance's signup/password policy and any deployment challenge. Administrators can create users; ordinary signup cannot request administrator privileges.
Creation checks are not an idempotency guarantee
username and a nonempty password are validated; userId, when supplied, must equal username. Email is trimmed and lowercased and cannot be reused by another account. validateOnly avoids creating the account but does not reserve a username or guarantee a later creation. requestId is declared but is not used for deduplication by this implementation. After an ambiguous POST, check whether the account exists before retrying.
Request
CreateUser creates a new user.
/api/v1/usersParameters
| Name / location | Type / requirement | Description |
|---|---|---|
userIdquery | string Not marked required in OpenAPI | Optional. The resource ID to use for this user. If set, it must equal user.username and follow the username format. Format: ^[a-zA-Z0-9]([a-zA-Z0-9-]{0,34}[a-zA-Z0-9])?$ |
validateOnlyquery | boolean Not marked required in OpenAPI | Optional. If set, validate the request but don't actually create the user. |
requestIdquery | string Not marked required in OpenAPI | Optional. An idempotency token that can be used to ensure that multiple requests to create a user have the same result. |
Request body
Required
application/json · User
Responses
200 · OK
application/json · User
default · Default error response
application/json · Status
Complete operation definition
All declared constraints, media types and response details are retained below. Schema references link to their complete definitions.
Open JSON definition
{
"tags": [
"UserService"
],
"description": "CreateUser creates a new user.",
"operationId": "UserService_CreateUser",
"parameters": [
{
"name": "userId",
"in": "query",
"description": "Optional. The resource ID to use for this user. If set, it must equal\n user.username and follow the username format.\n Format: ^[a-zA-Z0-9]([a-zA-Z0-9-]{0,34}[a-zA-Z0-9])?$",
"schema": {
"type": "string"
}
},
{
"name": "validateOnly",
"in": "query",
"description": "Optional. If set, validate the request but don't actually create the user.",
"schema": {
"type": "boolean"
}
},
{
"name": "requestId",
"in": "query",
"description": "Optional. An idempotency token that can be used to ensure that multiple\n requests to create a user have the same result.",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/User"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/User"
}
}
}
},
"default": {
"description": "Default error response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Status"
}
}
}
}
}
}