# Messages
## PropertiesAttributesMembers
A `Message` represents an individual message that is sent to or received from Ably.
### nameName
The event name, if provided.
_Type: `String`_
### dataData
The message payload, if provided.
_Type: `String`, `StringBuffer`, `JSON Object``String`, `ByteArray`, `JSONObject`, `JSONArray``String`, `byte[]`, `plain C# object that can be serialized to JSON``String`, `Binary` (ASCII-8BIT String), `Hash`, `Array``NSString *`, `NSData *`, `NSDictionary *`, `NSArray *``String`, `NSData`, `Dictionary`, `Array``String`, `Map`, `List`_
### extrasExtras
Metadata and/or ancillary payloads, if provided. Valid payloads include [`push`](https://ably.com/docs/push/publish.md?source=llms.txt#payload), [`headers`](https://ably.com/docs/channels.md?source=llms.txt#metadata) (a map of strings to strings for arbitrary customer-supplied metadata), [`ephemeral`](https://ably.com/docs/pub-sub/advanced.md?source=llms.txt#ephemeral), and [`privileged`](https://ably.com/docs/platform/integrations/skip-integrations.md?source=llms.txt).
_Type: `JSONObject`, `JSONArray`plain C# object that can be converted to JSON`JSON Object``Hash`, `Array``Dictionary`, `Array``NSDictionary *`, `NSArray *`_
### idId
A Unique ID assigned by Ably to this message.
_Type: `String`_
### clientIdClientIdclient_id
The client ID of the publisher of this message.
_Type: `String`_
### connectionIdConnectionIdconnection_id
The connection ID of the publisher of this message.
_Type: `String`_
### connectionKeyConnectionKeyconnection_key
A connection key, which can optionally be included for a REST publish as part of the [publishing on behalf of a realtime client functionality](https://ably.com/docs/pub-sub/advanced.md?source=llms.txt#publish-on-behalf).
_Type: `String`_
### timestampTimestamp
Timestamp when the message was first received by the Ably, as milliseconds since the epocha `Time` object.
_Type: `Integer``Long Integer``DateTimeOffset``Time``NSDate`_
### encodingEncoding
This will typically be empty as all messages received from Ably are automatically decoded client-side using this value. However, if the message encoding cannot be processed, this attribute will contain the remaining transformations not applied to the `data` payload.
_Type: `String`_
### action
The action type of the message, one of the [`MessageAction`](https://ably.com/docs/api/realtime-sdk/types.md?source=llms.txt#message-action) enum values.
_Type: `enum { MESSAGE_CREATE, MESSAGE_UPDATE, MESSAGE_DELETE, META, MESSAGE_SUMMARY }`_
### serial
A server-assigned identifier that will be the same in all future updates of this message. It can be used to add [annotations](https://ably.com/docs/messages/annotations.md?source=llms.txt) to a message or to [update or delete](https://ably.com/docs/messages/updates-deletes.md?source=llms.txt) it. Serial will only be set if you enable annotations, updates, deletes, and appends in [rules](https://ably.com/docs/channels.md?source=llms.txt#rules).
_Type: `String`_
### annotations
An object containing information about annotations that have been made to the object.
_Type: [`MessageAnnotations`](https://ably.com/docs/api/realtime-sdk/types.md?source=llms.txt#message-annotations)_
### version
An object containing version metadata for messages that have been updated or deleted. See [updating and deleting messages](https://ably.com/docs/messages/updates-deletes.md?source=llms.txt) for more information.
_Type: [`MessageVersion`](#message-version)_
### Message constructors
#### Message.fromEncoded
`Message.fromEncoded(Object encodedMsg, ChannelOptions channelOptions?) -> Message`
A static factory method to create a [`Message`](https://ably.com/docs/api/realtime-sdk/types.md?source=llms.txt#message) from a deserialized `Message`-like object encoded using Ably's wire protocol.
##### Parameters
| Parameter | Description | Type |
|-----------|-------------|------|
| encodedMsg | A `Message`-like deserialized object. | `Object` |
| channelOptions | An optional [`ChannelOptions`](https://ably.com/docs/api/realtime-sdk/types.md?source=llms.txt#channel-options). If you have an encrypted channel, use this to allow the library to decrypt the data. | `Object` |
##### Returns
A [`Message`](https://ably.com/docs/api/realtime-sdk/types.md?source=llms.txt#message) object
#### Message.fromEncodedArray
`Message.fromEncodedArray(Object[] encodedMsgs, ChannelOptions channelOptions?) -> Message[]`
A static factory method to create an array of [`Messages`](https://ably.com/docs/api/realtime-sdk/types.md?source=llms.txt#message) from an array of deserialized `Message`-like object encoded using Ably's wire protocol.
##### Parameters
| Parameter | Description | Type |
|-----------|-------------|------|
| encodedMsgs | An array of `Message`-like deserialized objects. | `Array` |
| channelOptions | An optional [`ChannelOptions`](https://ably.com/docs/api/realtime-sdk/types.md?source=llms.txt#channel-options). If you have an encrypted channel, use this to allow the library to decrypt the data. | `Object` |
##### Returns
An `Array` of [`Message`](https://ably.com/docs/api/realtime-sdk/types.md?source=llms.txt#message) objects
## MessageAnnotations
#### PropertiesMembersAttributes
| Property | Description | Type |
|----------|-------------|------|
| summary | An object whose keys are annotation types, and the values are aggregated summaries for that annotation type | `Record` |
## MessageVersion
#### PropertiesMembersAttributes
| Property | Description | Type |
|----------|-------------|------|
| serial | An Ably-generated ID that uniquely identifies this version of the message. Can be compared lexicographically to determine version ordering. For an original message with an action of `message.create`, this will be equal to the top-level `serial`. | `String` |
| timestamp | The time this version was created (when the update or delete operation was performed). For an original message, this will be equal to the top-level `timestamp`. | `Integer``Long Integer``DateTimeOffset``Time``NSDate` |
| clientId | The client identifier of the user who performed the update or delete operation. Only present for `message.update` and `message.delete` actions. | `String` (optional) |
| description | Optional description provided when the update or delete was performed. Only present for `message.update` and `message.delete` actions. | `String` (optional) |
| metadata | Optional metadata provided when the update or delete was performed. Only present for `message.update` and `message.delete` actions. | `Object` (optional) |
## Related Topics
- [Constructor](https://ably.com/docs/api/realtime-sdk.md?source=llms.txt): Realtime Client Library SDK API reference section for the constructor object.
- [Connection](https://ably.com/docs/api/realtime-sdk/connection.md?source=llms.txt): Realtime Client Library SDK API reference section for the connection object.
- [Channels](https://ably.com/docs/api/realtime-sdk/channels.md?source=llms.txt): Realtime Client Library SDK API reference section for the channels and channel objects.
- [Channel Metadata](https://ably.com/docs/api/realtime-sdk/channel-metadata.md?source=llms.txt): Realtime Client Library SDK API reference section for channel metadata.
- [Presence](https://ably.com/docs/api/realtime-sdk/presence.md?source=llms.txt): Realtime Client Library SDK API reference section for the presence object.
- [Authentication](https://ably.com/docs/api/realtime-sdk/authentication.md?source=llms.txt): Realtime Client Library SDK API reference section for authentication.
- [History](https://ably.com/docs/api/realtime-sdk/history.md?source=llms.txt): Realtime Client Library SDK API reference section for the history methods.
- [Push Notifications - Admin](https://ably.com/docs/api/realtime-sdk/push-admin.md?source=llms.txt): Realtime Client Library SDK API reference section for push notifications admin.
- [Push Notifications - Devices](https://ably.com/docs/api/realtime-sdk/push.md?source=llms.txt): Realtime Client Library SDK API reference section for push notification device subscription.
- [Encryption](https://ably.com/docs/api/realtime-sdk/encryption.md?source=llms.txt): Realtime Client Library SDK API reference section for the crypto object.
- [Statistics](https://ably.com/docs/api/realtime-sdk/statistics.md?source=llms.txt): Realtime Client Library SDK API reference section for the stats object.
- [Types](https://ably.com/docs/api/realtime-sdk/types.md?source=llms.txt): Realtime Client Library SDK API reference section for types.
## Documentation Index
To discover additional Ably documentation:
1. Fetch [llms.txt](https://ably.com/llms.txt?source=llms.txt) for the canonical list of available pages.
2. Identify relevant URLs from that index.
3. Fetch target pages as needed.
Avoid using assumed or outdated documentation paths.