Send an Event

You can add Events to your stream data to record discrete actions for future reference.

Before you begin

Sending event data

To send event data to a stream, use the POST method with this endpoint:


You should replace ${topicName} with the name of the topic your stream belongs to, and ${streamId} with the id of the stream you wish to send data to. For example:

You can create a new stream by supplying a ${streamId} that doesn’t already exist. This avoids the need to call the create stream endpoint separately.

Your payload should be an array of events. Each event is an object containing the following properties:


a unique identifier for the event


the nanosecond-precise timestamp at which the event occurred


a object containing key-value string pairs representing tag values


a string value associated with the event

Example request

This example call adds a single event to a stream. The event has an example value and demonstrates use of a tag to include additional information.

  • curl

  • Node.js

curl -i "https://${domain}${topicName}/streams/${streamId}/events/data" \
     -H "Authorization: bearer ${token}" \
     -H "Content-Type: application/json" \
     -d '[{
             "id": "Alert",
             "timestamp": 1618133869000000000,
             "tags": {
                 "capacity": "over"
             "value": "Help"
const https = require('https');

const data = JSON.stringify({
    "id": "Alert",
    "timestamp": 1618133869000000000,
    "tags": {
        "capacity": "over"
    "value": "Help"

const options = {
    hostname: domain + '',
    path: '/topics/' + topicName + '/streams/' + streamId + '/events/data',
    method: 'POST',
    headers: {
        'Authorization': 'Bearer ' + token,
        'Content-Type': 'application/json'

const req = https.request(options);



No payload is returned from this call. A 200 HTTP response code indicates success. If the call fails, you should see either a 4xx or 5xx response code indicating what went wrong.

Using SignalR

// Also available as JsFiddle at
var signalR = require("@microsoft/signalr");
const token = "YOUR_TOKEN"
const workspaceId = "YOUR_WORKSPACE_ID"
const topic = "YOUR_TOPIC_NAME"
const streamId = "ID_OF_STREAM_TO_WRITE_TO"

const options = {
    accessTokenFactory: () => token

const connection = new signalR.HubConnectionBuilder()
    .withUrl("https://writer-" + workspaceId + "", options)

// Establish connection
connection.start().then(async () => {
    console.log("Connected to Quix.");

    // Note, SignalR uses the same models as the HTTP endpoints, so if in doubt, check HTTP endpoint samples or Swagger for model.
    let eventData = [
            "timestamp": * 1000000, // set now in nanoseconds,
            "tags": {
                "capacity": "over"
            "id": "Alert",
            "value": "Successful sample run"

    // Send stream update details
    console.log("Sending event data");
    await connection.invoke("SendEventData", topic, streamId, eventData);
    console.log("Sent event data");