Get Warrants
Get a collection of warrants. Can be filtered down by specific objectType
, objectId
and/or relation
.
GET /v1/warrants?objectType=TYPE&objectId=ID&relation=RELATION
Parameters
Parameter | Description | Type | Required |
---|---|---|---|
objectType | Filter for warrants by a specific 'objectType'. | Query param | no |
objectId | Filter for warrants by a specific object with given id. | Query param | no |
relation | Filter for warrants containing the given 'relation'. | Query param | no |
Request
- Curl
- Go
- Java
- Node.js
- Python
- Ruby
curl "https://api.warrant.dev/v1/warrants?objectType=role" \
-H "Authorization: ApiKey YOUR_KEY"
warrants, err := client.ListWarrants(warrant.ListWarrantParams{
ObjectType: "role",
})
if err != nil {
// handle error
}
try {
Map<String, Object> params = new HashMap<>();
params.put("objectType", "role");
Warrant[] warrants = client.listWarrants(params);
} catch (WarrantException e) {
// Handle error
}
warrants = client.list_warrants(object_type="role", object_id="", relation="")
client
.listWarrants({ objectType: "role"})
.then((warrants) => {
// process warrants
}
.catch((error) => console.log(error));
Warrant::Warrant.list(object_type: "role")
Response
[
{
"objectType": "role",
"objectId": "34",
"relation": "member",
"subject": {
"objectType": "user",
"objectId": "test-user1"
}
},
{
"objectType": "role",
"objectId": "36",
"relation": "member",
"subject": {
"objectType": "user",
"objectId": "test-user2"
}
}
]