Reply to Comment
curl --request POST \
--url https://api.trynawa.com/v1/comments/{id}/replyimport requests
url = "https://api.trynawa.com/v1/comments/{id}/reply"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.trynawa.com/v1/comments/{id}/reply', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));Endpoints
Reply to Comment
Generate a context-aware reply to a comment in Arabic or English.
POST
/
v1
/
comments
/
{id}
/
reply
Reply to Comment
curl --request POST \
--url https://api.trynawa.com/v1/comments/{id}/replyimport requests
url = "https://api.trynawa.com/v1/comments/{id}/reply"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.trynawa.com/v1/comments/{id}/reply', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));Generate an AI-powered reply that matches the commenter’s language and cultural context. For Arabic comments, replies match the detected dialect (Gulf, Egyptian, Levantine, MSA). For English comments, replies are natural and platform-appropriate. Language is auto-detected unless overridden.
Cost: $0.008 per request (8 credits). Semantic cache hits are free (
X-NAWA-Cache: HIT).Request
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The comment ID to reply to. |
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
tone | string | No | Reply tone: friendly, professional, casual, formal. Default: friendly. |
max_length | integer | No | Maximum reply length in characters. Default: 500. |
context | string | No | Additional context about the channel or video to improve reply relevance. |
language | string | No | Force reply language: ar, en, auto. Default: auto (matches commenter’s language). |
Example request
curl -X POST https://api.trynawa.com/v1/comments/cmt_abc123/reply \
-H "Authorization: Bearer nawa_test_sk_xxx" \
-H "Content-Type: application/json" \
-d '{
"tone": "friendly",
"context": "Tech review channel focused on smartphones"
}'
const { data, error } = await nawa.comments.reply('cmt_abc123', {
tone: 'friendly',
context: 'Tech review channel focused on smartphones'
})
result = nawa.comments.reply(
comment_id="cmt_abc123",
tone="friendly",
context="Tech review channel focused on smartphones"
)
Response
Success response (200)
{
"success": true,
"result": {
"comment_id": "cmt_abc123",
"reply_text": "إن شاء الله الجزء الثاني قريب! تابعنا عشان ما يفوتك 🔔",
"reply_dialect": "gulf",
"tone": "friendly",
"original_intent": "question",
"original_dialect": "gulf"
},
"errors": [],
"request_id": "req_rep789xyz012"
}
Result fields
| Field | Type | Description |
|---|---|---|
comment_id | string | The comment that was replied to |
reply_text | string | The generated reply text |
reply_dialect | string | null | Dialect used in the reply (matches original). null for English replies. |
tone | string | The tone used for the reply |
original_intent | string | Detected intent of the original comment |
original_dialect | string | Detected dialect of the original comment |
Was this page helpful?