Warehouse

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

Endpoints

GET
GET
POST
POST
POST
POST
GET
POST

List all warehouse suggestions

Required API key scopes

warehouse_view:read

Query parameters

  • assignee_id
    integer
  • kind
    string
    One of: "certify""deprecate""materialize""unmaterialize"
  • limit
    integer
  • offset
    integer
  • status
    string
    One of: "proposed""accepted""dismissed""expired""auto_resolved"
  • subject_id
    string
  • surface
    string
    One of: "models""catalog"

Response


Example request

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

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": [
{
"payload": {
"subject_name": "string"
},
"evidence": {
"days_with_data": 0,
"human_requests": 0,
"human_users": 0,
"human_days": 0,
"background_requests": 0,
"requests_by_surface": {
"property1": 0,
"property2": 0
},
"last_read_at": "2019-08-24T14:15:22Z"
},
"created_asset": {},
"reviewed_by": {
"id": 0,
"first_name": "string",
"email": "string"
},
"assignee": {
"id": 0,
"first_name": "string",
"email": "string"
},
"kind": "certify",
"subject_kind": "saved_query",
"status": "proposed",
"dismissal_reason": "not_useful",
"asset_outcome": "live",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"subject_id": "80e197be-61ad-4068-b4ff-a483fb5c18f9",
"payload_version": 0,
"evidence_window_start": "2019-08-24T14:15:22Z",
"evidence_window_end": "2019-08-24T14:15:22Z",
"last_seen_at": "2019-08-24T14:15:22Z",
"surfaced_at": "2019-08-24T14:15:22Z",
"reviewed_at": "2019-08-24T14:15:22Z",
"dismissal_note": "string",
"realized_seconds_saved_per_month": 0,
"realized_bytes_saved_per_month": 0,
"can_act": true,
"subject_source_id": "e73bea0e-332b-4501-b025-578fa8bb608b",
"subject_schema_id": "7add8d9b-16c5-4387-97c4-8345f19bf24f"
}
]
}

Retrieve warehouse suggestions

Required API key scopes

warehouse_view:read

Path parameters

  • id
    string

Response


Example request

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

Example response

Status 200
RESPONSE
{
"payload": {
"subject_name": "string"
},
"evidence": {
"days_with_data": 0,
"human_requests": 0,
"human_users": 0,
"human_days": 0,
"background_requests": 0,
"requests_by_surface": {
"property1": 0,
"property2": 0
},
"last_read_at": "2019-08-24T14:15:22Z"
},
"created_asset": {},
"reviewed_by": {
"id": 0,
"first_name": "string",
"email": "string"
},
"assignee": {
"id": 0,
"first_name": "string",
"email": "string"
},
"kind": "certify",
"subject_kind": "saved_query",
"status": "proposed",
"dismissal_reason": "not_useful",
"asset_outcome": "live",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"subject_id": "80e197be-61ad-4068-b4ff-a483fb5c18f9",
"payload_version": 0,
"evidence_window_start": "2019-08-24T14:15:22Z",
"evidence_window_end": "2019-08-24T14:15:22Z",
"last_seen_at": "2019-08-24T14:15:22Z",
"surfaced_at": "2019-08-24T14:15:22Z",
"reviewed_at": "2019-08-24T14:15:22Z",
"dismissal_note": "string",
"realized_seconds_saved_per_month": 0,
"realized_bytes_saved_per_month": 0,
"can_act": true,
"subject_source_id": "e73bea0e-332b-4501-b025-578fa8bb608b",
"subject_schema_id": "7add8d9b-16c5-4387-97c4-8345f19bf24f"
}

Create warehouse suggestions accept

Required API key scopes

warehouse_view:writedata_catalog_approval:writewarehouse_view:write

Path parameters

  • id
    string

Query parameters

  • bulk
    boolean
    Default: false
  • surface
    string
    One of: "models""catalog"

Request parameters

  • refresh_interval_seconds
    integer
  • refresh_mode
  • incremental_key
    string
  • unique_key
    array
  • lookback_seconds
    integer
  • keep_materialized
    boolean
  • delete_view
    boolean

