# Events API

## POST /event/ingest

> Ingest a new user event

```json
{"openapi":"3.0.0","info":{"title":"Integration API","version":"1.0.0"},"servers":[{"url":"https://integration-api.userflux.co"}],"security":[{"WriteOnlyBearerAuth":[]}],"components":{"securitySchemes":{"WriteOnlyBearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Your Integration API Write Only API Key. Note: You must use the Write Only API Key, not the Read + Write API Key when using this key in a public website or app for frontend analytics tracking."}},"schemas":{"IngestEventRequest":{"type":"object","properties":{"userId":{"type":"string"},"anonymousId":{"type":"string"},"name":{"type":"string"},"timestamp":{"type":"number"},"properties":{"type":"object"}}}}},"paths":{"/event/ingest":{"post":{"summary":"Ingest a new user event","description":"","responses":{"204":{"description":"Successful Response"}},"parameters":[{"name":"locationEnrichment","in":"query","required":false,"schema":{"type":"boolean"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IngestEventRequest"}}}}}}}}
```

## POST /event/ingest/batch

> Ingest a batch of user events

```json
{"openapi":"3.0.0","info":{"title":"Integration API","version":"1.0.0"},"servers":[{"url":"https://integration-api.userflux.co"}],"security":[{"WriteOnlyBearerAuth":[]}],"components":{"securitySchemes":{"WriteOnlyBearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Your Integration API Write Only API Key. Note: You must use the Write Only API Key, not the Read + Write API Key when using this key in a public website or app for frontend analytics tracking."}},"schemas":{"IngestEventRequest":{"type":"object","properties":{"userId":{"type":"string"},"anonymousId":{"type":"string"},"name":{"type":"string"},"timestamp":{"type":"number"},"properties":{"type":"object"}}}}},"paths":{"/event/ingest/batch":{"post":{"summary":"Ingest a batch of user events","description":"","responses":{"204":{"description":"Successful Response"}},"parameters":[{"name":"locationEnrichment","in":"query","required":false,"schema":{"type":"boolean"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/IngestEventRequest"}}}}}}}}}}}
```

{% hint style="info" %}
The Batch endpoint accepts up to 50 events per request
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://userflux.gitbook.io/userflux-docs/apis/events-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
