ZitadelDocs

Get schema by ID

Get a schema by its ID. A schema ID identifies one immutable revision, so this returns exactly that revision. To find the current revision of an object type, list with `revisions=latest`. Schema IDs are unique within a project, not across projects (the seeded default schema carries the same `$id` in every project). A Console session that manages more than one project names the project with `project_id`; without it, the ID is resolved in the credential's own project when it is ambiguous. A project secret always resolves in its own project and ignores `project_id`.

GET
/schemas/{id}

Get a schema by its ID. A schema ID identifies one immutable revision, so this returns exactly that revision. To find the current revision of an object type, list with revisions=latest.

Schema IDs are unique within a project, not across projects (the seeded default schema carries the same $id in every project). A Console session that manages more than one project names the project with project_id; without it, the ID is resolved in the credential's own project when it is ambiguous. A project secret always resolves in its own project and ignores project_id.

Authorization

headerAuthorizationBearer <token>

Scope: schema.read

Path Parameters

id*string

Query Parameters

team_id?string

The unique identifier of the team

Match^[a-zA-Z0-9_-]+$
project_id?string

The project the request addresses. Omit it to address the credential's own project.

Match^[a-zA-Z0-9_-]+$

Response Body

The schema was retrieved successfully

application/json
  1. response

A schema resource: the server-owned envelope around a customer-authored JSON Schema document.

schema is the customer-authored document, served verbatim: its keys and contents are defined entirely by its author. The rest of the object — id, metadata — is the server-owned envelope. Keeping the two apart means the document may declare any property (including id or metadata) without colliding with the envelope, and the resource id stays distinguishable from the document's own $id.

id*string

The resource id: the server-minted sch_* identifier, or the customer-supplied $id URI when the document declared one at creation.

schema*

The customer-authored JSON Schema document, served verbatim.

metadata*
curl -X GET 'https://example.com/schemas/string'
{  "id": "string",  "schema": {    "$schema": "https://json-schema.org/draft/2020-12/schema",    "objectType": "string",    "kind": "user-schema",    "metaSchema": "http://example.com",    "x-auth-methods": {      "password": {        "enabled": true      },      "passkey": {        "enabled": true      },      "magic_link": {        "enabled": true      },      "sso": {        "providers": [          "google"        ],        "enabled": true      },      "otp": {        "enabled": true      }    },    "x-identifier": "string",    "x-display": [      "string"    ],    "properties": {      "property1": {        "x-unique": "unspecified",        "x-claim": "string",        "x-audit": false,        "properties": {          "property1": {},          "property2": {}        }      },      "property2": {        "x-unique": "unspecified",        "x-claim": "string",        "x-audit": false,        "properties": {          "property1": {},          "property2": {}        }      }    }  },  "metadata": {    "created_at": "2019-08-24T14:15:22Z"  }}