Skip to main content
POST
/
api
/
partner
/
v1
/
analytics
/
targets
curl --request POST \
  --url https://www.genviral.io/api/partner/v1/analytics/targets \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "platform": "tiktok",
    "identifier": "@brand",
    "alias": "Brand HQ"
  }'
{
  "ok": true,
  "code": 201,
  "message": "Analytics target created",
  "data": {
    "target": {
      "id": "e7a7f417-56db-4320-9e9a-fd6fdabda09d",
      "user_id": "7f026314-7657-4b0f-bb45-8fd4c0b95fd7",
      "workspace_id": "4cb5d3fd-8c8f-4ed7-a17c-4ffb52c7e6ac",
      "platform": "tiktok",
      "identifier": "@brand",
      "normalized_identifier": "brand",
      "display_name": "Brand HQ",
      "last_refreshed_at": null
    },
    "created": true
  }
}
Creates a tracked analytics target in the authenticated key scope.

Body Parameters

platform
string
required
Supported values: tiktok, instagram, youtube.
identifier
string
required
Account identifier/handle to track (for example @brand).
alias
string
Optional display name override.
curl --request POST \
  --url https://www.genviral.io/api/partner/v1/analytics/targets \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "platform": "tiktok",
    "identifier": "@brand",
    "alias": "Brand HQ"
  }'
{
  "ok": true,
  "code": 201,
  "message": "Analytics target created",
  "data": {
    "target": {
      "id": "e7a7f417-56db-4320-9e9a-fd6fdabda09d",
      "user_id": "7f026314-7657-4b0f-bb45-8fd4c0b95fd7",
      "workspace_id": "4cb5d3fd-8c8f-4ed7-a17c-4ffb52c7e6ac",
      "platform": "tiktok",
      "identifier": "@brand",
      "normalized_identifier": "brand",
      "display_name": "Brand HQ",
      "last_refreshed_at": null
    },
    "created": true
  }
}

Error Responses

  • 400 invalid_json — request body is not valid JSON
  • 400 invalid_payload — body must be a JSON object
  • 400 — unsupported platform or missing identifier
  • 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.