Create Flight Categories

Why create a flight category?

When you are working with flights and campaigns, you may wish to add a category to this flight. The Create Flight Categories API endpoint will add this category to the flight; however, if the category does not exist, this API call will create the category and then add it to the flight.

The JSON response will include the unique Flight Category ID that can be used to remove the category from the flight.

API syntax

When using the Create Flight Categories API, 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/flight/{FlightID}/category

Where:

FlightID

Field Type Requirement Description
FlightID int32 required ID of the Flight
Name string required The category's name
Id int32 optional The category ID. If the category is new to your network, this field is optional

Response Format

200

{
  "Id": 4567,
  "Name": "Sports"
}

Creating a new category:

curl -X POST -H 'X-Adzerk-ApiKey:<APIKEY>' -H "Content-Type:application/json" "https://api.kevel.co/v1/flight/12345/category" --data-binary '{"Name":"Sports"}'

Linking an existing category to the flight:

curl -X POST -H 'X-Adzerk-ApiKey:<APIKEY>' -H "Content-Type:application/json" "https://api.kevel.co/v1/flight/12345/category" --data-binary '{"Name":"Sports","Id":4567}'