Web Analytics Content Autopilot

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

Endpoints

GET
GET
POST
POST

List all web analytics content autopilot runs

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_runs
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_runs/

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_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"
}
]
}

Retrieve web analytics content autopilot runs

Required API key scopes

web_analytics:read

Path parameters

  • id
    string

Response


Example request

GET /api/projects/:project_id/web_analytics_content_autopilot_runs/: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_runs/:id/

Example response

Status 200
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 runs

Stops a pending or generating run without creating content writes.

Required API key scopes

web_analytics:write

Path parameters

  • id
    string

Response


Example request

POST /api/projects/:project_id/web_analytics_content_autopilot_runs/:id/cancel
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_runs/:id/cancel/

Example response

Status 200
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 runs

Captures the current profile and creates one pending on-demand content research run.

Required API key scopes

web_analytics:write

Request parameters

  • profile_id
    string

Response


Example request

POST /api/projects/:project_id/web_analytics_content_autopilot_runs/start
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_runs/start/\
-d profile_id="string"

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"
}