Memos

Create User

CreateUser creates a user. The first user of an instance becomes an admin. Otherwise, unless an admin calls it, the instance must allow user registration and password sign-up, and the new user gets the USER role.

POST
/api/users

Query Parameters

userId?string

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?$

validateOnly?boolean

Optional. If set, validate the request but do not create the user.

requestId?string

Optional. An idempotency token. Currently ignored.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

User is an account on the instance.

Response Body

application/json

application/json

curl -X POST "https://example.com/api/users" \  -H "Content-Type: application/json" \  -d '{    "username": "string",    "role": "ROLE_UNSPECIFIED",    "state": "STATE_UNSPECIFIED"  }'
{  "name": "string",  "username": "string",  "displayName": "string",  "email": "string",  "avatarUrl": "string",  "description": "string",  "password": "string",  "role": "ROLE_UNSPECIFIED",  "state": "STATE_UNSPECIFIED",  "createTime": "2019-08-24T14:15:22Z",  "updateTime": "2019-08-24T14:15:22Z"}