Ingest events
curl --request POST \
--url https://platform.runonatlas.com/external/event/ \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"customerId": "atlas-internal-customer-id-123",
"data": {
"quantity": 10
},
"eventName": "api-usage",
"generatedAt": "2022-01-01T00:00:00.000Z",
"idempotencyKey": "idempotency-key-123",
"userId": "atlas-internal-user-id-123"
}
'import requests
url = "https://platform.runonatlas.com/external/event/"
payload = {
"customerId": "atlas-internal-customer-id-123",
"data": { "quantity": 10 },
"eventName": "api-usage",
"generatedAt": "2022-01-01T00:00:00.000Z",
"idempotencyKey": "idempotency-key-123",
"userId": "atlas-internal-user-id-123"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customerId: 'atlas-internal-customer-id-123',
data: {quantity: 10},
eventName: 'api-usage',
generatedAt: '2022-01-01T00:00:00.000Z',
idempotencyKey: 'idempotency-key-123',
userId: 'atlas-internal-user-id-123'
})
};
fetch('https://platform.runonatlas.com/external/event/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://platform.runonatlas.com/external/event/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'customerId' => 'atlas-internal-customer-id-123',
'data' => [
'quantity' => 10
],
'eventName' => 'api-usage',
'generatedAt' => '2022-01-01T00:00:00.000Z',
'idempotencyKey' => 'idempotency-key-123',
'userId' => 'atlas-internal-user-id-123'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://platform.runonatlas.com/external/event/"
payload := strings.NewReader("{\n \"customerId\": \"atlas-internal-customer-id-123\",\n \"data\": {\n \"quantity\": 10\n },\n \"eventName\": \"api-usage\",\n \"generatedAt\": \"2022-01-01T00:00:00.000Z\",\n \"idempotencyKey\": \"idempotency-key-123\",\n \"userId\": \"atlas-internal-user-id-123\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://platform.runonatlas.com/external/event/")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"customerId\": \"atlas-internal-customer-id-123\",\n \"data\": {\n \"quantity\": 10\n },\n \"eventName\": \"api-usage\",\n \"generatedAt\": \"2022-01-01T00:00:00.000Z\",\n \"idempotencyKey\": \"idempotency-key-123\",\n \"userId\": \"atlas-internal-user-id-123\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform.runonatlas.com/external/event/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customerId\": \"atlas-internal-customer-id-123\",\n \"data\": {\n \"quantity\": 10\n },\n \"eventName\": \"api-usage\",\n \"generatedAt\": \"2022-01-01T00:00:00.000Z\",\n \"idempotencyKey\": \"idempotency-key-123\",\n \"userId\": \"atlas-internal-user-id-123\"\n}"
response = http.request(request)
puts response.read_bodyEvents
Ingest events
Ingest events into Atlas. Events are processed asynchronously, so the response does not indicate when the events have been processed or that the data is correct. For example, if you send a customer ID that does not exist, this endpoint will accept it anyway.
POST
/
external
/
event
/
Ingest events
curl --request POST \
--url https://platform.runonatlas.com/external/event/ \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"customerId": "atlas-internal-customer-id-123",
"data": {
"quantity": 10
},
"eventName": "api-usage",
"generatedAt": "2022-01-01T00:00:00.000Z",
"idempotencyKey": "idempotency-key-123",
"userId": "atlas-internal-user-id-123"
}
'import requests
url = "https://platform.runonatlas.com/external/event/"
payload = {
"customerId": "atlas-internal-customer-id-123",
"data": { "quantity": 10 },
"eventName": "api-usage",
"generatedAt": "2022-01-01T00:00:00.000Z",
"idempotencyKey": "idempotency-key-123",
"userId": "atlas-internal-user-id-123"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customerId: 'atlas-internal-customer-id-123',
data: {quantity: 10},
eventName: 'api-usage',
generatedAt: '2022-01-01T00:00:00.000Z',
idempotencyKey: 'idempotency-key-123',
userId: 'atlas-internal-user-id-123'
})
};
fetch('https://platform.runonatlas.com/external/event/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://platform.runonatlas.com/external/event/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'customerId' => 'atlas-internal-customer-id-123',
'data' => [
'quantity' => 10
],
'eventName' => 'api-usage',
'generatedAt' => '2022-01-01T00:00:00.000Z',
'idempotencyKey' => 'idempotency-key-123',
'userId' => 'atlas-internal-user-id-123'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://platform.runonatlas.com/external/event/"
payload := strings.NewReader("{\n \"customerId\": \"atlas-internal-customer-id-123\",\n \"data\": {\n \"quantity\": 10\n },\n \"eventName\": \"api-usage\",\n \"generatedAt\": \"2022-01-01T00:00:00.000Z\",\n \"idempotencyKey\": \"idempotency-key-123\",\n \"userId\": \"atlas-internal-user-id-123\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://platform.runonatlas.com/external/event/")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"customerId\": \"atlas-internal-customer-id-123\",\n \"data\": {\n \"quantity\": 10\n },\n \"eventName\": \"api-usage\",\n \"generatedAt\": \"2022-01-01T00:00:00.000Z\",\n \"idempotencyKey\": \"idempotency-key-123\",\n \"userId\": \"atlas-internal-user-id-123\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform.runonatlas.com/external/event/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customerId\": \"atlas-internal-customer-id-123\",\n \"data\": {\n \"quantity\": 10\n },\n \"eventName\": \"api-usage\",\n \"generatedAt\": \"2022-01-01T00:00:00.000Z\",\n \"idempotencyKey\": \"idempotency-key-123\",\n \"userId\": \"atlas-internal-user-id-123\"\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Body
application/json
- object
- object[]
The event idempotency key. Used to ensure that the event is not processed multiple times. Each event must have a unique idempotency key. If not provided, an idempotency key will be automatically generated hashing the event payload.
Minimum string length:
1Example:
"idempotency-key-123"
Response
The events have been accepted and will be processed asynchronously.

