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

# Update Message Needs Help

PATCH https://api.fortresstech.io/v1/messages/{messageId}/needsHelp
Content-Type: application/json

Available by RequestFlag or resolve a message's **needs help** state. Leslie raises the flag when unable to answer a
resident's question; a Fortress staff member can raise or resolve one too. While any message on the
conversation has an open flag, the conversation's `conversationStatus` reads `NEEDS_HELP` regardless of
where the underlying workflow stands. Resolving the last open flag returns the conversation to whatever
status that workflow currently calls for.A single `PATCH` handles both directions: `isFlagged: true` raises the flag, `isFlagged: false` resolves
it. The response echoes the message plus a rollup of the conversation's needs-help state, so you don't
need a follow-up `GET /conversations` to learn whether the thread is still flagged.The request is idempotent. Flagging an already-flagged message, or resolving one that isn't flagged,
returns `200` with the current state rather than an error — Leslie retrying a request must not have to
distinguish a repeat from the original.This endpoint is part of our evolving API ecosystem.
To explore availability for your integration, please contact our team.

Reference: https://developer.fortresstech.io/api-reference/messaging/update-message-needs-help

## Authentication

- `x-api-key` header (required) — API Key authentication via header

## Request

### Path parameters

- `messageId` (string, required) — The id of the message

### Body (application/json)

This endpoint expects a MessageNeedsHelpUpdate.

- `isFlagged` (boolean, required) — True to flag the message as needing help, false to resolve an existing flag.
- `reason` (string, optional) — Free-text reason for the flag. Omit it rather than sending an empty string. Ignored when `isFlagged` is false.
- `userId` (string, optional) — Attributes the flag or resolution to this Fortress user. Only honoured on requests authenticated with a service `x-api-key`; a request authenticated with a user token ignores this field and is always attributed to the signed-in user instead.

## Response

### 200

The updated message, plus a rollup of the conversation's needs-help state. Returned whether or not this request changed anything.

- `id` (string, optional) — Unique identifier for the message.
- `conversationId` (string, optional) — The conversation this message belongs to. Messages to the same recipient from the same property are grouped into a single conversation.
- `type` (enum, optional) — Direction and origin of the message. Messages created through `POST /messages` are always `OUTBOUND`.
  - Allowed values: `OUTBOUND`, `INBOUND`, `INTERNAL`, `EMAIL`, `UNRECOGNIZED_KEYWORD_RESPONSE`
- `content` (string, optional) — The body of the message. Limited to 1600 characters on send.
- `messageStatus` (string, optional) — Current delivery status. Statuses reported by the downstream carrier or email provider are passed through verbatim, so this is an open set rather than a fixed enum. Statuses set by Fortress: `CREATED`, `PROCESSING`, `FAILED`, `INVALID_PHONE_NUMBER`, `INVALID_EMAIL`, `RECEIVED`, `AUTOMATED`, `MASS_COMMUNICATION`. Statuses reported by the carrier: `QUEUED`, `SENT`, `DELIVERED`, `UNDELIVERED`, `FAILED`. The terminal statuses for SMS are `DELIVERED`, `UNDELIVERED`, and `FAILED`. For email they are `DELIVERED`, `FAILED`, and `REJECTED`.
- `messageStatusReason` (string, optional, nullable) — Explanation for the current status. Populated when a message fails to send.
- `messageSid` (string, optional) — Identifier assigned by the downstream SMS carrier. Absent until the message has been accepted for delivery.
- `customerStatus` (string, optional) — Status of the recipient at the time the message was created, as recorded in Fortress.
- `idempotencyId` (string, optional) — Caller-supplied key that uniquely identifies the send request. Reusing a key returns the original message rather than sending a duplicate.
- `isAutomated` (boolean, optional) — True when the message was generated by a Fortress automation rather than a person.
- `needsHelp` (boolean, optional, nullable) — True while this message has an open needs-help flag. Absent on messages that have never been flagged.
- `needsHelpDetails` (MessagesMessageIdNeedsHelpPatchResponsesContentApplicationJsonSchemaNeedsHelpDetails, optional, nullable) — Who raised the needs-help flag, why, and who resolved it. Absent on messages that have never been flagged. The flag details survive resolution, so this still describes the original request after `needsHelp` returns to false.
- `subject` (string, optional) — Subject line. Email messages only.
- `emailAddress` (string, optional) — Recipient email address. Email messages only.
- `attachments` (list of MessagesMessageIdNeedsHelpPatchResponsesContentApplicationJsonSchemaAttachmentsItems, optional) — Media attached to the message.
- `metadata` (map from string to any, optional) — Caller-supplied metadata, plus `sentAt` and `sentBy` recorded by Fortress at send time.
- `organizationId` (string, optional)
- `customerId` (string, optional) — Set when the recipient is a customer.
- `prospectId` (string, optional) — Set when the recipient is a prospect.
- `userId` (string, optional) — The Fortress user the message was sent on behalf of.
- `createdAt` (datetime, optional)
- `updatedAt` (datetime, optional)
- `conversation` (MessagesMessageIdNeedsHelpPatchResponsesContentApplicationJsonSchemaConversation, optional) — A rollup of the parent conversation, for confirming its status without a follow-up read.

