API filtering
Marcel Ursprung avatar
Written by Marcel Ursprung
Updated over a week ago

URI Encoding

All examples below are formatted for readability, actual GET requests require URI encoding. See example below vs the URI encoded equivalent.

Formatted for readability:


URI encoded equivalent:


TIP: Constructing manual URI encoded filters queries

To manually create URI encoded filter queries use the handy jQuery.param() function from your browser's console on any website with jQuery installed. 

   filter: {
      email: {
         $in: [



Simple filtering with GET requests

Return all contacts with the first name of "Marcel"


Multiple filters can be appended, and they will be joined with a logical AND operator.
The example below will return all contacts with the first name "Martin" and the email "martin@envoke.com".


Filtering Keywords & Operators

NOTE: All examples will be in displayed with pretty printed JSON for readability, but actual GET requests will require URI encoding.

Filters support nested levels of operators, and the filter object is modelled on that of mongoDB

The supported keywords are:

  • $and = Logical AND. This is the default operator and is not required in most cases as two filters at the same level will produce an $and

  • $or = Logical OR 

  • $ne = Not equal

  • $in = Match value in a set (can replace many OR conditions)

  • $regex = Match a regex pattern

  • $gt = Greater than

  • $lt = Less than

  • $gte = Greater than or equal

  • $lte = Less than or equal

NOTE: Not all fields support every operator. Unsupported fields will return as a validation error.

Example request showing a logical AND filter containing a regex match plus additional sort, limit and skip:

   "filter": {
      "marketing_rating_status": "PASSED_TO_SALES",
      "contact.email": {
         "$regex": "envoke|bettermail|agito"
   "sort": {
      "contact.email": "ASC"
   "limit": 1,
   "skip": 5

URI encoded equivalent GET Request


Example OR filter 

   filter: {
      $or: [
         { first_name: "Marcel" },
         { first_name: "Marcus" }

URI encoded equivalent GET Request


Did this answer your question?