Delete a Warrant
Delete a warrant, if it exists. The warrant to be deleted is specified by the combination of 'objectType', 'objectId', 'relation' and 'subject' provided in the delete request.
DELETE /v1/warrants
Parameters
Parameter | Description | Type | Required |
---|---|---|---|
objectType | The type of object. Must be one of your system's existing object types. | JSON body | yes |
objectId | The id of the specific object. | JSON body | yes |
relation | The relation for this object to subject association. The relation must be valid as per the object type definition. | JSON body | yes |
subject | The specific subject (object, user etc.) to be associated with the object. A subject can either be a specific object (by id) or a group of objects defined by a set containing an objectType, objectId and relation. | JSON body | yes |
Request
- Curl
- Go
- Java
- Node.js
- Python
- Ruby
- PHP
curl "https://api.warrant.dev/v1/warrants" \
-X DELETE \
-H "Authorization: ApiKey YOUR_KEY" \
--data-raw \
'{
"objectType": "report",
"objectId": "23ft346",
"relation": "editor",
"subject": {
"objectType": "user",
"objectId": "15ads7823a9df7as433gk23dd"
}
}'
err := warrant.Delete(&warrant.WarrantParams{
ObjectType: "report",
ObjectId: "23ft346",
Relation: "editor",
Subject: warrant.Subject{
ObjectType: "user",
ObjectId": "15ads7823a9df7as433gk23dd",
},
})
if err != nil {
// handle error
}
try {
Report report = new Report("23ft346"); // assuming 'Report' implements the 'WarrantObject' interface
client.deleteWarrant(report, "editor", new WarrantSubject("user", "15ads7823a9df7as433gk23dd"));
} catch (WarrantException e) {
// Handle error
}
await warrantClient.Warrant.delete({
object: {
objectType: "report",
objectId: "23ft346",
},
relation: "editor",
subject: { objectType: "user", objectId: "15ads7823a9df7as433gk23dd" },
});
user_subject = warrant.Subject("user", "15ads7823a9df7as433gk23dd")
warrant.Warrant.delete(object_type="report", object_id="23ft346", relation="editor", subject=user_subject)
Warrant::Warrant.delete(object_type: "report", object_id: "23ft346", relation: "editor", subject: { object_type: "user", object_id: "15ads7823a9df7as433gk23dd" })
$subject = new \Warrant\Subject("user", "15ads7823a9df7as433gk23dd");
$warrant->deleteWarrant(new \Warrant\Warrant("report", "23ft346", "editor", $subject));
Response
200 OK