# Update Triggerer Rule

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/triggerer/rules/{rule_id}:
    put:
      summary: Update Triggerer Rule
      deprecated: false
      description: ''
      tags:
        - API Reference/Management API/Triggerer/Rules
      parameters:
        - name: rule_id
          in: path
          description: ''
          required: true
          example: 1
          schema:
            type: integer
        - name: Content-Type
          in: header
          description: '[Details](doc-341635)'
          required: true
          example: application/json
          schema:
            type: string
            default: application/json
            const: application/json
        - name: X-User-Agent
          in: header
          description: Arbitrary identifier of your client. [Details](doc-341635)
          required: true
          example: '{{X_USER_AGENT}}'
          schema:
            type: string
            default: '{{X_USER_AGENT}}'
        - name: X-Product-Name
          in: header
          description: API Product for API context. [Details](doc-341635)
          required: true
          example: '{{PRODUCT_NAME}}'
          schema:
            type: string
            default: '{{PRODUCT_NAME}}'
        - name: X-Loyalty-Club-Slug
          in: header
          description: LoyaltyClub for API context. [Details](doc-342138)
          required: false
          example: '{{LOYALTY_CLUB_SLUG}}'
          schema:
            type: string
            default: '{{LOYALTY_CLUB_SLUG}}'
        - name: X-Customer
          in: header
          description: Customer for API context.  [Details](doc-342139)
          required: false
          example: '{{CUSTOMER_ID}}'
          schema:
            type: string
            default: '{{CUSTOMER_ID}}'
        - name: Authorization
          in: header
          description: '[Member](doc-342129) or [User](doc-342130) Authorization.'
          required: false
          example: Bearer {{_OAUTH_TOKEN}}
          schema:
            type: string
            default: Bearer {{_OAUTH_TOKEN}}
        - name: X-Client-Authorization
          in: header
          description: '[Token](doc-342128) Authorization.'
          example: '{{API_TOKEN}}'
          schema:
            type: string
            default: '{{API_TOKEN}}'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Rule'
              example:
                rule:
                  name:
                    value: Use coupon from collection "Valentines"
                    translations:
                      pl: Użycie kuponu z kolekcji "Walentynki"
                  event_type: string
                  frequency:
                    limit: 1
                    minimum: 1
                    rate: 1
                  limit: 1
                  minimum: 1
                  rate: 1
                  paused: false
                  data_conditions:
                    operator:
                      - EQUAL
                      - GREATER
                      - LOWER
                      - EQUALS_OR_GREATER
                      - EQUALS_OR_LOWER
                      - IS_GIVEN
                      - IS_NOT_GIVEN
                      - NOT_EQUALS
                      - IN
                      - NOT_IN
                    value: string
                    value_type:
                      - STRING
                      - NUMBER
                      - BOOLEAN
                      - ID
                      - ARRAY_OF_STRINGS
                      - ARRAY_OF_NUMBERS
                      - ARRAY_OF_IDS
                    or_value_is_null: false
                  audience_id: 1
                  hook_delayed_by_seconds: 100
                  hook_on_checks_failure: false
                  excluded_sources: []
                  daily_auto_trigger_at: '12:00'
                  hook_type: string
                  options:
                    rewards_api:
                      grant_points: 3
                      points_function: >-
                        if (eventData.amount > 100) {eventData.amount * 2} else
                        if (eventData.amount > 50 && eventTime >
                        Date.parse('2024-09-01')) {20} else {0}
                    mesages_api:
                      message_id: 1
                    offers_api:
                      offer_id: 389123
                      offer_usable_for_seconds: 3600
                    slack:
                      channel: string
                      webhook_url: https://url.com
                    url:
                      webhook_url: https://url.com
                      webhook_secret: string
          headers: {}
          x-apidog-name: Success
      security: []
      x-apidog-folder: API Reference/Management API/Triggerer/Rules
      x-apidog-status: pending
      x-run-in-apidog: https://app.eu.apidog.com/web/project/346351/apis/api-3511117-run
