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

# Record an event



## OpenAPI

````yaml post /api/v1/events
openapi: 3.0.3
info:
  title: Xem API
  version: '1.0'
  description: Comprehensive API server for Xem email marketing platform
  contact: {}
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: https://api.xem.email/api/v1
    description: Production server
  - url: http://localhost:8080/api/v1
    description: Development server
security: []
tags:
  - name: Authentication
    description: User authentication and authorization endpoints
  - name: Teams
    description: Team management and collaboration features
  - name: Campaigns
    description: Email campaign creation, management, and tracking
  - name: Analytics
    description: Campaign analytics, audience insights, and performance metrics
  - name: Contacts
    description: Contact management and mailing list operations
  - name: Templates
    description: Email template management and customization
  - name: Automations
    description: Email automation workflows and triggers
  - name: SMTP
    description: SMTP configuration and email delivery settings
  - name: IMAP
    description: IMAP configuration for email inbox management
  - name: Webhooks
    description: Webhook management for real-time event notifications
  - name: Files
    description: File upload and management for attachments and media
  - name: Domains
    description: Domain management for email authentication
  - name: API Keys
    description: API key management for programmatic access
paths:
  /api/v1/events:
    post:
      tags:
        - Events
      summary: Record a contact event
      description: >-
        Records something a contact did in your app (for example trial_started).
        Automations whose trigger is "Event named X" start for that contact,
        with each scalar property available as {{event_<name>}}. Identify the
        contact by contactId, or by email; with listId, an unknown email is
        added to that list first.
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/internal_handlers.ContactEventInput'
      responses:
        '202':
          description: Event recorded
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: string
        '404':
          description: Contact or list not found
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: string
        '422':
          description: Address is suppressed
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: string
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: string
      security:
        - ApiKeyAuth: []
components:
  schemas:
    internal_handlers.ContactEventInput:
      type: object
      properties:
        contactId:
          type: string
        email:
          type: string
          example: ada@example.com
        event:
          type: string
          example: trial_started
        listId:
          description: >-
            ListID creates the contact in this list when no contact there has
            the email.
          type: string
        properties:
          type: object
          additionalProperties: true
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: API key for programmatic access

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.