---
title: "Get trends (Account Authorization)"
method: GET
path: "/api/v1/profile/insight/trend/{externalId}"
tags: ["Insights"]
---

# Get trends (Account Authorization)

`GET /api/v1/profile/insight/trend/{externalId}`

## Request

- Base URL: `https://api.sahha.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.sahha.ai/api/v1/profile/insight/trend/{externalId}`
- Auth: API key in header `Authorization`

Gets trend data for a profile with account authorization. Can be filtered by name, category, and date range.

## Path parameters

- `externalId` string, required

## Query parameters

- `startDateTime` string, date-time
- `endDateTime` string, date-time
- `name` string
- `category` string
- `periodicity` string
- `version` number, float

## Response `200`

Success

- TrendDto[]
  - `id` string, uuid: Unique identifier for the trend.
  - `type` string: The type of the data structure, always 'trend'.
  - `category` string: The category of the trend, such as 'score', 'factor', or 'biomarker'.
  - `name` string: The name of the metric being trended.
  - `state` string: The direction of the trend: 'increasing', 'decreasing', or 'stable'.
  - `isHigherBetter` boolean, nullable: Indicates whether higher values are better for this metric.
  - `valueRange` number[]: The minimum and maximum values in the data set, as [min, max].
  - `unit` string: The unit of measurement for the values.
  - `periodicity` string: The time period each data point represents, typically 'weekly'.
  - `trendStartDateTime` string, date-time: The start datetime for the entire trend period.
  - `trendEndDateTime` string, date-time: The end datetime for the entire trend period.
  - `data` TrendDataPointDto[]: The collection of data points that make up the trend.
    - `id` string, uuid: Unique identifier for the trend data point.
    - `startDateTime` string, date-time: The start date and time of the period this data point represents.
    - `endDateTime` string, date-time: The end date and time of the period this data point represents.
    - `value` number, double: The measured or calculated value for this time period.
    - `percentChangeFromPrevious` number, double, nullable: The percentage change from the previous period's value, expressed as a decimal (e.g., 0.05 = 5% increase).
  - `createdAtUtc` string, date-time: The UTC timestamp when this trend was created.
  - `version` number, float: The version of the trend algorithm used.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized

---

[API](https://skmtc.dev/sahha/apis/sahha-platform-v1.md) - [All operations](https://skmtc.dev/sahha/apis/sahha-platform-v1/llms.txt) - [OpenAPI document](https://skmtc.dev/sahha/apis/sahha-platform-v1/revisions/c7f918b46707?raw)
