Skip to content

Create an Event



POST /api/v1/events/create

Overview

Create an event and specify the event content. Events written via this interface have df_source=custom.

Body Request Parameters

Parameter Name Type Required Description
date integer Y Event time. Unix timestamp, unit: milliseconds
Can be empty: False
status string Y Event status (options: critical/error/warning/ok/info/nodata)
Can be empty: False
Optional values: ['critical', 'error', 'warning', 'ok', 'info', 'nodata']
title string Y Event title
Can be empty: False
message string Detailed description of the event
Can be empty: False
origin string Origin of the event
Can be empty: False
customTags json User-defined fields for events
Can be empty: False

Additional Parameter Notes

Request Example

curl 'https://openapi.guance.com/api/v1/events/create' \
  -H 'Content-Type: application/json' \
  -H 'DF-API-KEY: <DF-API-KEY>' \
  --data-raw $'{"date":1668141576000,"status":"info","title":"Test Custom Event 01","message":"Test Custom Event - Message","customTags":{"server":"Custom Service"}}' \
  --compressed

Response

{
    "code": 200,
    "content": true,
    "errorCode": "",
    "message": "",
    "success": true,
    "traceId": "TRACE-5EB2700B-52BF-40D7-A547-90FB7EC855DD"
} 

Feedback

Is this page helpful? ×