Skip to content
Documentation
Hevia for developers

Events

Send your own events (an order was paid, a booking was made) to start the business's automations.

Send your own events (an order was paid, a booking was made) to start the business's automations.

Send an event to the automations

POST /events

ScopePackageIdempotency-Key
events:writeScale (API) with automationsnot used

Needs the automations feature as well (Growth and up, so every Scale business has it). The body may be up to 64 KB. type must be one of the event types of the automations (see the guide Trigger a workflow by API); type plus id runs once: sending the same pair again answers 200 with duplicate: true and starts nothing. The answer lists the automation runs that started.

Request body

JSON object EventInput.

FieldTypeDescription
type (required)string
id (required)stringYour id of the event; the same type + id runs once.
contactobject
dataobject

Request

curl -X POST "https://hevia.app/api/v1/events" \
  -H "Authorization: Bearer $HEVIA_KEY" \
  -H "Content-Type: application/json" \
  -d '{"type":"order.paid","id":"order-1042","contact":{"email":"anna@example.com"},"data":{"order_number":"1042","amount":"129.00"}}'

Response

200 Duplicate (already received, nothing runs twice), 201 Accepted.

JSON
{
  "data": {
    "id": "3f1c2a9e-5b7d-4e21-9c0a-6d8e2f4b1a70",
    "duplicate": false,
    "runs": [
      {
        "ruleId": "order-paid-thanks",
        "status": "scheduled"
      }
    ]
  }
}

Errors

StatusCodeWhen
400invalid_requestInvalid request
401unauthorizedMissing or invalid key
403insufficient_scopeThe key or token does not have the scope of the endpoint.
403plan_requiredThe business's package does not include the API (Scale) or the feature of the endpoint.
413payload_too_largeBody too large
422invalid_requestInvalid body
429rate_limitedRate limit (120 requests per minute and key); see the RateLimit-* headers

Generated from the product's own registries, so the reference matches the API.