Web Analytics Content Autopilot

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

Endpoints

GET
GET
POST
POST
POST
POST

List all web analytics content autopilot proposals

Required API key scopes

web_analytics:read

Query parameters

  • limit
    integer
  • offset
    integer
  • profile_id
    string
  • run_id
    string

Response


Example request

GET /api/projects/:project_id/web_analytics_content_autopilot_proposals
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_proposals/

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",
"run_id": "dded282c-8ebd-44cf-8ba5-9a234973d1ec",
"proposal_type": "new_content",
"lifecycle_status": "generating",
"title": "string",
"target_query": "string",
"evidence": [
{
"opportunity_kind": "poor_ctr",
"explanation": "string",
"page_url": "http://example.com",
"query": "string"
}
],
"validation_report": {
"passed": true,
"checks": [
{
"check_key": "string",
"label": "string",
"passed": true,
"message": "string",
"blocking": true
}
]
},
"file_path": "string",
"target_url": "http://example.com",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}
]
}

Retrieve web analytics content autopilot proposals

Required API key scopes

web_analytics:read

Path parameters

  • id
    string

Response


Example request

GET /api/projects/:project_id/web_analytics_content_autopilot_proposals/: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_proposals/:id/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"run_id": "dded282c-8ebd-44cf-8ba5-9a234973d1ec",
"proposal_type": "new_content",
"lifecycle_status": "generating",
"title": "string",
"target_query": "string",
"target_url": "http://example.com",
"evidence": [
{
"opportunity_kind": "poor_ctr",
"explanation": "string",
"page_url": "http://example.com",
"query": "string"
}
],
"validation_report": {
"passed": true,
"checks": [
{
"check_key": "string",
"label": "string",
"passed": true,
"message": "string",
"blocking": true
}
]
},
"content_package": {
"file_path": "string",
"title": "string",
"description": "string",
"slug": "string",
"frontmatter": [
{
"key": "string",
"value": "string"
}
],
"internal_links": [
"http://example.com"
],
"source_notes": [
"string"
],
"json_ld": "string",
"llms_txt_line": "string"
},
"original_markdown": "string",
"proposed_markdown": "string",
"brief": {
"intent": "string",
"audience": "string",
"recommended_type": "string",
"target_page": "string",
"site_pages_to_read": [
"string"
],
"competitors_to_research": [
{
"name": "string",
"url": "string"
}
],
"working_title": "string",
"outline": [
"string"
],
"questions_to_answer": [
"string"
],
"competitor_coverage": [
"string"
],
"engine_answer_summary": "string",
"disambiguation": "string"
},
"source_ledger": [
{
"claim": "string",
"source_url": "string",
"quote": "string",
"kind": "site"
}
],
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}

Create web analytics content autopilot proposals

Saves reviewed Markdown and its structured package without publishing it.

Required API key scopes

web_analytics:write

Path parameters

  • id
    string

Request parameters

  • proposed_markdown
    string
  • content_package

Response


Example request

POST /api/projects/:project_id/web_analytics_content_autopilot_proposals/:id/edit
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_proposals/:id/edit/\
-d proposed_markdown="string",\
-d content_package=undefined

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"run_id": "dded282c-8ebd-44cf-8ba5-9a234973d1ec",
"proposal_type": "new_content",
"lifecycle_status": "generating",
"title": "string",
"target_query": "string",
"target_url": "http://example.com",
"evidence": [
{
"opportunity_kind": "poor_ctr",
"explanation": "string",
"page_url": "http://example.com",
"query": "string"
}
],
"validation_report": {
"passed": true,
"checks": [
{
"check_key": "string",
"label": "string",
"passed": true,
"message": "string",
"blocking": true
}
]
},
"content_package": {
"file_path": "string",
"title": "string",
"description": "string",
"slug": "string",
"frontmatter": [
{
"key": "string",
"value": "string"
}
],
"internal_links": [
"http://example.com"
],
"source_notes": [
"string"
],
"json_ld": "string",
"llms_txt_line": "string"
},
"original_markdown": "string",
"proposed_markdown": "string",
"brief": {
"intent": "string",
"audience": "string",
"recommended_type": "string",
"target_page": "string",
"site_pages_to_read": [
"string"
],
"competitors_to_research": [
{
"name": "string",
"url": "string"
}
],
"working_title": "string",
"outline": [
"string"
],
"questions_to_answer": [
"string"
],
"competitor_coverage": [
"string"
],
"engine_answer_summary": "string",
"disambiguation": "string"
},
"source_ledger": [
{
"claim": "string",
"source_url": "string",
"quote": "string",
"kind": "site"
}
],
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}

