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

# Send a custom event

> Records a custom event ("user did X") for a contact. Call it server-to-server with an API key from your backend when something happens in your app (signup, purchase, upgrade, …). Any active workflow whose trigger is that event name enrolls the contact. If the email isn't a known contact yet, the event is still recorded and matched once the contact exists. Fire-and-forget — a 200 means the event was accepted, not that a workflow ran. Event names may not contain a colon.



## OpenAPI

````yaml /openapi.json post /marketing/events
openapi: 3.0.0
info:
  title: JetEmail API
  version: 1.0.0
  description: API documentation for JetEmail's transactional email service.
servers:
  - url: https://api.jetemail.com
    description: Production
security:
  - apiKeyAuth: []
tags:
  - name: Email
    description: Send transactional email
  - name: Outbound
    description: 'Outbound sending: keys, SMTP users, domains, logs, suppression'
  - name: Inbound
    description: Inbound routing, domains and forward destinations
  - name: Marketing
    description: >-
      Marketing suite: templates, audiences, contacts, broadcasts, themes,
      assets
externalDocs:
  description: Download OpenAPI Specification
  url: /openapi.json
paths:
  /marketing/events:
    post:
      tags:
        - Marketing
      summary: Send a custom event
      description: >-
        Records a custom event ("user did X") for a contact. Call it
        server-to-server with an API key from your backend when something
        happens in your app (signup, purchase, upgrade, …). Any active workflow
        whose trigger is that event name enrolls the contact. If the email isn't
        a known contact yet, the event is still recorded and matched once the
        contact exists. Fire-and-forget — a 200 means the event was accepted,
        not that a workflow ran. Event names may not contain a colon.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - email
                - name
              properties:
                email:
                  type: string
                  description: The contact this event is about
                  example: jane@example.com
                name:
                  type: string
                  description: Event name — must match a workflow trigger to do anything
                  example: purchase_completed
                properties:
                  type: object
                  description: Arbitrary metadata for the event (available to the workflow)
                  example:
                    plan: pro
                    amount: 4900
      responses:
        '200':
          description: Event accepted
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
        '400':
          description: Missing/invalid email or name (or name contains a colon)
components:
  securitySchemes:
    apiKeyAuth:
      type: http
      scheme: bearer
      description: API key for account management endpoints. Use your api_ prefixed token.

````