Skip to main content
POST
/
1
/
batch
/
{datasetSlug}
Create Events
curl --request POST \
  --url https://api.honeycomb.io/1/batch/{datasetSlug} \
  --header 'Content-Type: application/json' \
  --header 'X-Honeycomb-Team: <api-key>' \
  --data '
[
  {
    "data": {},
    "time": "<string>",
    "samplerate": 123
  }
]
'
[
  {
    "status": 202
  },
  {
    "status": 400,
    "error": "Request body should not be empty."
  },
  {
    "status": 400,
    "error": "Event has too many columns."
  },
  {
    "status": 400,
    "error": "Request body is malformed and cannot be read."
  }
]

Authorizations

X-Honeycomb-Team
string
header
required

A Honeycomb Configuration Key is required to use this API. A Configuration Key can be found in the API Keys section of the environment configuration, which can be found under Environment Settings -> API Keys -> Configuration tab. Check out our documentation to find your API Keys.

More information can be found in Manage Environments.

Headers

Content-Encoding
enum<string>

Included when sending events in a file. Size limitations may be addressed by compressing request bodies with gzip or zstd compression. Be sure to set the Content-Encoding to gzip or zstd when compressing the request body. If sending plaintext, omit this header; "plaintext" is included to simplify the example with curl.

Available options:
gzip,
zstd

Path Parameters

datasetSlug
string
required

The dataset slug.

Body

The array should contain one or more JSON objects representing Events. Each Event contains its payload under the data key. Values of time and/or samplerate can be included as well.

The JSON payload should have the structure:

[{ "data": { "key1": "value1", "key2": 2.0 } }, ... ]

Size limitations may be addressed by compressing request bodies with gzip or zstd compression.

An empty 202 response indicates that the event has been queued for processing.

data
object
time
string

Should be in RFC3339 high precision format (for example, YYYY-MM-DDTHH:MM:SS.mmmZ). May be a Unix epoch (seconds since 1970) with second or greater precision (for example, 1452759330927). Optional. If not set, defaults to the time that the API receives the event.

samplerate
integer

An integer representing the denominator in the fraction 1/n when client-side sampling has been applied. Optional. If not set, defaults to 1, meaning "not sampled". Refer to Sampling for more detail.

Response

Enqueued for processing

status
number
error
string