inndx
GitHub

Hosts

Read the hosts a crawl has seen and manage their labels.

A host is a domain the crawl has encountered, such as example.com. Each host has a hash, a hex-encoded value used to address it as a path segment and to identify it.

These endpoints share the pagination and error conventions.

List hosts

GET/v1/hosts

Returns a page of hosts the crawl has seen.

Query parametersin: query
page
string

Pagination cursor. See pagination.

per_page
numberdefault: 10

Maximum number of hosts to return.

min: 1max: 100
host_hashes
string[]

Return only hosts with these hashes.

hosts
string[]

Return only hosts with these exact domains.

labels
object

Return only hosts whose labels match every supplied key and value.

Responses

curl 'http://localhost:8022/v1/hosts?per_page=20' \
  -H 'X-Tenant-Id: acme'

Upsert hosts

PUT/v1/hosts

Inserts or updates a batch of hosts by domain.

Request bodyin: body
hosts
string[]required

The domains to insert or update.

min: 1max: 255
Responses

curl -X PUT 'http://localhost:8022/v1/hosts' \
  -H 'X-Tenant-Id: acme' \
  -H 'Content-Type: application/json' \
  -d '{ "hosts": ["example.com", "docs.example.com"] }'

Get a host

GET/v1/hosts/{host_hash}

Returns a single host by hash. The {host_hash} path segment is the host's hash.

Responses

curl 'http://localhost:8022/v1/hosts/9a2f…' \
  -H 'X-Tenant-Id: acme'
GET/v1/hosts/{host_hash}/links

Returns a page of links belonging to a host. The {host_hash} path segment is the host's hash.

Query parametersin: query
page
string

Pagination cursor. See pagination.

per_page
numberdefault: 10

Maximum number of links to return.

min: 1max: 100
url_hashes
string[]

Return only links with these hashes.

urls
string[]

Return only links with these exact URLs.

labels
object

Return only links whose labels match every supplied key and value.

Responses

curl 'http://localhost:8022/v1/hosts/9a2f…/links?per_page=20' \
  -H 'X-Tenant-Id: acme'

Get a host's labels

GET/v1/hosts/{host_hash}/labels

Returns the labels for a host. The {host_hash} path segment is the host's hash.

Responses

curl 'http://localhost:8022/v1/hosts/9a2f…/labels' \
  -H 'X-Tenant-Id: acme'

Set a host's labels

PUT/v1/hosts/{host_hash}/labels

Merges the supplied labels into a host's labels, replacing the value of any key that already exists.

Request bodyin: body
labels
objectrequired

String key and value pairs to set on the host.

Responses

curl -X PUT 'http://localhost:8022/v1/hosts/9a2f…/labels' \
  -H 'X-Tenant-Id: acme' \
  -H 'Content-Type: application/json' \
  -d '{ "labels": { "tier": "primary" } }'

Delete a host's labels

DELETE/v1/hosts/{host_hash}/labels

Deletes the named label keys from a host.

Query parametersin: query
keys
string[]

The label keys to delete.

Responses

curl -X DELETE 'http://localhost:8022/v1/hosts/9a2f…/labels?keys=tier' \
  -H 'X-Tenant-Id: acme'

Search docs

Search the Self-host documentation