# Project.update\_annotations()

**URL:** <https://community.labelstud.io/t/project-update-annotations/261>\
**Category:** Label Studio SDK\
**Created:** [June 27, 2024, 8:10am UTC](https://community.labelstud.io/t/project-update-annotations/261 "2024-06-27T08:10:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ras](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.labelstud.io/ras/32/264_2.png) [@ras](https://community.labelstud.io/u/ras)\
**Post date:** [June 27, 2024, 8:10am UTC](https://community.labelstud.io/t/project-update-annotations/261/1 "2024-06-27T08:10:41Z")

</div>

Hi,

I want to use the update\_annotation function to update the ‘polygonlabels’ value in my annotations. From what I can tell this value is under annotations \> result \> values \> polygonlabels. I want to change the value using the python sdk. Can anyone help?

---

<div class="post-metadata">

**Author:** ![caitlinhumansignal](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.labelstud.io/caitlinhumansignal/32/82_2.png) [@caitlinhumansignal](https://community.labelstud.io/u/caitlinhumansignal)\
**Post date:** [June 28, 2024, 2:29am UTC](https://community.labelstud.io/t/project-update-annotations/261/2 "2024-06-28T02:29:36Z")

</div>

You can try something like this:

```auto
from label_studio_sdk import Client

# Initialize the Label Studio client
ls = Client(url='https://your-label-studio-instance.com', api_key='your_api_key')

# Define the project ID and task ID
project_id = 1
task_id = 123

# Define the annotation ID you want to update
annotation_id = 456

# Define the new polygonlabels value
new_polygonlabels = [
    {
        "original_width": 1024,
        "original_height": 768,
        "image_rotation": 0,
        "value": {
            "points": [[10, 10], [20, 20], [30, 10]],
            "polygonlabels": ["NewLabel"]
        },
        "from_name": "label",
        "to_name": "image",
        "type": "polygonlabels"
    }
]

# Update the annotation
response = ls.update_annotation(
    task_id=task_id,
    annotation_id=annotation_id,
    result=new_polygonlabels
)

print(response)

```
