Skip to main content
This article explains how to configure an authorization model for a store in an OpenFGA server.

Before you start

  1. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_URL and, if needed, FGA_API_TOKEN.
  2. You have installed the SDK, created the store and setup the SDK client.
  3. You have loaded FGA_STORE_ID and FGA_API_URL as environment variables.

Step by step

Assume that you want to configure your store with the following model. To configure authorization model, we can invoke the write authorization models API. Initialize the SDK once, then place the request in the same scope as the client. For Python, put the request inside the async with block; for Go, .NET, and Java, use the method that initializes the client.
The API will then return the authorization model ID.
The OpenFGA API only accepts an authorization model in the API’s JSON syntax.To convert between the API Syntax and the friendly DSL, you can use the FGA CLI.
Take a look at the following sections for more information on how to configure authorization model in your store.

Getting Started with Modeling

Read how to get started with modeling.

Modeling: Direct Relationships

Read the basics of modeling authorization and granting access to users.
Last modified on September 28, 2026