Create web analytics content autopilot proposals

Returns validated Markdown and structured JSON without publishing it.

Required API key scopes

web_analytics:write

Path parameters

  • id
    string

Response


Example request

POST /api/projects/:project_id/web_analytics_content_autopilot_proposals/:id/export
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_proposals/:id/export/

Example response

Status 200
RESPONSE
{
"filename": "string",
"markdown": "string",
"content_package": {
"file_path": "string",
"title": "string",
"description": "string",
"slug": "string",
"frontmatter": [
{
"key": "string",
"value": "string"
}
],
"internal_links": [
"http://example.com"
],
"source_notes": [
"string"
],
"json_ld": "string",
"llms_txt_line": "string"
}
}

Create web analytics content autopilot proposals

Returns a proposal to generation while keeping its previous result inspectable in history.

Required API key scopes

web_analytics:write

Path parameters

  • id
    string

Response


Example request

POST /api/projects/:project_id/web_analytics_content_autopilot_proposals/:id/regenerate
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_proposals/:id/regenerate/

Example response

Status 202
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"run_id": "dded282c-8ebd-44cf-8ba5-9a234973d1ec",
"proposal_type": "new_content",
"lifecycle_status": "generating",
"title": "string",
"target_query": "string",
"target_url": "http://example.com",
"evidence": [
{
"opportunity_kind": "poor_ctr",
"explanation": "string",
"page_url": "http://example.com",
"query": "string"
}
],
"validation_report": {
"passed": true,
"checks": [
{
"check_key": "string",
"label": "string",
"passed": true,
"message": "string",
"blocking": true
}
]
},
"content_package": {
"file_path": "string",
"title": "string",
"description": "string",
"slug": "string",
"frontmatter": [
{
"key": "string",
"value": "string"
}
],
"internal_links": [
"http://example.com"
],
"source_notes": [
"string"
],
"json_ld": "string",
"llms_txt_line": "string"
},
"original_markdown": "string",
"proposed_markdown": "string",
"brief": {
"intent": "string",
"audience": "string",
"recommended_type": "string",
"target_page": "string",
"site_pages_to_read": [
"string"
],
"competitors_to_research": [
{
"name": "string",
"url": "string"
}
],
"working_title": "string",
"outline": [
"string"
],
"questions_to_answer": [
"string"
],
"competitor_coverage": [
"string"
],
"engine_answer_summary": "string",
"disambiguation": "string"
},
"source_ledger": [
{
"claim": "string",
"source_url": "string",
"quote": "string",
"kind": "site"
}
],
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}

Create web analytics content autopilot proposals

Rejects a proposal without changing the public site.

Required API key scopes

web_analytics:write

Path parameters

  • id
    string

Response


Example request

POST /api/projects/:project_id/web_analytics_content_autopilot_proposals/:id/reject
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_proposals/:id/reject/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"run_id": "dded282c-8ebd-44cf-8ba5-9a234973d1ec",
"proposal_type": "new_content",
"lifecycle_status": "generating",
"title": "string",
"target_query": "string",
"target_url": "http://example.com",
"evidence": [
{
"opportunity_kind": "poor_ctr",
"explanation": "string",
"page_url": "http://example.com",
"query": "string"
}
],
"validation_report": {
"passed": true,
"checks": [
{
"check_key": "string",
"label": "string",
"passed": true,
"message": "string",
"blocking": true
}
]
},
"content_package": {
"file_path": "string",
"title": "string",
"description": "string",
"slug": "string",
"frontmatter": [
{
"key": "string",
"value": "string"
}
],
"internal_links": [
"http://example.com"
],
"source_notes": [
"string"
],
"json_ld": "string",
"llms_txt_line": "string"
},
"original_markdown": "string",
"proposed_markdown": "string",
"brief": {
"intent": "string",
"audience": "string",
"recommended_type": "string",
"target_page": "string",
"site_pages_to_read": [
"string"
],
"competitors_to_research": [
{
"name": "string",
"url": "string"
}
],
"working_title": "string",
"outline": [
"string"
],
"questions_to_answer": [
"string"
],
"competitor_coverage": [
"string"
],
"engine_answer_summary": "string",
"disambiguation": "string"
},
"source_ledger": [
{
"claim": "string",
"source_url": "string",
"quote": "string",
"kind": "site"
}
],
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}