Response


Example request

POST /api/projects/:project_id/warehouse_suggestions/:id/accept
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/warehouse_suggestions/:id/accept/\
-d refresh_interval_seconds="integer"

Example response

Status 200
RESPONSE
{
"payload": {
"subject_name": "string"
},
"evidence": {
"days_with_data": 0,
"human_requests": 0,
"human_users": 0,
"human_days": 0,
"background_requests": 0,
"requests_by_surface": {
"property1": 0,
"property2": 0
},
"last_read_at": "2019-08-24T14:15:22Z"
},
"created_asset": {},
"reviewed_by": {
"id": 0,
"first_name": "string",
"email": "string"
},
"assignee": {
"id": 0,
"first_name": "string",
"email": "string"
},
"kind": "certify",
"subject_kind": "saved_query",
"status": "proposed",
"dismissal_reason": "not_useful",
"asset_outcome": "live",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"subject_id": "80e197be-61ad-4068-b4ff-a483fb5c18f9",
"payload_version": 0,
"evidence_window_start": "2019-08-24T14:15:22Z",
"evidence_window_end": "2019-08-24T14:15:22Z",
"last_seen_at": "2019-08-24T14:15:22Z",
"surfaced_at": "2019-08-24T14:15:22Z",
"reviewed_at": "2019-08-24T14:15:22Z",
"dismissal_note": "string",
"realized_seconds_saved_per_month": 0,
"realized_bytes_saved_per_month": 0,
"can_act": true,
"subject_source_id": "e73bea0e-332b-4501-b025-578fa8bb608b",
"subject_schema_id": "7add8d9b-16c5-4387-97c4-8345f19bf24f"
}

Create warehouse suggestions assign

Required API key scopes

warehouse_view:write

Path parameters

  • id
    string

Request parameters

  • assignee_id
    integer | null

Response


Example request

POST /api/projects/:project_id/warehouse_suggestions/:id/assign
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/warehouse_suggestions/:id/assign/\
-d assignee_id="integer"

Example response

Status 200
RESPONSE
{
"payload": {
"subject_name": "string"
},
"evidence": {
"days_with_data": 0,
"human_requests": 0,
"human_users": 0,
"human_days": 0,
"background_requests": 0,
"requests_by_surface": {
"property1": 0,
"property2": 0
},
"last_read_at": "2019-08-24T14:15:22Z"
},
"created_asset": {},
"reviewed_by": {
"id": 0,
"first_name": "string",
"email": "string"
},
"assignee": {
"id": 0,
"first_name": "string",
"email": "string"
},
"kind": "certify",
"subject_kind": "saved_query",
"status": "proposed",
"dismissal_reason": "not_useful",
"asset_outcome": "live",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"subject_id": "80e197be-61ad-4068-b4ff-a483fb5c18f9",
"payload_version": 0,
"evidence_window_start": "2019-08-24T14:15:22Z",
"evidence_window_end": "2019-08-24T14:15:22Z",
"last_seen_at": "2019-08-24T14:15:22Z",
"surfaced_at": "2019-08-24T14:15:22Z",
"reviewed_at": "2019-08-24T14:15:22Z",
"dismissal_note": "string",
"realized_seconds_saved_per_month": 0,
"realized_bytes_saved_per_month": 0,
"can_act": true,
"subject_source_id": "e73bea0e-332b-4501-b025-578fa8bb608b",
"subject_schema_id": "7add8d9b-16c5-4387-97c4-8345f19bf24f"
}

Create warehouse suggestions dismiss

Required API key scopes

warehouse_view:write

Path parameters

  • id
    string

Query parameters

  • bulk
    boolean
    Default: false
  • surface
    string
    One of: "models""catalog"

Request parameters

  • reason
  • note
    string

Response


Example request

POST /api/projects/:project_id/warehouse_suggestions/: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/warehouse_suggestions/:id/dismiss/\
-d reason=undefined

