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

# Ingest a custom event

> Accepts a customer event (e.g. "purchase", "new_account_created") and enriches it for downstream processing. The event is associated with a contact (resolved via `aiContactId` or `phone`) on a specific channel (resolved via `channelId` or `channelPhone`). Responds immediately with the generated event id; processing happens in the background. Rate limited to 1000 requests per hour per client.



## OpenAPI

````yaml /openapi.json post /api/v1/events
openapi: 3.0.0
info:
  title: Vambe AI API
  description: Vambe AI documentation
  version: '1.0'
  contact: {}
servers:
  - url: https://api.vambe.me
    description: Production Server
security: []
tags:
  - name: Vambe AI
    description: ''
paths:
  /api/v1/events:
    post:
      tags:
        - Events API
      summary: Ingest a custom event
      description: >-
        Accepts a customer event (e.g. "purchase", "new_account_created") and
        enriches it for downstream processing. The event is associated with a
        contact (resolved via `aiContactId` or `phone`) on a specific channel
        (resolved via `channelId` or `channelPhone`). Responds immediately with
        the generated event id; processing happens in the background. Rate
        limited to 1000 requests per hour per client.
      operationId: EventsApiController_ingest
      parameters:
        - name: x-api-key
          in: header
          description: API key used to authorize the request
          required: true
          schema:
            type: string
      requestBody:
        required: true
        description: >-
          Event payload. `contact` requires at least one of `aiContactId` or
          `phone`; `channel` requires at least one of `channelId` or
          `channelPhone`.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IngestEventDto'
            examples:
              purchase:
                summary: Purchase event identified by phone
                value:
                  event: purchase
                  occurredAt: '2026-04-21T14:30:00.000Z'
                  properties:
                    orderId: ORD-123
                    total: 49990
                    currency: CLP
                  contact:
                    phone: '+56911112222'
                    name: Jane Doe
                    email: jane@example.com
                  channel:
                    channelPhone: '+56999999999'
              byIds:
                summary: Event identified by aiContactId and channelId
                value:
                  event: cart_abandoned
                  properties:
                    cartId: CART-42
                  contact:
                    aiContactId: 9d1c0a7e-3e9f-4a2c-8f1b-1f2b1a3c4d5e
                  channel:
                    channelId: '42'
      responses:
        '202':
          description: >-
            Event accepted for asynchronous processing. Returns the generated
            event id.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                    example: df980fc8-b6db-4820-bf22-2969482d106d
        '400':
          description: >-
            Bad request — payload failed validation, `occurredAt` is in the
            future, properties exceed limits, or the provided `channelId` /
            `channelPhone` did not match any channel for this client.
        '401':
          description: Unauthorized — invalid or missing API key.
        '429':
          description: Too many requests — client rate limit exceeded.
components:
  schemas:
    IngestEventDto:
      type: object
      properties:
        event:
          type: string
          minLength: 1
          maxLength: 100
        occurredAt:
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
        properties:
          default: {}
          type: object
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 1024
                nullable: true
              - type: number
                nullable: true
              - type: boolean
                nullable: true
        contact:
          type: object
          properties:
            aiContactId:
              type: string
              format: uuid
              pattern: >-
                ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
            phone:
              type: string
              minLength: 5
              maxLength: 32
            name:
              type: string
              minLength: 1
              maxLength: 200
            email:
              type: string
              format: email
              pattern: >-
                ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
        channel:
          type: object
          properties:
            channelId:
              type: string
              minLength: 1
              maxLength: 64
            channelPhone:
              type: string
              minLength: 5
              maxLength: 32
      required:
        - event
        - properties
        - contact
        - channel

````