---
updatedAt: 2026-08-01T11:27:33.000Z
agentTools:
  projectIndex: https://dev.kevel.com/llms.txt
---

# Update Distance Targeting Geometry

## Why Update Distance Targeting Geometry?

When you are working with distance targeting, you may occasionally wish to update the distance targeting geometry object to improve targeting for a flight. The Kevel API enables you to update the geometry object by using the Update Distance Targeting Geometry endpoint and making changes by making a `PUT` request to the endpoint and including the changes you would like to make to the geometry object.

This API call will then update the Distance targeting geometry object associated with the flight specified.

## API Syntax

When using the Update 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:

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

Where:

* `PUT` - 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

> 📘 Clearing attribute values
>
> To unset or clear an attribute, set its value to `NULL`.

<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}/distance/{GeometryID}": {
      "put": {
        "summary": "Update Distance Targeting Geometry",
        "description": "",
        "operationId": "updates-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
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "Distance": {
                    "type": "number",
                    "description": "The radius of the Distance geometry in kilometers. Min: 0.01, Max: 500 Optional on networks withuser-specified radius features enabled; omit for user-specified radius.",
                    "format": "float"
                  },
                  "Latitude": {
                    "type": "number",
                    "description": "The latitude of the Distance point. Saved up to 7 decimal places. Cannot be used with `StreetAddress`.",
                    "format": "float"
                  },
                  "Longitude": {
                    "type": "number",
                    "description": "The longitude of the Distance point. Saved up to 7 decimal places. Cannot be used with `StreetAddress`.",
                    "format": "float"
                  },
                  "StreetAddress": {
                    "type": "string",
                    "description": "The street address of the Distance point. This will be resolved to latitude and longitude. Cannot be used with `Latitude` and `Longitude` params."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"Distance\": 42,\n  \"StreetAddress\": \"1 Kevel Boulevard, Keveltown NC 27701\",\n  \"FlightId\": 12345,\n  \"Latitude\": 35.9950488,\n  \"Longitude\": -78.9081815,\n  \"Id\": 123\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "Distance": {
                      "type": "integer",
                      "example": 42,
                      "default": 0
                    },
                    "StreetAddress": {
                      "type": "string",
                      "example": "1 Kevel Boulevard, Keveltown NC 27701"
                    },
                    "FlightId": {
                      "type": "integer",
                      "example": 12345,
                      "default": 0
                    },
                    "Latitude": {
                      "type": "number",
                      "example": 35.9950488,
                      "default": 0
                    },
                    "Longitude": {
                      "type": "number",
                      "example": -78.9081815,
                      "default": 0
                    },
                    "Id": {
                      "type": "integer",
                      "example": 123,
                      "default": 0
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Unresolvable address": {
                    "value": "{\n  \"Errors\": [\n    {\n      \"message\": \"Address cannot be resolved\",\n      \"values\": {\n        \"Distance\": 42,\n        \"StreetAddress\": \"bad address\",\n        \"FlightId\": 12345\n      }\n    }\n  ]\n}"
                  },
                  "Validation errors": {
                    "value": "{\n  \"Errors\": [\n    {\n      \"path\": [\n        \"Latitude\"\n      ],\n      \"value\": 200,\n      \"message\": \"Value '200' at '[\\\"Latitude\\\"]' Decimal value must be <= 90.0.\"\n    },\n    {\n      \"path\": [\n        \"Longitude\"\n      ],\n      \"value\": 200,\n      \"message\": \"Value '200' at '[\\\"Longitude\\\"]' Decimal value must be <= 180.0.\"\n    },\n    {\n      \"path\": [\n        \"Distance\"\n      ],\n      \"value\": 700,\n      \"message\": \"Value '700' at '[\\\"Distance\\\"]' Decimal value must be <= 500.\"\n    }\n  ]\n}"
                  },
                  "Max geometries reached": {
                    "value": "{\n  \"Errors\": [\n    {\n      \"message\": \"Error inserting Geometry\",\n      \"values\": {\n        \"Distance\": 42,\n        \"Latitude\": 35.9950488,\n        \"Longitude\": -78.9081815,\n        \"FlightId\": 12345,\n        \"StreetAddress\": \"1 Adzerk Boulevard, Adzerktown NC 27701\"\n      }\n    }\n  ]\n}"
                  },
                  "Bad JSON": {
                    "value": "{\n  \"Errors\": \"Invalid JSON payload\"\n}"
                  }
                },
                "schema": {
                  "oneOf": [
                    {
                      "title": "Unresolvable address",
                      "type": "object",
                      "properties": {
                        "Errors": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "message": {
                                "type": "string",
                                "example": "Address cannot be resolved"
                              },
                              "values": {
                                "type": "object",
                                "properties": {
                                  "Distance": {
                                    "type": "integer",
                                    "example": 42,
                                    "default": 0
                                  },
                                  "StreetAddress": {
                                    "type": "string",
                                    "example": "bad address"
                                  },
                                  "FlightId": {
                                    "type": "integer",
                                    "example": 12345,
                                    "default": 0
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "title": "Validation errors",
                      "type": "object",
                      "properties": {
                        "Errors": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "example": "Latitude"
                                }
                              },
                              "value": {
                                "type": "integer",
                                "example": 200,
                                "default": 0
                              },
                              "message": {
                                "type": "string",
                                "example": "Value '200' at '[\"Latitude\"]' Decimal value must be <= 90.0."
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "title": "Max geometries reached",
                      "type": "object",
                      "properties": {
                        "Errors": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "message": {
                                "type": "string",
                                "example": "Error inserting Geometry"
                              },
                              "values": {
                                "type": "object",
                                "properties": {
                                  "Distance": {
                                    "type": "integer",
                                    "example": 42,
                                    "default": 0
                                  },
                                  "Latitude": {
                                    "type": "number",
                                    "example": 35.9950488,
                                    "default": 0
                                  },
                                  "Longitude": {
                                    "type": "number",
                                    "example": -78.9081815,
                                    "default": 0
                                  },
                                  "FlightId": {
                                    "type": "integer",
                                    "example": 12345,
                                    "default": 0
                                  },
                                  "StreetAddress": {
                                    "type": "string",
                                    "example": "1 Adzerk Boulevard, Adzerktown NC 27701"
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "title": "Bad JSON",
                      "type": "object",
                      "properties": {
                        "Errors": {
                          "type": "string",
                          "example": "Invalid JSON payload"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "503",
            "content": {
              "application/json": {
                "examples": {
                  "Geocoding unavailable": {
                    "value": "{\n  \"Errors\": [\n    {\n      \"message\": \"Geocoding service unavailable\"\n    }\n  ]\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "Errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "message": {
                            "type": "string",
                            "example": "Geocoding service unavailable"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false,
        "x-readme": {
          "code-samples": [
            {
              "language": "curl",
              "code": "## Using street address \n\ncurl -X PUT -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" -H \"Content-Type:application/json\" https://api.kevel.co/v1/flight/12345/distance/123 --data-binary '{\"Distance\":42.0,\"StreetAddress\":\"1 Adzerk Boulevard, Adzerktown NC 27701\"}'\n\n## Using longitude and latitude\n\ncurl -X PUT -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" -H \"Content-Type:application/json\" https://api.kevel.co/v1/flight/12345/distance/123 --data-binary '{\"Distance\":42.0,\"Latitude\":35.9950488,\"Longitude\":-78.9081815}'",
              "name": "cURL"
            },
            {
              "language": "javascript",
              "code": "const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\n// Using street address \n\nasync function updateDistanceTargeting() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications, logger});\n\n  let distanceTargeting = await client.run(\"distanceTargeting\", \"update\", {\n    flightId: 12345,\n    geometryId: 123,\n    distance: 42.0,\n    streetAddress: \"1 Adzerk Boulevard, Adzerktown NC 27701\"\n  });\n\n  console.log(distanceTargeting);\n}\nupdateDistanceTargeting()\n\n// Using longitude and latitude\n\nasync function updateDistanceTargeting() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications, logger});\n\n  let distanceTargeting = await client.run(\"distanceTargeting\", \"update\", {\n    flightId: 12345,\n    geometryId: 123,\n    distance: 42.0,\n    latitude: 35.9950488,\n    longitude: -78.9081815\n  });\n\n  console.log(distanceTargeting);\n}\nupdateDistanceTargeting()"
            },
            {
              "language": "ruby",
              "code": "require \"adzerk\"\n\n# Using street address \n\ndef update_distance_targeting()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    flight_id = 12345\n    geometry_id = 123\n    data = {\n        distance: 42,\n        street_address: \"1 Kevel Boulevard, Keveltown NC 27701\"\n    }\n    pp client.distance_targetings.update(flight_id, geometry_id, data)\nend\nupdate_distance_targeting()\n\n# Using longitude and latitude\n\ndef update_distance_targeting()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    flight_id = 12345\n    geometry_id = 123\n    data = {\n        distance: 42,\n        latitude: 35.9950488,\n        longitude: -78.9081815\n    }\n    pp client.distance_targetings.update(flight_id, geometry_id, data)\nend\nupdate_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
}
```