Update a security entity relationship
POST
/api/security/update/{id}
const url = 'https://example.com/api/security/update/example';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"type":"users","field":"groups","action":"add","data":["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://example.com/api/security/update/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "type": "users", "field": "groups", "action": "add", "data": [ "example" ] }'Adds or removes a related entity (users, groups, roles) on a security entity. Updates both sides of the relationship.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
Entity ID
string
Request Body
Section titled “Request Body”Media typeapplication/json
object
type
required
Entity type being mutated
string
Example
usersfield
required
Property being modified
string
Example
groupsaction
required
Mutation action
string
Example
adddata
required
Any of:
string
Array<string>
Responses
Section titled “Responses”Update result message
Media typeapplication/json
string
Examplegenerated
exampleAccess denied
Media typeapplication/json
object
error
required
Indicates an error occurred
boolean
message
required
Error message describing what went wrong
string
Example
{ "error": true, "message": "Item not found"}