Batch Delete Warrants Warrant Cloud Only
Delete up to 100 warrants in one API request.
Endpoint
DELETE /v2/warrants
Request
Body
A list
of warrant
s (as defined in the delete warrant API).
note
Each batch delete request can delete up to 100 new warrants. Requests containing more than 100 warrants will fail.
Batch deletes are atomic operations. If any error (client or server) is encountered during creation, none of the warrants will be deleted. Batch delete requests can therefore be safely retried.
- cURL
- Go
- Java
- Node.js
- PHP
- Python
- Ruby
curl "https://api.warrant.dev/v2/warrants" \
-X DELETE \
-H "Authorization: ApiKey YOUR_KEY" \
--data-raw \
'[
{
"objectType": "report",
"objectId": "avk2837",
"relation": "viewer",
"subject": {
"objectType": "user",
"objectId": "5djfs6"
}
},
{
"objectType": "report",
"objectId": "slp1029",
"relation": "viewer",
"subject": {
"objectType": "user",
"objectId": "8lnsp7"
}
}
]'
warrantToken, err := warrant.BatchDelete([]warrant.WarrantParams{
{
ObjectType: "report",
ObjectId: "avk2837",
Relation: "member",
Subject: warrant.Subject{
ObjectType: "user",
ObjectId: "5djfs6"
},
},
{
ObjectType: "report",
ObjectId: "slp1029",
Relation: "member",
Subject: warrant.Subject{
ObjectType: "user",
ObjectId: "8lnsp7",
},
},
})
String warrantToken = client.deleteWarrants(new Warrant[]{
new Warrant("report", "avk2837", "member", new WarrantSubject("user", "5djfs6")),
new Warrant("report", "slp1029", "member", new WarrantSubject("user", "8lnsp7"))
});
DELETE /v2/warrants
let warrantToken = await warrantClient.Warrant.batchDelete([
{
"objectType": "report",
"objectId": "avk2837",
"relation": "viewer",
"subject": {
"objectType": "user",
"objectId": "5djfs6"
}
},
{
"objectType": "report",
"objectId": "slp1029",
"relation": "viewer",
"subject": {
"objectType": "user",
"objectId": "8lnsp7"
}
},
]);
warrant_token = warrant.Warrant.batch_delete([
{"objectType": "report", "objectId": "avk2837", "relation": "member", "subject": {"objectType": "user", "objectId": "5djfs6"}},
{"objectType": "report", "objectId": "slp1029", "relation": "member", "subject": {"objectType": "user", "objectId": "8lnsp7"}},
])
DELETE /v2/warrants
warrant_token = Warrant::Warrant.batch_delete([
{ object_type: "report", object_id: "avk2837", relation: "viewer", subject: { object_type: "user", object_id: "5djfs6" } },
{ object_type: "report", object_id: "slp1029", relation: "viewer", subject: { object_type: "user", object_id: "8lnsp7" } }
])
Response
Headers
Warrant-Token string
A unique transaction identifier for this write operation. Can be cached and passed on subsequent read requests.
200 OK