Permify requires PostgreSQL 13.8 or higher for production use. The quick-start below uses in-memory storage so you can get started without a database.
Set up Permify
Run Permify with Docker
Pull and start the Permify container with a single command:This starts Permify with the following defaults:
Authorization data is stored in memory by default. To persist data, configure a PostgreSQL database in a config YAML file and mount it into the container.
| Port | Protocol | Description |
|---|---|---|
3476 | REST / HTTP | REST API endpoint |
3478 | gRPC | gRPC service endpoint |
Verify the service is running
Send a health check request to confirm Permify is up:A successful response confirms the service is ready to accept requests.
Write your authorization schema
Permify uses its own schema language to model entities, relations, and permissions. For this quickstart, we’ll model a simple organization where admins can edit files and both admins and members can view them.POST
/v1/tenants/{tenant_id}/schemas/writeRequest
- cURL
- Schema (readable)
All Permify APIs require a
tenant_id. Permify supports multi-tenancy by default. Use the pre-inserted tenant t1 if you don’t need multiple tenants.Write authorization data
Now grant a user an admin role on an organization. This creates a relational tuple that Permify uses when evaluating access.POST This creates the tuple
/v1/tenants/{tenant_id}/data/writecURL
organization:1#admin@user:1, meaning user 1 (Ashley) has the admin role on organization 1.The response includes a snap_token:Response
What’s next
You’ve completed the core Permify workflow: run the service, define a schema, write data, and check permissions. From here:- Modeling Authorization — learn the full Permify Schema language: entities, relations, permissions, and operators.
- Syncing Data — understand how to keep your authorization data in sync with your application.
- Enforcing Permissions — explore the full set of permission APIs including bulk check, lookup entity, and lookup subject.
- Testing Authorization — write automated tests for your authorization model.
Our team is happy to help you get started. Schedule a call with a Permify engineer or join the Discord community to discuss.