/

Sending events

Define event types

Name the things that happen in your product and describe their payloads.

3 min read

An event type is a name your customers subscribe to. Pick names that read as a noun and a past-tense verb, separated by a dot: invoice.paid, order.shipped, member.removed.

Create one

curl https://api.sluicehq.dev/v3/event-types \
  -H "Authorization: Bearer sk_test_4f9a2c7e1b" \
  -d name=invoice.paid \
  -d description="An invoice was paid in full"

curl https://api.sluicehq.dev/v3/event-types \
  -H "Authorization: Bearer sk_test_4f9a2c7e1b" \
  -d name=invoice.paid \
  -d description="An invoice was paid in full"

curl https://api.sluicehq.dev/v3/event-types \
  -H "Authorization: Bearer sk_test_4f9a2c7e1b" \
  -d name=invoice.paid \
  -d description="An invoice was paid in full"

Add a schema

A JSON schema is optional, but it does two things for you. Sluice rejects events that do not match it, so a bug on your side never reaches a customer, and the customer portal shows the schema next to the event name.

Naming rules

  • Lowercase letters, numbers, dots and underscores

  • Up to 64 characters

  • Names are permanent. Archive a type instead of renaming it.

Something missing or wrong on this page? Tell us at support@sluicehq.dev and we will fix it.

Create a free website with Framer, the website builder loved by startups, designers and agencies.