Skip to Content
Data Imports

Start Posthog Import

POST
/v0/projects/{idOrSlug}/data-imports/posthog

Authorization

apiKeyAuth
headerx-api-key<token>

FastStats API key. Pass it in the x-api-key header or as a Bearer token in the Authorization header.

Path Parameters

idOrSlug*string

Request Body

application/json
  1. body
apiKey?|null
region*string
Value in"us""eu"
posthogProjectId*string
datasets*array<>
Items1 <= items <= 8

Response Body

DataImportRecord

application/json
  1. response
id*string
source*"posthog"
Value in"posthog"
region*string
Value in"us""eu"
externalProjectId*string
externalProjectName*string|null
status*string
Value in"running""completed""failed""cancelled"
datasets*array<>
currentDataset*|null
counts*
notes*array<string>
error*string|null
rangeFrom*string
rangeTo*string
createdAt*string
finishedAt*string|null
Example Request
curl -X POST 'https://api.faststats.dev/v0/projects/string/data-imports/posthog' \
  -H 'Content-Type: application/json' \
  -d '{
  "region": "us",
  "posthogProjectId": "string",
  "datasets": [
    "replays"
  ]
}'
Example Response
{
  "id": "string",
  "source": "posthog",
  "region": "us",
  "externalProjectId": "string",
  "externalProjectName": "string",
  "status": "running",
  "datasets": [
    "replays"
  ],
  "currentDataset": "replays",
  "counts": {
    "replays": {
      "imported": 0,
      "skipped": 0,
      "failed": 0
    },
    "errors": {
      "imported": 0,
      "skipped": 0,
      "failed": 0
    },
    "collections": {
      "imported": 0,
      "skipped": 0,
      "failed": 0
    },
    "events": {
      "imported": 0,
      "skipped": 0,
      "failed": 0
    },
    "vitals": {
      "imported": 0,
      "skipped": 0,
      "failed": 0
    },
    "segments": {
      "imported": 0,
      "skipped": 0,
      "failed": 0
    },
    "annotations": {
      "imported": 0,
      "skipped": 0,
      "failed": 0
    },
    "insights": {
      "imported": 0,
      "skipped": 0,
      "failed": 0
    }
  },
  "notes": [
    "string"
  ],
  "error": "string",
  "rangeFrom": "string",
  "rangeTo": "string",
  "createdAt": "string",
  "finishedAt": "string"
}