## Retrieve

`projects.retrieve(strproject_id)  -> ProjectRetrieveResponse`

**get** `/projects/{projectId}`

Get a project by projectId

### Parameters

- `project_id: str`

### Returns

- `class ProjectRetrieveResponse: …`

  - `project: Project`

    - `id: str`

      The project ID (example: "project_eyVcnFJcR92BxBkz7N6g5w")

    - `created_at: str`

    - `keys: List[ProjectKey]`

      The keys of the project (get from the ProjectRoles table)

      - `id: str`

        The key's member id (its API user id, `apiu_...`), taken by the member and
        usage routes (example: "apiu_eyVcnFJcR92BxBkz7N6g5w")

      - `api_key_id: str`

        The API key id (`api_...`), taken by the api-keys routes (example:
        "api_eyVcnFJcR92BxBkz7N6g5w")

      - `api_key_status: Literal["active", "inactive"]`

        The status of the API key

        - `"active"`

        - `"inactive"`

      - `created_at: str`

        The API key creation date as an ISO string (example: "2023-02-03T11:19:41.579Z")

      - `name: str`

        The API key name (example: "eurv-scenario")

      - `role: str`

        A project role value. Accepted values are:

        - a built-in role: `"admin"`, `"editor"` or `"reader"` (see `ProjectRoles`);
        - a custom inline role: a `;`-separated scope list, e.g.
          `"assets.write;workflows.run"`.

        Resolved to capabilities by `ProjectRole.scopesFromRole()`.

      - `scope: Literal["project", "team"]`

        The scope of the API key: 'project' for project-scoped keys, 'team' for team-scoped keys

        - `"project"`

        - `"team"`

      - `updated_at: str`

        The API key last update date as an ISO string (example: "2023-02-03T11:19:41.579Z")

      - `author_id: Optional[str]`

        The member who created the key: a human, or the member id (`apiu_...`) of
        the team API key that created it.

      - `consumption: Optional[float]`

        Consumption (CU) used by this key over the current billing period.

      - `last_used_at: Optional[str]`

        The date the API key was last used to authenticate a request, as an ISO
        string (example: "2023-02-03T11:19:41.579Z"). Absent if the key has never
        been used.

      - `max_consumption: Optional[float]`

        The key's effective consumption (CU) cap for the period (per-key override,
        else the team-wide default). Absent when the key is uncapped.

      - `owner_id: Optional[str]`

        For a PROJECT key: the project it was created on (the team id on some
        legacy keys). Absent for team keys.

      - `projects: Optional[List[ProjectKeyProject]]`

        For a PROJECT key: the projects it has access to and its role on each.
        Empty when the key is currently not a member of any (live) project.
        Absent for team keys.

        - `project_id: str`

          The project the key has a role on

        - `role: str`

          The key's role on this project: a built-in role (`admin`/`editor`/`reader`)
          or a custom `;`-separated scope list (example: `"asset.read;model.read"`).

    - `name: str`

      The project name (example: "Default Project")

    - `privacy_mode: bool`

      Whether the project is privacyMode
      In a privacyMode project, users can only see their own generated assets (except admins)

    - `team_id: str`

      The team ID (example: "team_eyVcnFJcR92BxBkz7N6g5w")

    - `updated_at: str`

    - `users: List[ProjectUser]`

      The users of the project (get from the ProjectRoles table)

      - `id: str`

        The user ID (example: "eyVcnFJcR92BxBkz7N6g5w")

      - `created_at: str`

        The user creation date as an ISO string (example: "2023-02-03T11:19:41.579Z")

      - `email: str`

        The user email (example: "herve@scenario.com")

      - `role: str`

        A project role value. Accepted values are:

        - a built-in role: `"admin"`, `"editor"` or `"reader"` (see `ProjectRoles`);
        - a custom inline role: a `;`-separated scope list, e.g.
          `"assets.write;workflows.run"`.

        Resolved to capabilities by `ProjectRole.scopesFromRole()`.

      - `updated_at: str`

        The user last update date as an ISO string (example: "2023-02-03T11:19:41.579Z")

      - `avatar: Optional[ProjectUserAvatar]`

        The user's avatar

        - `asset_id: Optional[str]`

          ID of the asset used as thumbnail if provided, otherwise undefined

        - `url: Optional[str]`

          Signed URL of the assetId or free url if assetId is undefined

      - `consumption: Optional[float]`

        Consumption (CU) used by this member over the current billing period.

      - `max_consumption: Optional[float]`

        The member's effective consumption (CU) cap for the period (per-user
        override, else the team-wide default). Absent when the member is uncapped.

    - `avatar: Optional[ProjectAvatar]`

      The project's avatar

      - `asset_id: Optional[str]`

        ID of the asset used as thumbnail if provided, otherwise undefined

      - `url: Optional[str]`

        Signed URL of the assetId or free url if assetId is undefined

    - `consumption: Optional[float]`

      Consumption (CU) used by this project over the current billing period.

    - `description: Optional[str]`

      High-level markdown description of the project
      Only returned on single project GET, not on list

    - `description_date: Optional[str]`

      ISO string date when the description was last updated
      Only returned on single project GET, not on list

    - `disable_ip_detection: Optional[bool]`

      When true, IP detection is switched off for this project even if the team
      has an active posture. Absent means the team posture applies.
      The posture itself (disabled / active-fail-open / active-fail-closed) is a
      team-level setting, see the team's ipDetectionEnforcement.

    - `max_consumption: Optional[float]`

      The project's consumption (CU) cap for the period. Absent when uncapped.

    - `quality_gate_auto_detect: Optional[bool]`

      Whether Quality Gate auto-detection runs on generation for this project.

    - `settings: Optional[ProjectSettings]`

      Project settings. Returned on `GET` and `PUT /projects/{projectId}`,
      absent from the projects list.

      - `homepage: Optional[Dict[str, object]]`

        Published homepage layout.

