What is Data Bundles?
Ensuring that authorization data remains in sync with the business model is an important practice when using Permify. Prior to Data Bundles, it was the responsibility of the services (such as WriteData API) to structure how relations are created and deleted when actions occur on resources. With the Data Bundles, you be able to bundle and model the creation and deletion of relations and attributes when specific actions occur on resources in your applications. We believe this functionality will streamline managing authorization data as well as managing this in a central place increase visibility around certain actions/triggers that end up with data creation.How Bundles Works
Let’s examine how Bundles operates with basic example. Let’s say you want to model how data will be created when an organization created in your application. For this purpose, you can utilize the WriteBundle API endpoint. This API enables users to define or update data bundles, each distinguished by a unique name. Here’s an example body for WriteBundle in this scenario:- organization:789#admin@user:564
- organization:789#manager@user:564
- organization:789$public|boolean:false
- organization:789#admin@user:564
- organization:789#manager@user:564
- organization:789$public|boolean:false
Endpoints
Write Bundles Request
The “Write Bundle” API is designed for handling data in a multi-tenant application environment. Its primary function is to write and delete data according to predefined structures. This API allows users to define or update data bundles, each distinguished by a unique name.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
application/json
BundleWriteRequest is used to request the writing of a bundle. It contains the tenant_id to identify the tenant and the Bundles object.
Response
A successful response.
BundleWriteResponse is the response for a BundleWriteRequest. It includes a name which could be used as an identifier or acknowledgment.