# Validate Workflow Action

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/automation/workflows/actions/validate:
    post:
      summary: Validate Workflow Action
      deprecated: false
      description: >-
        Runs a validation of WorkflowAction attributes without context of
        specific Workflow
      tags:
        - API Reference/Management API/Automation/Workflow Actions
      parameters:
        - 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}}'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                workflow_action: &ref_11
                  $ref: '#/components/schemas/WorkflowAction'
              x-apidog-orders:
                - workflow_action
              required:
                - workflow_action
              x-apidog-ignore-properties: []
            examples: {}
      responses:
        '200':
          description: >-
            On success, returns just an empty body indicating that the payload
            is valid.
          content:
            application/json:
              schema:
                type: object
                properties: {}
                x-apidog-orders: []
                x-apidog-ignore-properties: []
          headers: {}
          x-apidog-name: Success
        '405':
          description: ''
          content:
            application/json:
              schema:
                title: ''
                type: object
                properties:
                  error:
                    type: string
                    default: >-
                      Maximum number of actions (5) for this workflow has been
                      reached.
                x-apidog-orders:
                  - error
                required:
                  - error
                x-apidog-ignore-properties: []
          headers: {}
          x-apidog-name: Method not allowed
        '422':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    examples:
                      - Invalid parameters
                    const: Invalid parameters
                  details:
                    type: object
                    properties: {}
                    x-apidog-orders: []
                    description: 'See: [Params Validation](doc-341637)'
                    additionalProperties: true
                    x-apidog-ignore-properties: []
                required:
                  - error
                  - details
                x-apidog-orders:
                  - error
                  - details
                x-apidog-ignore-properties: []
          headers: {}
          x-apidog-name: ''
      security: []
      x-apidog-folder: API Reference/Management API/Automation/Workflow Actions
      x-apidog-status: released
      x-run-in-apidog: https://app.eu.apidog.com/web/project/346351/apis/api-4376769-run