### Example

```python
import os
from scenario_sdk import Scenario

client = Scenario(
    api_key=os.environ.get("SCENARIO_SDK_API_KEY"),  # This is the default and can be omitted
    api_secret=os.environ.get("SCENARIO_SDK_API_SECRET"),  # This is the default and can be omitted
)
project = client.projects.retrieve(
    "projectId",
)
print(project.project)
```

#### Response

```json
{
  "project": {
    "id": "id",
    "createdAt": "createdAt",
    "keys": [
      {
        "id": "id",
        "apiKeyId": "apiKeyId",
        "apiKeyStatus": "active",
        "createdAt": "createdAt",
        "name": "name",
        "role": "role",
        "scope": "project",
        "updatedAt": "updatedAt",
        "authorId": "authorId",
        "consumption": 0,
        "lastUsedAt": "lastUsedAt",
        "maxConsumption": 0,
        "ownerId": "ownerId",
        "projects": [
          {
            "projectId": "projectId",
            "role": "role"
          }
        ]
      }
    ],
    "name": "name",
    "privacyMode": true,
    "teamId": "teamId",
    "updatedAt": "updatedAt",
    "users": [
      {
        "id": "id",
        "createdAt": "createdAt",
        "email": "email",
        "role": "role",
        "updatedAt": "updatedAt",
        "avatar": {
          "assetId": "assetId",
          "url": "url"
        },
        "consumption": 0,
        "maxConsumption": 0
      }
    ],
    "avatar": {
      "assetId": "assetId",
      "url": "url"
    },
    "consumption": 0,
    "description": "description",
    "descriptionDate": "descriptionDate",
    "disableIpDetection": true,
    "maxConsumption": 0,
    "qualityGateAutoDetect": true,
    "settings": {
      "homepage": {
        "foo": "bar"
      }
    }
  }
}
```
