> Markdown versions of all pages of this connector library are available by appending `.md` to the page URL. For the full index of connectors, see [llms.txt](https://connectors.appmixer.com/llms.txt).

# Send Event

- Component: `appmixer.loops.core.SendEvent`
- Kind: Action
- Version: 1.0.0
- Visibility: Public
- Connector: [appmixer.loops 1.0.0](https://connectors.appmixer.com/connector/appmixer.loops/1.0.0.md)
- Component page: <https://connectors.appmixer.com/connector/appmixer.loops/1.0.0/component/appmixer.loops.core.SendEvent>

Send an event to Loops to trigger workflows for a contact. The contact is identified by email or user ID and is created when it does not exist.

## Input ports

### Port `in`

| Field | Type | Description |
| --- | --- | --- |
| Event Name (`eventName`) | text | The name of the event, for example `signup`. |
| Email (`email`) | text | The contact's email address. Required if User ID is not provided. |
| User ID (`userId`) | text | The contact's unique user ID. Required if Email is not provided. |
| Event Properties (`eventProperties`) | textarea | Optional JSON object of event properties available in emails sent by this event, for example `{"planName": "Pro"}`. Create the event properties in Loops first. |
| Contact Properties (`contactProperties`) | textarea | Optional JSON object of contact properties to update on the contact with this event, for example `{"firstName": "Alex"}`. |
| Mailing Lists (`mailingLists`) | multiselect | Mailing lists to add the contact to. |
| Idempotency Key (`idempotencyKey`) | text | Optional unique ID for this request (up to 100 characters). Loops rejects a repeated key within 24 hours, which prevents duplicate emails. |

## Output ports

### Port `out`

| Field | Type | Description |
| --- | --- | --- |
| Success (`success`) | boolean | - |
| Event Name (`eventName`) | string | - |

## Full metadata (component.json)

```json
{
  "name": "appmixer.loops.core.SendEvent",
  "label": "Send Event",
  "description": "Send an event to Loops to trigger workflows for a contact. The contact is identified by email or user ID and is created when it does not exist.",
  "author": "Appmixer <info@appmixer.com>",
  "version": "1.0.0",
  "auth": {
    "service": "appmixer:loops"
  },
  "quota": {
    "manager": "appmixer:loops",
    "resources": "requests",
    "scope": {
      "userId": "{{userId}}"
    }
  },
  "inPorts": [
    {
      "name": "in",
      "schema": {
        "type": "object",
        "properties": {
          "eventName": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          },
          "eventProperties": {
            "type": "string"
          },
          "contactProperties": {
            "type": "string"
          },
          "mailingLists": {
            "type": [
              "array",
              "string"
            ]
          },
          "idempotencyKey": {
            "type": "string"
          }
        },
        "required": [
          "eventName"
        ]
      },
      "inspector": {
        "inputs": {
          "eventName": {
            "type": "text",
            "index": 1,
            "label": "Event Name",
            "tooltip": "The name of the event, for example <code>signup</code>."
          },
          "email": {
            "type": "text",
            "index": 2,
            "label": "Email",
            "tooltip": "The contact's email address. Required if User ID is not provided."
          },
          "userId": {
            "type": "text",
            "index": 3,
            "label": "User ID",
            "tooltip": "The contact's unique user ID. Required if Email is not provided."
          },
          "eventProperties": {
            "type": "textarea",
            "index": 4,
            "label": "Event Properties",
            "tooltip": "Optional JSON object of event properties available in emails sent by this event, for example <code>{\"planName\": \"Pro\"}</code>. Create the event properties in Loops first."
          },
          "contactProperties": {
            "type": "textarea",
            "index": 5,
            "label": "Contact Properties",
            "tooltip": "Optional JSON object of contact properties to update on the contact with this event, for example <code>{\"firstName\": \"Alex\"}</code>."
          },
          "mailingLists": {
            "type": "multiselect",
            "index": 6,
            "label": "Mailing Lists",
            "tooltip": "Mailing lists to add the contact to.",
            "source": {
              "url": "/component/appmixer/loops/core/ListMailingLists?outPort=out",
              "data": {
                "messages": {
                  "in/outputType": "array"
                },
                "properties": {
                  "isSource": true
                },
                "transform": "./ListMailingLists#toSelectArray"
              }
            }
          },
          "idempotencyKey": {
            "type": "text",
            "index": 7,
            "label": "Idempotency Key",
            "tooltip": "Optional unique ID for this request (up to 100 characters). Loops rejects a repeated key within 24 hours, which prevents duplicate emails."
          }
        }
      }
    }
  ],
  "outPorts": [
    {
      "name": "out",
      "schema": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success",
            "example": true
          },
          "eventName": {
            "type": "string",
            "title": "Event Name",
            "example": "signup"
          }
        }
      }
    }
  ],
  "icon": "(data URI omitted)"
}
```
