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

# 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:

`POST https://api.kevel.co/v1/flight/{FlightID}/category`

Where:

* `POST` - the type of API request being made.
* `https://api.kevel.co` - the URL for the request.
* `v1` - the API version.
* `flight`- the API endpoint being called.
* `FlightID`- The ID associated with the flight.
* `category`- The individual category associated with the flight.

<br />

# 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/flight/{FlightID}/category": {
      "post": {
        "summary": "Create Flight Categories",
        "description": "",
        "operationId": "create-flight-categories",
        "parameters": [
          {
            "name": "FlightID",
            "in": "path",
            "description": "ID of the Flight",
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "Name"
                ],
                "properties": {
                  "Name": {
                    "type": "string",
                    "description": "The category's name"
                  },
                  "Id": {
                    "type": "integer",
                    "description": "The category ID. If the category is new to your network, this field is optional",
                    "format": "int32"
                  }
                }
              },
              "examples": {
                "JSON": {
                  "value": {
                    "Id": 4567,
                    "Name": "Sports"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"Id\":4567,\n  \"Name\":\"Sports\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "Id": {
                      "type": "integer",
                      "example": 4567,
                      "default": 0
                    },
                    "Name": {
                      "type": "string",
                      "example": "Sports"
                    }
                  }
                }
              }
            }
          }
        },
        "x-readme": {
          "code-samples": [
            {
              "language": "curl",
              "code": "## Creating a new category:\ncurl -X POST -H 'X-Adzerk-ApiKey:<APIKEY>' -H \"Content-Type:application/json\" \"https://api.kevel.co/v1/flight/12345/category\" --data-binary '{\"Name\":\"Sports\"}'\n\n## Linking an existing category to the flight:\ncurl -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}'"
            },
            {
              "language": "javascript",
              "code": "const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function createFlightCategory() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let flightCategory = await client.run(\"flightCategory\", \"create\", {\n    flightId: 12345,\n    name: \"Sports\"\n  });\n\n  console.log(flightCategory);\n}\n\ncreateFlightCategory();"
            },
            {
              "language": "ruby",
              "code": "require \"adzerk\"\n\ndef create_flight_category()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    flight_id = 12345\n    data = {\n        name: \"Test Flight Category\"\n    }\n    pp client.categories.create(flight_id, data)\nend\ncreate_flight_category()"
            }
          ],
          "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
}
```