def get(
slug: str,
*,
product: str | None = None,
timeout: float | None = None,
) -> ProjectResourceasync def get(
slug: str,
*,
product: str | None = None,
timeout: float | None = None,
) -> ProjectResourceReads a single project. A UUID shaped slug is resolved as a uniqueId first and only then as a slug, which is why ids never need a product hint.
Slugs do need one. Because slugs are unique per product, a slug that exists in two products fails with 409 project.ambiguous_product and you must retry with product=. Projects outside a restricted key allowlist, and projects inside private products with no grant, come back as 404 rather than 403, so absence and denial look identical here.
Example
from envless import envless
project = envless.projects.get('api', product='billing')
product = project['product']
print(project['id'], product['name'] if product else None)import asyncio
from envless import AsyncEnvless
async def main() -> None:
async with AsyncEnvless() as envless:
project = await envless.projects.get('api', product='billing')
product = project['product']
print(project['id'], product['name'] if product else None)
asyncio.run(main())Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
slug | str | Yes | Project slug, or the project uniqueId. |
product | str | No | Product slug used to disambiguate a project slug that exists in more than one product. |
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
ProjectResource including the product dict the project belongs to.
Worth knowing
product=is matched against product slugs only. A product uniqueId there yields 404.- A missing project is 404
project.not_foundand an ambiguous slug is 409project.ambiguous_product. - A project sitting beyond the plan allowance fails with 402 and stays locked until the workspace upgrades.
Required scopes
projects:read
Underlying endpoint
GET /projects/{slug}
Request and response schema, every error code, and a live playground.
In TypeScript
envless.projects.get()
The same method in @goenvless/sdk, with the same request, retries and errors.