POST
/
v1
/
livestate
/
broadcast

Use this API to broadcast live state events to any document. Use it with the Live State feature.

Endpoint

POST https://api.velt.dev/v1/livestate/broadcast

Headers

x-velt-api-key
string
required

Your API key.

x-velt-auth-token
string
required

Body Parameters

data
object
required

Example Request

{
  "organizationId": "YOUR_ORGANIZATION_ID",
  "documentId": "YOUR_DOCUMENT_ID",
  "liveStateDataId": "sample_live_state_data_id",
  "data": {
    "status": "active",
    "message": "Hello World",
    "customField": "custom value"
  },
  "merge": true
}

Response

Success Response

{
  "result": {
    "status": "success",
    "message": "Event broadcasted successfully.",
    "data": {
      "success": true
    }
  }
}

Error Response

{
  "error": {
    "message": "ERROR_MESSAGE",
    "status": "ERROR_CODE"
  }
}