Get Tenants for User
Get all tenants that a specific user
is associated to.
caution
This endpoint has been deprecated and will be phased out at the end of 2023. Please update any existing usages of it to use the Query endpoint instead.
Endpoint
GET /v1/users/:userId/tenants
Request
- cURL
- Go
- Java
- Node.js
- Python
- Ruby
- PHP
curl "https://api.warrant.dev/v1/users/15ksdf87a23g/tenants" \
-H "Authorization: ApiKey YOUR_KEY"
userTenants, err := tenant.ListTenantsForUser("15ksdf87a23g", &warrant.ListTenantParams{
ListParams: warrant.ListParams{
Limit: 10,
},
})
if err != nil {
// handle error
}
ListResult<Tenant> tenants = client.listTenantsForUser("15ksdf87a23g", new ListParams().withLimit(10));
// Class method
const tenants = await warrantClient.Tenant.listTenantsForUser("15ksdf87a23g", { limit: 10 });
// Instance method
const user = await warrantClient.User.get("15ksdf87a23g");
const tenants = await user.listTenants({ limit: 10 });
user_tenants = warrant.Tenant.list_for_user("15ksdf87a23g", {"limit": 10})
# Class Method
user_tenants = Warrant::Tenant.list_for_user("15ksdf87a23g")
# Instance Method
user = Warrant::User.get("15ksdf87a23g")
user_tenants = user.list_tenants
Response
[
{
"tenantId": "dunder-mifflin",
"name": "Dunder Mifflin"
},
{
"tenantId": "In2sgYSjVG8etPU2",
"name": "tenant-name"
}
]