Skip to main content
Using Auth0 FGA, you can update multiple relationship tuples in a single transaction.

Before you start

Familiarize yourself with basic Auth0 FGA Concepts before completing this guide.

Step by step

01. Add and remove relationship tuples in the same transaction

A call to the Write API can add or delete tuples in your store. For example, the following tuple makes tweet:1 public by making everyone a viewer: Deleting the previous tuple converts this tweet to private: By removing the tuple, we made the tweet visible to no-one, which may not be what we want. The Write API allows you to send up to 40 unique tuples in the request. (This limit applies to the sum of both writes and deletes in that request). This means we can submit one API call that converts the tweet from public to visible to only the user’s followers. Sending multiple tuples per request can also help maintain consistency. For example, if anne follows becky, you can save the following two tuples or neither of them:
In this case, the type user exists because users can be related to each other, so users now are a type in the system.
The Auth0 Fine-Grained Authorization (FGA) service attempts to perform all the changes sent in a single Write API call in one transaction. If it cannot complete all the changes, it rejects all of them.