---
updatedAt: 2026-08-01T23:46:20.000Z
agentTools:
  projectIndex: https://dev.kevel.com/llms.txt
---

# Flight Filtering

## Why Filter Fights?

When you have a large number of flights, you may find it necessary to filter the number or results returned in a single request.

This API request returns a stream of line-delimited JSON where each line of output is a single JSON object representing one flight. The flight object contains the properties of the flight as well as an array of the "Ad IDs" associated with that flight.

> 📘 Note
>
> This endpoint does not return ad objects. By default, this endpoint returns all flights saved in an account, but you can use the query parameters to filter.

## Filtering Behaviors

Use the `beforeStartDate`, `afterStartDate`, `beforeEndDate`, and `afterEndDate` query parameters to filter flights by a range of time periods. For example, `?beforeStartDate=2017-01-01&afterStartDate=2016-11-30` returns all flights with a StartDate between 2016-12-01 and 2016-12-31. `?afterStartDate=2016-11-30` returns all flights with a `StartDate` of 2016-12-01 or later.

You can also use these query parameters in combination, which will only return flights that fall within *both* those ranges.

Besides `beforeEndDate` and `afterEndDate`, you can also include the `noEndDate=true` query parameter. This will return any flights without an `EndDate` set *in addition* to any flights filtered by an `EndDate` range.

> 👍 Important
>
> You should URL encode special characters when filtering with the `name` and `nameContains` parameters.

## API Syntax

When using the *Flight Filtering* API call, it is important to understand the syntax required to make the request. Because the Kevel API is a RESTful API, there is a specific request format that must be followed to ensure the endpoint can process the request. The format is:

`GET https://api.kevel.co/v1/fast/flight`

Where:

* `GET` - the type of API request being made.
* `https://api.kevel.co` - the URL for the request.
* `v1` - the API version.
* `fast` - the API endpoint being called.
* `flight` - The value returned from the

**Response Parameters**

> 📘 Note
>
> Along with flight information, additional response parameters will be returned with this request, which are listed in the table below.

<Table align={["left","left"]}>
  <thead>
    <tr>
      <th>
        Property
      </th>

      <th>
        Description
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `LastModifiedDate`
        (string)
      </td>

      <td>
        The date/time the flight was last updated
      </td>
    </tr>

    <tr>
      <td>
        `CustomFieldsJson`\
        (string)
      </td>

      <td>
        An object of custom fields available for the flight and their values
      </td>
    </tr>

    <tr>
      <td>
        `StartDate`\
        (string)
      </td>

      <td>
        The start date for the flight. YYYY-MM-DD HH:MM:SS
      </td>
    </tr>

    <tr>
      <td>
        `PriorityId`\
        (integer)
      </td>

      <td>
        The Priority's ID
      </td>
    </tr>

    <tr>
      <td>
        `IsDeleted`\
        (boolean)
      </td>

      <td>
        If the flight is set as deleted
      </td>
    </tr>

    <tr>
      <td>
        `Id`\
        (integer)
      </td>

      <td>
        The Flight's ID
      </td>
    </tr>

    <tr>
      <td>
        `IsNoDuplicates`\
        (boolean)
      </td>

      <td>
        If the flight is set to not serve more than once per ad request
      </td>
    </tr>

    <tr>
      <td>
        `IsArchived`\
        (boolean)
      </td>

      <td>
        If the flight is archived
      </td>
    </tr>

    <tr>
      <td>
        `RateType`\
        (integer)
      </td>

      <td>
        Enum value for the Rate of the flight
      </td>
    </tr>

    <tr>
      <td>
        `FreqCap`\
        (integer)
      </td>

      <td>
        The value of the frequency cap
      </td>
    </tr>

    <tr>
      <td>
        `IsCompanion`\
        (boolean)
      </td>

      <td>
        If the all the ads in the flight must be served together
      </td>
    </tr>

    <tr>
      <td>
        `CanPassback`\
        (boolean)
      </td>

      <td>
        If the flight can pass back to the next flight in an adChain
      </td>
    </tr>

    <tr>
      <td>
        `CapType`\
        (integer)
      </td>

      <td>
        Enum value for the Cap of the flight
      </td>
    </tr>

    <tr>
      <td>
        `Price`\
        (integer)
      </td>

      <td>
        The Flight's price
      </td>
    </tr>

    <tr>
      <td>
        `IsActive`\
        (boolean)
      </td>

      <td>
        If the flight is Active and available to serve
      </td>
    </tr>

    <tr>
      <td>
        `FreqCapType`\
        (integer)
      </td>

      <td>
        The unit of time for frequency capping
      </td>
    </tr>

    <tr>
      <td>
        `CustomTargeting`\
        (string)
      </td>

      <td>
        A JSON custom targeting query
      </td>
    </tr>

    <tr>
      <td>
        `IsTrackingConversions`\
        (boolean)
      </td>

      <td>
        If the flight is set to track conversions
      </td>
    </tr>

    <tr>
      <td>
        `FreqCapDuration`\
        (integer)
      </td>

      <td>
        How often a frequency cap should occur
      </td>
    </tr>

    <tr>
      <td>
        `PassbackSortOrder`\
        (integer)
      </td>

      <td>
        The order of the flight in its priority's adChain
      </td>
    </tr>

    <tr>
      <td>
        `GoalType`\
        (integer)
      </td>

      <td>
        Enum value for the Goal type of the flight
      </td>
    </tr>

    <tr>
      <td>
        `DailyCapAmount`\
        (integer)
      </td>

      <td>
        When a cap is set, the max events allowed per day
      </td>
    </tr>

    <tr>
      <td>
        `Name`\
        (string)
      </td>

      <td>
        The name of the flight
      </td>
    </tr>

    <tr>
      <td>
        `LifetimeCapAmount`\
        (integer)
      </td>

      <td>
        When a cap is set, the max events allowed per the lifetime of the flight
      </td>
    </tr>

    <tr>
      <td>
        `AdvertiserId`\
        (integer)
      </td>

      <td>
        The advertiser the flight belongs to
      </td>
    </tr>

    <tr>
      <td>
        `Keywords`\
        (string)
      </td>

      <td>
        The keyword targeting set on the flight
      </td>
    </tr>

    <tr>
      <td>
        `EndDate`\
        (string)
      </td>

      <td>
        The end date for the flight. YYYY-MM-DD HH:MM:SS
      </td>
    </tr>

    <tr>
      <td>
        `AdIds`\
        (array)
      </td>

      <td>
        The IDs of the ads associated with the flight
      </td>
    </tr>

    <tr>
      <td>
        `Impressions`\
        (integer)
      </td>

      <td>
        The Goal Amount of the flight
      </td>
    </tr>

    <tr>
      <td>
        `CampaignId`\
        (integer)
      </td>

      <td>
        The campaign the flight belongs to
      </td>
    </tr>
  </tbody>
