Streamlit

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

Endpoints

GET
POST
GET
PATCH
DELETE
POST
GET
POST
POST
GET
POST
POST
GET

List all streamlit apps

Required API key scopes

streamlit_app:read

Query parameters

  • limit
    integer
  • offset
    integer

Response


Example request

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

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": [
{
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "string",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "string"
},
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"short_id": "string",
"name": "string",
"description": "string",
"cpu_cores": 0.1,
"memory_gb": 0.1,
"status": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}
]
}

Create streamlit apps

Required API key scopes

streamlit_app:write

Request parameters

  • name
    string
  • description
    string
  • cpu_cores
    number
  • memory_gb
    number

Response


Example request

POST /api/projects/:project_id/streamlit_apps
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/streamlit_apps/\
-d name="string"

Example response

Status 201
RESPONSE
{
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "string",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "string"
},
"active_version": {
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "string",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "string"
},
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"version_number": 0,
"zip_hash": "string",
"snapshot_id": "string",
"created_at": "2019-08-24T14:15:22Z"
},
"sandbox": {
"status": "string",
"restart_count": 0,
"last_error": "string",
"started_at": "2019-08-24T14:15:22Z",
"last_activity_at": "2019-08-24T14:15:22Z",
"version_number": 0
},
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"short_id": "string",
"name": "string",
"description": "string",
"cpu_cores": 0.1,
"memory_gb": 0.1,
"status": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}

Retrieve streamlit apps

Required API key scopes

streamlit_app:read

Path parameters

  • short_id
    string

Response


Example request

GET /api/projects/:project_id/streamlit_apps/:short_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/streamlit_apps/:short_id/

Example response

Status 200
RESPONSE
{
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "string",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "string"
},
"active_version": {
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "string",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "string"
},
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"version_number": 0,
"zip_hash": "string",
"snapshot_id": "string",
"created_at": "2019-08-24T14:15:22Z"
},
"sandbox": {
"status": "string",
"restart_count": 0,
"last_error": "string",
"started_at": "2019-08-24T14:15:22Z",
"last_activity_at": "2019-08-24T14:15:22Z",
"version_number": 0
},
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"short_id": "string",
"name": "string",
"description": "string",
"cpu_cores": 0.1,
"memory_gb": 0.1,
"status": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}

Update streamlit apps

Required API key scopes

streamlit_app:write

Path parameters

  • short_id
    string

Request parameters

  • name
    string
  • description
    string
  • cpu_cores
    number
  • memory_gb
    number

Response


Example request

PATCH /api/projects/:project_id/streamlit_apps/:short_id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X PATCH \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/streamlit_apps/:short_id/\
-d name="string"

Example response

Status 200
RESPONSE
{
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "string",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "string"
},
"active_version": {
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "string",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "string"
},
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"version_number": 0,
"zip_hash": "string",
"snapshot_id": "string",
"created_at": "2019-08-24T14:15:22Z"
},
"sandbox": {
"status": "string",
"restart_count": 0,
"last_error": "string",
"started_at": "2019-08-24T14:15:22Z",
"last_activity_at": "2019-08-24T14:15:22Z",
"version_number": 0
},
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"short_id": "string",
"name": "string",
"description": "string",
"cpu_cores": 0.1,
"memory_gb": 0.1,
"status": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}

Delete streamlit apps

Required API key scopes

streamlit_app:write

Path parameters

  • short_id
    string

Example request

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

Example response

Status 204 No response body

Create streamlit apps activate version

Path parameters

  • short_id
    string

Request parameters

  • version_number
    integer

Response


Example request

POST /api/projects/:project_id/streamlit_apps/:short_id/activate_version
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/streamlit_apps/:short_id/activate_version/\
-d version_number="integer"

Example response

Status 200
RESPONSE
{
"active_version": {
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "string",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "string"
},
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"version_number": 0,
"zip_hash": "string",
"snapshot_id": "string",
"created_at": "2019-08-24T14:15:22Z"
}
}

Retrieve streamlit apps connect info

Path parameters

  • short_id
    string

Response


Example request

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

Example response

Status 200
RESPONSE
{
"iframe_url": "string",
"expires_in": 0
}

Create streamlit apps restart

Path parameters

  • short_id
    string

Response


Example request

