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

# Trigger Business Event

> This API allows you to trigger a business event in MoEngage. You can set up campaigns to be executed when these events are triggered.


<Note>
  **Rate Limit**
  You can send 200 triggers in a day, and 50 in each hour.
</Note>

# FAQs

<AccordionGroup>
  <Accordion title="Do I need to pass the value for all event attributes while triggering the campaign?">
    No, it is not required to pass all the attributes while triggering the business event.
  </Accordion>

  <Accordion title="How do I know if the campaign has been triggered successfully?">
    You can view the campaign analytics to see if the campaign for the business event has been triggered successfully. Navigate to *Engage -> Campaigns* on the MoEngage Dashboard and search for the campaign associated with the Business Event.
  </Accordion>
</AccordionGroup>


## OpenAPI

````yaml /api/business-events/business-events.yaml post /business_event/trigger
openapi: 3.0.3
info:
  title: MoEngage Business Events API
  description: >
    API for creating, triggering, and searching business events in MoEngage.


    You can use these events to trigger campaigns whenever they occur. For
    example, you can create business events for various situations, such as when
    new episodes of an OTT series become available, when there is a flight
    delay, or when there is a price drop on an item in a cart.


    **Postman Collections**

    We have made it easy for you to test the APIs. [View in
    Postman](https://www.postman.com/moengage-dev/workspace/api-docs/collection/3182294-38587f83-f039-46f3-b86e-10af2c918053).
  version: '1.0'
servers:
  - url: https://api-0{X}.moengage.com/v1.0
    description: MoEngage API Server
    variables:
      X:
        default: '1'
        description: >-
          Your MoEngage Data Center (DC) number. Refer to MoEngage docs for your
          correct DC.
security:
  - basicAuth: []
tags:
  - name: Business Events
    description: Manage and trigger business events.
paths:
  /business_event/trigger:
    post:
      tags:
        - Business Events
      summary: Trigger Business Event
      description: >
        This API allows you to trigger a business event in MoEngage. You can set
        up campaigns to be executed when these events are triggered.
      operationId: triggerBusinessEvent
      parameters:
        - in: header
          name: Content-Type
          schema:
            type: string
            default: application/json
          required: true
          description: Set the Content-Type header to application/json.
      requestBody:
        description: Event to trigger.
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - event_name
                - event_attributes
              properties:
                event_name:
                  type: string
                  description: The name of the business event to be triggered.
                  example: Series_Name
                event_attributes:
                  type: object
                  description: >
                    This field contains the event attributes with which the
                    business event will be triggered.


                    **Structure:** "event_attributes": { "attribute_name1":
                    "<attribute value>", ... }


                    Every attribute contains the following information:

                    *attribute_name* - This field contains the name of the
                    business event attribute for which the value is being sent
                    in the request. The attribute_name is a String.


                    **Example:** "attribute_name": "season"
                  additionalProperties: true
                  example:
                    season: Season 1
                    episodes: 12
                    cast:
                      - John Doe
                      - Jane Doe
                    date: 11/11/2023
                triggered_by:
                  type: string
                  format: email
                  description: Information about who triggered the business event.
                  example: john.doe@example.com
            example:
              event_name: Series_Name
              event_attributes:
                season: Season 1
                episodes: 12
                cast:
                  - John Doe
                  - Jane Doe
                date: 11/11/2023
              triggered_by: john.doe@example.com
      responses:
        '200':
          description: >-
            This response is returned when the request is processed
            successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: The business event has been triggered
        '400':
          description: >-
            This response is returned when the required parameters are missing
            from the request or when the provided parameters are invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                eventNotFound:
                  summary: Event does not exist
                  value:
                    error:
                      code: 400 Bad Request
                      message: Business event does not exists
                      details:
                        - code: InvalidValue
                          target: event_name
                          message: Business event does not exist
                      request_id: 64a54cf9633fda13b668132f
                wrongAttribute:
                  summary: Wrong Attribute
                  value:
                    error:
                      code: 400 Bad Request
                      message: Wrong business event attribute passed in api request
                      details:
                        - code: InvalidValue
                          target: rating1
                          message: Wrong business event attribute passed in api request
                      request_id: 64a54b0f633fda13b6681259
                noActiveCampaign:
                  summary: No active campaign found
                  value:
                    error:
                      code: 400 Bad Request
                      message: No active campaign found for business event name
                      details:
                        - code: InvalidValue
                          target: event_name
                          message: No active campaign found for business event name
                      request_id: 64a54dbf633fda13b668142d
                invalidEmail:
                  summary: Invalid Email
                  value:
                    error:
                      code: 400 Bad Request
                      message: Business event does not exists
                      details:
                        - code: MissingValue
                          target: triggered_by
                          message: 'triggered_by - Invalid email address : ''abc'''
                      request_id: 64a54dec633fda13b668142f
        '401':
          description: >-
            This response is returned when the authorization parameters are
            missing or incorrect in the HTTP Auth Header.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 401 Authentication error
                  message: Authentication required
                  details:
                    - code: InvalidValue
                      target: Authorization
                      message:
                        code: MissingValue
                        target: Authorization
                        message: >-
                          APP_ID and APP_SECRET_KEY is missing in Authorization
                          Header.
                  request_id: 64a54e0e633fda13b6681430
        '429':
          description: >-
            This response is returned when the number of requests has exceeded
            the rate limit.
          content:
            application/json:
              schema:
                type: object
              example:
                status: error
                data:
                  code: 429
                  title: rate limiter exception
                  description: Exceeded rate limit for this app
        '500':
          description: >-
            This response is returned when the system runs into an unexpected
            error.
          content:
            application/json:
              schema:
                type: object
              example:
                title: Internal Server Error
                message: >-
                  An unexpected error was encountered while processing this
                  request. Please contact MoEngage Team
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: This field contains the error code.
              example: 400 Bad Request
            message:
              type: string
              description: This field contains the error message.
              example: Bad request
            details:
              type: array
              description: >-
                This array contains the specifics and describes the error in
                detail.
              items:
                type: object
                properties:
                  code:
                    type: string
                    example: InvalidValue
                  target:
                    oneOf:
                      - type: string
                      - type: array
                        items:
                          type: string
                    example: event_name
                  message:
                    oneOf:
                      - type: string
                      - type: object
                      - type: array
                    example: Business event does not exist
            request_id:
              type: string
              description: This field contains the request ID of the failed request.
              example: 64a54cf9633fda13b668132f
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: >
        The Basic authentication header contains your Base64-encoded key. This
        authentication parameter, used for access control, must be passed with
        the request. 


        Format: `Authorization: Basic Base64_ENCODED_WORKSPACEID_APIKEY==`

````