v28

latestOpenAPI 3.1.0raw.githubusercontent.com2026-05-013593344.3 KB
Business Events

Create an event

Track timestamped events representing user or organization actions. Events are used to track important business outcomes (signups, conversions, upgrades, cancellations, etc.) and integrate them into Greenflash's quality metrics. Each event can be optionally linked to a conversation, user, and organization.

post/events

Request body

eventTypestring required

The specific name or category of the event being tracked (e.g., "trial_started", "signup", "feature_usage"). This helps categorize events for analysis and often pairs with "value" to define the outcome.

productIdstring uuid required

The unique identifier of the Greenflash product associated with this event. This links the event to a specific product context.

externalUserIdstring

Your system's unique identifier for the user associated with this event. Used to map Greenflash events back to your user records.

userIdstring uuid

The unique Greenflash identifier for the user. Provide this if you already have the Greenflash User ID; otherwise, use "externalUserId".

externalOrganizationIdstring

Your system's unique identifier for the organization associated with this event. Used to map events to your customer accounts.

organizationIdstring uuid

The unique Greenflash identifier for the organization. Provide this if you have the Greenflash Organization ID.

externalConversationIdstring

Your system's unique identifier for the conversation or thread where this event occurred.

conversationIdstring uuid

The unique Greenflash identifier for the conversation. Links the event to a specific chat session in Greenflash.

influence'positive' | 'negative' | 'neutral'

A high-level categorization of how this event generally "changed things" or influenced quality (positive, negative, or neutral). Use this for broad classification of outcomes.

qualityImpactScorenumber

A precise numeric score between -1.0 and 1.0 for direct control over the quality impact. If omitted, it is automatically derived from the "influence" field.

valuestring required

The specific value associated with the event (e.g., "99.00", "5", "premium_plan"). This pairs with "valueType" and "eventType" to define the magnitude or content of the event.

valueType'currency' | 'numeric' | 'text' | 'boolean'

Defines the format of the "value" field (currency, numeric, or text). This ensures the value is interpreted and processed correctly.

eventAtstring date-time

The ISO 8601 timestamp of when the event actually occurred. Defaults to the current time if not provided. Useful for backdating historical events.

propertiesobject

A key-value object for storing additional, unstructured context about the event (e.g., { source: "web_app", campaign_id: "123" }). Useful for custom filtering.

insertIdstring

A unique key for idempotency. If you retry a request with the same insertId, it prevents creating a duplicate event record.

sampleRatenumber

Controls the percentage of requests that are ingested (0.0 to 1.0). For example, 0.1 means 10% of events will be stored. Defaults to 1.0 (all events ingested). Sampling is deterministic based on event type and organization.

forceSampleboolean

When true, bypasses sampling and ensures this event is always ingested regardless of sampleRate. Use for critical events that must be captured.

Response

Event created successfully or existing event returned (idempotent)

successboolean required

Whether the API call was successful.

eventIdstring required

The unique Greenflash ID of the event record that was created.