Stage a new permission rule into a change request
POST
/api/v1/projects/{projectIdOrKey}/permission-rules
const url = 'https://app.avera.io/api/v1/projects/example/permission-rules?sandboxId=example';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"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?sandboxId=example' \ --header 'Content-Type: application/json' \ --data '{ "principal": "example", "verb": "example", "itemTypes": [ "example" ], "states": [ "example" ], "fields": [ "example" ], "relationshipTypes": [ "example" ], "transitionIds": [ "example" ] }'Every rule mutation requires an open change request named by sandboxId; the change is staged there and applies only at promotion, so a rule change is always reviewed before it applies.
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
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
Example generated
{ "principal": "example", "verb": "example", "itemTypes": [ "example" ], "states": [ "example" ], "fields": [ "example" ], "relationshipTypes": [ "example" ], "transitionIds": [ "example" ]}Responses
Section titled “Responses”OK
Media type*/*
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