Home Articles Pitch Api

Contents

Start hereAPI DocsIntroductionSend your first eventEvent parametersStructured EventsActionsContextsError handlingManualIntroductionBasicsConventionsSetupTest modeNotificationsPWA

API Docs

Event api params

Here are all event api’s parameters. Only name is required, everything else is optional.

namestring required

Required, must be a string, max 26 characters, more characters will be truncated.

avatarstring

1 character only. Rest will be truncated.

typestring

If left blank, defaults to ‘text’. Controls how content field is rendered. Options are ‘text’, ‘rows’, ‘json’, ‘image’.

userIdstring

Defaults to null. Use this to map events to specific users. If a number is passed, it will be converted to a string.

contentstring/json

Mixed content type, can be a string or JSON depending on what type is set.

actionsjson

JSON Array, defaults to an empty array. Related to actions.

mutedboolean

Defaults to false. If true, won’t show up in the events UI unless the unmute button next to the search bar is clicked.

notifyboolean

Defaults to false. If true, will send you a push notification(if enabled on your device)

testboolean

Optional, boolean, defaults to false. If true, this event won’t show up unless test mode is activated.

contextIdstring

Defaults to null. Related to contexts.

contextStartboolean

Defaults to false. Related to contexts.

const ops = new Operational("yourapikey");
const e = {
  name: "some event",
  avatar: "🤖",
  type: "text",
  userId: null,
  content: "Hello mellow!",
  actions: [],
  muted: false,
  notify: false,
  test: false,
  contextId: null,
  contextStart: false
};

await ops.events.ingest(e);
Copy
Send your first eventStructured Events