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

# Update annotation

> UpdateAnnotation

 Updates an existing annotation.



## OpenAPI

````yaml patch /annotations/annotations/v1/{annotation_id}
openapi: 3.0.3
info:
  title: Studio API - Motto
  version: 0.0.0
servers:
  - url: https://api.mottostreaming.com
    description: Production server
security:
  - BearerAuth: []
tags:
  - name: AccountService
    description: Account management service
  - name: ActionConfigurationService
    description: Action configuration service definition
  - name: ActionSecretService
    description: Action type service definition
  - name: ActionService
    description: Action service definition
  - name: ActionTypeService
    description: Action type service definition
  - name: ActivityService
    description: Activity service definition
  - name: AdService
    description: Ad management service.
  - name: AnnotationService
    description: Annotation service definition
  - name: AnnotationSetService
    description: Annotation service definition
  - name: AnnotationTypeService
    description: Annotation service definition
  - name: AssetService
    description: Asset management service.
  - name: AuthService
    description: Auth service definition
  - name: BannerService
    description: Banner service definition
  - name: BannerV2Service_v2
    description: Banner service definition
  - name: BannerV3Service_v3
    description: Banner service definition
  - name: CleengService
    description: CleengService service definition
  - name: ClipService
    description: ClipService is the service that handles Clip operations.
  - name: ConfigurationService
    description: >-
      Configuration management service. These configurations allow modifying the
      behavior of streams, uploads, simulcasts, etc.
  - name: ContentTypeService
    description: ContentType service definition
  - name: CreativeWorkService
    description: CreativeWork service definition
  - name: EntitlementService
    description: Entitlement service definition
  - name: EntityService
    description: Entity service definition
  - name: EventService
    description: Event service definition
  - name: FileService
    description: OTT files management.
  - name: IngestService
    description: Ingest management service.
  - name: IngestService_v2
    description: Ingest management service.
  - name: LiveStreamService
    description: LiveStream management service.
  - name: LiveStreamService_v2
    description: LiveStream management service.
  - name: OfferService
    description: Offer service definition
  - name: OrganizationService
    description: Organization management service.
  - name: PageService
    description: Page service definition
  - name: PageService_v2
    description: Page service definition
  - name: PlatformService
    description: Platform service definition
  - name: PlaylistService
    description: Playlist management service.
  - name: ProjectService
    description: Project management service.
  - name: SimulcastService
    description: Simulcast management service.
  - name: SlugService
    description: Slug service definition
  - name: SpiideoService
    description: SpiideoService service definition
  - name: StandingService
    description: Standing service definition
  - name: StitcherService
    description: StitcherService is the service that handles stitching operations.
  - name: StripeService
    description: StripeService service definition
  - name: SubscriptionService
    description: Subscription service definition
  - name: SubtitleService
    description: SubtitleService is the service that handles Subtitle operations.
  - name: TransactionService
    description: Transaction service definition
  - name: UploadService
    description: Upload management service.
  - name: UsageService
    description: The UsageService provides methods to retrieve usage data for SKUs.
  - name: UserService
    description: User management service
  - name: VODService
    description: VODService is the service that handles VOD operations.
  - name: VODService_v2
    description: VODService is the service that handles VOD operations.
  - name: VideoProtectionService
    description: VideoProtection management service.
  - name: VideoProtectionService_v2
    description: VideoProtection management service.
  - name: VideoService
    description: Video management service.
