Skip to main content
POST
/
datasets
/
{dataset_name}
/
ingest
cURL
curl --request POST \
  --url https://api.axiom.co/v1/datasets/{dataset_name}/ingest \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '"<string>"'
import requests

url = "https://api.axiom.co/v1/datasets/{dataset_name}/ingest"

payload = "<string>"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify('<string>')
};

fetch('https://api.axiom.co/v1/datasets/{dataset_name}/ingest', 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://api.axiom.co/v1/datasets/{dataset_name}/ingest",
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('<string>'),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$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://api.axiom.co/v1/datasets/{dataset_name}/ingest"

payload := strings.NewReader("\"<string>\"")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
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://api.axiom.co/v1/datasets/{dataset_name}/ingest")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("\"<string>\"")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.axiom.co/v1/datasets/{dataset_name}/ingest")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "\"<string>\""

response = http.request(request)
puts response.read_body
{
  "ingested": 2,
  "failed": 0,
  "failures": [],
  "processedBytes": 16
}
{
"code": 403,
"message": "Forbidden"
}
Use this endpoint to ingest data into the US East 1 (AWS) edge deployment. For more information, see Ingest data and Edge deployments.The base domain for this endpoint is https://api.axiom.co, irrespective of your edge deployment.To ingest data to a specific edge deployment, use the Ingest data to edge deployment endpoint.

Authorizations

Authorization
string
header
required

Authenticate using an API token or personal access token (PAT). Include the token as a Bearer token: Authorization: Bearer <token>. For more information, see Tokens.

Headers

X-Axiom-CSV-Fields
string[]

A list of optional comma separated fields to use for CSV ingestion. If not specified, the first line of the CSV will be used as the field names.

X-Axiom-Event-Labels
string

An optional JSON encoded object with additional labels to add to all events in the request

Path Parameters

dataset_name
string
required

Unique name of the dataset.

Query Parameters

timestamp-field
string

The name of the field to use as the timestamp. If not specified, the timestamp will be the time the event was received by Axiom.

timestamp-format
string

The date-time format of the timestamp field. The reference time is Mon Jan 2 15:04:05 -0700 MST 2006, as specified in https://pkg.go.dev/time/?tab=doc#Parse

csv-delimiter
string

The delimiter to use when parsing CSV data. If not specified, the default delimiter is ,.

Body

Data you want to send to Axiom. Supported formats: JSON, NDJSON, CSV. Upload the data in a file or send it in the payload of the request.

Response

ingest status

failed
integer<uint64>
required

Number of failures that occurred during ingest

ingested
integer<uint64>
required

Number of events ingested

processedBytes
integer<uint64>
required

Number of bytes processed

blocksCreated
integer<uint32>

Number of blocks created

failures
object[]

List of failures that occurred during ingest

walLength
integer<uint32>

Length of the WAL