Skip to content

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:

  • id
    a unique identifier for the event

  • timestamp
    the nanosecond-precise timestamp at which the event occurred

  • tags
    a object containing key-value string pairs representing tag values

  • value
    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 -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

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");


Also available as JsFiddle at