---
updatedAt: 2026-05-27T10:18:53.000Z
agentTools:
  projectIndex: https://gethapn.readme.io/llms.txt
---

# Update boundary

Updates an existing boundary using a boundary identifier.

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "description": "The Hapn API is an HTTP interface for managing devices, accounts, and cloud data.",
    "version": "1.0.0",
    "title": "Hapn API",
    "termsOfService": "https://gethapn.com/terms",
    "contact": {
      "name": "Dev",
      "email": "developer@gethapn.com",
      "url": "http://gethapn.com"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
    }
  },
  "servers": [
    {
      "url": "https://api.iotgps.io/v1",
      "description": "Prod"
    },
    {
      "url": "https://api-dev.iotgps.io/v1",
      "description": "Dev"
    }
  ],
  "paths": {
    "/boundaries/{boundaryId}": {
      "put": {
        "summary": "Update boundary",
        "tags": [
          "Boundaries"
        ],
        "operationId": "put-boundaries",
        "description": "Updates an existing boundary using a boundary identifier.",
        "parameters": [
          {
            "name": "boundaryId",
            "in": "path",
            "required": true,
            "description": "Id of the boundary",
            "schema": {
              "type": "number"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateBoundaryBody"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Update boundary result",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessResponse"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "result": {
                          "$ref": "#/components/schemas/Boundary"
                        }
                      }
                    }
                  ]
                },
                "examples": {
                  "example-1": {
                    "value": {
                      "success": true,
                      "message": "ok",
                      "result": {
                        "name": "Turner Towers",
                        "type": "P",
                        "created": "2022-04-23T12:57:14.000Z",
                        "modified": "2022-04-23T12:57:14.000Z",
                        "location": "115 Eastern Parkway, Brooklyn, New York 11238, United States",
                        "color": "#9b59b6",
                        "status": "active",
                        "geometry": {
                          "id": "033c88d812c21bbaabaa5f650e267156",
                          "type": "Feature",
                          "properties": {},
                          "geometry": {
                            "coordinates": [
                              [
                                -73.96689197286175,
                                40.67429897688385
                              ],
                              [
                                -73.96285891553887,
                                40.67351038085229
                              ],
                              [
                                -73.96255958706571,
                                40.67145520797439
                              ],
                              [
                                -73.96747487567782,
                                40.67269787821573
                              ],
                              [
                                -73.96689197286175,
                                40.67429897688385
                              ]
                            ],
                            "type": "Polygon"
                          }
                        },
                        "radiusDisplayUnit": "m"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/BoundaryNotFound"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Boundary": {
        "type": "object",
        "x-examples": {
          "example-1": {
            "boundaryId": 316385,
            "name": "Turner Towers",
            "created": "2021-04-23T12:57:14.000Z",
            "modified": "2021-04-23T12:57:14.000Z",
            "location": "115 Eastern Parkway, Brooklyn, New York 11238, United States",
            "color": "#9b59b6",
            "status": "active",
            "geometry": {
              "id": "033c88d812c21bbaabaa5f650e267156",
              "type": "Feature",
              "properties": {},
              "geometry": {
                "coordinates": [
                  [
                    [
                      -73.96689197286175,
                      40.67429897688385
                    ],
                    [
                      -73.96285891553887,
                      40.67351038085229
                    ],
                    [
                      -73.96255958706571,
                      40.67145520797439
                    ],
                    [
                      -73.96747487567782,
                      40.67269787821573
                    ],
                    [
                      -73.96689197286175,
                      40.67429897688385
                    ]
                  ]
                ],
                "type": "Polygon"
              }
            }
          }
        },
        "description": "",
        "properties": {
          "boundaryId": {
            "type": "integer"
          },
          "color": {
            "description": "Hex color code `#RRGGBB`",
            "type": "string"
          },
          "created": {
            "type": "string"
          },
          "geometry": {
            "description": "Polygon definition on GeoJSON format. For more info see: https://datatracker.ietf.org/doc/html/rfc7946",
            "type": "object"
          },
          "location": {
            "description": "Address",
            "type": "string"
          },
          "modified": {
            "type": "string"
          },
          "name": {
            "description": "Boundary name",
            "type": "string"
          },
          "status": {
            "description": "Boundary status",
            "enum": [
              "active",
              "deleted"
            ]
          }
        }
      },
      "UpdateBoundaryBody": {
        "type": "object",
        "x-examples": {
          "example-1": {
            "name": "Turner Towers",
            "location": "115 Eastern Parkway, Brooklyn, New York 11238, United States",
            "color": "#9b59b6",
            "status": "active",
            "geometry": {
              "id": "033c88d812c21bbaabaa5f650e267156",
              "type": "Feature",
              "properties": {},
              "geometry": {
                "coordinates": [
                  [
                    [
                      -73.96689197286175,
                      40.67429897688385
                    ],
                    [
                      -73.96285891553887,
                      40.67351038085229
                    ],
                    [
                      -73.96255958706571,
                      40.67145520797439
                    ],
                    [
                      -73.96747487567782,
                      40.67269787821573
                    ],
                    [
                      -73.96689197286175,
                      40.67429897688385
                    ]
                  ]
                ],
                "type": "Polygon"
              }
            }
          }
        },
        "description": "Update boundary request body",
        "properties": {
          "color": {
            "description": "Hex color code `#RRGGBB`",
            "type": "string"
          },
          "geometry": {
            "description": "Polygon definition on GeoJSON format. For more info see: https://datatracker.ietf.org/doc/html/rfc7946",
            "type": "object"
          },
          "location": {
            "description": "Address",
            "type": "string"
          },
          "name": {
            "description": "Boundary name",
            "type": "string"
          },
          "status": {
            "description": "Boundary status",
            "enum": [
              "active",
              "deleted"
            ]
          }
        },
        "required": [
          "color",
          "geometry",
          "name",
          "location",
          "status"
        ]
      },
      "SuccessResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "message": {
            "type": "string"
          },
          "result": {
            "type": "object"
          }
        },
        "required": [
          "message",
          "success"
        ],
        "x-examples": {
          "example-1": {
            "value": {
              "success": true,
              "message": "ok",
              "result": {
                "imei": "12345"
              }
            }
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "success",
          "message"
        ],
        "x-examples": {
          "example-1": {
            "value": {
              "success": false,
              "message": "Unauthorized"
            }
          }
        }
      }
    },
    "responses": {
      "BoundaryNotFound": {
        "description": "The specified resource was not found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "example-1": {
                "value": {
                  "success": false,
                  "message": "Boundary Not Found"
                }
              }
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Unauthorized",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "example-1": {
                "value": {
                  "success": false,
                  "message": "Unauthorized"
                }
              }
            }
          }
        }
      },
      "Error": {
        "description": "Server error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "example-1": {
                "value": {
                  "success": false,
                  "message": "Error"
                }
              }
            }
          }
        }
      }
    },
    "securitySchemes": {
      "OAuth2": {
        "type": "oauth2",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://auth.usehapn.com/oauth2/token",
            "scopes": {}
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Boundaries",
      "description": "User's boundaries"
    }
  ],
  "security": [
    {
      "OAuth2": []
    }
  ]
}
```