Example response

Status 200
RESPONSE
{
"payload": {
"subject_name": "string"
},
"evidence": {
"days_with_data": 0,
"human_requests": 0,
"human_users": 0,
"human_days": 0,
"background_requests": 0,
"requests_by_surface": {
"property1": 0,
"property2": 0
},
"last_read_at": "2019-08-24T14:15:22Z"
},
"created_asset": {},
"reviewed_by": {
"id": 0,
"first_name": "string",
"email": "string"
},
"assignee": {
"id": 0,
"first_name": "string",
"email": "string"
},
"kind": "certify",
"subject_kind": "saved_query",
"status": "proposed",
"dismissal_reason": "not_useful",
"asset_outcome": "live",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"subject_id": "80e197be-61ad-4068-b4ff-a483fb5c18f9",
"payload_version": 0,
"evidence_window_start": "2019-08-24T14:15:22Z",
"evidence_window_end": "2019-08-24T14:15:22Z",
"last_seen_at": "2019-08-24T14:15:22Z",
"surfaced_at": "2019-08-24T14:15:22Z",
"reviewed_at": "2019-08-24T14:15:22Z",
"dismissal_note": "string",
"realized_seconds_saved_per_month": 0,
"realized_bytes_saved_per_month": 0,
"can_act": true,
"subject_source_id": "e73bea0e-332b-4501-b025-578fa8bb608b",
"subject_schema_id": "7add8d9b-16c5-4387-97c4-8345f19bf24f"
}

Create warehouse suggestions resume

Required API key scopes

warehouse_view:write

Path parameters

  • id
    string

Response


Example request

POST /api/projects/:project_id/warehouse_suggestions/:id/resume
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/warehouse_suggestions/:id/resume/

Example response

Status 200
RESPONSE
{
"payload": {
"subject_name": "string"
},
"evidence": {
"days_with_data": 0,
"human_requests": 0,
"human_users": 0,
"human_days": 0,
"background_requests": 0,
"requests_by_surface": {
"property1": 0,
"property2": 0
},
"last_read_at": "2019-08-24T14:15:22Z"
},
"created_asset": {},
"reviewed_by": {
"id": 0,
"first_name": "string",
"email": "string"
},
"assignee": {
"id": 0,
"first_name": "string",
"email": "string"
},
"kind": "certify",
"subject_kind": "saved_query",
"status": "proposed",
"dismissal_reason": "not_useful",
"asset_outcome": "live",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"subject_id": "80e197be-61ad-4068-b4ff-a483fb5c18f9",
"payload_version": 0,
"evidence_window_start": "2019-08-24T14:15:22Z",
"evidence_window_end": "2019-08-24T14:15:22Z",
"last_seen_at": "2019-08-24T14:15:22Z",
"surfaced_at": "2019-08-24T14:15:22Z",
"reviewed_at": "2019-08-24T14:15:22Z",
"dismissal_note": "string",
"realized_seconds_saved_per_month": 0,
"realized_bytes_saved_per_month": 0,
"can_act": true,
"subject_source_id": "e73bea0e-332b-4501-b025-578fa8bb608b",
"subject_schema_id": "7add8d9b-16c5-4387-97c4-8345f19bf24f"
}

Retrieve warehouse suggestions status

Required API key scopes

warehouse_view:read

Query parameters

  • surface
    string
    One of: "models""catalog"

Response


Example request

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

Example response

Status 200
RESPONSE
{
"enabled": true,
"eligible": true,
"days_with_data": 0,
"window_days": 0,
"paused_reason": "string",
"refreshed_at": "2019-08-24T14:15:22Z",
"waiting": 0,
"can_show_more": true
}

Create warehouse suggestions surface more

Required API key scopes

warehouse_view:write

Request parameters

  • surface

Response


Example request

POST /api/projects/:project_id/warehouse_suggestions/surface_more
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/warehouse_suggestions/surface_more/\
-d surface=undefined

Example response

Status 200
RESPONSE
{
"surfaced": 0
}