sandbox-environments
sandbox_environments

API for managing sandbox environments that control network access for task runs.

patch/api/projects/{project_id}/sandbox_environments/{id}/

Request

  • Base URL: https://us.posthog.com
  • URL: https://us.posthog.com/api/projects/{project_id}/sandbox_environments/{id}/
  • Auth: one of:
    • HTTP bearer
    • HTTP bearer

Path parameters

idstring required
project_idstring required

Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.

Request body

namestring

Display name for the environment.

network_access_level'trusted' | 'full' | 'custom'
  • trusted - Trusted
  • full - Full
  • custom - Custom
allowed_domainsstring[]

Allowed domains for custom network access.

include_default_domainsboolean

Whether to include default trusted domains (GitHub, npm, PyPI).

repositoriesstring[]

Repositories this environment applies to (format: org/repo).

environment_variablesunknown
privateboolean

If true, only the creator can see this environment; otherwise the whole team can.

custom_image_idstring uuid nullable

Custom base image for this environment's sandboxes (Modal VM runtime only); null uses the default base.

Response

idstring uuid required
namestring required
network_access_levelstring required
allowed_domainsstring[]
include_default_domainsboolean required
repositoriesstring[]
has_environment_variablesboolean

Whether any environment variables are set on this environment.

environment_variable_keysstring[]

Names of the environment variables that are set, sorted. Values are write-only and never returned.

privateboolean required
internalboolean required
effective_domainsstring[]
created_atstring date-time nullable
updated_atstring date-time nullable
custom_image_idstring uuid nullable
custom_image_namestring nullable
custom_image_statusstring nullable

Changes

No recorded changes to this operation across all 1 revision of this API.