[POST] .../v1/region/edit
Edits region. Use this method to rename a region or move it to another parent in the region tree after reading the target record with Region/Get. The method validates id, checks region edit permission 446, verifies that the region exists, rejects parent_id equal to id, updates changed fields, writes an action log record, invalidates the region cache, sends the RegionEdited webhook and returns row_affected. The request body is required; name is optional, parent_id must not equal id and because the runtime model uses 0 as the default long value, omitting parent_id moves the region to the root. Missing body, invalid id, unknown region, parent_id equal to id, no changed fields, denied permission and database errors are returned as HTTP 200 ErrorResult business errors.
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| id | Int64 | Required | Region ID. |
| name | String | Optional | Region name. |
| parent_id | Int64 | Optional | Parent region ID. A value of 0 moves the region to the root level. |
Request Example
{
"id": 12,
"parent_id": 1,
"name": "Tashkent city"
}
Response Parameters
| Name | Type | Description |
|---|---|---|
| ok | Boolean | Indicates whether the request completed successfully. |
| result | Update | Update operation result. |
Response Example
{
"ok": true,
"result": {
"row_affected": 1,
"ids": null
}
}