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

# Send a custom event

> Send one product event (a signup, a deposit, a purchase). It resolves to a contact by wallet, then email, then external id, creating the contact if none matches. Returns `202`: accepted for processing, not yet acted on.



## OpenAPI

````yaml /api-reference/openapi.json post /events
openapi: 3.0.3
info:
  title: Onchain Suite API
  version: 1.0.0
  description: >-
    The server-to-server API. Authenticate with a secret (`sk_`) key and call
    these endpoints from your backend to register contacts, send events, message
    users, ingest consented captures, and feed automations. Secret keys are
    server-only: never ship one to a browser, a mobile app, or a public repo.
servers:
  - url: https://api.onchainsuite.com/api/v1
    description: Production
security:
  - secretKey: []
tags:
  - name: Contacts
    description: Register and list contacts.
  - name: Events
    description: Send product events that drive automations and segments.
  - name: Messaging
    description: Send in-app pushes and launch campaigns.
  - name: Forms
    description: Ingest consented captures from your backend.
  - name: Automation
    description: Feed trigger events into the automation runtime.
paths:
  /events:
    post:
      tags:
        - Events
      summary: Send a custom event
      description: >-
        Send one product event (a signup, a deposit, a purchase). It resolves to
        a contact by wallet, then email, then external id, creating the contact
        if none matches. Returns `202`: accepted for processing, not yet acted
        on.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - event
                - contact
              properties:
                event:
                  type: string
                  description: >-
                    Event name, matching `^[a-zA-Z0-9_.:-]{1,64}$`, lower-cased
                    on arrival.
                  example: first_deposit
                contact:
                  $ref: '#/components/schemas/ContactRef'
                attributes:
                  type: object
                  description: Contact traits merged onto the contact record. Max 50 keys.
                  additionalProperties: true
                payload:
                  type: object
                  description: Event-specific data, kept with the event. Max 16 KB.
                  additionalProperties: true
                idempotencyKey:
                  type: string
                  description: Your dedup key. Strongly recommended.
                  example: deposit:0xabc:9184
                occurredAt:
                  type: string
                  format: date-time
                  description: >-
                    When it happened. Rejected if older than 7 days or more than
                    5 minutes in the future.
                test:
                  type: boolean
                  description: 'Dry run: reports what it would match but sends nothing.'
      responses:
        '202':
          description: Accepted.
          content:
            application/json:
              schema:
                type: object
                properties:
                  accepted:
                    type: boolean
                  deduplicated:
                    type: boolean
                  idempotencyKey:
                    type: string
        '400':
          description: Validation failure (the message names the field).
        '401':
          description: Missing, invalid, or revoked secret key.
        '429':
          description: Rate limited (`RATE_LIMITED`), back off and retry.
components:
  schemas:
    ContactRef:
      type: object
      description: Who the event or action is for. Provide at least one identifier.
      properties:
        email:
          type: string
          format: email
        walletAddress:
          type: string
        externalId:
          type: string
          description: Your own user id.
  securitySchemes:
    secretKey:
      type: http
      scheme: bearer
      description: >-
        Your secret key, for example `sk_live_...`. Send it as `Authorization:
        Bearer sk_live_...`. A `sk_test_...` key runs in test mode.

````

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