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

# Aampe Streaming API

> Estimated setup time: 1 hour

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 for authentication. [**You can find it by going to System Setup > Integrations > API keys and copying the Ingest API Key.**](/api-guide/api-keys)

## Endpoint Details

* **URL:** [https://ingestion.api.aampe.com/v1/events](https://ingestion.api.aampe.com/v1/events)
* **Method:** POST
* **Content-Type:** application/json

## Request Parameters

### Required Parameters

| Parameter   | Type   | Description                                                                             |
| :---------- | :----- | :-------------------------------------------------------------------------------------- |
| contact\_id | string | Unique identifier for the user triggering the event. Must be at least 1 character long. |
| event\_name | string | Name of the event that occurred. Must be at least 1 character long.                     |
| timestamp   | string | Unix timestamp when the event occurred.                                                 |

### Optional Parameters

| Parameter | Type   | Description                                                   |
| :-------- | :----- | :------------------------------------------------------------ |
| event\_id | string | Optional unique identifier for the event.                     |
| metadata  | string | Optional 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

| Code | Description                                             |
| :--- | :------------------------------------------------------ |
| 202  | Event successfully received and accepted for processing |
| 422  | Validation 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](/api-guide/api-guide).

***
