To add metadata for a message, send the metadata object inside the message object while sending a message. The same metadata object will be received in message list API with the message object. The metadata object is a map with string keys and values.

Sample Message Object JSON with Metadata:

  "message":"Hi John",
  "metadata" : {
    "key1" : "value1",
    "key2" : "value2"