Docs
DocumentationQuery ReferenceAPI Reference
Open Console→→
DocumentationQuery ReferenceAPI Reference

Get started

IntroductionSend dataQuery dataPaginationAPI limits

Annotations

List all annotationsGETRetrieve annotationGETCreate annotationPOSTUpdate annotationPUTDelete annotationDELETE

API tokens

List all API tokensGETRetrieve API tokenGETCreate API tokenPOSTRegenerate API tokenPOSTDelete API tokenDELETE

Dashboards

List all dashboardsGETRetrieve dashboardGETCreate dashboardPOSTUpdate dashboardPUTPatch dashboard elementPATCHDelete dashboardDELETE

Datasets

List all datasetsGETRetrieve datasetGETList all fields in datasetGETRetrieve field in datasetGETCreate datasetPOSTIngest dataPOSTRun queryPOSTRun query (legacy)POSTTrim datasetPOSTUpdate datasetPUTUpdate fieldPUTVacuum datasetPOSTDelete datasetDELETE

Edge

Ingest data to edge deploymentIngest Splunk HEC eventsIngest raw Splunk HEC eventsCheck Splunk HEC healthRun APL query to edge deploymentRun batch query to edge deploymentRun MPL query to edge deploymentGet metrics for a datasetGet metric tags for a datasetGet metric tag values for a datasetGet tags for a datasetGet tag values for a dataset

Map fields

List all map fieldsGETCreate map fieldPOSTUpdate list of map fieldsPUTDelete map fieldsDELETE

Monitors

List all monitorsGETRetrieve monitorGETRetrieve monitor historyGETCreate monitorPOSTUpdate monitorPUTDelete monitorDELETE

Notifiers

List all notifiersGETRetrieve notifierGETCreate notifierPOSTUpdate notifierPUTDelete notifierDELETE

Organizations

List all orgsGETRetrieve orgGETCreate orgPOSTUpdate orgPUTProvision orgPOST

Role-based access control

List all rolesGETRetrieve roleGETList all groupsGETRetrieve groupGETCreate rolePOSTCreate groupPOSTUpdate rolePUTUpdate groupPUTDelete roleDELETEDelete groupDELETE

Saved queries

List all saved queriesGETRetrieve saved queryGETCreate saved queryPOSTUpdate saved queryPUTDelete saved queryDELETE

Users

Retrieve current userGETList all usersGETRetrieve userGETCreate userPOSTUpdate current userPUTUpdate user rolePUTDelete user from orgDELETE

Views

List all viewsGETRetrieve viewGETCreate viewPOSTUpdate viewPUTDelete viewDELETE

Virtual fields

List all virtual fieldsGETRetrieve virtual fieldGETCreate virtual fieldPOSTUpdate virtual fieldPUTDelete virtual fieldDELETE
Get started

Get started with Axiom API

This section explains how to send data to Axiom, query data, and manage resources using the Axiom API.

You can use the Axiom API (Application Programming Interface) to send data to Axiom, query data, and manage resources programmatically. This page covers the basics for interacting with the Axiom API.

Prerequisites

  • Create an Axiom account.
  • Create a dataset in Axiom where you send your data.

API basics

Axiom API follows the REST architectural style and uses JSON for serialization. You can send API requests to Axiom with curl or API tools such as Postman.

For example, the following curl command ingests data to an Axiom dataset:

shell
curl -X 'POST' 'https://AXIOM_DOMAIN/v1/ingest/DATASET_NAME' \
  -H 'Authorization: Bearer API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '[
    {
      "axiom": "logs"
    }
  ]'
Info

Replace AXIOM_DOMAIN with the base domain of your edge deployment. For more information, see Edge deployments.

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 send your data.

For more information, see Send data to Axiom via API and Ingest data endpoint.

Base domain

The base domain of an API request depends on the following:

  • To ingest data, use the Ingest data endpoint with the base domain of your edge deployment.

    Edge deploymentBase domain for ingest and query
    US East 1 (AWS)us-east-1.aws.edge.axiom.co
    EU Central 1 (AWS)eu-central-1.aws.edge.axiom.co

    For more information on edge deployments, see Edge deployments.

  • For all other API endpoints, use the base domain https://api.axiom.co.

Content type

Encode the body of API requests as JSON objects and set the Content-Type header to application/json. Unless otherwise specified, Axiom encodes all responses (including errors) as JSON objects.

Authentication

To prove that API requests come from you, you must include forms of authentication called tokens in your API requests. Axiom offers two types of tokens:

  • API tokens let you control the actions that can be performed with the token. For example, you can specify that requests authenticated with a certain API token can only query data from a particular dataset.
  • Personal access tokens (PATs) provide full control over your Axiom account. Requests authenticated with a PAT can perform every action you can perform in Axiom. When possible, use API tokens instead of PATs.

If you use an API token for authentication, include the API token in the Authorization header.

shell
Authorization: Bearer API_TOKEN

If you use a PAT for authentication, include the PAT in the Authorization header and the org ID in the x-axiom-org-id header. For more information, see Determine org ID.

shell
Authorization: Bearer API_TOKEN
x-axiom-org-id: ORG_ID

If authentication is unsuccessful for a request, Axiom returns the error status code 403.

Data types

Below is a list of the types of data used within the Axiom API:

NameDefinitionExample
IDA unique value used to identify resources."io12h34io1h24i"
StringA sequence of characters used to represent text."string value"
BooleanA type of two possible values representing true or false.true
IntegerA number without decimals.4567
FloatA number with decimals.15.67
MapA data structure with a list of values assigned to a unique key.{ "key": "value" }
ListA data structure with only a list of values separated by a comma.["value", 4567, 45.67]

What’s next

  • Ingest data via API
  • Query data via API
Was this page helpful?
Suggest edits on GitHub
NextSend data to Axiom via API
On this page
API basicsBase domainContent typeAuthenticationData typesWhat’s next