paths:
  /annotations/annotations/v1/{annotation_id}:
    patch:
      tags:
        - AnnotationService
      description: |-
        UpdateAnnotation

         Updates an existing annotation.
      operationId: AnnotationService_UpdateAnnotation
      parameters:
        - name: annotation_id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/motto.annotations.annotation.v1.UpdateAnnotationRequest
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/motto.annotations.annotation.v1.UpdateAnnotationResponse
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/google.rpc.Status'
components:
  schemas:
    motto.annotations.annotation.v1.UpdateAnnotationRequest:
      required:
        - annotation_id
        - annotation
        - update_mask
      type: object
      properties:
        annotation_id:
          type: string
        annotation:
          $ref: '#/components/schemas/motto.annotations.annotation.v1.Annotation'
        update_mask:
          type: string
          format: field-mask
    motto.annotations.annotation.v1.UpdateAnnotationResponse:
      type: object
      properties:
        annotation:
          $ref: '#/components/schemas/motto.annotations.annotation.v1.Annotation'
    google.rpc.Status:
      type: object
      properties:
        code:
          type: integer
          description: >-
            The status code, which should be an enum value of
            [google.rpc.Code][google.rpc.Code].
          format: int32
        message:
          type: string
          description: >-
            A developer-facing error message, which should be in English. Any
            user-facing error message should be localized and sent in the
            [google.rpc.Status.details][google.rpc.Status.details] field, or
            localized by the client.
        details:
          type: array
          items:
            $ref: '#/components/schemas/google.protobuf.Any'
          description: >-
            A list of messages that carry the error details.  There is a common
            set of message types for APIs to use.
      description: >-
        The `Status` type defines a logical error model that is suitable for
        different programming environments, including REST APIs and RPC APIs. It
        is used by [gRPC](https://github.com/grpc). Each `Status` message
        contains three pieces of data: error code, error message, and error
        details. You can find out more about this error model and how to work
        with it in the [API Design
        Guide](https://cloud.google.com/apis/design/errors).
    motto.annotations.annotation.v1.Annotation:
      required:
        - project_id
        - type_id
        - video_id
        - offset
      type: object
      properties:
        id:
          readOnly: true
          type: string
          description: System generated unique identifier for the annotation.
        project_id:
          type: string
        type_id:
          type: string
          description: >-
            The type of annotation. This corresponds to a set of previously
            defined types.
        video_id:
          type: string
          description: The video in which this annotation occurs.
        offset:
          type: string
          description: >-
            The time at which this annotation occurs in the video. This is
            defined in milliseconds, relative to the start of
             the video. For example, if a goal happens after 5 minutes of the video, this would be 300000.

             If the offset is not know, you can provide a negative value, e.g. -1.
             Note: if you provide a negative offset, the annotation may be ignored by some systems that require a known offset,
             like annotation actions (e.g. clipping a video).

             See also: `start_offset` and `end_offset`.
        visibility:
          enum:
            - VISIBILITY_UNSPECIFIED
            - VISIBILITY_PUBLISHED
            - VISIBILITY_UNLISTED
            - VISIBILITY_HIDDEN
          type: string
          description: >-
            The visibility of the annotation. If the annotation is hidden, then
            it will not be shown to the user.
             Note: depending on the configuration of the annotation type, some of the actions associated with this annotation
             may still have publicly visible consequences (e.g. a generated clip may be visible to the public, if so configured).

             This may be left to unspecified, in which case the visibility will be inherited from the annotation type.
          format: enum
        event_id:
          type: string
          description: |-
            Optional.
             When provided, this should be an event ID that is associated with this annotation. This information
             can be provided by downstream services that need more context, or to perform associated actions (e.g. updating event metadata).
        creative_work_id:
          type: string
          description: |-
            Optional.
             When provided, this should be an creative work ID that is associated with this annotation. This information
             can be provided by downstream services that need more context, or to perform associated actions (e.g. updating creative work metadata).
        entity_ids:
          type: array
          items:
            type: string
          description: |-
            Optional.
             When provided, this should be a list of entity IDs that are associated with this annotation. This information
             can be provided by downstream services that need more context, or to perform associated actions.
             The kinds of entities that should be associated with an annotation are defined by the annotation type.
        action_overrides:
          type: object
          description: >-
            A map that can be used to override action configurations for this
            specific annotation.

             For example, let's assume there are two action types configured on the associated annotation type, `create_clip` and `share_to_instagram`.
             The existing action configuration for `create_clip` may look like this:
             ```
             {
               "create_clip": {
                 "name": "Goal",
                 "relative_end_offset": 10000,
                 "relative_start_offset": -10000
               }
             }
             ```

             This would result in a clip with a 20 second duration, starting 10 seconds before the annotation and ending 10 seconds after.
             However, if you are creating an annotation for a goal that you know took more (or less) time to fully capture,
             you can override the action configuration for this specific annotation:
             ```
             {
               "create_clip": {
                 "relative_end_offset": 13000,
                 "relative_start_offset": -15000
               }
             }
             ```

             You can also override multiple action configurations at once:
             ```
             {
               "create_clip": {
                 "relative_end_offset": 13000,
                 "relative_start_offset": -15000
               },
               "share_to_instagram": {
                 "social_media_post": "What a beauty! #goal #soccer"
               }
             }
             ```

             The structure of this object should match the structure of the `action_configuration`'s `configuration` property, but you do not have to provide all values.
             Any values you do not provide will be taken from the existing action configuration.
        start_offset:
          type: string
          description: >-
            The time at which the relevant portion of the annotation occurs in
            the video. This is defined in milliseconds,
             relative to the start of the video.
             For example, if a goal happens after 5 minutes of the video, but the action starts at 4 minutes and 50 seconds,
             this would be 290000.

             Providing this can be useful for annotation actions that work with ranges, e.g. creating a clip that starts before the annotation.
             This is an optional value, and when not provided, the `start_offset` will be derived from `offset` based on
             the action configuration.
        end_offset:
          type: string
          description: >-
            The time at which the relevant portion of the annotation ends in the
            video. This is defined in milliseconds,
             relative to the start of the video.
             For example, if a goal happens after 5 minutes of the video, but the action ends at 5 minutes and 10 seconds,
             this would be 310000.

             Providing this can be useful for annotation actions that work with ranges, e.g. creating a clip that ends after the annotation.
             This is an optional value, and when not provided, the `end_offset` will be derived from `offset` based on
             the action configuration.
        source_type:
          enum:
            - SOURCE_TYPE_UNSPECIFIED
            - SOURCE_TYPE_MANUAL
            - SOURCE_TYPE_AI
            - SOURCE_TYPE_EXTERNAL
            - SOURCE_TYPE_CROWD
          type: string
          description: >-
            The source of the annotation. This can be used to track where the
            annotation came from.
          format: enum
        source_id:
          type: string
          description: >-
            A unique identifier for the source of the annotation. This can be
            used to track where the annotation came from.
             Optional.
        confidence:
          type: number
          description: >-
            The confidence score of the annotation, meaning how certain it is
            that this annotation is accurate.
             This is a floating point number between 0 and 1, where 0 means no confidence and 1 means full confidence.
          format: float
        timer_label:
          type: string
          description: >-
            A textual representation of the scoreboard's time value at the time
            of the annotation. This can be any representation
             that you choose, and may be used to display the time of the annotation to end users in a more human-readable format.
             This differs from the `offset` field, which is a time value relative to the start of the video.
             This is an optional field.
             Example's for soccer: 46' (46th minute), 90+3' (90th minute, 3 minutes of added time).
        order:
          type: string
          description: >-
            An integer that can be used to order annotations of the same type
            within a video. It is advised to space this
             out in large increments (e.g. 1000) to allow for future insertions and re-orderings. If this field is not set,
             it will take the value of the `offset` field.
      description: >-
        Annotation is an invocation of an annotation type and represents a
        single moment in a video that represents
         an occurrence of that annotation type. For example, if you have an annotation type "goal", then an Annotation could
         created when a goal occurs in the video.
    google.protobuf.Any:
      type: object
      properties:
        '@type':
          type: string
          description: The type of the serialized message.
      additionalProperties: true
      description: >-
        Contains an arbitrary serialized message along with a @type that
        describes the type of the serialized message.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.