def get(
project: str,
environment: str,
*,
product: str | None = None,
timeout: float | None = None,
) -> EnvironmentSummaryResourceasync def get(
project: str,
environment: str,
*,
product: str | None = None,
timeout: float | None = None,
) -> EnvironmentSummaryResourceFetches a single environment inside a project. The two path arguments are not symmetrical: project accepts a slug or a uniqueId, while environment is a slug only. An environment uniqueId 404s on every route in this namespace.
The payload is the summary shape, identical to a list row, and it carries the stored exposed flag and updatedAt directly.
Example
from envless import envless
environment = envless.environments.get('api', 'production')
print(environment['id'])import asyncio
from envless import AsyncEnvless
async def main() -> None:
async with AsyncEnvless() as envless:
environment = await envless.environments.get('api', 'production')
print(environment['id'])
asyncio.run(main())Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
project | str | Yes | Project slug or uniqueId that owns the environment. |
environment | str | Yes | Environment slug, unique within the project. |
product | str | No | Product slug that disambiguates an ambiguous project slug. |
timeout | float | No | Seconds each attempt of this call may take, the response body included, before it raises EnvlessNetworkError with is_timeout set. Overrides the client's timeout for this call, and 0 turns the limit off. |
Returns
EnvironmentSummaryResource with id, name, slug, projectId, exposed, createdAt and updatedAt.
Worth knowing
- A 402 on this route means the project is locked for exceeding the plan project allowance, not that the environment is missing.
- Use the
idfrom here as theenvironmentIdyou match against variables and versions.
Required scopes
environments:read
Underlying endpoint
GET /projects/{slug}/environments/{environmentSlug}
Request and response schema, every error code, and a live playground.
In TypeScript
envless.environments.get()
The same method in @goenvless/sdk, with the same request, retries and errors.