Stage a batch of permission rule changes as one gesture
POST
/api/v1/projects/{projectIdOrKey}/permission-rules/batch
const url = 'https://app.avera.io/api/v1/projects/example/permission-rules/batch?sandboxId=example';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"ops":[{"op":"example","ruleId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","rule":{"principal":"example","verb":"example","itemTypes":["example"],"states":["example"],"fields":["example"],"relationshipTypes":["example"],"transitionIds":["example"]}}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url 'https://app.avera.io/api/v1/projects/example/permission-rules/batch?sandboxId=example' \ --header 'Content-Type: application/json' \ --data '{ "ops": [ { "op": "example", "ruleId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "rule": { "principal": "example", "verb": "example", "itemTypes": [ "example" ], "states": [ "example" ], "fields": [ "example" ], "relationshipTypes": [ "example" ], "transitionIds": [ "example" ] } } ] }'Creates, updates and deletes staged into one change request all-or-nothing, so a save never leaves fragments.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”projectIdOrKey
required
string
Query Parameters
Section titled “Query Parameters”sandboxId
required
string
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
ops
required
Example generated
{ "ops": [ { "op": "example", "ruleId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "rule": { "principal": "example", "verb": "example", "itemTypes": [ "example" ], "states": [ "example" ], "fields": [ "example" ], "relationshipTypes": [ "example" ], "transitionIds": [ "example" ] } } ]}Responses
Section titled “Responses”OK
Media type*/*
Array<object>
object
id
required
string format: uuid
citation
required
string
principal
required
string
verb
required
string
itemTypes
Array<string> | null
states
Array<string> | null
fields
Array<string> | null
relationshipTypes
Array<string> | null
transitionIds
Array<string> | null
templateKey
string | null
origin
required
string
modifiedAt
required
string format: date-time