# Posting Events

!!!
The ingestion endpoint requires an API key with `Write` permissions. [Learn More](/api-keys#permissions)
!!!!

To post events, make a POST request to your ingest POST URL, which contains your POST ID. Find your POST URL [here](https://app.aggregations.io/organization/){target="_blank"}.
```
POST https://ingest.aggregations.io/[POST ID]
```

All API calls require `x-api-token` Authentication. Include it in your header with your API key. 

``` #1,3 POST Header Template 
curl --location 'https://ingest.aggregations.io/{INSERT POST ID HERE}’\
--header 'Content-Type: application/json' \
--header 'x-api-token: {INSERT API KEY}' \
--data ‘[{}]'
```

``` #1,3 Example POST Header
curl --location 'https://ingest.aggregations.io/abc12345' \
--header 'Content-Type: application/json' \
--header 'x-api-token: XXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \
--data '[{}]'
``` 
---

### Ingest API Limits {#limits}

+++ Max Payload Size = 1 MB 
The Ingest API can handle requests that are 1 MB or smaller. If events are posted in excess of 1 MB, the request will be rejected with a `400 -  Bad Request` Error.
+++
+++ Max Rate Limit = 1,000 Requests Per Second 
The Ingest API has a default rate limit of 1,000 requests per second. Once this limit is exceeded, subsequent requests will be rejected with a `429 Too Many Requests` Error.

 If you still require a higher rate limit [Contact Us](https://aggregations.io/contact?subject=Ingest%20Rate%20Limit%20Request%)
 +++

 ---
 
### Troubleshooting {#troubleshooting}

All successfully ingested events will return a `200 - Success` response. Below is a list of reasons your response may have failed. You can use tools such as [Postman](https://www.postman.com){target="_blank"} or [Insomnia](https://insomnia.rest){target="_blank"} to test and troubleshoot your POSTs. 

Error | Issue | Resolution
--- | --- | ---
`400` Bad Request | Request exceeds max payload size (1MB) | Reduce the size of your payload. Consider batching into smaller payloads.
`400` Bad Request | Incorrect event format | Verify your payload format matches your Ingestion schema on the [Organizations](https://app.aggregations.io/organization/){target="_blank"} page.
`400` Bad Request | Malformed payload | Your payload may be invalid JSON and unable to be parsed.
`401` Unauthorized | Invalid API Key | Ensure the API key you're using is valid
`401` Unauthorized | Disabled API Key | Ensure the API key you're using is enabled on the [API Keys](https://app.aggregations.io/api-keys){target="_blank"} page
`401` Unauthorized | No authorization header | Ensure your request has the `x-api-token` header set
`401` Unauthorized | API Key doesn't have proper permissions | Ensure the API Key being used has `Write` permissions. [Learn More](/api-keys#permissions)
`402` Payment Required | Organization does not have an active plan | Sign up for a plan or start your free trial on the [Organizations](https://app.aggregations.io/organization/){target="_blank"} page.
`429` Too Many Requests | Rate limit exceeded | You're doing more than 1,000 requests per second across your organization. Consider batching your events into larger payloads by combining more events into each request.
`429` Too Many Requests | Plan usage exceeded | Your organization has reached its monthly limit and does not have overages enabled. Verify your current period usage on the Aggregations.io [Organizations](https://app.aggregations.io/organization/){target="_blank"} page. 
