Managing a Schema
Once you've defined your schema, you can implement it in Descope using either the Console or programmatically via SDKs and APIs.
Managing Schemas in the Console
The easiest way to create and manage schemas is through the Descope Console. Navigate to the Authorization page and select the FGA tab.
From the FGA tab, you can:
- Create new schemas - Start from scratch or use a template
- Edit existing schemas - Modify your schema directly in the editor
- Delete schemas - Remove schemas and all associated relations
The Console provides a visual editor where you can write your schema in DSL format, validate it, and save it directly to your project.
![]()
Managing Schemas with SDKs and APIs
To implement a schema programmatically, you can create a YAML or JSON file that defines the schema and make a saveSchema call via API or SDK. Or, use the other schema management functions to create, update, and delete schemas, namespaces, and relation definitions.
Install SDK
Import and initialize Management SDK
Save (create or update) a schema
The saveSchema function allows for creation or updating of a schema. If the schema already exists, the upgrade parameter determines whether the existing schema will be overwritten entirely.
This code shows how to save the schema defined in a given file (YAML/JSON). An example of this schema file can be found in the Define Schema page.
Delete a schema
The deleteSchema function deletes an existing schema, including all relations.
Load a schema
The loadSchema function returns the current project's schema.
Dry run a schema
The dryRunSchema function validates a schema without saving it and returns what would be deleted from the current schema. This is useful for testing schema changes before applying them.
Delete a namespace
The deleteNamespace function deletes a specific namespace and all related relations. This operation cannot be undone.