Skip to content

Add message to HCS topic endpoint

POST
/v2/hcs/topic/{topicId}/message

Add a new message to an existing HCS topic endpoint.

topicId
required
string

Topic UUID

X-API-Key
string

API Key

X-API-Secret
string

API Secret

object
topicId
required

The topic UUID

string
123e4567-e89b-12d3-a456-426614174000
eventName
required

The event name

string
InvoiceCreated
attributes

The attributes for the event

Array<object>
object
[
{
"dataType": "string",
"hash": "123e4567-e89b-12d3-a456-426614174000"
}
]

Message has been added to the topic. If the response is empty, it means the message is not added yet, you have to use webhook to subscribe the event, or to get the message id, you can use the getHcsTopicMessageV2 endpoint.

object
id
required

The Message Id

string
topicId
required

The topic UUID

string
message

The message published on Hedera Consensus Service topic

string
url

The link to the network message

string
event
required

The name of the event

string
transactionId

A transaction id from saved topic message

string