Skip to main content

Create a Warrant

Create a new warrant that associates an object (objectType and objectId) to a user via a relation.

POST /v1/warrants

Parameters

ParameterDescriptionTypeRequired
objectTypeThe type of object. Must be one of your system's existing object types.JSON bodyyes
objectIdThe id of the specific object.JSON bodyyes
relationThe relation for this object to user association. The relation must be valid as per the object type definition.JSON bodyyes
userThe specific user to be associated with the object. In this context, a user is either a specific userId or a group of users defined by a set containing an objectType, objectId and relation.JSON bodyyes

Sample Request

curl "https://api.warrant.dev/v1/warrants" \
-X POST \
-H "Authorization: ApiKey YOUR_KEY" \
--data-raw \
'{
"objectType": "report",
"objectId": "23ft346",
"relation": "editor",
"user": {
"userId": "15ads7823a9df7as433gk23dd"
}
}'

Sample Response

{
"objectType": "report",
"objectId": "23ft346",
"relation": "editor",
"user": {
"userId": "15ads7823a9df7as433gk23dd"
}
}