The Aampe Events API endpoint allows you to post real-time event data to Aampe’s system. This endpoint is designed for streaming live user interactions and activities as they occur within your application.

Authentication

To use this API, you’ll need an API key. You can find it by going to System Setup > Integrations > Aampe endpoint and clicking Connect.

Endpoint Details

Request Parameters

Required Parameters

ParameterTypeDescription
contact_idstringUnique identifier for the user triggering the event. Must be at least 1 character long.
event_namestringName of the event that occurred. Must be at least 1 character long.
timestampstringUnix timestamp when the event occurred.

Optional Parameters

ParameterTypeDescription
event_idstringOptional unique identifier for the event.
metadatastringOptional JSON object containing additional event information.

Example Request

{
  "contact_id": "user123",
  "event_name": "button_click",
  "timestamp": 1638360000,
  "event_id": "evt_123456",
  "metadata": {
    "button_location": "header",
    "page": "home",
    "user_type": "premium"
  }
}

Response Codes

CodeDescription
202Event successfully received and accepted for processing
422Validation error - request parameters are invalid

Error Response Example

{
  "detail": [
    {
      "loc": ["body", "contact_id"],
      "msg": "field required",
      "type": "value_error.missing"
    }
  ]
}

Further Details

Find detailed developer documentation here.