POST /api/projects/:project_id/streamlit_apps/:short_id/restart
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/streamlit_apps/:short_id/restart/

Example response

Status 202
RESPONSE
{
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "string",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "string"
},
"active_version": {
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "string",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "string"
},
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"version_number": 0,
"zip_hash": "string",
"snapshot_id": "string",
"created_at": "2019-08-24T14:15:22Z"
},
"sandbox": {
"status": "string",
"restart_count": 0,
"last_error": "string",
"started_at": "2019-08-24T14:15:22Z",
"last_activity_at": "2019-08-24T14:15:22Z",
"version_number": 0
},
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"short_id": "string",
"name": "string",
"description": "string",
"cpu_cores": 0.1,
"memory_gb": 0.1,
"status": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}

Create streamlit apps start

Path parameters

  • short_id
    string

Response


Example request

POST /api/projects/:project_id/streamlit_apps/:short_id/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/streamlit_apps/:short_id/start/

Example response

Status 200
RESPONSE
{
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "string",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "string"
},
"active_version": {
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "string",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "string"
},
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"version_number": 0,
"zip_hash": "string",
"snapshot_id": "string",
"created_at": "2019-08-24T14:15:22Z"
},
"sandbox": {
"status": "string",
"restart_count": 0,
"last_error": "string",
"started_at": "2019-08-24T14:15:22Z",
"last_activity_at": "2019-08-24T14:15:22Z",
"version_number": 0
},
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"short_id": "string",
"name": "string",
"description": "string",
"cpu_cores": 0.1,
"memory_gb": 0.1,
"status": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}
Status 202
RESPONSE
{
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "string",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "string"
},
"active_version": {
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "string",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "string"
},
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"version_number": 0,
"zip_hash": "string",
"snapshot_id": "string",
"created_at": "2019-08-24T14:15:22Z"
},
"sandbox": {
"status": "string",
"restart_count": 0,
"last_error": "string",
"started_at": "2019-08-24T14:15:22Z",
"last_activity_at": "2019-08-24T14:15:22Z",
"version_number": 0
},
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"short_id": "string",
"name": "string",
"description": "string",
"cpu_cores": 0.1,
"memory_gb": 0.1,
"status": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}

Retrieve streamlit apps status

Path parameters

  • short_id
    string

Response


Example request

GET /api/projects/:project_id/streamlit_apps/:short_id/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/streamlit_apps/:short_id/status/

Example response

Status 200
RESPONSE
{
"status": "string",
"restart_count": 0,
"last_error": "string",
"started_at": "2019-08-24T14:15:22Z",
"last_activity_at": "2019-08-24T14:15:22Z",
"version_number": 0
}

Create streamlit apps stop

Path parameters

  • short_id
    string

Response


Example request

POST /api/projects/:project_id/streamlit_apps/:short_id/stop
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/streamlit_apps/:short_id/stop/

Example response

Status 200
RESPONSE
{
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "string",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "string"
},
"active_version": {
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "string",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "string"
},
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"version_number": 0,
"zip_hash": "string",
"snapshot_id": "string",
"created_at": "2019-08-24T14:15:22Z"
},
"sandbox": {
"status": "string",
"restart_count": 0,
"last_error": "string",
"started_at": "2019-08-24T14:15:22Z",
"last_activity_at": "2019-08-24T14:15:22Z",
"version_number": 0
},
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"short_id": "string",
"name": "string",
"description": "string",
"cpu_cores": 0.1,
"memory_gb": 0.1,
"status": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}

Create streamlit apps upload version

Path parameters

  • short_id
    string

Request parameters

  • file
    string

Response


Example request

POST /api/projects/:project_id/streamlit_apps/:short_id/upload_version
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/streamlit_apps/:short_id/upload_version/\
-d file="string"

Example response

Status 201
RESPONSE
{
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "string",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "string"
},
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"version_number": 0,
"zip_hash": "string",
"snapshot_id": "string",
"created_at": "2019-08-24T14:15:22Z"
}

Retrieve streamlit apps versions

Path parameters

  • short_id
    string

Response


Example request

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

Example response

Status 200
RESPONSE
{
"results": [
{
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "string",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "string"
},
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"version_number": 0,
"zip_hash": "string",
"snapshot_id": "string",
"created_at": "2019-08-24T14:15:22Z"
}
]
}

Community questions