Memos
User Service

Create User

CreateUser creates a new user.

POST
/api/v1/users

Query Parameters

userId?string

Optional. The user ID to use for this user. If empty, a unique ID will be generated. Must match the pattern [a-z0-9-]+

validateOnly?boolean

Optional. If set, validate the request but don't actually create the user.

requestId?string

Optional. An idempotency token that can be used to ensure that multiple requests to create a user have the same result.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

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

On this page

No Headings