Skip to main content

Update an Object Type

Update an object type.

PUT /v1/object-types/:type

Parameters

ParameterDescriptionTypeRequired
typeThe id of the object type to update.Path paramyes
relationsThe set of all relations for this object type. See creating an object type for more details.JSON bodyyes

Sample Request

PUT /v1/object-types/:type
curl "https://api.warrant.dev/v1/object-types/report" \
-X PUT \
-H "Authorization: ApiKey YOUR_KEY" \
--data-raw \
'{
"relations": {
"editor": {
"type": "anyOf",
"rules": [
{
"type": "userset",
"relation": "owner"
}
]
},
"owner": {},
"parent": {},
"viewer": {
"type": "anyOf",
"rules": [
{
"type": "userset",
"relation": "editor"
},
{
"type": "objectUserset",
"relation": "parent",
"userset": {
"type": "userset",
"relation": "viewer"
}
}
]
}
}
}'

Sample Response

{
"type": "report",
"relations": {
"editor": {
"type": "anyOf",
"rules": [
{
"type": "userset",
"relation": "owner"
}
]
},
"owner": {},
"parent": {},
"viewer": {
"type": "anyOf",
"rules": [
{
"type": "userset",
"relation": "editor"
},
{
"type": "objectUserset",
"relation": "parent",
"userset": {
"type": "userset",
"relation": "viewer"
}
}
]
}
}
}