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: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.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.
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 theContent-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.
Authorization header.
Authorization header and the org ID in the x-axiom-org-id header. For more information, see Determine org ID.
403.