List Warrants
List warrants (matching an optional set of filters).
GET /v2/warrants
Request
Headers
Warrant-Token string
, optional
A valid Warrant-Token from a previous write operation or latest
. Used to specify desired consistency for this read operation.
Query Params
objectType string
, required if objectId is specified
Only return warrants whose objectType
matches this value.
objectId string
Only return warrants whose objectId
matches this value.
relation string
Only return warrants whose relation
matches this value.
subjectType string
, required if subjectId
is specified
Only return warrants with a subject whose objectType
matches this value.
subjectId string
Only return warrants with a subject whose objectId
matches this value.
subjectRelation string
Only return warrants with a subject whose relation
matches this value.
This endpoint supports all of the query parameters specified in the Pagination & Sorting section. The supported value for the sortBy
parameter is createdAt
.
Request
- cURL
- Java
- Node.js
curl "https://api.warrant.dev/v2/warrants" \
-H "Authorization: ApiKey YOUR_KEY"
WarrantListResult warrants = client.listWarrants(new WarrantFilters(), new ListParams().withLimit(25));
const warrants = await warrantClient.Warrant.list({ limit: 25 });
warrants = warrant.Warrant.list({"limit": 25})
warrants = Warrant::Warrant.list({ limit: 25 })
Response
Body
results array
A list of warrants.
prevCursor string
This attribute will be omitted from the response if there are no previous results to fetch.
nextCursor string
This attribute will be omitted from the response if there are no more results to fetch.
{
"results": [
{
"objectType": "role",
"objectId": "admin",
"relation": "member",
"subject": {
"objectType": "user",
"objectId": "tony-stark"
}
},
{
"objectType": "role",
"objectId": "manager",
"relation": "member",
"subject": {
"objectType": "user",
"objectId": "pepper-potts"
}
},
{
"objectType": "permission",
"objectId": "mark-IV:write",
"relation": "member",
"subject": {
"objectType": "role",
"objectId": "admin"
}
},
{
"objectType": "permission",
"objectId": "mark-IV:read",
"relation": "member",
"subject": {
"objectType": "role",
"objectId": "manager"
}
}
]
}