> ## Documentation Index
> Fetch the complete documentation index at: https://docs.genviral.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Analytics Target

> Update display/refresh/favorite settings for one target

Updates settings for a single tracked analytics target.

## Path Parameters

<ParamField path="id" type="string" required>
  Analytics target ID.
</ParamField>

## Body Parameters

At least one of these fields is required:

<ParamField body="displayName" type="string">
  New display name (nullable).
</ParamField>

<ParamField body="refreshPolicy" type="object">
  Refresh policy patch (for example `freeDailyRefresh`, `maxPosts`).
</ParamField>

<ParamField body="favorite" type="boolean">
  Favorite toggle stored in metadata.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request PATCH \
    --url https://www.genviral.io/api/partner/v1/analytics/targets/e7a7f417-56db-4320-9e9a-fd6fdabda09d \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '{
      "favorite": true
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "ok": true,
    "code": 200,
    "message": "Analytics target updated",
    "data": {
      "id": "e7a7f417-56db-4320-9e9a-fd6fdabda09d",
      "platform": "tiktok",
      "identifier": "@brand",
      "display_name": "Brand HQ",
      "metadata": {
        "favorite": true
      }
    }
  }
  ```
</ResponseExample>

## Error Responses

* `400 missing_target_id` - missing path parameter
* `400 invalid_json` - PATCH body is not valid JSON
* `400 invalid_payload` - PATCH body must be a JSON object
* `400` - no valid updates provided
* `404` - target not found in current key scope
* `401`/`403` - authentication failed or key lacks workspace access
* `500` - unexpected database/analytics service error

All error responses from analytics endpoints include an `error_code` field.
