> ## Documentation Index
> Fetch the complete documentation index at: https://docs.atomscale.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Sample Annotation

> Update fields on an existing spatial annotation

Updates a spatial annotation. Only the fields you include in the body are changed.

<ParamField path="physical_sample_id" type="string" required>
  UUID of the physical sample
</ParamField>

<ParamField path="annotation_id" type="string" required>
  UUID of the annotation to update
</ParamField>

<ParamField body="property_name" type="string">
  Name of the property being annotated
</ParamField>

<ParamField body="property_value" type="number">
  Value of the annotated property
</ParamField>

<ParamField body="property_unit" type="string">
  Unit for the property value
</ParamField>

<ParamField body="coord_ref_frame" type="string">
  Coordinate reference frame. One of `sample_relative` or `stage_absolute`.
</ParamField>

<ParamField body="coord_units" type="string">
  Units for the coordinate values
</ParamField>

<ParamField body="coord_x" type="number">
  X coordinate of the annotation
</ParamField>

<ParamField body="coord_y" type="number">
  Y coordinate of the annotation
</ParamField>

<ParamField body="coord_z" type="number">
  Z coordinate of the annotation
</ParamField>

<ParamField body="metadata" type="object">
  Arbitrary key-value metadata for the annotation
</ParamField>

## Response

<ResponseField name="id" type="string">
  Annotation UUID
</ResponseField>

<ResponseField name="physical_sample_id" type="string">
  UUID of the physical sample the annotation belongs to
</ResponseField>

<ResponseField name="property_name" type="string">
  Name of the annotated property
</ResponseField>

<ResponseField name="property_value" type="number">
  Value of the annotated property
</ResponseField>

<ResponseField name="property_unit" type="string">
  Unit for the property value, or `null` if not set
</ResponseField>

<ResponseField name="char_source_type" type="string">
  Characterization source type, or `null` if not set
</ResponseField>

<ResponseField name="coord_ref_frame" type="string">
  Coordinate reference frame. One of `sample_relative` or `stage_absolute`.
</ResponseField>

<ResponseField name="coord_units" type="string">
  Units for the coordinate values, or `null` if not set
</ResponseField>

<ResponseField name="coord_x" type="number">
  X coordinate of the annotation, or `null` if not set
</ResponseField>

<ResponseField name="coord_y" type="number">
  Y coordinate of the annotation, or `null` if not set
</ResponseField>

<ResponseField name="coord_z" type="number">
  Z coordinate of the annotation, or `null` if not set
</ResponseField>

<ResponseField name="data_id" type="string">
  UUID of the data item the annotation is derived from, or `null` if not set
</ResponseField>

<ResponseField name="annotation_metadata" type="object">
  Arbitrary key-value metadata, or `null` if not set
</ResponseField>

<ResponseField name="last_updated" type="string">
  ISO 8601 timestamp of the last update
</ResponseField>

<ResponseField name="version" type="string">
  Version string of the annotation record
</ResponseField>

<RequestExample>
  ```python Python theme={null}
  import requests

  response = requests.patch(
      "https://api.atomscale.ai/physical_samples/a1b2c3d4-5678-90ab-cdef-1234567890ab/annotations/f47ac10b-58cc-4372-a567-0e02b2c3d479",
      headers={
          "X-API-KEY": "YOUR_API_KEY",
          "Content-Type": "application/json"
      },
      json={
          "property_value": 26.0
      }
  )
  annotation = response.json()
  ```

  ```bash cURL theme={null}
  curl -X PATCH "https://api.atomscale.ai/physical_samples/a1b2c3d4-5678-90ab-cdef-1234567890ab/annotations/f47ac10b-58cc-4372-a567-0e02b2c3d479" \
    -H "X-API-KEY: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "property_value": 26.0
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
    "physical_sample_id": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
    "property_name": "thickness",
    "property_value": 26.0,
    "property_unit": "nm",
    "char_source_type": "xrd",
    "coord_ref_frame": "sample_relative",
    "coord_units": "mm",
    "coord_x": 1.5,
    "coord_y": 2.0,
    "coord_z": null,
    "data_id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
    "annotation_metadata": null,
    "last_updated": "2024-01-16T10:15:00Z",
    "version": "0.269.1"
  }
  ```
</ResponseExample>
