Web Analytics Content Autopilot

For instructions on how to authenticate to use this endpoint, see API overview.

Endpoints

GET
GET
POST
POST
POST

List all web analytics content autopilot opportunities

Required API key scopes

web_analytics:read

Query parameters

  • limit
    integer
  • offset
    integer
  • profile_id
    string

Response


Example request

GET /api/projects/:project_id/web_analytics_content_autopilot_opportunities
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/web_analytics_content_autopilot_opportunities/

Example response

Status 200
RESPONSE
{
"count": 123,
"next": "http://api.example.org/accounts/?offset=400&limit=100",
"previous": "http://api.example.org/accounts/?offset=200&limit=100",
"results": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"profile_id": "bfcb6779-b1f9-41fc-92d7-88f8bc1d12e8",
"run_id": "dded282c-8ebd-44cf-8ba5-9a234973d1ec",
"proposal_id": "10dc578f-36d9-436c-bba3-e0bf53d58e9e",
"kind": "ai_visibility_gap",
"title": "string",
"score": 0.1,
"recommended_type": "new_content",
"target_url": "http://example.com",
"evidence": [
{
"opportunity_kind": "poor_ctr",
"explanation": "string",
"page_url": "http://example.com",
"query": "string"
}
],
"gap": {
"checks": 0,
"cited_checks": 0,
"mentioned_checks": 0,
"citation_rate": 0.1,
"engines": [
"string"
],
"engines_not_citing": [
"string"
],
"competitor_urls": [
"string"
],
"competitor_domains": [
"string"
],
"engine_search_queries": [
"string"
],
"our_cited_urls": [
"string"
],
"latest_answers": [
{
"engine": "string",
"answer_text": "string",
"checked_at": "string"
}
],
"last_checked_at": "string"
},
"status": "new",
"last_refreshed_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}
]
}

Retrieve web analytics content autopilot opportunities

Required API key scopes

web_analytics:read

Path parameters

  • id
    string

Response


Example request

GET /api/projects/:project_id/web_analytics_content_autopilot_opportunities/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/web_analytics_content_autopilot_opportunities/:id/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"profile_id": "bfcb6779-b1f9-41fc-92d7-88f8bc1d12e8",
"run_id": "dded282c-8ebd-44cf-8ba5-9a234973d1ec",
"proposal_id": "10dc578f-36d9-436c-bba3-e0bf53d58e9e",
"kind": "ai_visibility_gap",
"title": "string",
"score": 0.1,
"recommended_type": "new_content",
"target_url": "http://example.com",
"evidence": [
{
"opportunity_kind": "poor_ctr",
"explanation": "string",
"page_url": "http://example.com",
"query": "string"
}
],
"gap": {
"checks": 0,
"cited_checks": 0,
"mentioned_checks": 0,
"citation_rate": 0.1,
"engines": [
"string"
],
"engines_not_citing": [
"string"
],
"competitor_urls": [
"string"
],
"competitor_domains": [
"string"
],
"engine_search_queries": [
"string"
],
"our_cited_urls": [
"string"
],
"latest_answers": [
{
"engine": "string",
"answer_text": "string",
"checked_at": "string"
}
],
"last_checked_at": "string"
},
"status": "new",
"last_refreshed_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}

Create web analytics content autopilot opportunities

Marks an opportunity as dismissed. It stays dismissed across refreshes, and list responses still include it with status dismissed.

Required API key scopes

web_analytics:write

Path parameters

  • id
    string

Response


Example request

POST /api/projects/:project_id/web_analytics_content_autopilot_opportunities/:id/dismiss
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/web_analytics_content_autopilot_opportunities/:id/dismiss/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"profile_id": "bfcb6779-b1f9-41fc-92d7-88f8bc1d12e8",
"run_id": "dded282c-8ebd-44cf-8ba5-9a234973d1ec",
"proposal_id": "10dc578f-36d9-436c-bba3-e0bf53d58e9e",
"kind": "ai_visibility_gap",
"title": "string",
"score": 0.1,
"recommended_type": "new_content",
"target_url": "http://example.com",
"evidence": [
{
"opportunity_kind": "poor_ctr",
"explanation": "string",
"page_url": "http://example.com",
"query": "string"
}
],
"gap": {
"checks": 0,
"cited_checks": 0,
"mentioned_checks": 0,
"citation_rate": 0.1,
"engines": [
"string"
],
"engines_not_citing": [
"string"
],
"competitor_urls": [
"string"
],
"competitor_domains": [
"string"
],
"engine_search_queries": [
"string"
],
"our_cited_urls": [
"string"
],
"latest_answers": [
{
"engine": "string",
"answer_text": "string",
"checked_at": "string"
}
],
"last_checked_at": "string"
},
"status": "new",
"last_refreshed_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}

Create web analytics content autopilot opportunities

Starts a run that researches and drafts content for the selected opportunities.

Required API key scopes

web_analytics:write

Request parameters

  • profile_id
    string
  • opportunity_ids
    array

Response


Example request

POST /api/projects/:project_id/web_analytics_content_autopilot_opportunities/draft
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/web_analytics_content_autopilot_opportunities/draft/\
-d profile_id="string",\
-d opportunity_ids="array"

Example response

Status 202
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"profile_id": "bfcb6779-b1f9-41fc-92d7-88f8bc1d12e8",
"run_status": "pending",
"input_snapshot": {
"domain": "http://example.com",
"confidence": "standard",
"source_urls": [
"http://example.com"
],
"content_boundaries": [
"string"
],
"brand_rules": [
"string"
]
},
"errors": [
{
"error_code": "string",
"message": "string"
}
],
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"completed_at": "2019-08-24T14:15:22Z"
}

Create web analytics content autopilot opportunities

Re-reads AI citation checks and updates the site's content opportunities. Makes no model calls.

Required API key scopes

web_analytics:write

Request parameters

  • profile_id
    string

Example request

POST /api/projects/:project_id/web_analytics_content_autopilot_opportunities/refresh
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/web_analytics_content_autopilot_opportunities/refresh/\
-d profile_id="string"

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"profile_id": "bfcb6779-b1f9-41fc-92d7-88f8bc1d12e8",
"run_id": "dded282c-8ebd-44cf-8ba5-9a234973d1ec",
"proposal_id": "10dc578f-36d9-436c-bba3-e0bf53d58e9e",
"kind": "ai_visibility_gap",
"title": "string",
"score": 0.1,
"recommended_type": "new_content",
"target_url": "http://example.com",
"evidence": [
{
"opportunity_kind": "poor_ctr",
"explanation": "string",
"page_url": "http://example.com",
"query": "string"
}
],
"gap": {
"checks": 0,
"cited_checks": 0,
"mentioned_checks": 0,
"citation_rate": 0.1,
"engines": [
"string"
],
"engines_not_citing": [
"string"
],
"competitor_urls": [
"string"
],
"competitor_domains": [
"string"
],
"engine_search_queries": [
"string"
],
"our_cited_urls": [
"string"
],
"latest_answers": [
{
"engine": "string",
"answer_text": "string",
"checked_at": "string"
}
],
"last_checked_at": "string"
},
"status": "new",
"last_refreshed_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}