components:
  schemas:
    WorkflowAction:
      oneOf:
        - $ref: '#/components/schemas/SendMessage'
        - $ref: '#/components/schemas/GrantOffer'
        - $ref: '#/components/schemas/GrantPoints'
        - $ref: '#/components/schemas/AddToGroup'
        - $ref: '#/components/schemas/RemoveFromGroup'
        - $ref: '#/components/schemas/AddToProgram'
        - $ref: '#/components/schemas/RemoveFromProgram'
        - $ref: '#/components/schemas/CallWebhook'
      x-apidog-folder: ''
    CallWebhook:
      type: object
      properties:
        frequency:
          type: object
          properties:
            period: &ref_0
              type: string
              enum:
                - minute
                - hour
                - day
                - week
                - month
                - quarter
              x-apidog-enum:
                - value: minute
                  name: ''
                  description: ''
                - value: hour
                  name: ''
                  description: ''
                - value: day
                  name: ''
                  description: ''
                - value: week
                  name: ''
                  description: ''
                - value: month
                  name: ''
                  description: ''
                - value: quarter
                  name: ''
                  description: ''
              examples:
                - day
            limit: &ref_1
              type: integer
              description: Maximum number of action executions for member
              examples:
                - 5
              minimum: 1
          x-apidog-orders: &ref_2
            - period
            - limit
          description: >-
            When present, describes how often the action can be executed for the
            same member in the given period
          required:
            - period
            - limit
          x-apidog-ignore-properties: []
          nullable: true
        total_limit: &ref_3
          type: integer
          description: Total maximum number of action executions for member
          minimum: 1
          examples:
            - 100
          nullable: true
        delay_seconds: &ref_4
          type: integer
          description: >-
            The number of seconds to wait before action execution after the
            trigger activation 
          minimum: 1
          maximum: 86400
          examples:
            - 90
          nullable: true
        id: &ref_5
          $ref: '#/components/schemas/id'
          description: Primary identifier of the record
          readOnly: true
        created_at: &ref_6
          type: string
          description: Time at which the record was created
          format: date-time
          readOnly: true
          examples:
            - '2022-11-15T16:25:58.099512Z'
        updated_at: &ref_7
          type: string
          description: Time at which the record was updated for the last time
          format: date-time
          readOnly: true
          examples:
            - '2022-11-15T16:25:58.099512Z'
        type: &ref_8
          type: string
          description: Type of workflow action
          enum:
            - add_to_group
            - add_to_program
            - call_webhook
            - grant_offer
            - grant_points
            - remove_from_group
            - remove_from_program
            - send_message
          x-apidog-enum:
            - value: add_to_group
              name: ''
              description: ''
            - value: add_to_program
              name: ''
              description: ''
            - value: call_webhook
              name: ''
              description: ''
            - value: grant_offer
              name: ''
              description: ''
            - value: grant_points
              name: ''
              description: ''
            - value: remove_from_group
              name: ''
              description: ''
            - value: remove_from_program
              name: ''
              description: ''
            - value: send_message
              name: ''
              description: ''
        url:
          type: string
          format: uri
          examples:
            - https://example.com/webhook
          description: URL to send the webhook notification
        secret:
          type: string
          description: String that may be used to authenticate the webhook requests
          examples:
            - 1dbaf751ad4cd3a0ee592707e81abb6e
      x-apidog-orders:
        - 01KDQJQW241AG543HFQ47CQZNB
        - url
        - secret
      x-apidog-refs:
        01KDQJQW241AG543HFQ47CQZNB: &ref_9
          $ref: '#/components/schemas/_Core'
      required:
        - delay_seconds
        - id
        - created_at
        - updated_at
        - type
        - url
        - secret
      x-apidog-ignore-properties:
        - frequency
        - total_limit
        - delay_seconds
        - id
        - created_at
        - updated_at
        - type
      x-apidog-folder: ''
    id:
      type: integer
      description: Primary identifier of the record
      format: uint64
      readOnly: true
      examples:
        - 1
      x-apidog-folder: ''
    _Core:
      type: object
      properties:
        frequency:
          type: object
          properties:
            period: *ref_0
            limit: *ref_1
          x-apidog-orders: *ref_2
          description: >-
            When present, describes how often the action can be executed for the
            same member in the given period
          required:
            - period
            - limit
          x-apidog-ignore-properties: []
          nullable: true
        total_limit: *ref_3
        delay_seconds: *ref_4
        id: *ref_5
        created_at: *ref_6
        updated_at: *ref_7
        type: *ref_8
      x-apidog-orders:
        - frequency
        - total_limit
        - delay_seconds
        - 01KFAN95RZPAERVYV0GYTCV0KC
        - type
      x-apidog-refs:
        01KFAN95RZPAERVYV0GYTCV0KC:
          $ref: '#/components/schemas/Base%20record%20attributes'
      required:
        - delay_seconds
        - id
        - created_at
        - updated_at
        - type
      x-apidog-ignore-properties:
        - id
        - created_at
        - updated_at
      x-apidog-folder: ''
    Base record attributes:
      type: object
      properties:
        id: *ref_5
        created_at: *ref_6
        updated_at: *ref_7
      x-apidog-orders:
        - id
        - created_at
        - updated_at
      required:
        - id
        - created_at
        - updated_at
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    RemoveFromProgram:
      type: object
      properties:
        frequency:
          type: object
          properties:
            period: *ref_0
            limit: *ref_1
          x-apidog-orders: *ref_2
          description: >-
            When present, describes how often the action can be executed for the
            same member in the given period
          required:
            - period
            - limit
          x-apidog-ignore-properties: []
          nullable: true
        total_limit: *ref_3
        delay_seconds: *ref_4
        id: *ref_5
        created_at: *ref_6
        updated_at: *ref_7
        type: *ref_8
        program_id: &ref_10
          description: ID of the [Program](doc-341689) to remove the member from
          $ref: '#/components/schemas/id1'
      x-apidog-orders:
        - 01KDQJQW241AG543HFQ47CQZNB
        - program_id
      x-apidog-refs:
        01KDQJQW241AG543HFQ47CQZNB: *ref_9
      required:
        - delay_seconds
        - id
        - created_at
        - updated_at
        - type
        - program_id
      x-apidog-ignore-properties:
        - frequency
        - total_limit
        - delay_seconds
        - id
        - created_at
        - updated_at
        - type
      x-apidog-folder: ''
    id1:
      type: integer
      title: ''
      description: Identifier
      examples:
        - 1
      minimum: 1
      x-apidog-folder: ''
    AddToProgram:
      type: object
      properties:
        frequency:
          type: object
          properties:
            period: *ref_0
            limit: *ref_1
          x-apidog-orders: *ref_2
          description: >-
            When present, describes how often the action can be executed for the
            same member in the given period
          required:
            - period
            - limit
          x-apidog-ignore-properties: []
          nullable: true
        total_limit: *ref_3
        delay_seconds: *ref_4
        id: *ref_5
        created_at: *ref_6
        updated_at: *ref_7
        type: *ref_8
        program_id: *ref_10
      x-apidog-orders:
        - 01KDQJQW241AG543HFQ47CQZNB
        - program_id
      x-apidog-refs:
        01KDQJQW241AG543HFQ47CQZNB: *ref_9
      required:
        - delay_seconds
        - id
        - created_at
        - updated_at
        - type
        - program_id
      x-apidog-ignore-properties:
        - frequency
        - total_limit
        - delay_seconds
        - id
        - created_at
        - updated_at
        - type
      x-apidog-folder: ''
    RemoveFromGroup:
      type: object
      properties:
        frequency:
          type: object
          properties:
            period: *ref_0
            limit: *ref_1
          x-apidog-orders: *ref_2
          description: >-
            When present, describes how often the action can be executed for the
            same member in the given period
          required:
            - period
            - limit
          x-apidog-ignore-properties: []
          nullable: true
        total_limit: *ref_3
        delay_seconds: *ref_4
        id: *ref_5
        created_at: *ref_6
        updated_at: *ref_7
        type: *ref_8
        group_id: *ref_10
      x-apidog-orders:
        - 01KDQJQW241AG543HFQ47CQZNB
        - group_id
      x-apidog-refs:
        01KDQJQW241AG543HFQ47CQZNB: *ref_9
      required:
        - delay_seconds
        - id
        - created_at
        - updated_at
        - type
        - group_id
      x-apidog-ignore-properties:
        - frequency
        - total_limit
        - delay_seconds
        - id
        - created_at
        - updated_at
        - type
      x-apidog-folder: ''
    AddToGroup:
      type: object
      properties:
        frequency:
          type: object
          properties:
            period: *ref_0
            limit: *ref_1
          x-apidog-orders: *ref_2
          description: >-
            When present, describes how often the action can be executed for the
            same member in the given period
          required:
            - period
            - limit
          x-apidog-ignore-properties: []
          nullable: true
        total_limit: *ref_3
        delay_seconds: *ref_4
        id: *ref_5
        created_at: *ref_6
        updated_at: *ref_7
        type: *ref_8
        group_id: *ref_10
      x-apidog-orders:
        - 01KDQJQW241AG543HFQ47CQZNB
        - group_id
      x-apidog-refs:
        01KDQJQW241AG543HFQ47CQZNB: *ref_9
      required:
        - delay_seconds
        - id
        - created_at
        - updated_at
        - type
        - group_id
      x-apidog-ignore-properties:
        - frequency
        - total_limit
        - delay_seconds
        - id
        - created_at
        - updated_at
        - type
      x-apidog-folder: ''
    GrantPoints:
      type: object
      properties:
        frequency:
          type: object
          properties:
            period: *ref_0
            limit: *ref_1
          x-apidog-orders: *ref_2
          description: >-
            When present, describes how often the action can be executed for the
            same member in the given period
          required:
            - period
            - limit
          x-apidog-ignore-properties: []
          nullable: true
        total_limit: *ref_3
        delay_seconds: *ref_4
        id: *ref_5
        created_at: *ref_6
        updated_at: *ref_7
        type: *ref_8
        points:
          type: integer
          description: Number of points to grant
          minimum: 1
          examples:
            - 45
      x-apidog-orders:
        - 01KDQJQW241AG543HFQ47CQZNB
        - points
      x-apidog-refs:
        01KDQJQW241AG543HFQ47CQZNB: *ref_9
      required:
        - delay_seconds
        - id
        - created_at
        - updated_at
        - type
        - points
      x-apidog-ignore-properties:
        - frequency
        - total_limit
        - delay_seconds
        - id
        - created_at
        - updated_at
        - type
      x-apidog-folder: ''
    GrantOffer:
      type: object
      properties:
        frequency:
          type: object
          properties:
            period: *ref_0
            limit: *ref_1
          x-apidog-orders: *ref_2
          description: >-
            When present, describes how often the action can be executed for the
            same member in the given period
          required:
            - period
            - limit
          x-apidog-ignore-properties: []
          nullable: true
        total_limit: *ref_3
        delay_seconds: *ref_4
        id: *ref_5
        created_at: *ref_6
        updated_at: *ref_7
        type: *ref_8
        offer_id: *ref_10
        feedback:
          type: object
          properties:
            timeout_days: &ref_12
              type: integer
              maximum: 365
              minimum: 1
              examples:
                - 14
              description: |
                Number of days for gathering the feedback from user
            success_action: *ref_11
            timeout_action: *ref_11
          x-apidog-orders: &ref_13
            - timeout_days
            - success_action
            - timeout_action
          required:
            - timeout_days
            - success_action
            - timeout_action
          x-apidog-ignore-properties: []
          nullable: true
      x-apidog-orders:
        - 01KDQJQW241AG543HFQ47CQZNB
        - offer_id
        - 01KDQTC93GXNEJHTH5Y6DM2QTW
      x-apidog-refs:
        01KDQJQW241AG543HFQ47CQZNB: *ref_9
        01KDQTC93GXNEJHTH5Y6DM2QTW: &ref_14
          $ref: '#/components/schemas/_Feedback'
      required:
        - delay_seconds
        - id
        - created_at
        - updated_at
        - type
        - offer_id
        - feedback
      x-apidog-ignore-properties:
        - frequency
        - total_limit
        - delay_seconds
        - id
        - created_at
        - updated_at
        - type
        - feedback
      x-apidog-folder: ''
    _Feedback:
      type: object
      properties:
        feedback:
          type: object
          properties:
            timeout_days: *ref_12
            success_action: *ref_11
            timeout_action: *ref_11
          x-apidog-orders: *ref_13
          required:
            - timeout_days
            - success_action
            - timeout_action
          x-apidog-ignore-properties: []
          nullable: true
      x-apidog-orders:
        - feedback
      required:
        - feedback
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    SendMessage:
      type: object
      properties:
        frequency:
          type: object
          properties:
            period: *ref_0
            limit: *ref_1
          x-apidog-orders: *ref_2
          description: >-
            When present, describes how often the action can be executed for the
            same member in the given period
          required:
            - period
            - limit
          x-apidog-ignore-properties: []
          nullable: true
        total_limit: *ref_3
        delay_seconds: *ref_4
        id: *ref_5
        created_at: *ref_6
        updated_at: *ref_7
        type: *ref_8
        message_id: *ref_10
        feedback:
          type: object
          properties:
            timeout_days: *ref_12
            success_action: *ref_11
            timeout_action: *ref_11
          x-apidog-orders: *ref_13
          required:
            - timeout_days
            - success_action
            - timeout_action
          x-apidog-ignore-properties: []
          nullable: true
      x-apidog-orders:
        - 01KDQJQW241AG543HFQ47CQZNB
        - message_id
        - 01KDQTBCA95PQ5P7FEYA48GRJD
      x-apidog-refs:
        01KDQJQW241AG543HFQ47CQZNB: *ref_9
        01KDQTBCA95PQ5P7FEYA48GRJD: *ref_14
      required:
        - delay_seconds
        - id
        - created_at
        - updated_at
        - type
        - message_id
        - feedback
      x-apidog-ignore-properties:
        - frequency
        - total_limit
        - delay_seconds
        - id
        - created_at
        - updated_at
        - type
        - feedback
      x-apidog-folder: ''
  securitySchemes: {}
servers:
  - url: https://api.mpc.dev.placewise.com
    description: Staging
security: []

```