Filtering
Filter Query Syntax
For endpoints that support it, results can be narrowed using a filter[field][key(optional)][$op]=value query parameter convention.
field: The name of the filterable field, as documented on the endpoint.key(optional): For fields backed by a JSON object (likemetadata), the specific key to filter on.$op: The comparison operator to apply (see below).value: The value to compare against.
Example:
GET /v1/messages?filter[metadata][campaign_code][$eq]=SUMMER25
Supported Operators
| Operator | Meaning | Example |
|---|---|---|
$eq | Equal to | filter[channel][$eq]=email |
$ne | Not equal to | filter[channel][$ne]=sms |
$in | In a set of values (comma-separated) | filter[metadata][campaign_code][$in]=SUMMER25,WINTER25 |
$notIn | Not in a set of values (comma-separated) | filter[metadata][campaign_code][$notIn]=SUMMER25 |
$lt / $lte | Less than / less than or equal to | filter[created_at][$lte]=2026-01-01T00:00:00Z |
$gt / $gte | Greater than / greater than or equal to | filter[created_at][$gte]=2026-01-01T00:00:00Z |
$null | Is null / is not null, given a boolean value | filter[campaign_id][$null]=true |
$contains | Substring match | filter[recipient][$contains]=@example.com |
Not every field accepts every operator. The set of operators available for a field is capped by its value type, and each endpoint's API reference documents the exact operators allowed for each of its filterable fields.
| Value type | Allowed operators |
|---|---|
| Boolean | $eq, $ne, $null |
| Enum / UUID | $eq, $ne, $null, $in, $notIn |
| Number | $eq, $ne, $null, $in, $notIn, $lt, $lte, $gt, $gte |
| Date / Datetime | $eq, $ne, $null, $lt, $lte, $gt, $gte |
| String | $eq, $ne, $null, $in, $notIn, $contains |
Object Fields
Fields backed by a JSON object, such as metadata, accept any key. The operator is then applied to that key's value:
filter[metadata][campaign_code][$eq]=SUMMER25
Combining Filters
Multiple filters, and multiple operators on the same field, can be combined in a single request. All conditions are combined with a logical AND:
GET /v1/messages?filter[created_at][$gte]=2026-01-01T00:00:00Z&filter[created_at][$lte]=2026-01-31T23:59:59Z&filter[channel][$eq]=email
Error Handling
If the field doesn't exist, doesn't accept a key, or the operator used isn't allowed for that field, the API rejects the request:
- HTTP Code:
400 Bad Request - Meaning: The filter could not be applied as written.
Error handling
The NMP API uses standard HTTP response codes to indicate the success or failure of a request. In the event of failure, the response body is always formatted in JSON and provides structured details to facilitate debugging.
Create an email content
The NMP (Numberly Martech Platform) enables the automation of email content creation via its API. This technical guide details the process of creating HTML content, managing hosted images, and integrating this content into your campaigns.