Tenants
Tenants are a core part of Unblind, the very reason Unblind exists is so you can have observability over your tenants. On this page, we'll dive into the different tenant endpoints you can use to manage tenants and query their telemetry using Unblind API. We'll look at how to query, list, get or update tenants.
The tenant model
The tenant model contains all the metadata about a tenant. Tenant data is derived from the tenant ID attributes sent to Unblind.
Properties
- Name
id- Type
- string
- Description
Unique identifier for the tenant.
- Name
name- Type
- string
- Description
The name for the tenant.
List all tenants
This endpoint allows you to retrieve a paginated list of all your active tenants. By default, a maximum of a hundred tenants are shown per page.
Optional attributes
- Name
limit- Type
- integer
- Description
Limit the number of tenants returned.
Request
curl https://api.unblind.dev/v1/tenants \
-X 'GET' \
-H "Authorization: Bearer <API_KEY>" \
-d limit=100
Response
{
"next_page": null,
"data": [
{
"id": "WAz8eIbvDR60rouK",
"name": "Acme, Inc.",
},
{
"id": "hSIhXBhNe8X1d8Et"
// ...
}
]
}
Retrieve a tenant
This endpoint allows you to retrieve a tenant by providing their id. Refer to the list at the top of this page to see which properties are included with tenant objects.
Request
curl https://api.unblind.dev/v1/tenants/WAz8eIbvDR60rouK \
-X 'GET' \
-H "Authorization: Bearer <API_KEY>"
Response
{
"id": "WAz8eIbvDR60rouK",
"name": "Acme, Inc."
}
Update a tenant
This endpoint allows you to perform an update on a tenant. Currently, the only attribute that can be updated on tenants is the name attribute which controls how a tenant appears or gets searched in Unblind.
Optional attributes
- Name
name- Type
- string
- Description
The tenant name. By default, this is empty.
Request
curl https://api.unblind.dev/v1/tenants/WAz8eIbvDR60rouK \
-X 'PUT' \
-H "Authorization: Bearer <API_KEY>" \
-d name="Acme, Inc."
Response
{
"id": "WAz8eIbvDR60rouK",
"name": "Acme, Inc."
}
Query timeseries
This endpoint allows you to query a tenant's metric timeseries
Required query parameters
- Name
queries- Type
- object
- Description
Queries object. Fields map one to one metric tag to a value.
- Name
startTime- Type
- string
- Description
UNIX timestamp.
Optional query parameters
- Name
endTime- Type
- number
- Description
UNIX timestamp.
- Name
interval- Type
- number
- Description
Intervals of time to aggregate data.
Request
curl "https://api.unblind.dev/v1/tenants/WAz8eIbvDR60rouK/timeseries" \
-X POST \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"queries": [
{
"metrics": [
"nodejs.eventloop.delay.p50",
"nodejs.eventloop.delay.p99"
],
"groupBy": ["service.name"],
"operator": "max",
"attributes": { "host": ["web01"] }
}
],
"startTime": 1737168000000,
"endTime": 1737772799000
}'
Response
{
"metadata": [],
"query" :{},
"series": [
{
"name": "nodejs.eventloop.delay.p50",
"display_name": "NodeJS Event Loop Delay P50",
"unit": {
"name": "Milliseconds",
"short_name": "ms"
},
"length": 3,
"values": [
{ "timestamp": "2025-01-01T00:00:00Z", "value": 10 },
{ "timestamp": "2025-01-01T00:20:00Z", "value": 20 },
{ "timestamp": "2025-01-01T00:40:00Z", "value": 30 }
]
}
],
"times": [1763657608, 1763657608, 1763657608]
}
Query logs
This endpoint allows you to query a tenant's logs
Required query parameters
- Name
startTime- Type
- string
- Description
UNIX timestamp.
Optional query parameters
- Name
body- Type
- string
- Description
Body string.
- Name
span_id- Type
- string
- Description
Span ID.
- Name
trace_id- Type
- string
- Description
Trace ID.
- Name
severity- Type
- string
- Description
Severity text.
- Name
attributes- Type
- object
- Description
Attributes object.
- Name
endTime- Type
- number
- Description
UNIX timestamp.
- Name
page- Type
- string
- Description
next_pagevalue.
Request
curl -H "Authorization: Bearer <API_KEY>" \
"https://api.unblind.dev/v1/tenants/WAz8eIbvDR60rouK/logs" \
-X POST \
-H "Content-Type: application/json" \
-d '{
"startTime": 1737168000000,
"endTime": 1737772799000,
"attributes": {
"host.arch": "arm64"
}
}'
Response
{
"next_page": "Nabfwen8qsKdE7jk"
"data": [
{
"body": ""
}
]
}