components:
  schemas:
    Rule:
      type: object
      properties:
        name:
          type: object
          properties:
            value:
              type: string
            translations:
              type: object
              properties: {}
              x-apidog-orders: []
              x-apidog-ignore-properties: []
          required:
            - value
            - translations
          x-apidog-orders:
            - value
            - translations
          x-apidog-ignore-properties: []
        event_type:
          type: string
        frequency:
          type: object
          properties:
            limit:
              type: integer
            minimum:
              type: integer
            rate:
              type: integer
          required:
            - limit
            - minimum
            - rate
          x-apidog-orders:
            - limit
            - minimum
            - rate
          x-apidog-ignore-properties: []
        limit:
          type: integer
        minimum:
          type: integer
        rate:
          type: integer
        paused:
          type: boolean
        data_conditions:
          type: object
          properties:
            operator:
              type: array
              items:
                type: string
              description: enum
            value:
              type: string
            value_type:
              type: array
              items:
                type: string
              description: enum
            or_value_is_null:
              type: boolean
          required:
            - operator
            - value
            - value_type
            - or_value_is_null
          x-apidog-orders:
            - operator
            - value
            - value_type
            - or_value_is_null
          x-apidog-ignore-properties: []
        audience_id:
          type: integer
        hook_delayed_by_seconds:
          type: integer
        hook_on_checks_failure:
          type: boolean
        excluded_sources:
          type: array
          items:
            type: string
        daily_auto_trigger_at:
          type: string
        hook_type:
          type: string
        options:
          type: object
          properties:
            rewards_api:
              type: object
              properties:
                grant_points:
                  type: number
                points_function:
                  type: string
                  description: JS function for granting points, overrides grant_points
                  examples:
                    - >-
                      if (eventData.amount > 100) {return eventData.amount *
                      2;}             if (eventData.amount > 50 && eventTime >
                      Date.parse('2024-09-01')) {return 20;}             return
                      0;
              x-apidog-orders:
                - grant_points
                - points_function
              required:
                - grant_points
                - points_function
              x-apidog-ignore-properties: []
            mesages_api:
              type: object
              properties:
                message_id:
                  type: integer
              required:
                - message_id
              x-apidog-orders:
                - message_id
              x-apidog-ignore-properties: []
            offers_api:
              type: object
              properties:
                offer_id:
                  description: Offer to grant
                  type: integer
                offer_usable_for_seconds:
                  description: >-
                    (optional) Number of seconds defining how long member will
                    be able to use the offer for
                  type: integer
              required:
                - offer_id
                - offer_usable_for_seconds
              x-apidog-orders:
                - offer_id
                - offer_usable_for_seconds
              x-apidog-ignore-properties: []
            slack:
              type: object
              properties:
                channel:
                  type: string
                webhook_url:
                  type: string
              required:
                - channel
                - webhook_url
              x-apidog-orders:
                - channel
                - webhook_url
              x-apidog-ignore-properties: []
            url:
              type: object
              properties:
                webhook_url:
                  type: string
                webhook_secret:
                  type: string
              required:
                - webhook_url
                - webhook_secret
              x-apidog-orders:
                - webhook_url
                - webhook_secret
              x-apidog-ignore-properties: []
          required:
            - rewards_api
            - mesages_api
            - offers_api
            - slack
            - url
          x-apidog-orders:
            - rewards_api
            - mesages_api
            - offers_api
            - slack
            - url
          x-apidog-ignore-properties: []
      required:
        - name
        - event_type
        - frequency
        - limit
        - minimum
        - rate
        - paused
        - data_conditions
        - audience_id
        - hook_delayed_by_seconds
        - hook_on_checks_failure
        - excluded_sources
        - daily_auto_trigger_at
        - hook_type
        - options
      x-apidog-orders:
        - name
        - event_type
        - frequency
        - limit
        - minimum
        - rate
        - paused
        - data_conditions
        - audience_id
        - hook_delayed_by_seconds
        - hook_on_checks_failure
        - excluded_sources
        - daily_auto_trigger_at
        - hook_type
        - options
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
  securitySchemes: {}
servers:
  - url: https://api.mpc.dev.placewise.com
    description: Staging
security: []

```