Get a schema by ID
Returns a schema by ID. A schema ID identifies one immutable revision, so
this returns exactly that revision. To find the current revision of an
object type, call listSchemas (GET /schemas) 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.
AuthorizationBearer <token>Scope: schema.read
schema_id*stringThe schema ID: the id that publishSchema (POST /schemas) returns or listSchemas (GET /schemas) lists.
team_id?stringThe team ID: the id that createTeam (POST /teams) or queryTeams (POST /teams/query) returns.
^[a-zA-Z0-9_-]+$project_id?stringThe project the request addresses, by the id that createProject (POST /projects)
returns. Omit it to address the credential's own project.
^[a-zA-Z0-9_-]+$The schema.
application/json- response
A schema resource: the server-owned envelope around a customer-authored JSON Schema document.
schema is the customer-authored document, served verbatim: its author
defines its keys and contents. The rest of the object (id and 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*stringThe schema's ID: the server-generated 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*import { configureZitadel, getApi } from "@zitadel/api/config";// In the browser, through the SDK proxy: the session cookie authenticates the call.const client = getApi(configureZitadel({ projectId: "proj_01KWH1P4MYS7F0N9WD3P2E4YM5" }));const schema = await client.getSchema("sch_01KWHF2XY6RN7F0N9WD3P2E4YM", { team_id: "team_01KZZY8PX8K8ATNVDSMRCZY4N1" });{ "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", "in_use": true }}Was this helpful?