Skip to main content

Batch Create Warrants
Warrant Cloud Only

Create up to 100 new warrants in one API request.

Endpoint

POST /v2/warrants

Request

Body


A list of warrants (as defined in the create warrant API).


note

Each batch create request can create up to 100 new warrants. Requests containing more than 100 warrants will fail.

Batch creates are atomic operations. If any error (client or server) is encountered during creation, none of the warrants will be created. Batch create requests can therefore be safely retried.

POST /v2/warrants
curl "https://api.warrant.dev/v2/warrants" \
-X POST \
-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"
}
}
]'

Response

Headers


Warrant-Token string

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


200 OK
[
{
"objectType": "report",
"objectId": "avk2837",
"relation": "viewer",
"subject": {
"objectType": "user",
"objectId": "5djfs6"
}
},
{
"objectType": "report",
"objectId": "slp1029",
"relation": "viewer",
"subject": {
"objectType": "user",
"objectId": "8lnsp7"
}
}
]