---
updatedAt: 2025-09-18T22:00:33.000Z
agentTools:
  projectIndex: https://dev.kevel.com/llms.txt
---

# Delete Distance Targeting Geometry

## Why Delete Distance Targeting Geometry?

You may find it necessary to remove a distance targeting geometry object from a flight when you want to change the targeting parameters for that flight. The Kevel API enables you to delete a distance targeting geometry object using the `DELETE` call to the Distance Targeting Geometry API endpoint. When you make this request, the geometry object associated with the flight you specified, using `FlightID` will be removed from the flight.

## API Syntax

When using the Delete Distance Targeting Geometry API endpoint, 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:

`DELETE https://api.kevel.co/v1/flight/{FlightID}/distance/{GeometryID}`

Where:

* `DELETE` - 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.
* `distance` - the distance targeting geometry object that contains the `Distance`, `Latitude`, `Longitude`, and `StreetAddress` body parameters used for distance targeting.
* `GeometryID` - The ID of the Distance Targeting geometry

# 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}/distance/{GeometryID}": {
      "delete": {
        "summary": "Delete Distance Targeting Geometry",
        "description": "",
        "operationId": "delete-geodistance-targeting-geometry",
        "parameters": [
          {
            "name": "FlightID",
            "in": "path",
            "description": "The ID of the flight",
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "required": true
          },
          {
            "name": "GeometryID",
            "in": "path",
            "description": "The ID of the Distance Targeting geometry",
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "## No response body"
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "text/plain": {
                "examples": {
                  "Not found": {
                    "value": "{\n  \"message\": \"GeoDistance Targeting Geometry not found.\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "GeoDistance Targeting Geometry not found."
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false,
        "x-readme": {
          "code-samples": [
            {
              "language": "curl",
              "code": "curl -X DELETE -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" https://api.kevel.co/v1/flight/12345/distance/1234 \n",
              "name": "cURL"
            },
            {
              "language": "javascript",
              "code": "const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function deleteDistanceTargeting() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications, logger});\n\n  let distanceTargeting = await client.run(\"distanceTargeting\", \"delete\", {\n    flightId: 12345,\n    geometryId: 123\n  });\n    \n  console.log(distanceTargeting);\n}\ndeleteDistanceTargeting()"
            },
            {
              "language": "ruby",
              "code": "require \"adzerk\"\n\ndef delete_distance_targeting()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    flight_id = 12345\n    geometry_id = 123\n    pp client.distance_targetings.delete(flight_id, geometry_id)\nend\ndelete_distance_targeting()"
            }
          ],
          "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
}
```