This page explains how to send to Axiom using the API.
The Axiom REST API accepts the following data formats:
This page explains how to send data to Axiom via cURL commands in each of these formats, and how to send data with the Axiom Node.js library.
For more information on other ingest options, see Send data.
For an introduction to the basics of the Axiom API and to the authentication options, see Introduction to Axiom API.
The API requests on this page use the ingest data endpoint. For more information, see the API reference.
To send data to Axiom in JSON format:
timestamp-field
and timestamp-format
. For more information, see the ingest data API reference.Content-Type
header to application/json
.Authorization
header to Bearer API_TOKEN
.https://AXIOM_DOMAIN/v1/datasets/DATASET_NAME/ingest
.Replace AXIOM_DOMAIN
with api.axiom.co
if your organization uses the US region, and with api.eu.axiom.co
if your organization uses the EU region. For more information, see Regions.
Replace API_TOKEN
with the Axiom API token you have generated. For added security, store the API token in an environment variable.
Replace DATASET_NAME
with the name of the Axiom dataset where you want to send data.
The following example request contains grouped events. The structure of the JSON payload has the scheme of [ { "labels": { "key1": "value1", "key2": "value2" } }, ]
where the array contains one or more JSON objects describing events.
Example request
Replace AXIOM_DOMAIN
with api.axiom.co
if your organization uses the US region, and with api.eu.axiom.co
if your organization uses the EU region. For more information, see Regions.
Replace API_TOKEN
with the Axiom API token you have generated. For added security, store the API token in an environment variable.
Replace DATASET_NAME
with the name of the Axiom dataset where you want to send data.
Example response
Example request
Replace AXIOM_DOMAIN
with api.axiom.co
if your organization uses the US region, and with api.eu.axiom.co
if your organization uses the EU region. For more information, see Regions.
Replace API_TOKEN
with the Axiom API token you have generated. For added security, store the API token in an environment variable.
Replace DATASET_NAME
with the name of the Axiom dataset where you want to send data.
Example response
Example request
Replace AXIOM_DOMAIN
with api.axiom.co
if your organization uses the US region, and with api.eu.axiom.co
if your organization uses the EU region. For more information, see Regions.
Replace API_TOKEN
with the Axiom API token you have generated. For added security, store the API token in an environment variable.
Replace DATASET_NAME
with the name of the Axiom dataset where you want to send data.
Example response
To send data to Axiom in NDJSON format:
timestamp-field
and timestamp-format
. For more information, see the ingest data API reference.Content-Type
header to either application/json
or application/x-ndjson
.Authorization
header to Bearer API_TOKEN
. Replace API_TOKEN
with the Axiom API token you have generated.https://AXIOM_DOMAIN/v1/datasets/DATASET_NAME/ingest
. Replace DATASET_NAME
with the name of the Axiom dataset where you want to send data.Replace AXIOM_DOMAIN
with api.axiom.co
if your organization uses the US region, and with api.eu.axiom.co
if your organization uses the EU region. For more information, see Regions.
Replace API_TOKEN
with the Axiom API token you have generated. For added security, store the API token in an environment variable.
Replace DATASET_NAME
with the name of the Axiom dataset where you want to send data.
Example request
Replace AXIOM_DOMAIN
with api.axiom.co
if your organization uses the US region, and with api.eu.axiom.co
if your organization uses the EU region. For more information, see Regions.
Replace API_TOKEN
with the Axiom API token you have generated. For added security, store the API token in an environment variable.
Replace DATASET_NAME
with the name of the Axiom dataset where you want to send data.
Example response
To send data to Axiom in JSON format:
timestamp-field
and timestamp-format
. For more information, see the ingest data API reference.Content-Type
header to text/csv
.Authorization
header to Bearer API_TOKEN
. Replace API_TOKEN
with the Axiom API token you have generated.https://AXIOM_DOMAIN/v1/datasets/DATASET_NAME/ingest
. Replace DATASET_NAME
with the name of the Axiom dataset where you want to send data.Replace API_TOKEN
with the Axiom API token you have generated. For added security, store the API token in an environment variable.
Replace DATASET_NAME
with the name of the Axiom dataset where you want to send data.
Replace AXIOM_DOMAIN
with api.axiom.co
if your organization uses the US region, and with api.eu.axiom.co
if your organization uses the EU region. For more information, see Regions.
Example request
Replace AXIOM_DOMAIN
with api.axiom.co
if your organization uses the US region, and with api.eu.axiom.co
if your organization uses the EU region. For more information, see Regions.
Replace API_TOKEN
with the Axiom API token you have generated. For added security, store the API token in an environment variable.
Replace DATASET_NAME
with the name of the Axiom dataset where you want to send data.
Example response
Install and configure the Axiom Node.js library.
Encode the events as JSON objects.
Pass the dataset name and the array of JSON objects to the axiom.ingest
function.
Replace AXIOM_DOMAIN
with api.axiom.co
if your organization uses the US region, and with api.eu.axiom.co
if your organization uses the EU region. For more information, see Regions.
Replace API_TOKEN
with the Axiom API token you have generated. For added security, store the API token in an environment variable.
Replace DATASET_NAME
with the name of the Axiom dataset where you want to send data.
For more information on other libraries you can use to query data, see Send data.
After ingesting data to Axiom, you can query it via API or the Axiom app UI.