inndx
GitHub

URL patterns

Manage per-host URL pattern sets and test paths against them.

A URL pattern set classifies a host's URLs by category using regular expressions or URL-pattern matching.

These endpoints share the pagination and error conventions.

List pattern sets

GET/v1/patterns

Returns a page of pattern sets across all hosts, most recent first.

Query parametersin: query
page
string

Pagination cursor. See pagination.

per_page
numberdefault: 10

Maximum number of pattern sets to return.

min: 1max: 100
include_ids
string[]

Return only pattern sets with these IDs.

format: uuid
exclude_ids
string[]

Omit pattern sets with these IDs.

format: uuid
categories
string[]

Return only pattern sets in these categories.

articlesblogsproductsforumssectionsothers
formats
string[]

Return only pattern sets using these formats.

regexurl_pattern
host_hashes
string[]

Return only pattern sets for these host hashes.

hosts
string[]

Return only pattern sets for these domains.

created_before
string

Return only pattern sets created before this timestamp.

format: date-time
created_after
string

Return only pattern sets created after this timestamp.

format: date-time
Responses

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

List a host's pattern sets

GET/v1/hosts/{host_hash}/patterns

Returns a page of pattern sets for one 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 pattern sets to return.

min: 1max: 100
include_ids
string[]

Return only pattern sets with these IDs.

format: uuid
exclude_ids
string[]

Omit pattern sets with these IDs.

format: uuid
categories
string[]

Return only pattern sets in these categories.

articlesblogsproductsforumssectionsothers
formats
string[]

Return only pattern sets using these formats.

regexurl_pattern
created_before
string

Return only pattern sets created before this timestamp.

format: date-time
created_after
string

Return only pattern sets created after this timestamp.

format: date-time
Responses

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

Create a pattern set

POST/v1/hosts/{host_hash}/patterns

Creates a pattern set for a host. The {host_hash} path segment is the host's hash.

Request bodyin: body
category
stringrequired

The category the patterns classify URLs into.

articlesblogsproductsforumssectionsothers
patterns
objectrequired

The pattern definition. The shape is one of the variants below, distinguished by its format field.

id
string

The ID to assign. Generated when omitted.

format: uuid
One of
regex
format
string

Identifies a regular-expression pattern set.

regex
patterns
string[]

The regular expressions to match URLs against.

url_pattern
format
string

Identifies a URL-pattern pattern set.

url_pattern
patterns
string[]

The URL patterns to match URLs against.

Responses

curl -X POST 'http://localhost:8022/v1/hosts/9a3f…/patterns' \
  -H 'X-Tenant-Id: acme' \
  -H 'Content-Type: application/json' \
  -d '{
    "category": "articles",
    "patterns": { "format": "regex", "patterns": ["^/articles/.+$"] }
  }'

Get a pattern set

GET/v1/patterns/{patterns_id}

Returns a single pattern set by ID. The {patterns_id} path segment is the pattern set's UUID.

Responses

curl 'http://localhost:8022/v1/patterns/7c2b…' \
  -H 'X-Tenant-Id: acme'

Update a pattern set

PUT/v1/patterns/{patterns_id}

Replaces the patterns of a pattern set.

Request bodyin: body
patterns
objectrequired

A replacement pattern definition. The shape is one of the variants under Create a pattern set, distinguished by its format field.

Responses

curl -X PUT 'http://localhost:8022/v1/patterns/7c2b…' \
  -H 'X-Tenant-Id: acme' \
  -H 'Content-Type: application/json' \
  -d '{ "patterns": { "format": "regex", "patterns": ["^/blog/.+$"] } }'

Delete a pattern set

DELETE/v1/patterns/{patterns_id}

Deletes a pattern set.

Responses

curl -X DELETE 'http://localhost:8022/v1/patterns/7c2b…' \
  -H 'X-Tenant-Id: acme'

Match paths

POST/v1/patterns/{patterns_id}/match

Tests paths against a pattern set and reports which patterns matched.

Request bodyin: body
paths
string[]required

The paths to test against the pattern set.

min: 1max: 255
Responses

curl -X POST 'http://localhost:8022/v1/patterns/7c2b…/match' \
  -H 'X-Tenant-Id: acme' \
  -H 'Content-Type: application/json' \
  -d '{ "paths": ["/articles/hello-world"] }'

Search docs

Search the Self-host documentation