DocumentationAPI reference

Rust · 0.1.0

Create User

POST /api/v1/users

UserService · UserService_CreateUser

Protocol-derived reference. Authorization and instance policy still apply. Schema descriptions are inherited from the MIT-licensed application contract; examples here are not executed against a live server.

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.

POST/api/v1/users

Parameters

Name / locationType / requirementDescription
userId
query
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])?$
validateOnly
query
boolean
Not marked required in OpenAPI
Optional. If set, validate the request but don't actually create the user.
requestId
query
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"
          }
        }
      }
    }
  }
}