> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.getdial.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.getdial.ai/_mcp/server.

# Reply to a message

POST https://api.getdial.ai/api/v1/messages/{messageId}/reply
Content-Type: application/json

Sends a threaded reply or a reaction targeted at an existing message.

**The sender is derived from the target message.** The reply goes out
from the Dial number the target message belongs to, to the other party
of that message — there is no `to` or `fromNumberId`. A reply always
stays in the conversation the target message is part of.

The request carries **exactly one** of:

- `body` — a text reply. On iMessage numbers it is delivered as a
  native threaded reply (quoting the target message) when the recipient
  supports threads, and as a regular message otherwise. On standard
  numbers it is delivered as a regular SMS.
- `reaction` — a reaction to the target message: one of the six
  reaction names (`love`, `like`, `dislike`, `laugh`, `emphasize`,
  `question`) or a **single emoji** (one visible symbol — skin-tone and
  multi-person emoji count as one; anything else is rejected with
  `400`). On iMessage numbers the reaction is delivered natively (a
  Tapback). When the recipient can only receive SMS — including
  everything sent from standard numbers — an **emoji** reaction is
  delivered as a regular message whose body is the emoji, and a
  reaction **name** is rejected with `400` (names have no SMS
  rendering; send an emoji instead).

**Targets.** Any message on the account can be targeted, with one
current restriction: on iMessage numbers the target must be an
**inbound** message — replying to your own sent messages isn't
supported on those numbers yet. Standard numbers accept targets in
both directions. A **reaction cannot itself be the target** — replying
or reacting to a reaction is rejected with `400`.

The created message is recorded like any outbound message and billed
the same as Send a message. Its `replyToId` points at the target
message; `reaction` carries the reaction string when one was sent (a
reaction delivered natively has an empty `body`; one delivered as a
regular message carries the emoji in `body` too).

Not idempotent — retrying a failed request can send a duplicate reply.
On an ambiguous failure, confirm via List messages before re-sending.


Reference: https://docs.getdial.ai/api-reference/rest-api/messages/reply-to-message

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: rest
  version: 1.0.0
paths:
  /api/v1/messages/{messageId}/reply:
    post:
      operationId: reply-to-message
      summary: Reply to a message
      description: |
        Sends a threaded reply or a reaction targeted at an existing message.

        **The sender is derived from the target message.** The reply goes out
        from the Dial number the target message belongs to, to the other party
        of that message — there is no `to` or `fromNumberId`. A reply always
        stays in the conversation the target message is part of.

        The request carries **exactly one** of:

        - `body` — a text reply. On iMessage numbers it is delivered as a
          native threaded reply (quoting the target message) when the recipient
          supports threads, and as a regular message otherwise. On standard
          numbers it is delivered as a regular SMS.
        - `reaction` — a reaction to the target message: one of the six
          reaction names (`love`, `like`, `dislike`, `laugh`, `emphasize`,
          `question`) or a **single emoji** (one visible symbol — skin-tone and
          multi-person emoji count as one; anything else is rejected with
          `400`). On iMessage numbers the reaction is delivered natively (a
          Tapback). When the recipient can only receive SMS — including
          everything sent from standard numbers — an **emoji** reaction is
          delivered as a regular message whose body is the emoji, and a
          reaction **name** is rejected with `400` (names have no SMS
          rendering; send an emoji instead).

        **Targets.** Any message on the account can be targeted, with one
        current restriction: on iMessage numbers the target must be an
        **inbound** message — replying to your own sent messages isn't
        supported on those numbers yet. Standard numbers accept targets in
        both directions. A **reaction cannot itself be the target** — replying
        or reacting to a reaction is rejected with `400`.

        The created message is recorded like any outbound message and billed
        the same as Send a message. Its `replyToId` points at the target
        message; `reaction` carries the reaction string when one was sent (a
        reaction delivered natively has an empty `body`; one delivered as a
        regular message carries the emoji in `body` too).

        Not idempotent — retrying a failed request can send a duplicate reply.
        On an ambiguous failure, confirm via List messages before re-sending.
      tags:
        - messages
      parameters:
        - name: messageId
          in: path
          description: ID of the message to reply or react to (see List messages).
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: 'Your Dial API key, sent as `Authorization: Bearer sk_live_...`'
          required: true
          schema:
            type: string
      responses:
        '201':
          description: >-
            Reply queued. The created message, with `replyToId` set to the
            target message's ID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Messages_replyToMessage_Response_201'
        '400':
          description: The request body failed validation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: >-
            Insufficient Dial credit. The number is pay-as-you-go and the
            account's credit balance is at or below zero. Add credit or start a
            subscription. (error code `insufficient_credit`.)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: The requested resource was not found on this account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: >-
            The recipient is rate-limited. New contacts on iMessage numbers can
            only receive a limited number of messages until they reply; once
            they respond, the limit lifts. (error code `rate_limited`.)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                body:
                  type: string
                  description: >-
                    Reply text. Exactly one of `body` and `reaction` is
                    required.
                reaction:
                  type: string
                  description: >-
                    Reaction to send: `love`, `like`, `dislike`, `laugh`,
                    `emphasize`, `question`, or a single emoji. Exactly one of
                    `body` and `reaction` is required.
servers:
  - url: https://api.getdial.ai
    description: Dial REST API
