Contents
The Manual
Integrations
Self hosting
Other
Log event
Create an event in Operational. Send either name, content, or both.
Endpoint
- Method:
POST - Path:
/api/v1/log
Authentication
bearerAuth
Request body
Required: true
application/json
Schema: #/components/schemas/LogEventPayload
{
"name": "user signed up",
"avatar": ":)",
"content": "Someone signed up"
}
text/plain
Schema type: string
:) user signed up
Responses
201
Event created
- text/plain: Schema type:
string
400
Invalid payload
- text/plain: Schema type:
string
401
Authorization failed
- text/plain: Schema type:
string
Code samples
SDK (@operational.co/sdk)
import Operational from "@operational.co/sdk";
const ops = new Operational("API_KEY", {
// Optional: override per deployment
baseUrl: "https://api.your-domain.com",
});
await ops.events.log({
name: "user signed up",
avatar: ":)",
});
cURL
curl -X POST "https://api.your-domain.com/api/v1/log" \
-H "Authorization: Bearer API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"user signed up","avatar":":)"}'