# Reply to a Message

In addition to creating top-level messages, social.plus Chat SDK also allows you to reply to existing messages. To reply to a message, you'll need to specify the parent messages `parentMessageId` as one of the parameters. This allows the SDK to associate the new message as a reply to the parent comment.

Similar to creating a top-level message, you can use the SDK's optimistic creation feature to create a reply message.

{% tabs %}
{% tab title="iOS" %}
**Version 6**

{% embed url="<https://gist.github.com/amythee/5a24fec8ae07856463201f3e7b1a1b00>" %}

**Version 5 (Maintained)**

{% embed url="<https://gist.github.com/amythee/2b2db3ab91f252f723e942ccf2d6482a>" %}
{% endtab %}

{% tab title="Android" %}
**Version 6**

{% embed url="<https://gist.github.com/amythee/7197d3c152436d5c00893771c5ad85cf>" %}

**Version 5 (Maintained)**

{% embed url="<https://gist.github.com/amythee/14df5d319f9c9b999d7cab6e04198def#file-amitymessagereply-kt>" %}
{% endtab %}

{% tab title="JavaScript" %}

```javascript

import { MessageRepository } from '@amityco/js-sdk'
​
const message = { ... };
​
MessageRepository.createTextMessage({
  channelId: 'channelId',
  text: 'reply message',
  parentId: message.messageId
});
```

{% endtab %}

{% tab title="TypeScript" %}
Version 6

{% embed url="<https://gist.github.com/amythee/7a980b5ca8225838ab3b51507a36f26c#file-replymessage-ts>" %}

Beta (v0.0.1)

{% embed url="<https://gist.github.com/7737ac58ff0479b7eb0dc60199b3b74a>" %}
{% endtab %}

{% tab title="Flutter" %}
{% embed url="<https://gist.github.com/amythee/15d2f575d9e3a9badf6a2c63bec0c901>" %}
{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.social.plus/social-plus-sdk/chat/messaging/send-a-message/reply-to-a-message.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
