---
title: "Generate an AI competitive insight (7-day cooldown)"
method: POST
path: "/api/v1/apps/{id}/competitor-landscape"
tags: ["Write"]
---

# Generate an AI competitive insight (7-day cooldown)

`POST /api/v1/apps/{id}/competitor-landscape`

## Request

- Base URL: `https://api.trysonar.app`
- URL: `https://api.trysonar.app/api/v1/apps/{id}/competitor-landscape`
- Auth: HTTP bearer

Runs an AI analysis over the landscape: clusters keyword gaps into named opportunity themes with per-keyword metrics, writes threat narratives for climbing competitors, and diffs against the previous analysis. At most one analysis per app per 7 days — 429 with code `cooldown` and the next available time while in cooldown. 403 `trial_locked` on trial plans (AI-cost feature, paid plans only; GET stays available), 422 `no_competitors` / `too_little_data` (fewer than 5 compared keywords), 502 `ai_failed`. Requires a paid (non-trial) Indie or Agency plan and a write-scope API key.

## Path parameters

- `id` string, required

## Request body

- object

## Response `200`

{ app_id, insight } — same insight shape as the GET endpoint

- object
  - `data` object, required: Result payload — full field reference at https://trysonar.app/docs/api

## Other responses

- `400`: Missing or invalid request parameters
- `401`: Missing or invalid API key
- `403`: Plan or scope insufficient (workspace endpoints need an Indie or Agency plan; writes also need a write-scope key)
- `404`: Resource not found or not tracked by your organization
- `422`: no_competitors (track a competitor first) or too_little_data (fewer than 5 compared keywords)
- `429`: cooldown — an analysis was generated within the last 7 days; the message carries the next available time
- `500`: Unexpected server error
- `502`: ai_failed — the AI analysis failed, retry shortly

---

[API](https://skmtc.dev/trysonar/apis/sonar-api.md) · [All operations](https://skmtc.dev/trysonar/apis/sonar-api/llms.txt) · [OpenAPI document](https://skmtc.dev/trysonar/apis/sonar-api/revisions/bf1d31dadd5f?raw)
