Skip to main content

Delete a Warrant

Delete a warrant, if it exists. The warrant to be deleted is specified by the combination of the objectType, objectId, relation, subject, and (optionally) policy provided in the delete request.

Endpoint
DELETE /v2/warrants

Request

Body


objectType string

The type of object. Must be one of your system's existing object types.


objectId string

The id of the specific object.


relation string

The relation for this object to subject association. The relation must be valid as per the object type definition.


subject object

The subject for which this warrant applies. Subject can be a specific object (by id) or a set of objects matching the given objectType, objectId and relation.


policy string, optional

A boolean expression that must evaluate to true for this warrant to apply. The expression can reference variables that are provided in the context attribute of access check requests. See Key Concepts > Warrants > Policies & Context to learn more about writing policies.


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

Response

Headers


Warrant-Token string

A unique transaction identifier for this write operation. Can be cached and passed on subsequent read requests.


Body


objectType string

The type of object. Must be one of your system's existing object types.


objectId string

The id of the specific object.


relation string

The relation for this object to subject association. The relation must be valid as per the object type definition.


subject object

The subject for which this warrant applies. Subject can be a specific object (by id) or a set of objects matching the given objectType, objectId and relation.


policy string

A boolean expression that must evaluate to true for this warrant to apply. The expression can reference variables that are provided in the context attribute of access check requests. See Key Concepts > Warrants > Policies & Context to learn more about writing policies.


200 OK