Zitadel Preview Docs

Create new schema

Create a new schema. The schema definition must include a unique $id field, which will be used to identify the schema in future requests. The $id must be a valid URI and should ideally point to the location where the schema can be accessed. The schema can either be a concrete schema, e.g. a user schema, or a schema-url which will be resolved by the server.

POST
/schemas

Create a new schema. The schema definition must include a unique $id field, which will be used to identify the schema in future requests. The $id must be a valid URI and should ideally point to the location where the schema can be accessed.

The schema can either be a concrete schema, e.g. a user schema, or a schema-url which will be resolved by the server.

Authorization

oauth2 schema.write
AuthorizationBearer <token>

In: header

Scope: schema.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.

This schema is missing "allOf": [{"$ref": "https://json-schema.org/draft/2020-12/schema"}],. This is done because a lot of code generators cannot handle that.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/schemas?project_id=river-8421" \  -H "Content-Type: application/json" \  -d '{    "title": "ExampleUserSchema",    "$schema": "https://raw.githubusercontent.com/zitadel/nextgen/refs/heads/main/api/openapi/endpoints/schemas/user-schema.json",    "kind": "user-schema",    "type": "object",    "description": "This is an example of a user schema definition.",    "objectType": "human-user",    "x-auth-methods": {      "password": {        "enabled": false,        "position": 1      },      "passkey": {        "enabled": true,        "position": 2      }    },    "required": [      "email",      "password"    ],    "properties": {      "email": {        "type": "string",        "format": "email",        "description": "The user\'s email address."      },      "password": {        "type": "string",        "minLength": 8,        "description": "The user\'s password, which must be at least 8 characters long."      },      "firstName": {        "type": "string",        "description": "The user\'s first name."      },      "lastName": {        "type": "string",        "description": "The user\'s last name."      },      "address": {        "type": "object",        "description": "The user\'s address information.",        "properties": {          "street": {            "type": "string",            "description": "The street address."          },          "houseNumber": {            "type": "string",            "description": "The house number of the address."          },          "city": {            "type": "string",            "description": "The city of the address."          },          "postalCode": {            "type": "string",            "description": "The postal code of the address."          },          "country": {            "type": "string",            "description": "The country of the address."          }        }      }    }  }'
{  "id": "sch_abcd1234_efgh5678"}
{  "code": "string",  "message": "string",  "details": {}}
{  "code": "string",  "message": "string",  "details": {}}
{  "code": "string",  "message": "string",  "details": {}}