# Save a member's needs-analysis comments

`PUT /api/members/prospects/{memberId}/needs-analysis`

- **Success:** `200 OK`
- **Products:** not restricted by product
- **Features:** Prospecting (`PROSPECTS`)

HTML version: [Save a member's needs-analysis comments](https://support.gladstonesoftware.cloud/reference/members/save-a-members-needs-analysis-comments)

## Overview

Saves the needs-analysis note held against a member — the free-text record of what a prospective member said they want from a gym or centre, captured during a sales conversation.

A member has at most one needs-analysis record. This single call covers both creating it and changing it: if no record exists, one is created; if one exists, its comments are overwritten. You never need to check first, and there is no separate `POST`.

**The whole note is replaced on every call.** Omitting `comments`, or sending `null`, does not preserve the existing text — it stores an empty note. Read the current value first if you are appending to it.

The user and timestamps are stamped server-side from the calling context. `raisedByUserId` and `raisedDate` are set once when the record is first created and never change; `lastActionUserId` and `lastActionDate` are refreshed on every save. Any values you send for them are ignored.

Unlike most endpoints here, this one returns the saved record with `200 OK` rather than `204`.

## Endpoint

`PUT {base_url}/api/members/prospects/{memberId}/needs-analysis`

`{base_url}` is the environment URL issued to your integration. See [Authenticating with Gladstone APIs](../../guides/authenticating-with-gladstone-apis.md).

## Path parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `memberId` | integer (int32) | Yes | The member the note belongs to. Must be greater than 0, and must exist — a member that does not exist returns `422`, not `404`. |

## Request body

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `comments` | string | No | The needs-analysis note, maximum 4000 characters. Replaces the stored note outright. Omitting it or sending `null` is accepted and stores an empty note, so send the full text every time — including any text you want to keep. |

## Sample request

```bash title="cURL"
curl -X PUT '{base_url}/api/members/prospects/{memberId}/needs-analysis' \
  -H 'Authorization: Bearer {accessToken}' \
  -H 'X-Use-SSO: true' \
  -H 'Content-Type: application/json' \
  -d '{
  "comments": "string"
}'
```

## Response fields

| Field | Type | Description |
|-------|------|-------------|
| `id` | integer (int32) | The id of the needs-analysis record. Assigned when the record is first created and stable thereafter. |
| `memberId` | integer (int32) | The member the note belongs to — always the id from the path. |
| `comments` | string | The note as stored. Empty if you sent no `comments`. |
| `raisedByUserId` | string | The user who first created the record, taken from the calling context. Not changed by later saves. |
| `raisedDate` | string (date-time) | When the record was first created, in UTC. Not changed by later saves. |
| `lastActionUserId` | string | The user who made this save, taken from the calling context. Overwritten on every save. |
| `lastActionDate` | string (date-time) | When this save happened, in UTC. Overwritten on every save — use it to detect concurrent edits by staff. |

## Sample response

```json title="200 OK"
{
  "id": 12345,
  "memberId": 12345,
  "comments": "string",
  "raisedByUserId": "string",
  "raisedDate": "2026-08-14T19:00:00Z",
  "lastActionUserId": "string",
  "lastActionDate": "2026-08-14T19:00:00Z"
}
```

## Errors

| Status | Meaning | When |
|--------|---------|------|
| `400` | Bad request | `memberId` is 0 or negative, or the body is missing: `A valid memberId and request body are required.` |
| `400` | Bad request | `comments` is longer than 4000 characters: `comments must be 4000 characters or fewer.` |
| `422` | Unprocessable entity | No member exists with that id: `Member {memberId} does not exist.` |
| `500` | Internal server error | The change could not be saved, or another unexpected server-side failure occurred. No detail is returned in the body. |
