Write Schema
Permify provide it’s own authorization language to model common patterns of easily. We called the authorization model Permify Schema and it can be created on our playground as well as in any IDE or text editor.
We also have a VS Code extension to ease modeling Permify Schema with code snippets and syntax highlights. Note that on VS code the file with extension is “.perm”.
If you’re planning to test Permify manually, maybe with an API Design platform such as Postman, Insomnia, etc; we’re suggesting using our playground to create model. Because Permify Schema needs to be configured (send to API) in Permify API in a string format. Therefore, created model should be converted to string.
Although, it could easily be done programmatically, it could be little challenging to do it manually. To help on that, we have a button on the playground to copy created model to the clipboard as a string, so you get your model in string format easily.
Permify Schema needed to be send to API endpoint /v1/schemas/write” for configuration of your authorization model on Permify API.
Example Request on Postman
POST /v1/tenants/{tenant_id}/schemas/write
See the following FAQ page to refer to the suggested workflow for: Managing Schema Changes.
Path Parameters
Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant <code>t1</code> for this field. Required, and must match the pattern \“[a-zA-Z0-9-,]+\“, max 64 bytes.
Body
SchemaWriteRequest is the request message for the Write method in the Schema service. It contains tenant_id and the schema to be written.
schema is the string representation of the schema to be written.
Response
SchemaWriteResponse is the response message for the Write method in the Schema service. It returns the version of the written schema.
schema_version is the string that identifies the version of the written schema.