Zitadel Preview Docs

Create user

POST
/users

Authorization

oauth2 user.write
AuthorizationBearer <token>

In: header

Scope: user.write

Query Parameters

project_id*string

The unique identifier of the project

team_id?string

The unique identifier of the team

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

attributes is the document that must satisfy the user schema named by schema.

The resource primary key is server-assigned and returned in the response, so the request carries no id; metadata is server-owned for the same reason. Neither is part of this schema, which is what frees a user schema to declare properties of those names.

A request carrying any other top-level property is rejected rather than ignored. attributes stays open, since the user schema is what determines what belongs in it.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/users?project_id=proj_01hexample" \  -H "Content-Type: application/json" \  -d '{    "schema": "string",    "attributes": {}  }'
{  "id": "user_id_12345",  "schema": "string",  "attributes": {},  "metadata": {    "created_at": "2019-08-24T14:15:22Z",    "updated_at": "2019-08-24T14:15:22Z",    "status": "active",    "lifecycle_owner_team_id": "string"  }}
{  "code": "string",  "message": "string",  "details": {}}
{  "code": "string",  "message": "string",  "details": {}}
{  "code": "string",  "message": "string",  "details": {}}
{  "code": "string",  "message": "string",  "details": {}}
{  "code": "string",  "message": "string",  "details": {}}

{  "code": "auth.unauthorized",  "message": "The request lacks valid authentication credentials."}