Organizations

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

Endpoints

    GET/api/organizations/
    POST/api/organizations/
    GET/api/organizations/:id/
    PATCH/api/organizations/:id/
    DELETE/api/organizations/:id/
    GET/api/organizations/:organization_id/batch_exports/
    POST/api/organizations/:organization_id/batch_exports/
    GET/api/organizations/:organization_id/batch_exports/:id/
    PATCH/api/organizations/:organization_id/batch_exports/:id/
    DELETE/api/organizations/:organization_id/batch_exports/:id/
    POST/api/organizations/:organization_id/batch_exports/:id/backfill/
    POST/api/organizations/:organization_id/batch_exports/:id/pause/
    POST/api/organizations/:organization_id/batch_exports/:id/unpause/
    GET/api/organizations/:organization_id/domains/
    POST/api/organizations/:organization_id/domains/
    GET/api/organizations/:organization_id/domains/:id/
    PATCH/api/organizations/:organization_id/domains/:id/
    DELETE/api/organizations/:organization_id/domains/:id/
    POST/api/organizations/:organization_id/domains/:id/verify/
    GET/api/organizations/:organization_id/invites/
    POST/api/organizations/:organization_id/invites/
    DELETE/api/organizations/:organization_id/invites/:id/
    POST/api/organizations/:organization_id/invites/bulk/
    GET/api/organizations/:organization_id/members/
    PATCH/api/organizations/:organization_id/members/:user__uuid/
    DELETE/api/organizations/:organization_id/members/:user__uuid/
    GET/api/organizations/:organization_id/pipeline_destinations/
    POST/api/organizations/:organization_id/pipeline_destinations/
    GET/api/organizations/:organization_id/pipeline_destinations/:id/
    PATCH/api/organizations/:organization_id/pipeline_destinations/:id/
    DELETE/api/organizations/:organization_id/pipeline_destinations/:id/
    GET/api/organizations/:organization_id/pipeline_destinations/:id/check_for_updates/
    GET/api/organizations/:organization_id/pipeline_destinations/:id/source/
    PATCH/api/organizations/:organization_id/pipeline_destinations/:id/update_source/
    POST/api/organizations/:organization_id/pipeline_destinations/:id/upgrade/
    GET/api/organizations/:organization_id/pipeline_destinations/activity/
    GET/api/organizations/:organization_id/pipeline_destinations/exports_unsubscribe_configs/
    GET/api/organizations/:organization_id/pipeline_destinations/repository/
    GET/api/organizations/:organization_id/pipeline_destinations/unused/
    GET/api/organizations/:organization_id/pipeline_frontend_apps/
    POST/api/organizations/:organization_id/pipeline_frontend_apps/
    GET/api/organizations/:organization_id/pipeline_frontend_apps/:id/
    PATCH/api/organizations/:organization_id/pipeline_frontend_apps/:id/
    DELETE/api/organizations/:organization_id/pipeline_frontend_apps/:id/
    GET/api/organizations/:organization_id/pipeline_frontend_apps/:id/check_for_updates/
    GET/api/organizations/:organization_id/pipeline_frontend_apps/:id/source/
    PATCH/api/organizations/:organization_id/pipeline_frontend_apps/:id/update_source/
    POST/api/organizations/:organization_id/pipeline_frontend_apps/:id/upgrade/
    GET/api/organizations/:organization_id/pipeline_frontend_apps/activity/
    GET/api/organizations/:organization_id/pipeline_frontend_apps/exports_unsubscribe_configs/
    GET/api/organizations/:organization_id/pipeline_frontend_apps/repository/
    GET/api/organizations/:organization_id/pipeline_frontend_apps/unused/
    GET/api/organizations/:organization_id/pipeline_import_apps/
    POST/api/organizations/:organization_id/pipeline_import_apps/
    GET/api/organizations/:organization_id/pipeline_import_apps/:id/
    PATCH/api/organizations/:organization_id/pipeline_import_apps/:id/
    DELETE/api/organizations/:organization_id/pipeline_import_apps/:id/
    GET/api/organizations/:organization_id/pipeline_import_apps/:id/check_for_updates/
    GET/api/organizations/:organization_id/pipeline_import_apps/:id/source/
    PATCH/api/organizations/:organization_id/pipeline_import_apps/:id/update_source/
    POST/api/organizations/:organization_id/pipeline_import_apps/:id/upgrade/
    GET/api/organizations/:organization_id/pipeline_import_apps/activity/
    GET/api/organizations/:organization_id/pipeline_import_apps/exports_unsubscribe_configs/
    GET/api/organizations/:organization_id/pipeline_import_apps/repository/
    GET/api/organizations/:organization_id/pipeline_import_apps/unused/
    GET/api/organizations/:organization_id/pipeline_transformations/
    POST/api/organizations/:organization_id/pipeline_transformations/
    GET/api/organizations/:organization_id/pipeline_transformations/:id/
    PATCH/api/organizations/:organization_id/pipeline_transformations/:id/
    DELETE/api/organizations/:organization_id/pipeline_transformations/:id/
    GET/api/organizations/:organization_id/pipeline_transformations/:id/check_for_updates/
    GET/api/organizations/:organization_id/pipeline_transformations/:id/source/
    PATCH/api/organizations/:organization_id/pipeline_transformations/:id/update_source/
    POST/api/organizations/:organization_id/pipeline_transformations/:id/upgrade/
    GET/api/organizations/:organization_id/pipeline_transformations/activity/
    GET/api/organizations/:organization_id/pipeline_transformations/exports_unsubscribe_configs/
    GET/api/organizations/:organization_id/pipeline_transformations/repository/
    GET/api/organizations/:organization_id/pipeline_transformations/unused/
    GET/api/organizations/:organization_id/plugins/
    POST/api/organizations/:organization_id/plugins/
    GET/api/organizations/:organization_id/plugins/:id/
    PATCH/api/organizations/:organization_id/plugins/:id/
    DELETE/api/organizations/:organization_id/plugins/:id/
    GET/api/organizations/:organization_id/plugins/:id/check_for_updates/
    GET/api/organizations/:organization_id/plugins/:id/source/
    PATCH/api/organizations/:organization_id/plugins/:id/update_source/
    POST/api/organizations/:organization_id/plugins/:id/upgrade/
    GET/api/organizations/:organization_id/plugins/activity/
    GET/api/organizations/:organization_id/plugins/exports_unsubscribe_configs/
    GET/api/organizations/:organization_id/plugins/repository/
    GET/api/organizations/:organization_id/plugins/unused/
    GET/api/organizations/:organization_id/projects/
    POST/api/organizations/:organization_id/projects/
    GET/api/organizations/:organization_id/projects/:id/
    PATCH/api/organizations/:organization_id/projects/:id/
    DELETE/api/organizations/:organization_id/projects/:id/
    GET/api/organizations/:organization_id/projects/:id/activity/
    GET/api/organizations/:organization_id/projects/:id/is_generating_demo_data/
    PATCH/api/organizations/:organization_id/projects/:id/reset_token/
    GET/api/organizations/:organization_id/proxy_records/
    POST/api/organizations/:organization_id/proxy_records/
    GET/api/organizations/:organization_id/proxy_records/:id/
    PATCH/api/organizations/:organization_id/proxy_records/:id/
    DELETE/api/organizations/:organization_id/proxy_records/:id/
    GET/api/organizations/:organization_id/roles/
    POST/api/organizations/:organization_id/roles/
    GET/api/organizations/:organization_id/roles/:id/
    PATCH/api/organizations/:organization_id/roles/:id/
    DELETE/api/organizations/:organization_id/roles/:id/
    GET/api/organizations/:organization_id/roles/:role_id/role_memberships/
    POST/api/organizations/:organization_id/roles/:role_id/role_memberships/
    DELETE/api/organizations/:organization_id/roles/:role_id/role_memberships/:id/

    Retrieve

    Required API key scopes

    organization:read

    Query parameters

    • limit
      integer

      Number of results to return per page.

    • offset
      integer

      The initial index from which to return the results.

    Response


    Request

    GET /api/organizations
    export POSTHOG_PERSONAL_API_KEY=[your personal api key]
    curl \
    -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
    https://app.posthog.com/api/organizations/

    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",
    "name": "string",
    "slug": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z",
    "membership_level": 1,
    "plugins_access_level": 0,
    "teams": [
    {
    "property1": null,
    "property2": null
    }
    ],
    "available_features": [
    "string"
    ],
    "available_product_features": [
    null
    ],
    "is_member_join_email_enabled": true,
    "metadata": "string",
    "customer_id": "string",
    "enforce_2fa": true,
    "member_count": "string"
    }
    ]
    }

    Retrieve

    Required API key scopes

    organization:read

    Query parameters

    • limit
      integer

      Number of results to return per page.

    • offset
      integer

      The initial index from which to return the results.

    Response


    Request

    GET /api/organizations
    export POSTHOG_PERSONAL_API_KEY=[your personal api key]
    curl \
    -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
    https://app.posthog.com/api/organizations/

    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",
    "name": "string",
    "slug": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z",
    "membership_level": 1,
    "plugins_access_level": 0,
    "teams": [
    {
    "property1": null,
    "property2": null
    }
    ],
    "available_features": [
    "string"
    ],
    "available_product_features": [
    null
    ],
    "is_member_join_email_enabled": true,
    "metadata": "string",
    "customer_id": "string",
    "enforce_2fa": true,
    "member_count": "string"
    }
    ]
    }

    Create

    Required API key scopes

    organization:write

    Request parameters

    • name
      string
    • is_member_join_email_enabled
      boolean
    • enforce_2fa
      boolean

    Response


    Request

    POST /api/organizations
    export POSTHOG_PERSONAL_API_KEY=[your personal api key]
    curl
    -H 'Content-Type: application/json'\
    -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
    https://app.posthog.com/api/organizations/\
    -d name="string"

    Response

    Status 201
    RESPONSE
    {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "name": "string",
    "slug": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z",
    "membership_level": 1,
    "plugins_access_level": 0,
    "teams": [
    {
    "property1": null,
    "property2": null
    }
    ],
    "available_features": [
    "string"
    ],
    "available_product_features": [
    null
    ],
    "is_member_join_email_enabled": true,
    "metadata": "string",
    "customer_id": "string",
    "enforce_2fa": true,
    "member_count": "string"
    }

    Create

    Required API key scopes

    organization:write

    Request parameters

    • name
      string
    • is_member_join_email_enabled
      boolean
    • enforce_2fa
      boolean

    Response


    Request

    POST /api/organizations
    export POSTHOG_PERSONAL_API_KEY=[your personal api key]
    curl
    -H 'Content-Type: application/json'\
    -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
    https://app.posthog.com/api/organizations/\
    -d name="string"

    Response

    Status 201
    RESPONSE
    {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "name": "string",
    "slug": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z",
    "membership_level": 1,
    "plugins_access_level": 0,
    "teams": [
    {
    "property1": null,
    "property2": null
    }
    ],
    "available_features": [
    "string"
    ],
    "available_product_features": [
    null
    ],
    "is_member_join_email_enabled": true,
    "metadata": "string",
    "customer_id": "string",
    "enforce_2fa": true,
    "member_count": "string"
    }

    Retrieve

    Required API key scopes

    organization:read

    Path parameters

    • id
      string

      A UUID string identifying this organization.

    Response


    Request

    GET /api/organizations/:id
    export POSTHOG_PERSONAL_API_KEY=[your personal api key]
    curl \
    -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
    https://app.posthog.com/api/organizations/:id/

    Response

    Status 200
    RESPONSE
    {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "name": "string",
    "slug": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z",
    "membership_level": 1,
    "plugins_access_level": 0,
    "teams": [
    {
    "property1": null,
    "property2": null
    }
    ],
    "available_features": [
    "string"
    ],
    "available_product_features": [
    null
    ],
    "is_member_join_email_enabled": true,
    "metadata": "string",
    "customer_id": "string",
    "enforce_2fa": true,
    "member_count": "string"
    }

    Retrieve

    Required API key scopes

    organization:read

    Path parameters

    • id
      string

      A UUID string identifying this organization.

    Response


    Request

    GET /api/organizations/:id
    export POSTHOG_PERSONAL_API_KEY=[your personal api key]
    curl \
    -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
    https://app.posthog.com/api/organizations/:id/

    Response

    Status 200
    RESPONSE
    {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "name": "string",
    "slug": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z",
    "membership_level": 1,
    "plugins_access_level": 0,
    "teams": [
    {
    "property1": null,
    "property2": null
    }
    ],
    "available_features": [
    "string"
    ],
    "available_product_features": [
    null
    ],
    "is_member_join_email_enabled": true,
    "metadata": "string",
    "customer_id": "string",
    "enforce_2fa": true,
    "member_count": "string"
    }

    Update partial

    Required API key scopes

    organization:write

    Path parameters

    • id
      string

      A UUID string identifying this organization.

    Request parameters

    • name
      string
    • is_member_join_email_enabled
      boolean
    • enforce_2fa
      boolean

    Response


    Request

    PATCH /api/organizations/:id
    export POSTHOG_PERSONAL_API_KEY=[your personal api key]
    curl -X PATCH \
    -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
    https://app.posthog.com/api/organizations/:id/\
    -d name="string"

    Response

    Status 200
    RESPONSE
    {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "name": "string",
    "slug": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z",
    "membership_level": 1,
    "plugins_access_level": 0,
    "teams": [
    {
    "property1": null,
    "property2": null
    }
    ],
    "available_features": [
    "string"
    ],
    "available_product_features": [
    null
    ],
    "is_member_join_email_enabled": true,
    "metadata": "string",
    "customer_id": "string",
    "enforce_2fa": true,
    "member_count": "string"
    }

    Update partial

    Required API key scopes

    organization:write

    Path parameters

    • id
      string

      A UUID string identifying this organization.

    Request parameters

    • name
      string
    • is_member_join_email_enabled
      boolean
    • enforce_2fa
      boolean

    Response


    Request

    PATCH /api/organizations/:id
    export POSTHOG_PERSONAL_API_KEY=[your personal api key]
    curl -X PATCH \
    -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
    https://app.posthog.com/api/organizations/:id/\
    -d name="string"

    Response

    Status 200
    RESPONSE
    {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "name": "string",
    "slug": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z",
    "membership_level": 1,
    "plugins_access_level": 0,
    "teams": [
    {
    "property1": null,
    "property2": null
    }
    ],
    "available_features": [
    "string"
    ],
    "available_product_features": [
    null
    ],
    "is_member_join_email_enabled": true,
    "metadata": "string",
    "customer_id": "string",
    "enforce_2fa": true,
    "member_count": "string"
    }

    Delete

    Required API key scopes

    organization:write

    Path parameters

    • id
      string

      A UUID string identifying this organization.

    Request

    DELETE /api/organizations/:id
    export POSTHOG_PERSONAL_API_KEY=[your personal api key]
    curl -X DELETE \
    -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
    https://app.posthog.com/api/organizations/:id/

    Response

    Status 204 No response body

    Delete

    Required API key scopes

    organization:write

    Path parameters

    • id
      string

      A UUID string identifying this organization.

    Request

    DELETE /api/organizations/:id
    export POSTHOG_PERSONAL_API_KEY=[your personal api key]
    curl -X DELETE \
    -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
    https://app.posthog.com/api/organizations/:id/

    Response

    Status 204 No response body

    List all batch exports

    Required API key scopes

    batch_export:read

    Path parameters

    • organization_id
      string

    Query parameters

    • limit
      integer

      Number of results to return per page.

    • offset
      integer

      The initial index from which to return the results.

    Response


    Request

    GET /api/organizations/:organization_id/batch_exports
    export POSTHOG_PERSONAL_API_KEY=[your personal api key]
    curl \
    -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
    https://app.posthog.com/api/organizations/:organization_id/batch_exports/

    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",
    "team_id": 0,
    "name": "string",
    "destination": {
    "type": "S3",
    "config": null
    },
    "interval": "hour",
    "paused": true,
    "created_at": "2019-08-24T14:15:22Z",
    "last_updated_at": "2019-08-24T14:15:22Z",
    "last_paused_at": "2019-08-24T14:15:22Z",
    "start_at": "2019-08-24T14:15:22Z",
    "end_at": "2019-08-24T14:15:22Z",
    "latest_runs": [
    {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "status": "Cancelled",
    "records_completed": -2147483648,
    "latest_error": "string",
    "data_interval_start": "2019-08-24T14:15:22Z",
    "data_interval_end": "2019-08-24T14:15:22Z",
    "cursor": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "finished_at": "2019-08-24T14:15:22Z",
    "last_updated_at": "2019-08-24T14:15:22Z",
    "records_total_count": -2147483648,
    "batch_export": "0fa0a8a1-f280-4977-8bb4-bc7801a6902f"
    }
    ],
    "hogql_query": "string",
    "schema": null
    }
    ]
    }

    Create batch exports

    Required API key scopes

    batch_export:write

    Path parameters

    • organization_id
      string

    Request parameters

    • name
      string

      A human-readable name for this BatchExport.

    • destination
    • interval
    • paused
      boolean

      Whether this BatchExport is paused or not.

    • last_paused_at
      string

      The timestamp at which this BatchExport was last paused.

    • start_at
      string

      Time before which any Batch Export runs won't be triggered.

    • end_at
      string

      Time after which any Batch Export runs won't be triggered.

    • hogql_query
      string

    Response


    Request

    POST /api/organizations/:organization_id/batch_exports
    export POSTHOG_PERSONAL_API_KEY=[your personal api key]
    curl
    -H 'Content-Type: application/json'\
    -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
    https://app.posthog.com/api/organizations/:organization_id/batch_exports/\
    -d name="string",\
    -d destination=undefined,\
    -d interval=undefined

    Response

    Status 201
    RESPONSE
    {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "team_id": 0,
    "name": "string",
    "destination": {
    "type": "S3",
    "config": null
    },
    "interval": "hour",
    "paused": true,
    "created_at": "2019-08-24T14:15:22Z",
    "last_updated_at": "2019-08-24T14:15:22Z",
    "last_paused_at": "2019-08-24T14:15:22Z",
    "start_at": "2019-08-24T14:15:22Z",
    "end_at": "2019-08-24T14:15:22Z",
    "latest_runs": [
    {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "status": "Cancelled",
    "records_completed": -2147483648,
    "latest_error": "string",
    "data_interval_start": "2019-08-24T14:15:22Z",
    "data_interval_end": "2019-08-24T14:15:22Z",
    "cursor": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "finished_at": "2019-08-24T14:15:22Z",
    "last_updated_at": "2019-08-24T14:15:22Z",
    "records_total_count": -2147483648,
    "batch_export": "0fa0a8a1-f280-4977-8bb4-bc7801a6902f"
    }
    ],
    "hogql_query": "string",
    "schema": null
    }

    Retrieve batch exports

    Required API key scopes

    batch_export:read

    Path parameters

    • id
      string

      A UUID string identifying this batch export.

    • organization_id
      string

    Response


    Request

    GET /api/organizations/:organization_id/batch_exports/:id
    export POSTHOG_PERSONAL_API_KEY=[your personal api key]
    curl \
    -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
    https://app.posthog.com/api/organizations/:organization_id/batch_exports/:id/

    Response

    Status 200
    RESPONSE
    {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "team_id": 0,
    "name": "string",
    "destination": {
    "type": "S3",
    "config": null
    },
    "interval": "hour",
    "paused": true,
    "created_at": "2019-08-24T14:15:22Z",
    "last_updated_at": "2019-08-24T14:15:22Z",
    "last_paused_at": "2019-08-24T14:15:22Z",
    "start_at": "2019-08-24T14:15:22Z",
    "end_at": "2019-08-24T14:15:22Z",
    "latest_runs": [
    {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "status": "Cancelled",
    "records_completed": -2147483648,
    "latest_error": "string",
    "data_interval_start": "2019-08-24T14:15:22Z",
    "data_interval_end": "2019-08-24T14:15:22Z",
    "cursor": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "finished_at": "2019-08-24T14:15:22Z",
    "last_updated_at": "2019-08-24T14:15:22Z",
    "records_total_count": -2147483648,
    "batch_export": "0fa0a8a1-f280-4977-8bb4-bc7801a6902f"
    }
    ],
    "hogql_query": "string",
    "schema": null
    }

    Update batch exports

    Required API key scopes

    batch_export:write

    Path parameters

    • id
      string

      A UUID string identifying this batch export.

    • organization_id
      string

    Request parameters

    • name
      string

      A human-readable name for this BatchExport.

    • destination
    • interval
    • paused
      boolean

      Whether this BatchExport is paused or not.

    • last_paused_at
      string

      The timestamp at which this BatchExport was last paused.

    • start_at
      string

      Time before which any Batch Export runs won't be triggered.

    • end_at
      string

      Time after which any Batch Export runs won't be triggered.

    • hogql_query
      string

    Response


    Request

    PATCH /api/organizations/:organization_id/batch_exports/:id
    export POSTHOG_PERSONAL_API_KEY=[your personal api key]
    curl -X PATCH \
    -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
    https://app.posthog.com/api/organizations/:organization_id/batch_exports/:id/\
    -d team_id="integer"

    Response

    Status 200
    RESPONSE
    {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "team_id": 0,
    "name": "string",
    "destination": {
    "type": "S3",
    "config": null
    },
    "interval": "hour",
    "paused": true,
    "created_at": "2019-08-24T14:15:22Z",
    "last_updated_at": "2019-08-24T14:15:22Z",
    "last_paused_at": "2019-08-24T14:15:22Z",
    "start_at": "2019-08-24T14:15:22Z",
    "end_at": "2019-08-24T14:15:22Z",
    "latest_runs": [
    {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "status": "Cancelled",
    "records_completed": -2147483648,
    "latest_error": "string",
    "data_interval_start": "2019-08-24T14:15:22Z",
    "data_interval_end": "2019-08-24T14:15:22Z",
    "cursor": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "finished_at": "2019-08-24T14:15:22Z",
    "last_updated_at": "2019-08-24T14:15:22Z",
    "records_total_count": -2147483648,
    "batch_export": "0fa0a8a1-f280-4977-8bb4-bc7801a6902f"
    }
    ],
    "hogql_query": "string",
    "schema": null
    }

    Delete batch exports

    Required API key scopes

    batch_export:write

    Path parameters

    • id
      string

      A UUID string identifying this batch export.

    • organization_id
      string

    Request

    DELETE /api/organizations/:organization_id/batch_exports/:id
    export POSTHOG_PERSONAL_API_KEY=[your personal api key]
    curl -X DELETE \
    -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
    https://app.posthog.com/api/organizations/:organization_id/batch_exports/:id/

    Response

    Status 204 No response body

    Create batch exports backfill

    Trigger a backfill for a BatchExport.

    Path parameters

    • id
      string

      A UUID string identifying this batch export.

    • organization_id
      string

    Request parameters

    • name
      string

      A human-readable name for this BatchExport.

    • destination
    • interval
    • paused
      boolean

      Whether this BatchExport is paused or not.

    • last_paused_at
      string

      The timestamp at which this BatchExport was last paused.

    • start_at
      string

      Time before which any Batch Export runs won't be triggered.

    • end_at
      string

      Time after which any Batch Export runs won't be triggered.

    • hogql_query
      string

    Response


    Request

    POST /api/organizations/:organization_id/batch_exports/:id/backfill
    export POSTHOG_PERSONAL_API_KEY=[your personal api key]
    curl
    -H 'Content-Type: application/json'\
    -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
    https://app.posthog.com/api/organizations/:organization_id/batch_exports/:id/backfill/\
    -d name="string",\
    -d destination=undefined,\
    -d interval=undefined

    Response

    Status 200
    RESPONSE
    {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "team_id": 0,
    "name": "string",
    "destination": {
    "type": "S3",
    "config": null
    },
    "interval": "hour",
    "paused": true,
    "created_at": "2019-08-24T14:15:22Z",
    "last_updated_at": "2019-08-24T14:15:22Z",
    "last_paused_at": "2019-08-24T14:15:22Z",
    "start_at": "2019-08-24T14:15:22Z",
    "end_at": "2019-08-24T14:15:22Z",
    "latest_runs": [
    {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "status": "Cancelled",
    "records_completed": -2147483648,
    "latest_error": "string",
    "data_interval_start": "2019-08-24T14:15:22Z",
    "data_interval_end": "2019-08-24T14:15:22Z",
    "cursor": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "finished_at": "2019-08-24T14:15:22Z",
    "last_updated_at": "2019-08-24T14:15:22Z",
    "records_total_count": -2147483648,
    "batch_export": "0fa0a8a1-f280-4977-8bb4-bc7801a6902f"
    }
    ],
    "hogql_query": "string",
    "schema": null
    }

    Create batch exports pause

    Pause a BatchExport.

    Path parameters

    • id
      string

      A UUID string identifying this batch export.

    • organization_id
      string

    Request parameters

    • name
      string

      A human-readable name for this BatchExport.

    • destination
    • interval
    • paused
      boolean

      Whether this BatchExport is paused or not.

    • last_paused_at
      string

      The timestamp at which this BatchExport was last paused.

    • start_at
      string

      Time before which any Batch Export runs won't be triggered.

    • end_at
      string

      Time after which any Batch Export runs won't be triggered.

    • hogql_query
      string

    Response


    Request

    POST /api/organizations/:organization_id/batch_exports/:id/pause
    export POSTHOG_PERSONAL_API_KEY=[your personal api key]
    curl
    -H 'Content-Type: application/json'\
    -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
    https://app.posthog.com/api/organizations/:organization_id/batch_exports/:id/pause/\
    -d name="string",\
    -d destination=undefined,\
    -d interval=undefined

    Response

    Status 200
    RESPONSE
    {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "team_id": 0,
    "name": "string",
    "destination": {
    "type": "S3",
    "config": null
    },
    "interval": "hour",
    "paused": true,
    "created_at": "2019-08-24T14:15:22Z",
    "last_updated_at": "2019-08-24T14:15:22Z",
    "last_paused_at": "2019-08-24T14:15:22Z",
    "start_at": "2019-08-24T14:15:22Z",
    "end_at": "2019-08-24T14:15:22Z",
    "latest_runs": [
    {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "status": "Cancelled",
    "records_completed": -2147483648,
    "latest_error": "string",
    "data_interval_start": "2019-08-24T14:15:22Z",
    "data_interval_end": "2019-08-24T14:15:22Z",
    "cursor": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "finished_at": "2019-08-24T14:15:22Z",
    "last_updated_at": "2019-08-24T14:15:22Z",
    "records_total_count": -2147483648,
    "batch_export": "0fa0a8a1-f280-4977-8bb4-bc7801a6902f"
    }
    ],
    "hogql_query": "string",
    "schema": null
    }

    Create batch exports unpause

    Unpause a BatchExport.

    Path parameters

    • id
      string

      A UUID string identifying this batch export.

    • organization_id
      string

    Request parameters

    • name
      string

      A human-readable name for this BatchExport.

    • destination
    • interval
    • paused
      boolean

      Whether this BatchExport is paused or not.

    • last_paused_at
      string

      The timestamp at which this BatchExport was last paused.

    • start_at
      string

      Time before which any Batch Export runs won't be triggered.

    • end_at
      string

      Time after which any Batch Export runs won't be triggered.

    • hogql_query
      string

    Response


    Request

    POST /api/organizations/:organization_id/batch_exports/:id/unpause
    export POSTHOG_PERSONAL_API_KEY=[your personal api key]
    curl
    -H 'Content-Type: application/json'\
    -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
    https://app.posthog.com/api/organizations/:organization_id/batch_exports/:id/unpause/\
    -d name="string",\
    -d destination=undefined,\
    -d interval=undefined

    Response

    Status 200
    RESPONSE
    {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "team_id": 0,
    "name": "string",
    "destination": {
    "type": "S3",
    "config": null
    },
    "interval": "hour",
    "paused": true,
    "created_at": "2019-08-24T14:15:22Z",
    "last_updated_at": "2019-08-24T14:15:22Z",
    "last_paused_at": "2019-08-24T14:15:22Z",
    "start_at": "2019-08-24T14:15:22Z",
    "end_at": "2019-08-24T14:15:22Z",
    "latest_runs": [
    {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "status": "Cancelled",
    "records_completed": -2147483648,
    "latest_error": "string",
    "data_interval_start": "2019-08-24T14:15:22Z",
    "data_interval_end": "2019-08-24T14:15:22Z",
    "cursor": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "finished_at": "2019-08-24T14:15:22Z",
    "last_updated_at": "2019-08-24T14:15:22Z",
    "records_total_count": -2147483648,
    "batch_export": "0fa0a8a1-f280-4977-8bb4-bc7801a6902f"
    }
    ],
    "hogql_query": "string",
    "schema": null
    }

    List all domains

    Required API key scopes

    organization:read

    Path parameters

    • organization_id
      string

    Query parameters

    • limit
      integer

      Number of results to return per page.

    • offset
      integer

      The initial index from which to return the results.

    Response


    Request

    GET /api/organizations/:organization_id/domains
    export POSTHOG_PERSONAL_API_KEY=[your personal api key]
    curl \
    -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
    https://app.posthog.com/api/organizations/:organization_id/domains/

    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",
    "domain": "string",
    "is_verified": true,
    "verified_at": "2019-08-24T14:15:22Z",
    "verification_challenge": "string",
    "jit_provisioning_enabled": true,
    "sso_enforcement": "string",
    "has_saml": true,
    "saml_entity_id": "string",
    "saml_acs_url": "string",
    "saml_x509_cert": "string"
    }
    ]
    }

    Create domains

    Required API key scopes

    organization:write

    Path parameters

    • organization_id
      string

    Request parameters

    • domain
      string
    • jit_provisioning_enabled
      boolean
    • sso_enforcement
      string
    • saml_entity_id
      string
    • saml_acs_url
      string
    • saml_x509_cert
      string

    Response


    Request

    POST /api/organizations/:organization_id/domains
    export POSTHOG_PERSONAL_API_KEY