HTTP REST API

You can use Logtail even if there's no official library for your programming language by sending your logs to our HTTP API. It's simple to get started.

post
Log an event or an array of events

https://in.logtail.com/
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.
Request
Response
Request
Headers
Content-Type
optional
string
Either application/json or application/msgpack
Authorization
required
string
Bearer YOUR_LOGTAIL_SOURCE_TOKEN
Body Parameters
Multiple events
optional
array
An array of log events encoded in JSON or MessagePack
Single event
optional
object
A single log event encoded in JSON or MessagePack
Response
202: Accepted
The event was or the events were successfully logged.
(empty)
403: Forbidden
You provided an invalid source token.
Unauthorized
406: Not Acceptable
The body is not a valid JSON or MessagePack.
Couldn't parse JSON content.

Example: Single event

cURL (JSON)
cURL (MessagePack)
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{"

Example: Multiple events

cURL (JSON)
cURL (MessagePack)
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/json" \
-d "\x92\x81\xA7message\xA1A\x81\xA7message\xA1B"