Links · links.facets
GET/links/facetslinks.facets
List link facets
The values the workspace links can be filtered by, with the same filter[...] parameters as GET /links.
- Base URL
- https://api.redirhub.com/v1
- Auth
- Bearer token
- Idempotent
- Yes
- Returns
- application/json
The request
Call GET /links/facets with your bearer token. Narrow or order the result with the query parameters below.
# List link facets
curl "https://api.redirhub.com/v1/links/facets" \
-H "Authorization: Bearer $REDIRHUB_TOKEN"Query parameters
| Parameter | Description |
|---|---|
| hosts_searchoptionalstring | null · max 255 | |
| hosts_limitoptionalinteger | null · ≤ 200 · ≥ 1 | |
| sortoptionalstring | Sort results by field. Prefix with - for descending order. Available sorts: id, created_at, updated_at, total_clicksid-idcreated_at-created_atupdated_at-updated_attotal_clicks-total_clicks |
| filteroptionalobject | Filter results by one or more fields. Available filters: id, host, path, tld, handler, type, destination, search, tags, traffic, dns_correct, status, created_after, created_before |
| filter[id]optionalstring | |
| filter[host]optionalstring | A hostname already connected to the workspace. See List hostnames. |
| filter[path]optionalstring | |
| filter[tld]optionalstring | |
| filter[handler]optionalstring | What the link is: short-url or qr for a short link on a short-link hostname, redirect or migration for a redirect on the redirected hostname. |
| filter[type]optionalstring | Record type. List the available types with GET /shared/types. |
| filter[destination]optionalstring | Where matching traffic is sent. |
| filter[search]optionalstring | |
| filter[tags]optionalstring | Freeform labels. Filter on them with filter[tags]. |
| filter[traffic]optionalstring | |
| filter[dns_correct]optionalstring | |
| filter[status]optionalstring | The HTTP status code used for the redirect response. |
| filter[created_after]optionalstring | |
| filter[created_before]optionalstring |
The response
A 200 returns the record as JSON.
{
"total": 1,
"hosts": [
{
"value": "string",
"count": 1
}
],
"hosts_total": 1,
"tags": [
"campaign",
"q2"
],
"untagged": 1,
"qr": {
"qr_codes": 1,
"links_with_qr": 1
},
"kinds": {
"link": 1,
"qr": 1,
"redirect": 1,
"migration": 1,
"html": 1
},
"health": {
"paused": 1,
"dns_issue": 1,
"no_clicks": 1
},
"created": {
"last_7_days": 1,
"last_30_days": 1
},
"last_changed_at": "string",
"refreshing": true
}Status codes
200
SuccessCounts per value over the records the current filter matches, for suggested filters: the largest domains (20 unless
hosts_limit says otherwise, up to 200, narrowed by hosts_search) and how many domains there are in all, the 20 largest tags, untagged records, QR codes (created as one, or links that also have one), records per kind (link, qr, redirect, migration, and html for HTML pages), health (paused, DNS issue, no clicks in the last four weeks), records created in the last 7 and 30 days, and when a record was last created or changed (last_changed_at, null without records). Counts are kept for a minute; for a workspace with 10,000 links or more, older counts are returned at once with refreshing true while fresh ones are computed, so ask again a few seconds later. The first time such a workspace is counted, only total comes back, with refreshing true, until the rest is computed.401
UnauthenticatedUnauthenticated
422
Validation failedA field was rejected.
errors lists every field with its reason.429
Too many requestsToo many requests
