> ## 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.

# Set action configuration

> SetActionConfiguration

 Associates a number of action types with an annotation type. This means that when an annotation is created, it will
 trigger the associated actions to be executed.

 Note: To update action types on an annotation type, all action type IDs and the configuration must be re-submitted.
 To help with this, you can retrieve the current action type IDs and configuration via the GET call.



## OpenAPI

````yaml post /annotations/types/v1/{annotation_type_id}/action_configuration
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: 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: 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/types/v1/{annotation_type_id}/action_configuration:
    post:
      tags:
        - ActionConfigurationService
      description: |-
        SetActionConfiguration

         Associates a number of action types with an annotation type. This means that when an annotation is created, it will
         trigger the associated actions to be executed.

         Note: To update action types on an annotation type, all action type IDs and the configuration must be re-submitted.
         To help with this, you can retrieve the current action type IDs and configuration via the GET call.
      operationId: ActionConfigurationService_SetActionConfiguration
      parameters:
        - name: annotation_type_id
          in: path
          description: The id of the annotation type to attach action types to
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/motto.annotations.action_configuration.v1.SetActionConfigurationRequest
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/motto.annotations.action_configuration.v1.SetActionConfigurationResponse
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/google.rpc.Status'
components:
  schemas:
    motto.annotations.action_configuration.v1.SetActionConfigurationRequest:
      required:
        - annotation_type_id
        - configuration
      type: object
      properties:
        annotation_type_id:
          type: string
          description: The id of the annotation type to attach action types to
        configuration:
          type: object
          description: >-
            A map of `action_type_id` to a set of key-value pairs containing all
            input fields for that action type, and their values.

             For example, if there are two action types configured, `create_clip` and `share_to_instagram`, this map would look like:
             ```
             {
               "create_clip": {
                 "name": "Goal",
                 "relative_end_offset": 10000,
                 "relative_start_offset": -10000
               },
               "share_to_instagram": {
                 "clip_asset_id": "$create_clip.reserved_asset_id"
                 "social_media_post": "Have a look at this great goal! #soccer #goal #sports"
               }
             }
             ```

             A few things to note:
             1. The values you specify in this payload must match the types as defined in the action type's `input_fields` field.
             2. If you do not provide a value on an input field, the action type input field's default value will be used.
             3. If you want to pass the output of an action type as input to a following action type, you can use the `$` notation.
             The required format is `$action_type_id.output_field`. The field name must be a field in the output of a previous action type.
             In the example above, the `clip_asset_id` field in the `share_to_instagram` action type is populated with the `reserved_asset_id` field from the `create_clip` action type.

             These actions are executed in parallel where possible, unless there is a dependency between actions, in which case the dependent action will wait for the dependency to complete.
        conditions:
          type: array
          items:
            $ref: >-
              #/components/schemas/motto.annotations.action_configuration.v1.ActionConfigurationCondition
          description: >-
            The conditions under which the actions should be executed. If not
            provided, the actions will always be executed.
             If more than one condition is provided, all conditions must be met for the actions to be executed.
    motto.annotations.action_configuration.v1.SetActionConfigurationResponse:
      type: object
      properties: {}
    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.action_configuration.v1.ActionConfigurationCondition:
      type: object
      properties:
        confidence_threshold:
          type: number
          description: >-
            Only execute the actions if the confidence field on an annotation is
            greater than or equal to (>=) this value.


            Important: at most one of `confidence_threshold`, `source_types` may
            be set per request.
          format: float
        source_types:
          allOf:
            - $ref: >-
                #/components/schemas/motto.annotations.action_configuration.v1.ActionConfigurationConditionSourceTypes
          description: >-
            Only execute the actions if the source type is one of the provided
            types.


            Important: at most one of `confidence_threshold`, `source_types` may
            be set per request.
    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.
    motto.annotations.action_configuration.v1.ActionConfigurationConditionSourceTypes:
      type: object
      properties:
        types:
          type: array
          items:
            type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````