Skip to main content
This is currently only available for the Preview /meter-orders endpoint
All top-level API resources support filtering through query parameters. Nomos uses bracket notation for filters: filter[field][operator]=value.

Query Format

filter[<field>][<operator>]=<value>
Multiple filters are combined with AND logic.

Example

Filter active customers created after January 2024:
curl "https://api.nomos.energy/v2/customers?filter[status][eq]=active&filter[created_at][gte]=2024-01-01T00:00:00Z" \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'

Operators by Field Type

Available operators depend on the field type. Each endpoint documents which fields are filterable.

String Fields

OperatorDescriptionExample
eqExact matchfilter[email][eq][email protected]
neNot equalfilter[status][ne]=cancelled
containsCase-insensitive containsfilter[last_name][contains]=doe
starts_withCase-insensitive prefixfilter[email][starts_with]=john
ends_withCase-insensitive suffixfilter[email][ends_with][email protected]

Number Fields

OperatorDescriptionExample
eqEqual tofilter[amount][eq]=100
neNot equalfilter[amount][ne]=0
gtGreater thanfilter[amount][gt]=100
gteGreater than or equalfilter[amount][gte]=100
ltLess thanfilter[amount][lt]=1000
lteLess than or equalfilter[amount][lte]=1000

Date Fields

Dates must be in ISO 8601 format with timezone.
OperatorDescriptionExample
gteOn or afterfilter[created_at][gte]=2024-01-01T00:00:00Z
lteOn or beforefilter[created_at][lte]=2024-12-31T23:59:59Z

Boolean Fields

OperatorDescriptionExample
eqTrue or falsefilter[is_verified][eq]=true

Common Use Cases

Date Range

Get subscriptions created in January 2024:
curl "https://api.nomos.energy/v2/subscriptions?filter[created_at][gte]=2024-01-01T00:00:00Z&filter[created_at][lte]=2024-01-31T23:59:59Z" \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'

Multiple Values

Get customers with specific statuses:
curl "https://api.nomos.energy/v2/customers?filter[status][in]=active,pending" \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
Find customers with last name containing “Mueller”:
curl "https://api.nomos.energy/v2/customers?filter[last_name][contains]=Mueller" \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'

Non-Terminated Records

Get active subscriptions (not terminated):
curl "https://api.nomos.energy/v2/subscriptions?filter[terminated_at][is_null]=true" \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'

Combined with Pagination

Filters work seamlessly with pagination. Keep the same filter parameters when paginating:
curl "https://api.nomos.energy/v2/subscriptions?filter[status][eq]=active&limit=20&cursor=xxxx" \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'

Error Handling

Invalid filters return a 400 Bad Request with details about the issue.

Unknown Field

{
  "code": "VALIDATION_ERROR",
  "message": "Unknown filter field: 'unknown_field'"
}

Invalid Operator

{
  "code": "VALIDATION_ERROR",
  "message": "Operator 'contains' not allowed for field 'created_at' (type: date)"
}

Malformed Syntax

{
  "code": "VALIDATION_ERROR",
  "message": "Invalid filter syntax: 'filter[status]'. Expected format: filter[field][operator]=value"
}