SweetConnect LogoSweetConnect
ApiDatabus metrics

Stream asset state changes

Establishes a Server-Sent Events (SSE) connection to stream real-time metric states.

Access restricted to roles:

  • admin
  • manufacturer-admin
  • manufacturer-user
  • producer-admin
  • producer-user
  • sales-agent
GET
/v1/metrics/stream
AuthorizationBearer <token>

In: header

Response Body

text/event-stream

text/event-stream

text/event-stream

text/event-stream

text/event-stream

text/event-stream

curl -X GET "https://my.sweetconnect.io/api/databus/v1/metrics/stream"

Emitted when a valid state change is processed.

{
  "type": "databus.metrics.state.result",
  "data": {
    "assetId": "asset-1234",
    "state": "running",
    "original": "execute",
    "time": 1711200000000
  },
  "retry": 15000
}

{
  "errors": [
    {
      "errorCode": "RequestValidationError",
      "message": "The 'username' field is required.",
      "extension": {
        "type": "body",
        "key": "username"
      }
    }
  ]
}
{
  "errors": [
    {
      "errorCode": "Unauthorized",
      "message": "Authentication is required to access this resource.",
      "extension": {}
    }
  ]
}
{
  "errors": [
    {
      "errorCode": "NoPermission",
      "message": "You do not have permission to access this resource.",
      "extension": {}
    }
  ]
}
{
  "errorCode": "HttpError",
  "message": "Input is not valid",
  "extension": {}
}
{
  "errors": [
    {
      "errorCode": "InternalServerError",
      "message": "An unexpected error occurred. See logs for further details or create a support ticket.",
      "extension": {}
    }
  ]
}