Event Ingestion Endpoint API
URL: https://dev.client-events.runonatlas.com
Method: POST
Authentication: The API requires authentication using an API key, which should be included in the request headers.
- Header: x-api-key
- Value: Provided by Atlas
Request Body: The request body should be formatted in JSON and include the following fields:
Required Fields:
- customerId: The ID of the customer responsible for the event (required for event tracking and billing).
- eventName: The ID of the customer responsible for the event (required for event tracking and billing).
Optional Fields:
- idempotencyKey: A unique key to ensure the event is processed only once. This is recommended, especially for events that might be retried.
- timestamp: The time the event occurred. If not provided, a timestamp will be generated automatically.
- payload: A flexible section for any additional data about the event. While the fields in the payload are entirely optional, they allow you to include information like:
- status: Outcome of the event (e.g. success, failure)
- total_token: Total number of tokens consumed, which may affect billing.
- cpu_time: CPU time used, potentially relevant for resource-based billing.
Add anything you want or may want to use to bill your customers, even if you don’t have use for the field right now, but may in the future, add it! If these optional fields are left out, Atlas will assume default values, and charges may only be based on the submission of the event itself, not on resource usage.
Response: The API will return the following status codes:
- 200 OK: Event successfully processed.
- 400 Bad Request: Missing or invalid fields.
- 401 Unauthorized: Invalid or missing API key.
- 500 Internal Server Error: Server issues.
Idempotency: Ensure the same event isn’t processed multiple times by using an idempotencyKey. This key ensures retries don’t duplicate charges or event records.
Notes:
- Use the x-api-key header to authenticate.
- Only the customerId and eventName fields are required, but adding fields in the payload (like total_token and cpu_time) may be essential if your charges are usage-based.