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

# Get Goal & History

GET https://api.customerhub.com/web_api/users/{id}/edit

Get the current user's active goal, its progress highlights, and goal history. Goals are part of the user profile, so this reads `GET /users/:id/edit` and uses the goal fields from the response.

**Authentication:** Required — Bearer token (member).

**Goal fields on the user object:**
- `goal` — Current goal text (`null` when no active goal)
- `goal_updated_at` — ISO 8601 UTC timestamp when the current goal was set
- `goal_author` — Who set the goal (`id`, `name`, `first_name`, `avatar_url`); an admin when set from the admin portal
- `goal_highlights` — Key highlights extracted in the background after the goal is set
- `goal_history` — Archived goals (see below)

**Goal history:** `goal_history` is newest first, capped at the 20 most recent entries. Each entry has `goal`, `highlights`, `author`, `started_at`, `ended_at`, and `status` (`completed`, or `replaced` when a goal is overwritten or cleared via **Set Goal**). History is server-managed and read-only — it cannot be written directly.

**Response:** Full user profile (see **Get Current User Profile**); the goal fields above are the relevant part.

Reference: https://customerhub.com/api/api-reference/goals/get-goal-history

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `id` (string, required) — User ID path segment. The action always returns the authenticated user regardless of the value supplied.

## Response

### 200

OK

## Examples

**Response**

```json
{
  "data": {
    "achievements": [],
    "avatar_media_id": null,
    "avatar_url": null,
    "bio": "Community member",
    "cdata": {},
    "cover_image_url": null,
    "created_at": "2026-09-16T15:32:12Z",
    "email": "user@example.com",
    "engagement_score": 0,
    "facebook": null,
    "first_name": "John",
    "goal": null,
    "goal_author": null,
    "goal_highlights": [],
    "goal_history": [],
    "goal_updated_at": null,
    "id": "c7358892-5f29-47db-a705-2c53d10da4bd",
    "initials": "JD",
    "instagram": null,
    "keap_custom_fields": {},
    "last_name": "Doe",
    "last_seen_at": null,
    "linkedin": null,
    "name": "John Doe",
    "otp_enabled": false,
    "permissions": [
      {
        "created_at": "2026-09-16T15:32:13Z",
        "id": "d7f04ad1-48fa-4811-92ac-c37498412cc7",
        "product_id": "276c0669-64b7-4294-a8d3-30e5f1f77b6c",
        "source_segment_id": null,
        "user_id": "c7358892-5f29-47db-a705-2c53d10da4bd"
      }
    ],
    "phone": "+1 555 0100",
    "profile_completion": 55,
    "segment_ids": [],
    "settings": {
      "hidden_identities": [],
      "notify_comment_reply": true,
      "notify_onboarding_reminders": true,
      "notify_post_access": true,
      "notify_product_updates": true
    },
    "stats": {
      "comments": 3,
      "files": 0,
      "likes": 0,
      "onboardings": 1,
      "pages_completed": 0,
      "products": 1
    },
    "status": "active",
    "suspended_until": null,
    "updated_at": "2026-09-16T15:32:12Z",
    "website": "https://example.com",
    "x_twitter": null
  }
}
```

**SDK Code**

```python Goals_getGoalHistory_example
import requests

url = "https://api.customerhub.com/web_api/users/%7B%7Buser_id%7D%7D/edit"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript Goals_getGoalHistory_example
const url = 'https://api.customerhub.com/web_api/users/%7B%7Buser_id%7D%7D/edit';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

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

```go Goals_getGoalHistory_example
package main

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

func main() {

	url := "https://api.customerhub.com/web_api/users/%7B%7Buser_id%7D%7D/edit"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

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

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

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

}
```

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

url = URI("https://api.customerhub.com/web_api/users/%7B%7Buser_id%7D%7D/edit")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

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

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

HttpResponse<String> response = Unirest.get("https://api.customerhub.com/web_api/users/%7B%7Buser_id%7D%7D/edit")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.customerhub.com/web_api/users/%7B%7Buser_id%7D%7D/edit', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp Goals_getGoalHistory_example
using RestSharp;

var client = new RestClient("https://api.customerhub.com/web_api/users/%7B%7Buser_id%7D%7D/edit");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Goals_getGoalHistory_example
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.customerhub.com/web_api/users/%7B%7Buser_id%7D%7D/edit")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

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()
```