# π¦ Distributions API Documentation
## Endpoint
GET /v1/distributions
------------------------------------------------------------------------
## Query Parameters
### π Pagination
----------------------------------------------------------------------------
Parameter Type Description
----------- -------- -------------------------------------------------------
`page` number Page number (default: 1)
`limit` number Number of items per page (default: 15, min: 1, max: 50)
----------------------------------------------------------------------------
------------------------------------------------------------------------
### π Filtering
You can filter by the following fields:
- `id`
- `name`
- `cname`
- `domain`
- `status`
- `domain_type`
- `cache_strategy`
- `organization_id`
- `certificate_id`
- `enable_ssl`
- `is_redirect_http_to_https`
- `is_http2`
- `is_http3`
- `is_cname_valid`
- `is_acme_challenge_valid`
- `le_issue`
- `created_at`
- `updated_at`
#### Operators
Operator Description
--------------- ------------------------------------------
`eq` Equals
`ne` Not equals
`like` Contains (case insensitive)
`not-like` Does not contain
`starts-with` Starts with
`ends-with` Ends with
`gt` Greater than
`gte` Greater than or equal
`lt` Less than
`lte` Less than or equal
`in` In list (comma-separated)
`not-in` Not in list
`null` Is null
`not-null` Is not null
`between` Between two values (comma-separated)
`not-between` Not between two values (comma-separated)
#### Example Filters
filter[name][starts-with]=cdn-
filter[status][in]=active,disabled
filter[enable_ssl][eq]=true
filter[created_at][between]=2025-01-01,2025-08-01
------------------------------------------------------------------------
### β Sorting
---------------------------------------------------------------------------
Parameter Description
----------- ---------------------------------------------------------------
`sort` Sort fields. Prefix with `-` for descending. Allowed:
`created_at`, `updated_at`, `name`, `status`, `domain_type`,
`cache_strategy`, `domain`, `cname`
---------------------------------------------------------------------------
#### Example Sorts
sort=-created_at
sort=name
sort=-created_at,name
------------------------------------------------------------------------
## π Example Requests
### 1. Prefix search + newest first
GET /v1/distributions?filter[name][starts-with]=cdn-&sort=-created_at
### 2. Status + type + alphabetical
GET /v1/distributions?filter[status][in]=active,disabled&filter[domain_type][eq]=system&sort=name
### 3. Created date range
GET /v1/distributions?filter[created_at][between]=2025-01-01,2025-08-01&sort=-created_at
### 4. SSL-only
GET /v1/distributions?filter[enable_ssl][eq]=true
------------------------------------------------------------------------
## β Success Response
Status: 200 OK
{
"success": true,
"count": 2,
"data": [
{
"id": "uuid",
"name": "cdn-example",
"status": "active",
"domain_type": "system",
"enable_ssl": true,
"created_at": "2025-02-01T12:00:00Z",
"updated_at": "2025-02-10T12:00:00Z"
}
]
}
------------------------------------------------------------------------
## β Error Response
Status: 400 Bad Request
{
"success": false,
"message": "Invalid filter query",
"errors": {
"filter": "Unsupported field or operator"
}
}