POST
/
events
curl --request POST \
  --url https://api.dingify.workers.dev/api/events \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '{
  "name": "You got a new payment",
  "channel": "new-channel-name",
  "userId": "user-999",
  "icon": "🎉",
  "notify": true,
  "tags": {
    "plan": "premium",
    "cycle": "monthly"
  }
}'
{
  "ok": true,
  "message": "Event logged!",
  "event": {
    "id": "clwj5o92a0001adaz8mcbxqja",
    "name": "You got a new payment",
    "channelId": "new-channel-name",
    "userId": "user-999",
    "icon": "icon_event.png",
    "notify": true,
    "tags": {
      "Networking": "Yes",
      "Tech": "Yes"
    },
    "createdAt": "2024-05-23T11:14:27.682Z"
  }
}

Authorizations

X-API-KEY
string
header
required

Body

application/json
Details of the event to log.
name
string
required

The name of the event.

Example:

"You got a new payment"

channel
string
required

The channel name where the event is registered.

Example:

"new-channel-name"

userId
string
required

The ID of the user associated with the event.

Example:

"user-999"

notify
boolean
required

Whether to notify users about the event.

Example:

true

icon
string

An optional icon representing the event.

Example:

"🎉"

tags
object

Additional tags providing context for the event.

Example:
{ "plan": "premium", "cycle": "monthly" }

Response

201
application/json
Event logged successfully.
ok
boolean
Example:

true

message
string
Example:

"Event logged!"

event
object