components:
  schemas:
    MessageDirection:
      type: string
      enum:
        - inbound
        - outbound
      title: MessageDirection
    MessageChannel:
      type: string
      enum:
        - sms
        - imessage
        - rcs
        - unknown
      description: >-
        The channel the message was delivered on. `sms` for SMS/call numbers.
        For iMessage numbers, inbound messages report the channel actually used
        — `imessage`, `rcs`, or `sms`. Outbound iMessage sends report `unknown`,
        because the iMessage channel does not confirm which channel was
        ultimately used.
      title: MessageChannel
    MessageService:
      type: string
      enum:
        - imessage
        - rcs
        - sms
      description: >-
        For iMessage numbers, the confirmed delivery channel. Null for SMS/call
        numbers (where `channel` already says `sms`). Deprecated — prefer
        `channel`, which is authoritative.
      title: MessageService
    MessageStatus:
      type: string
      enum:
        - sent
        - delivered
        - undelivered
        - failed
        - unknown
        - received
      description: >-
        Delivery status. Outbound SMS/call messages start at `sent` and reach a
        terminal `delivered`, `undelivered`, or `failed`. Outbound iMessage
        messages are `unknown` (the iMessage channel does not report delivery).
        Inbound messages are `received`.
      title: MessageStatus
    MessageMedia:
      type: object
      properties:
        id:
          type: string
          description: Public media ID — an unguessable 32-character token.
        url:
          type: string
          format: uri
          description: >-
            Stable public URL serving the media (see Get public media). Safe to
            use directly as an image source; requires no authentication.
        contentType:
          type: string
          description: MIME type of the media.
        originalUrl:
          type:
            - string
            - 'null'
          description: >-
            Where the media came from — the caller-supplied URL on outbound
            messages, or the carrier's source URL on inbound messages. Null when
            the media was uploaded directly as bytes.
      description: A media attachment on a message, hosted by Dial.
      title: MessageMedia
    Message:
      type: object
      properties:
        id:
          type: string
        phoneNumberId:
          type: string
        from:
          type: string
          description: Sender in E.164 format.
        to:
          type: string
          description: Recipient in E.164 format.
        body:
          type: string
        direction:
          $ref: '#/components/schemas/MessageDirection'
        channel:
          $ref: '#/components/schemas/MessageChannel'
          description: >-
            The channel the message was delivered on. `sms` for SMS/call
            numbers. For iMessage numbers, inbound messages report the channel
            actually used — `imessage`, `rcs`, or `sms`. Outbound iMessage sends
            report `unknown`, because the iMessage channel does not confirm
            which channel was ultimately used.
        service:
          $ref: '#/components/schemas/MessageService'
          description: >-
            For iMessage numbers, the confirmed delivery channel. Null for
            SMS/call numbers (where `channel` already says `sms`). Deprecated —
            prefer `channel`, which is authoritative.
        status:
          $ref: '#/components/schemas/MessageStatus'
          description: >-
            Delivery status. Outbound SMS/call messages start at `sent` and
            reach a terminal `delivered`, `undelivered`, or `failed`. Outbound
            iMessage messages are `unknown` (the iMessage channel does not
            report delivery). Inbound messages are `received`.
        statusError:
          type:
            - string
            - 'null'
          description: >-
            A human-readable reason, present only when `status` is `undelivered`
            or `failed` (for example, when a carrier rejects the message). Null
            otherwise.
        media:
          type: array
          items:
            $ref: '#/components/schemas/MessageMedia'
          description: >-
            Media attachments on the message, in send order. Empty for plain
            text messages.
        replyToId:
          type:
            - string
            - 'null'
          description: >-
            ID of the message this one replies or reacts to. Set on messages
            created via Reply to a message, and on inbound threaded replies and
            reactions received on iMessage numbers. Null for ordinary messages,
            or when the target of an inbound reply isn't a message on your
            account.
        reaction:
          type:
            - string
            - 'null'
          description: >-
            The reaction this message carries — a reaction name (`love`, `like`,
            `dislike`, `laugh`, `emphasize`, `question`) or an emoji — when the
            message is a reaction, sent or received. Null otherwise. A reaction
            delivered natively has an empty `body`; a reaction delivered as a
            regular message over SMS carries the emoji in `body` too.
        createdAt:
          type: string
          format: date-time
      title: Message
    Messages_replyToMessage_Response_201:
      type: object
      properties:
        message:
          $ref: '#/components/schemas/Message'
      title: Messages_replyToMessage_Response_201
    ErrorError:
      oneOf:
        - type: string
        - type: object
          additionalProperties:
            description: Any type
      description: An error message, or a validation-error object for 400 responses.
      title: ErrorError
    Error:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/ErrorError'
          description: An error message, or a validation-error object for 400 responses.
      title: Error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Your Dial API key, sent as `Authorization: Bearer sk_live_...`'

```

## Examples



**Request**

```json
{}
```

**Response**

```json
{
  "message": {
    "id": "string",
    "phoneNumberId": "string",
    "from": "+14155550123",
    "to": "+14155559876",
    "body": "string",
    "direction": "inbound",
    "channel": "sms",
    "service": "imessage",
    "status": "delivered",
    "statusError": null,
    "media": [
      {
        "id": "a3f9c2d41e8b4f0a9c6d2e7b5a1f8c30",
        "url": "https://getdial.ai/public-media/a3f9c2d41e8b4f0a9c6d2e7b5a1f8c30.jpg",
        "contentType": "image/jpeg",
        "originalUrl": "https://your-cdn.example.com/summary.png"
      }
    ],
    "replyToId": null,
    "reaction": null,
    "createdAt": "2024-01-15T09:30:00Z"
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.getdial.ai/api/v1/messages/messageId/reply"

payload = {}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.getdial.ai/api/v1/messages/messageId/reply';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.getdial.ai/api/v1/messages/messageId/reply"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.getdial.ai/api/v1/messages/messageId/reply")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.getdial.ai/api/v1/messages/messageId/reply")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.getdial.ai/api/v1/messages/messageId/reply', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.getdial.ai/api/v1/messages/messageId/reply");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getdial.ai/api/v1/messages/messageId/reply")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```