Headers
Either application/json or application/msgpack
Bearer YOURLOGTAILSOURCE_TOKEN
Body parameters
An array of log events encoded in JSON or MessagePack
A single log event encoded in JSON or MessagePack
You can use Logtail even if there's no official library for your programming language by sending your logs to our HTTP API.
This endpoint allows you to log a single event or a list of events. The events can be encoded in JSON or preferably in a more efficient MessagePack.
Headers
Either application/json or application/msgpack
Bearer YOURLOGTAILSOURCE_TOKEN
Body parameters
An array of log events encoded in JSON or MessagePack
A single log event encoded in JSON or MessagePack
The event was, or the events were successfully logged.
You provided an invalid source token.
Response body
Unauthorized
The body is not a valid JSON or MessagePack.
Response body
Couldn't parse JSON content.
cURL (JSON)
curl -X POST https://in.logtail.com \
-H "Authorization: Bearer YOUR_LOGTAIL_SOURCE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"message":"logtail is ready","nested":{"values":123}}'
cURL (MessagePack)
curl -X POST https://in.logtail.com \
-H "Authorization: Bearer YOUR_LOGTAIL_SOURCE_TOKEN" \
-H "Content-Type: application/msgpack" \
-d "\x82\xA7message\xB0logtail is ready\xA6nested\x81\xA6values{"
cURL (JSON)
curl -X POST https://in.logtail.com \
-H "Authorization: Bearer YOUR_LOGTAIL_SOURCE_TOKEN" \
-H "Content-Type: application/json" \
-d '[{"message":"A"},{"message":"B"}]'
cURL (MessagePack)
curl -X POST https://in.logtail.com \
-H "Authorization: Bearer YOUR_LOGTAIL_SOURCE_TOKEN" \
-H "Content-Type: application/msgpack" \
-d "\x92\x81\xA7message\xA1A\x81\xA7message\xA1B"