Skip to main content

Get an Object Type

Get a specific object type by type.

Endpoint
GET /v2/object-types/:type

Request

Headers


Warrant-Token string, optional

A valid Warrant-Token from a previous write operation or latest. Used to specify desired consistency for this read operation.


Path Params


type string

The type of the object type to retrieve.


GET /v2/object-types/:type
curl "https://api.warrant.dev/v2/object-types/report" \
-H "Authorization: ApiKey YOUR_KEY"

Response

Body


type string

A string identifier for this new object type. The type can only be composed of lower-case alphanumeric chars and/or '-' and '_'.


relations object

The set of relationships that subjects can have on objects of this type. See Key Concepts > Object Types to learn more.


200 OK
{
"type": "report",
"relations": {
"parent": {},
"owner": {},
"editor": {
"inheritIf": "owner"
},
"viewer": {
"inheritIf": "anyOf",
"rules": [
{
"inheritIf": "editor"
},
{
"inheritIf": "viewer",
"ofType": "report",
"withRelation": "parent"
}
]
}
}
}