Create a user schema​
Create the first revision of a new user schema. The schema can then be used on users to store and validate their data.
Request Body required
Possible values: non-empty
and <= 200 characters
Type is a human readable word describing the schema.
JSON schema representation defining the user.
Possible values: [AUTHENTICATOR_TYPE_UNSPECIFIED
, AUTHENTICATOR_TYPE_USERNAME
, AUTHENTICATOR_TYPE_PASSWORD
, AUTHENTICATOR_TYPE_WEBAUTHN
, AUTHENTICATOR_TYPE_TOTP
, AUTHENTICATOR_TYPE_OTP_EMAIL
, AUTHENTICATOR_TYPE_OTP_SMS
, AUTHENTICATOR_TYPE_AUTHENTICATION_KEY
, AUTHENTICATOR_TYPE_IDENTITY_PROVIDER
]
Defines the possible types of authenticators.
Request Body required
Possible values: non-empty
and <= 200 characters
Type is a human readable word describing the schema.
JSON schema representation defining the user.
Possible values: [AUTHENTICATOR_TYPE_UNSPECIFIED
, AUTHENTICATOR_TYPE_USERNAME
, AUTHENTICATOR_TYPE_PASSWORD
, AUTHENTICATOR_TYPE_WEBAUTHN
, AUTHENTICATOR_TYPE_TOTP
, AUTHENTICATOR_TYPE_OTP_EMAIL
, AUTHENTICATOR_TYPE_OTP_SMS
, AUTHENTICATOR_TYPE_AUTHENTICATION_KEY
, AUTHENTICATOR_TYPE_IDENTITY_PROVIDER
]
Defines the possible types of authenticators.
Request Body required
Possible values: non-empty
and <= 200 characters
Type is a human readable word describing the schema.
JSON schema representation defining the user.
Possible values: [AUTHENTICATOR_TYPE_UNSPECIFIED
, AUTHENTICATOR_TYPE_USERNAME
, AUTHENTICATOR_TYPE_PASSWORD
, AUTHENTICATOR_TYPE_WEBAUTHN
, AUTHENTICATOR_TYPE_TOTP
, AUTHENTICATOR_TYPE_OTP_EMAIL
, AUTHENTICATOR_TYPE_OTP_SMS
, AUTHENTICATOR_TYPE_AUTHENTICATION_KEY
, AUTHENTICATOR_TYPE_IDENTITY_PROVIDER
]
Defines the possible types of authenticators.
- 200
- 201
- 403
- 404
- default
A successful response.
Schema
ID is the read-only unique identifier of the schema.
details object
{
"id": "string",
"details": {
"sequence": "2",
"changeDate": "2024-05-24T19:39:27.325Z",
"resourceOwner": "69629023906488334"
}
}
Schema
ID is the read-only unique identifier of the schema.
details object
{
"id": "string",
"details": {
"sequence": "2",
"changeDate": "2024-05-24T19:39:27.326Z",
"resourceOwner": "69629023906488334"
}
}
Schema
ID is the read-only unique identifier of the schema.
details object
{
"id": "string",
"details": {
"sequence": "2",
"changeDate": "2024-05-24T19:39:27.326Z",
"resourceOwner": "69629023906488334"
}
}
Schema successfully created
Schema
ID is the read-only unique identifier of the schema.
details object
{
"id": "string",
"details": {
"sequence": "2",
"changeDate": "2024-05-24T19:39:27.326Z",
"resourceOwner": "69629023906488334"
}
}
Schema
ID is the read-only unique identifier of the schema.
details object
{
"id": "string",
"details": {
"sequence": "2",
"changeDate": "2024-05-24T19:39:27.326Z",
"resourceOwner": "69629023906488334"
}
}
Schema
ID is the read-only unique identifier of the schema.
details object
{
"id": "string",
"details": {
"sequence": "2",
"changeDate": "2024-05-24T19:39:27.326Z",
"resourceOwner": "69629023906488334"
}
}
Returned when the user does not have permission to access the resource.
Schema
details object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
Schema
details object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
Schema
details object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
Returned when the resource does not exist.
Schema
details object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
Schema
details object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
Schema
details object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
An unexpected error response.
Schema
details object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
Schema
details object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
Schema
details object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
POST /v3alpha/user_schemas
Authorization
name: OAuth2type: oauth2scopes:openid,urn:zitadel:iam:org:project:id:zitadel:aud
flows: { "authorizationCode": { "authorizationUrl": "$CUSTOM-DOMAIN/oauth/v2/authorize", "tokenUrl": "$CUSTOM-DOMAIN/oauth/v2/token", "scopes": { "openid": "openid", "urn:zitadel:iam:org:project:id:zitadel:aud": "urn:zitadel:iam:org:project:id:zitadel:aud" } } }
Request
Request
curl -L -X POST 'https://$CUSTOM-DOMAIN/v3alpha/user_schemas' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"type": "employees",
"schema": {
"$schema": "https://example.com/user/employees",
"type": "object",
"properties": {
"name": {
"type": "string",
"required": true
},
"description": {
"type": "string"
}
}
},
"possibleAuthenticators": [
"AUTHENTICATOR_TYPE_USERNAME",
"AUTHENTICATOR_TYPE_PASSWORD",
"AUTHENTICATOR_TYPE_WEBAUTHN"
]
}'
curl -L -X POST 'https://$CUSTOM-DOMAIN/v3alpha/user_schemas' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"type": "employees",
"schema": {
"$schema": "https://example.com/user/employees",
"type": "object",
"properties": {
"name": {
"type": "string",
"required": true
},
"description": {
"type": "string"
}
}
},
"possibleAuthenticators": [
"AUTHENTICATOR_TYPE_USERNAME",
"AUTHENTICATOR_TYPE_PASSWORD",
"AUTHENTICATOR_TYPE_WEBAUTHN"
]
}'
curl -L -X POST 'https://$CUSTOM-DOMAIN/v3alpha/user_schemas' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"type": "employees",
"schema": {
"$schema": "https://example.com/user/employees",
"type": "object",
"properties": {
"name": {
"type": "string",
"required": true
},
"description": {
"type": "string"
}
}
},
"possibleAuthenticators": [
"AUTHENTICATOR_TYPE_USERNAME",
"AUTHENTICATOR_TYPE_PASSWORD",
"AUTHENTICATOR_TYPE_WEBAUTHN"
]
}'
curl -L -X POST 'https://$CUSTOM-DOMAIN/v3alpha/user_schemas' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"type": "employees",
"schema": {
"$schema": "https://example.com/user/employees",
"type": "object",
"properties": {
"name": {
"type": "string",
"required": true
},
"description": {
"type": "string"
}
}
},
"possibleAuthenticators": [
"AUTHENTICATOR_TYPE_USERNAME",
"AUTHENTICATOR_TYPE_PASSWORD",
"AUTHENTICATOR_TYPE_WEBAUTHN"
]
}'
curl -L -X POST 'https://$CUSTOM-DOMAIN/v3alpha/user_schemas' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"type": "employees",
"schema": {
"$schema": "https://example.com/user/employees",
"type": "object",
"properties": {
"name": {
"type": "string",
"required": true
},
"description": {
"type": "string"
}
}
},
"possibleAuthenticators": [
"AUTHENTICATOR_TYPE_USERNAME",
"AUTHENTICATOR_TYPE_PASSWORD",
"AUTHENTICATOR_TYPE_WEBAUTHN"
]
}'
curl -L -X POST 'https://$CUSTOM-DOMAIN/v3alpha/user_schemas' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"type": "employees",
"schema": {
"$schema": "https://example.com/user/employees",
"type": "object",
"properties": {
"name": {
"type": "string",
"required": true
},
"description": {
"type": "string"
}
}
},
"possibleAuthenticators": [
"AUTHENTICATOR_TYPE_USERNAME",
"AUTHENTICATOR_TYPE_PASSWORD",
"AUTHENTICATOR_TYPE_WEBAUTHN"
]
}'
curl -L -X POST 'https://$CUSTOM-DOMAIN/v3alpha/user_schemas' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"type": "employees",
"schema": {
"$schema": "https://example.com/user/employees",
"type": "object",
"properties": {
"name": {
"type": "string",
"required": true
},
"description": {
"type": "string"
}
}
},
"possibleAuthenticators": [
"AUTHENTICATOR_TYPE_USERNAME",
"AUTHENTICATOR_TYPE_PASSWORD",
"AUTHENTICATOR_TYPE_WEBAUTHN"
]
}'
curl -L -X POST 'https://$CUSTOM-DOMAIN/v3alpha/user_schemas' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"type": "employees",
"schema": {
"$schema": "https://example.com/user/employees",
"type": "object",
"properties": {
"name": {
"type": "string",
"required": true
},
"description": {
"type": "string"
}
}
},
"possibleAuthenticators": [
"AUTHENTICATOR_TYPE_USERNAME",
"AUTHENTICATOR_TYPE_PASSWORD",
"AUTHENTICATOR_TYPE_WEBAUTHN"
]
}'
curl -L -X POST 'https://$CUSTOM-DOMAIN/v3alpha/user_schemas' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"type": "employees",
"schema": {
"$schema": "https://example.com/user/employees",
"type": "object",
"properties": {
"name": {
"type": "string",
"required": true
},
"description": {
"type": "string"
}
}
},
"possibleAuthenticators": [
"AUTHENTICATOR_TYPE_USERNAME",
"AUTHENTICATOR_TYPE_PASSWORD",
"AUTHENTICATOR_TYPE_WEBAUTHN"
]
}'