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

# Trigger an Event

> API to pass an event, which in turn triggers workflows where that event is defined as the trigger.



## OpenAPI

````yaml POST /event/
openapi: 3.1.1
info:
  title: SuprSend API
  description: APIs supported on suprsend platform
  version: 1.2.2
servers:
  - url: https://hub.suprsend.com
security:
  - sec0: []
  - BearerAuth: []
paths:
  /event/:
    post:
      summary: Trigger an Event
      description: >-
        API to pass an event, which in turn triggers workflows where that event
        is defined as the trigger.
      operationId: event-api
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - distinct_id
                - event
              properties:
                distinct_id:
                  type: string
                  description: distinct_id of recipient who should receive the notification
                  default: _distinct_id_
                event:
                  type: string
                  description: string identifier for the event like `product_purchased`
                  default: _event_name_
                properties:
                  type: object
                  description: >-
                    Properties are used to render template or workflow variables
                    in the trigger.
                  properties:
                    $attachments:
                      type: array
                      description: >-
                        Use this key to pass email attachment in the trigger.
                        You can either pass attachment as a public URL or as a
                        base64-encoded file (limit < 50KB).
                      items:
                        oneOf:
                          - type: object
                            title: publicly accessible URL
                            description: >-
                              **Option 1: Pass file as publicly accessible URL**
                              (No limit on file size)
                            required:
                              - url
                            properties:
                              url:
                                type: string
                                format: uri
                                description: Publicly accessible URL of the file
                                example: https://bitcoincore.org/bitcoin.pdf
                              filename:
                                type: string
                                description: Filename to be shown in email
                                example: billing.pdf
                              ignore_if_error:
                                type: boolean
                                description: Ignore the attachment if it fails to load
                          - type: object
                            title: base64-encoded file
                            description: >-
                              Pass file as a **base-64 file** (supported limit <
                              50KB)
                            required:
                              - data
                            properties:
                              data:
                                type: string
                                description: Base64-encoded content of the file
                              filename:
                                type: string
                                description: Filename to be shown in email
                              contentType:
                                type: string
                                example: application/pdf
                  additionalProperties:
                    type: string
                tenant_id:
                  type: string
                  description: >-
                    string identifier of the tenant this event is associated
                    with
                $idempotency_key:
                  type: string
                  description: Idempotency key (valid for 24hours)
            examples:
              SHIPMENT ARRIVAL:
                value:
                  distinct_id: 0fxxx8f74-xxxx-41c5-8752-xxxcb6911fb08
                  event: ON SHIPMENT ARRIVAL
                  properties:
                    amount: 3780$
                    number: TRXC1034
                    vehicle: Truck
                    locations: San Francisco
      responses:
        '202':
          description: 202 - Accepted
          content:
            application/json:
              examples:
                Result:
                  value: OK
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: OK
      deprecated: false
      security:
        - BearerAuth: []
components:
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      name: Authorization
      x-bearer-format: bearer
      description: >-
        Bearer authentication header of the form `Bearer <token>`, where <token>
        is your auth token.
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API_Key
      description: >-
        Pass as `Bearer <API_KEY>`. Get API Key from SuprSend dashboard
        Developers -> API Keys section.

````