## Errors

### 400 Bad Request Error

`isFlagged` is missing or not a boolean, `reason` is not a string of 1 to 500 characters, or `userId` was supplied but is not a valid UUID.

- `type` (string, optional)
- `title` (string, optional)
- `status` (string, optional)
- `detail` (string, optional)
- `instance` (string, optional)

### 404 Not Found Error

No message exists with this id, or it is outside the requesting key's organization or property scope.

- `type` (string, optional)
- `title` (string, optional)
- `status` (string, optional)
- `detail` (string, optional)
- `instance` (string, optional)

## Types

### MessagesMessageIdNeedsHelpPatchResponsesContentApplicationJsonSchemaNeedsHelpDetails

Who raised the needs-help flag, why, and who resolved it. Absent on messages that have never been flagged. The flag details survive resolution, so this still describes the original request after `needsHelp` returns to false.

- `reason` (string, optional, nullable) — Free-text reason supplied when the flag was raised.
- `flaggedByType` (enum, optional, nullable) — Who raised the flag: `agent` for Leslie, `user` for a Fortress staff member.
  - Allowed values: `agent`, `user`
- `flaggedById` (string, optional, nullable) — Identifies who raised the flag. `leslie` for the agent, otherwise a Fortress user id.
- `flaggedAt` (datetime, optional, nullable) — When the flag was raised.
- `resolvedByType` (enum, optional, nullable) — Who resolved the flag, using the same `agent`/`user` distinction as the flag itself.
  - Allowed values: `agent`, `user`
- `resolvedById` (string, optional, nullable) — Identifies who resolved the flag.
- `resolvedAt` (datetime, optional, nullable) — When the flag was resolved. Null while the flag is still open.

### MessagesMessageIdNeedsHelpPatchResponsesContentApplicationJsonSchemaAttachmentsItems

- `key` (string, optional)
- `bucket` (string, optional)
- `type` (string, optional) — MIME type of the attachment.
- `url` (string, optional) — Time-limited download URL, generated per request. Expires 15 minutes after the response is issued.

### MessagesMessageIdNeedsHelpPatchResponsesContentApplicationJsonSchemaConversation

A rollup of the parent conversation, for confirming its status without a follow-up read.

- `id` (string, optional) — Unique identifier for the conversation.
- `conversationStatus` (enum, optional)
  - Allowed values: `NEEDS_HELP`, `NEW`, `UNRESOLVED`, `RESOLVED`, `INVALID_PHONE_NUMBER`, `INVALID_EMAIL`
- `needsHelpMessageIds` (list of string, optional) — Ids of messages on this conversation that still have an open needs-help flag.

## Examples

**Request**

```json
{
  "isFlagged": true
}
```

**Response**

```json
{
  "id": "string",
  "conversationId": "string",
  "type": "OUTBOUND",
  "content": "string",
  "messageStatus": "string",
  "messageStatusReason": "string",
  "messageSid": "string",
  "customerStatus": "string",
  "idempotencyId": "string",
  "isAutomated": true,
  "needsHelp": true,
  "needsHelpDetails": {
    "reason": "string",
    "flaggedByType": "agent",
    "flaggedById": "string",
    "flaggedAt": "2024-01-15T09:30:00Z",
    "resolvedByType": "agent",
    "resolvedById": "string",
    "resolvedAt": "2024-01-15T09:30:00Z"
  },
  "subject": "string",
  "emailAddress": "string",
  "attachments": [
    {
      "key": "string",
      "bucket": "string",
      "type": "string",
      "url": "string"
    }
  ],
  "metadata": {},
  "organizationId": "string",
  "customerId": "string",
  "prospectId": "string",
  "userId": "string",
  "createdAt": "2024-01-15T09:30:00Z",
  "updatedAt": "2024-01-15T09:30:00Z",
  "conversation": {
    "id": "string",
    "conversationStatus": "NEEDS_HELP",
    "needsHelpMessageIds": [
      "string"
    ]
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.fortresstech.io/v1/messages/messageId/needsHelp"

payload = { "isFlagged": True }
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.fortresstech.io/v1/messages/messageId/needsHelp';
const options = {
  method: 'PATCH',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"isFlagged":true}'
};

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.fortresstech.io/v1/messages/messageId/needsHelp"

	payload := strings.NewReader("{\n  \"isFlagged\": true\n}")

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

	req.Header.Add("x-api-key", "<apiKey>")
	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.fortresstech.io/v1/messages/messageId/needsHelp")

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

request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"isFlagged\": true\n}"

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.patch("https://api.fortresstech.io/v1/messages/messageId/needsHelp")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"isFlagged\": true\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.fortresstech.io/v1/messages/messageId/needsHelp', [
  'body' => '{
  "isFlagged": true
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.fortresstech.io/v1/messages/messageId/needsHelp");
var request = new RestRequest(Method.PATCH);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"isFlagged\": true\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["isFlagged": true] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.fortresstech.io/v1/messages/messageId/needsHelp")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
```