# 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 %}
