Stores
List all stores
Returns a paginated list of OpenFGA stores and a continuation token to get additional stores. The continuation token is empty if there are no more stores.
GET
/
stores
Node.js
const { OpenFgaClient, ConsistencyPreference } = require('@openfga/sdk');
const fgaClient = new OpenFgaClient({
apiUrl: process.env.FGA_API_URL,
});
async function main() {
const options = {
"pageSize": 20
};
const response = await fgaClient.listStores(options);
}
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});package main
import (
"context"
"os"
. "github.com/openfga/go-sdk/client"
)
func main() {
fgaClient, err := NewSdkClient(&ClientConfiguration{
ApiUrl: os.Getenv("FGA_API_URL"),
})
if err != nil {
panic(err)
}
pageSize := int32(20)
options := ClientListStoresOptions{
PageSize: &pageSize,
}
response, err := fgaClient.ListStores(context.Background()).Options(options).Execute()
if err != nil {
panic(err)
}
_ = response
}using System.Collections.Generic;
using OpenFga.Sdk.Client;
using OpenFga.Sdk.Client.Model;
using OpenFga.Sdk.Model;
using Environment = System.Environment;
var fgaClient = new OpenFgaClient(new ClientConfiguration() {
ApiUrl = Environment.GetEnvironmentVariable("FGA_API_URL"),
});
var body = new ClientListStoresRequest();
var options = new ClientListStoresOptions {
PageSize = 20,
};
var response = await fgaClient.ListStores(body, options);import asyncio
import os
from openfga_sdk.client import OpenFgaClient, ClientConfiguration
async def main():
configuration = ClientConfiguration(
api_url=os.environ.get("FGA_API_URL"),
)
async with OpenFgaClient(configuration) as fga_client:
options = {"page_size": 20}
response = await fga_client.list_stores(options=options)
asyncio.run(main())import dev.openfga.sdk.api.client.OpenFgaClient;
import dev.openfga.sdk.api.configuration.ClientConfiguration;
import dev.openfga.sdk.api.configuration.*;
import dev.openfga.sdk.api.client.model.*;
import dev.openfga.sdk.api.model.*;
import java.util.List;
import java.util.Map;
import java.util.ArrayList;
import dev.openfga.sdk.api.configuration.ClientListStoresOptions;
public class Example {
public static void main(String[] args) throws Exception {
var config = new ClientConfiguration()
.apiUrl(System.getenv("FGA_API_URL"));
var fgaClient = new OpenFgaClient(config);
var options = new ClientListStoresOptions()
.pageSize(20);
var response = fgaClient.listStores(options).get();
}
}# Set FGA_API_URL to the URL of your OpenFGA server.
# These examples use a server with authentication disabled.
# For authenticated servers, see /docs/getting-started/setup-sdk-client.
curl -X GET "$FGA_API_URL/stores?page_size=20"{
"continuation_token": "eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ==",
"stores": [
{
"created_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"name": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z"
}
]
}{
"code": "validation_error",
"message": "Generic validation error"
}{
"code": "unauthenticated",
"message": "unauthenticated"
}{
"code": "forbidden",
"message": "the principal is not authorized to perform the action"
}{
"code": "undefined_endpoint",
"message": "Endpoint not enabled"
}{
"code": "10",
"message": "transaction conflict"
}{
"code": "throttled_timeout_error",
"message": "timeout due to throttling on complex request"
}{
"code": "internal_error",
"message": "Internal Server Error"
}Query Parameters
The name parameter instructs the API to only include results that match that name./nMultiple results may be returned. Only exact matches are returned; substring matches and regexes are not be evaluated.
Last modified on September 28, 2026
Was this page helpful?
⌘I
Node.js
const { OpenFgaClient, ConsistencyPreference } = require('@openfga/sdk');
const fgaClient = new OpenFgaClient({
apiUrl: process.env.FGA_API_URL,
});
async function main() {
const options = {
"pageSize": 20
};
const response = await fgaClient.listStores(options);
}
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});package main
import (
"context"
"os"
. "github.com/openfga/go-sdk/client"
)
func main() {
fgaClient, err := NewSdkClient(&ClientConfiguration{
ApiUrl: os.Getenv("FGA_API_URL"),
})
if err != nil {
panic(err)
}
pageSize := int32(20)
options := ClientListStoresOptions{
PageSize: &pageSize,
}
response, err := fgaClient.ListStores(context.Background()).Options(options).Execute()
if err != nil {
panic(err)
}
_ = response
}using System.Collections.Generic;
using OpenFga.Sdk.Client;
using OpenFga.Sdk.Client.Model;
using OpenFga.Sdk.Model;
using Environment = System.Environment;
var fgaClient = new OpenFgaClient(new ClientConfiguration() {
ApiUrl = Environment.GetEnvironmentVariable("FGA_API_URL"),
});
var body = new ClientListStoresRequest();
var options = new ClientListStoresOptions {
PageSize = 20,
};
var response = await fgaClient.ListStores(body, options);import asyncio
import os
from openfga_sdk.client import OpenFgaClient, ClientConfiguration
async def main():
configuration = ClientConfiguration(
api_url=os.environ.get("FGA_API_URL"),
)
async with OpenFgaClient(configuration) as fga_client:
options = {"page_size": 20}
response = await fga_client.list_stores(options=options)
asyncio.run(main())import dev.openfga.sdk.api.client.OpenFgaClient;
import dev.openfga.sdk.api.configuration.ClientConfiguration;
import dev.openfga.sdk.api.configuration.*;
import dev.openfga.sdk.api.client.model.*;
import dev.openfga.sdk.api.model.*;
import java.util.List;
import java.util.Map;
import java.util.ArrayList;
import dev.openfga.sdk.api.configuration.ClientListStoresOptions;
public class Example {
public static void main(String[] args) throws Exception {
var config = new ClientConfiguration()
.apiUrl(System.getenv("FGA_API_URL"));
var fgaClient = new OpenFgaClient(config);
var options = new ClientListStoresOptions()
.pageSize(20);
var response = fgaClient.listStores(options).get();
}
}# Set FGA_API_URL to the URL of your OpenFGA server.
# These examples use a server with authentication disabled.
# For authenticated servers, see /docs/getting-started/setup-sdk-client.
curl -X GET "$FGA_API_URL/stores?page_size=20"{
"continuation_token": "eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ==",
"stores": [
{
"created_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"name": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z"
}
]
}{
"code": "validation_error",
"message": "Generic validation error"
}{
"code": "unauthenticated",
"message": "unauthenticated"
}{
"code": "forbidden",
"message": "the principal is not authorized to perform the action"
}{
"code": "undefined_endpoint",
"message": "Endpoint not enabled"
}{
"code": "10",
"message": "transaction conflict"
}{
"code": "throttled_timeout_error",
"message": "timeout due to throttling on complex request"
}{
"code": "internal_error",
"message": "Internal Server Error"
}