Views

Update a metrics view

Changed on

Changes a saved dashboard. Send at least one field; each one replaces its value wholesale, so metricsCard, metricsColumn, sorting and the filter arrays are not merged into what is already stored. visibility, isCollaborative, teamId, position and ownerId are owner-only, and ownerId must be an active user in the agency. Other users may change the rest when the view is collaborative (anyone who can see it) or when they are a member of the view's team (teamId), collaborative or not. System views cannot be changed at all.

patch/api/v1/metrics-views/{id}

Request

Path parameters

idstring uuid required

Metrics view ID

Example:3f1c9d2e-8a45-4c7b-9f01-2d6e5b4a7c31

Request body

namestring

New view name

positioninteger

Order within the owner's list, from 0 — owner only. A position past the end moves the view last

ownerIdstring uuid

Transfers the view to another user. Must be an active user in the agency — owner only

descriptionstring

Free-text description

visibility'public' | 'team' | 'private'

Who can see the view — owner only

isCollaborativeboolean

Whether anyone who can see the view may change it. Members of the view's team can change it either way

timeFrame'Today' | 'Yesterday' | 'This week' | 'Last week' | 'This month' | 'Last month' | 'This quarter' | 'Last quarter' | 'This year' | 'Last year' | 'Last 30 days' | 'Last 90 days' | 'Last 180 days' | 'All time' | 'null' nullable

Named relative period the dashboard defaults to

fromstring date-time nullable

Start of a fixed date range. Ignored when timeFrame is set

tostring date-time nullable

End of a fixed date range. Ignored when timeFrame is set

teamsToFilterstring[]

Team IDs the dashboard is scoped to

usersToFilterstring[]

User IDs the dashboard is scoped to

metricsCardstring[]

Metrics registry row IDs shown as cards. Unknown IDs are rejected with 400

teamIdstring uuid nullable

Team the view belongs to. IDs outside the agency are rejected with 400

refreshRateinteger

Auto-refresh interval in seconds. 0 disables it

Example request

{
  "visibility": "team",
  "sorting": [
    {
      "id": "placements",
      "direction": "DESC"
    }
  ],
  "timeFrame": "Last 30 days"
}

Response

Metrics view updated

status'ok' required

Changes