Sift | Docs

UpdateAnnotation

Updates an existing annotation using using the list of fields specified in `update_mask`.

PATCH
/api/v1/annotations

Request Body

application/jsonRequired

The request for a call to AnnotationService_UpdateAnnotation to update an annotation.

annotation
Required
object

updateMask
Required
string

The list of fields to be updated. The fields available to be updated are name, description, start_time, end_time, assigned_to_user_id, state, tags, legend_config, linked_channels, and metadata. Important Note: if tags is specified in the update mask and annotation.tags is an empty list then all associated tags on the annotation will be removed.

curl -X PATCH "<API_URL>/api/v1/annotations" \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "annotation": {
      "annotationId": "string",
      "name": "string",
      "description": "string",
      "startTime": "2019-08-24T14:15:22Z",
      "endTime": "2019-08-24T14:15:22Z",
      "createdByUserId": "string",
      "modifiedByUserId": "string",
      "createdDate": "2019-08-24T14:15:22Z",
      "modifiedDate": "2019-08-24T14:15:22Z",
      "runId": "string",
      "state": "ANNOTATION_STATE_UNSPECIFIED",
      "organizationId": "string",
      "assignedToUserId": "string",
      "annotationType": "ANNOTATION_TYPE_UNSPECIFIED",
      "tags": [
        "string"
      ],
      "legendConfig": "string",
      "createdByConditionId": "string",
      "createdByRuleConditionVersionId": "string",
      "reportRuleVersionId": "string",
      "assignedToUser": {
        "userId": "string",
        "userName": "string",
        "organizations": [
          {
            "organizationId": "string",
            "organizationName": "string"
          }
        ]
      },
      "deletedDate": "2019-08-24T14:15:22Z",
      "linkedChannels": [
        {
          "channel": {
            "channelId": "string"
          },
          "bitFieldElement": {
            "channelId": "string",
            "bitFieldName": "string"
          }
        }
      ],
      "assetIds": [
        "string"
      ],
      "metadata": [
        {
          "key": {
            "name": "string",
            "type": "METADATA_KEY_TYPE_UNSPECIFIED",
            "archivedDate": "2019-08-24T14:15:22Z"
          },
          "stringValue": "string",
          "numberValue": 0.1,
          "booleanValue": true,
          "archivedDate": "2019-08-24T14:15:22Z"
        }
      ]
    },
    "updateMask": "string"
  }'

A successful response.

{
  "annotation": {
    "annotationId": "string",
    "name": "string",
    "description": "string",
    "startTime": "2019-08-24T14:15:22Z",
    "endTime": "2019-08-24T14:15:22Z",
    "createdByUserId": "string",
    "modifiedByUserId": "string",
    "createdDate": "2019-08-24T14:15:22Z",
    "modifiedDate": "2019-08-24T14:15:22Z",
    "runId": "string",
    "state": "ANNOTATION_STATE_UNSPECIFIED",
    "organizationId": "string",
    "assignedToUserId": "string",
    "annotationType": "ANNOTATION_TYPE_UNSPECIFIED",
    "tags": [
      "string"
    ],
    "legendConfig": "string",
    "createdByConditionId": "string",
    "createdByRuleConditionVersionId": "string",
    "reportRuleVersionId": "string",
    "assignedToUser": {
      "userId": "string",
      "userName": "string",
      "organizations": [
        {
          "organizationId": "string",
          "organizationName": "string"
        }
      ]
    },
    "deletedDate": "2019-08-24T14:15:22Z",
    "linkedChannels": [
      {
        "channel": {
          "channelId": "string"
        },
        "bitFieldElement": {
          "channelId": "string",
          "bitFieldName": "string"
        }
      }
    ],
    "assetIds": [
      "string"
    ],
    "metadata": [
      {
        "key": {
          "name": "string",
          "type": "METADATA_KEY_TYPE_UNSPECIFIED",
          "archivedDate": "2019-08-24T14:15:22Z"
        },
        "stringValue": "string",
        "numberValue": 0.1,
        "booleanValue": true,
        "archivedDate": "2019-08-24T14:15:22Z"
      }
    ]
  }
}