</Table>

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "management-api-2",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.kevel.co"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "name": "X-Adzerk-ApiKey",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/v1/fast/flight": {
      "get": {
        "summary": "Flight Filtering",
        "description": "",
        "operationId": "flight-category",
        "parameters": [
          {
            "name": "isActive",
            "in": "query",
            "description": "Only return flights where `IsActive` is [true/false]. Default is `true`.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "isArchived",
            "in": "query",
            "description": "Only return flights where `IsArchived` is [true/false]. Default is `false`.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "beforeStartDate",
            "in": "query",
            "description": "Only return flights where `StartDate` is before the provided date. Format: `YYYY-MM-DD HH:MM:SS`; `HH:MM:SS` optional",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "afterStartDate",
            "in": "query",
            "description": "Only return flights where `StartDate` is after the provided date. Format: `YYYY-MM-DD HH:MM:SS`; `HH:MM:SS` optional",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "beforeEndDate",
            "in": "query",
            "description": "Only return flights where `EndDate` is before the provided date. Format: `YYYY-MM-DD HH:MM:SS`; `HH:MM:SS` optional",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "afterEndDate",
            "in": "query",
            "description": "Only return flights where `EndDate` is after the provided date. Format: `YYYY-MM-DD HH:MM:SS`; `HH:MM:SS` optional",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "noEndDate",
            "in": "query",
            "description": "Only return flights where `EndDate` is null",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "name",
            "in": "query",
            "description": "Only return flights where `Name` is an exact match of the query.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "nameContains",
            "in": "query",
            "description": "Only return flights where the given string is a substring of the `Name`. No wildcard characters are supported.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"LastModifiedDate\": \"2016-12-08T21:34:32Z\",\n  \"CustomFieldsJson\": \"{\\\"Currency\\\":\\\"USD: US Dollars\\\"}\",\n  \"StartDate\": \"2016-12-08T00:00:00Z\",\n  \"PriorityId\": 1234,\n  \"IsDeleted\": false,\n  \"Id\": 1234567,\n  \"IsNoDuplicates\": false,\n  \"IsArchived\": null,\n  \"RateType\": 1,\n  \"FreqCap\": 0,\n  \"IsCompanion\": false,\n  \"CanPassback\": false,\n  \"CapType\": 1,\n  \"Price\": 0,\n  \"IsActive\": true,\n  \"FreqCapType\": 0,\n  \"CustomTargeting\": \"\",\n  \"IsTrackingConversions\": false,\n  \"FreqCapDuration\": 0,\n  \"PassbackSortOrder\": null,\n  \"GoalType\": 2,\n  \"DailyCapAmount\": null,\n  \"Name\": \"There's a Flight\",\n  \"LifetimeCapAmount\": null,\n  \"AdvertiserId\": 12345,\n  \"Keywords\": \"\",\n  \"EndDate\": null,\n  \"AdIds\": [\n    1234567\n  ],\n  \"Impressions\": 100,\n  \"CampaignId\": 123456\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "LastModifiedDate": {
                      "type": "string",
                      "example": "2016-12-08T21:34:32Z"
                    },
                    "CustomFieldsJson": {
                      "type": "string",
                      "example": "{\"Currency\":\"USD: US Dollars\"}"
                    },
                    "StartDate": {
                      "type": "string",
                      "example": "2016-12-08T00:00:00Z"
                    },
                    "PriorityId": {
                      "type": "integer",
                      "example": 1234,
                      "default": 0
                    },
                    "IsDeleted": {
                      "type": "boolean",
                      "example": false,
                      "default": true
                    },
                    "Id": {
                      "type": "integer",
                      "example": 1234567,
                      "default": 0
                    },
                    "IsNoDuplicates": {
                      "type": "boolean",
                      "example": false,
                      "default": true
                    },
                    "IsArchived": {},
                    "RateType": {
                      "type": "integer",
                      "example": 1,
                      "default": 0
                    },
                    "FreqCap": {
                      "type": "integer",
                      "example": 0,
                      "default": 0
                    },
                    "IsCompanion": {
                      "type": "boolean",
                      "example": false,
                      "default": true
                    },
                    "CanPassback": {
                      "type": "boolean",
                      "example": false,
                      "default": true
                    },
                    "CapType": {
                      "type": "integer",
                      "example": 1,
                      "default": 0
                    },
                    "Price": {
                      "type": "integer",
                      "example": 0,
                      "default": 0
                    },
                    "IsActive": {
                      "type": "boolean",
                      "example": true,
                      "default": true
                    },
                    "FreqCapType": {
                      "type": "integer",
                      "example": 0,
                      "default": 0
                    },
                    "CustomTargeting": {
                      "type": "string",
                      "example": ""
                    },
                    "IsTrackingConversions": {
                      "type": "boolean",
                      "example": false,
                      "default": true
                    },
                    "FreqCapDuration": {
                      "type": "integer",
                      "example": 0,
                      "default": 0
                    },
                    "PassbackSortOrder": {},
                    "GoalType": {
                      "type": "integer",
                      "example": 2,
                      "default": 0
                    },
                    "DailyCapAmount": {},
                    "Name": {
                      "type": "string",
                      "example": "There's a Flight"
                    },
                    "LifetimeCapAmount": {},
                    "AdvertiserId": {
                      "type": "integer",
                      "example": 12345,
                      "default": 0
                    },
                    "Keywords": {
                      "type": "string",
                      "example": ""
                    },
                    "EndDate": {},
                    "AdIds": {
                      "type": "array",
                      "items": {
                        "type": "integer",
                        "example": 1234567,
                        "default": 0
                      }
                    },
                    "Impressions": {
                      "type": "integer",
                      "example": 100,
                      "default": 0
                    },
                    "CampaignId": {
                      "type": "integer",
                      "example": 123456,
                      "default": 0
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false,
        "x-readme": {
          "code-samples": [
            {
              "language": "curl",
              "code": "curl -N \"https://api.kevel.co/v1/fast/flight\" -H \"X-Adzerk-ApiKey:<API-KEY>\"\n\n# With multiple arguments\ncurl -N \"https://api.kevel.co/v1/fast/flight?beforeStartDate=2014-01-01&noEndDate=true&isActive=false&nameContains=shoe\" -H \"X-Adzerk-ApiKey:<API-KEY>\""
            },
            {
              "language": "javascript",
              "code": "const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function filterFlights() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let flights = await client.run(\"flight\", \"filter\", {nameContains: \"of\"});\n  console.log(flights);\n\n  let summaries = flights.map(a => `${a.id} - ${a.name} - ${a.campaignId}`);\n  console.log(summaries);\n}\n\nfilterFlights();"
            },
            {
              "language": "ruby",
              "code": "require \"adzerk\"\n\ndef filter_flights()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    flight_data = {\n        is_active: true,\n        name_contains: \"of\"\n    }\n    pp client.flights.filter_flights(flight_data)\nend\nfilter_flights()"
            }
          ],
          "samples-languages": [
            "curl",
            "javascript",
            "ruby"
          ]
        }
      }
    }
  },
  "x-readme": {
    "headers": [
      {
        "key": "X-Adzerk-Sdk-Version",
        "value": "Readme.io:ManagementAPI2"
      }
    ],
    "explorer-enabled": false,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```