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
/v1/patternsReturns a page of pattern sets across all hosts, most recent first.
- 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
curl 'http://localhost:8022/v1/patterns?per_page=20' \
-H 'X-Tenant-Id: acme'List a host's pattern sets
/v1/hosts/{host_hash}/patternsReturns a page of pattern sets for one host. The {host_hash} path segment is the host's hash.
- 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
curl 'http://localhost:8022/v1/hosts/9a3f…/patterns' \
-H 'X-Tenant-Id: acme'Create a pattern set
/v1/hosts/{host_hash}/patternsCreates a pattern set for a host. The {host_hash} path segment is the host's hash.
- 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
formatfield.- id string
The ID to assign. Generated when omitted.
format: uuid
- format string
Identifies a regular-expression pattern set.
regex- patterns string[]
The regular expressions to match URLs against.
- format string
Identifies a URL-pattern pattern set.
url_pattern- patterns string[]
The URL patterns to match URLs against.
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
/v1/patterns/{patterns_id}Returns a single pattern set by ID. The {patterns_id} path segment is the pattern set's UUID.
curl 'http://localhost:8022/v1/patterns/7c2b…' \
-H 'X-Tenant-Id: acme'Update a pattern set
/v1/patterns/{patterns_id}Replaces the patterns of a pattern set.
- patterns objectrequired
A replacement pattern definition. The shape is one of the variants under Create a pattern set, distinguished by its
formatfield.
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
/v1/patterns/{patterns_id}Deletes a pattern set.
curl -X DELETE 'http://localhost:8022/v1/patterns/7c2b…' \
-H 'X-Tenant-Id: acme'Match paths
/v1/patterns/{patterns_id}/matchTests paths against a pattern set and reports which patterns matched.
- paths string[]required
The paths to test against the pattern set.
min: 1max: 255
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"] }'