# Projects

## Create

`projects.create(ProjectCreateParams**kwargs)  -> ProjectCreateResponse`

**post** `/projects`

Create a new project

### Parameters

- `name: str`

  The name of the project.

- `team_id: Optional[str]`

  The teamId used for ownership resource management. Either to assert ownership or to set the owner of the resource(s)

- `auto_join: Optional[bool]`

  Whether to automatically join the project as admin.

- `privacy_mode: Optional[bool]`

  Whether to create the project in privacyMode. Default is false.

### Returns

- `class ProjectCreateResponse: …`

  - `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.create(
    name="name",
)
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"
      }
    }
  }
}
```

## Delete

`projects.delete(strproject_id)  -> object`

**delete** `/projects/{projectId}`

Delete a particular project

### Parameters

- `project_id: str`

### Returns

- `object`

### 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.delete(
    "projectId",
)
print(project)
```

#### Response

```json
{}
```

## List

`projects.list(ProjectListParams**kwargs)  -> SyncProjectsCursor[ProjectListResponse]`

**get** `/projects`

List projects of a team

### Parameters

- `page_size: Optional[int]`

  The number of items to return in the response. The default value is 10, maximum value is 100, minimum value is 1

- `pagination_token: Optional[str]`

  A token you received in a previous request to query the next page of items

- `team_id: Optional[str]`

  The teamId used for ownership resource management. Either to assert ownership or to set the owner of the resource(s)

### Returns

- `class ProjectListResponse: …`

  - `id: str`

    The project ID (example: "project_eyVcnFJcR92BxBkz7N6g5w")

  - `created_at: str`

  - `keys: List[Key]`

    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[KeyProject]]`

      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[User]`

    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[UserAvatar]`

      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[Avatar]`

    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[Settings]`

    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
)
page = client.projects.list()
page = page.projects[0]
print(page.id)
```

#### Response

```json
{
  "projects": [
    {
      "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"
        }
      }
    }
  ],
  "nextPaginationToken": "nextPaginationToken"
}
```

## 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"
      }
    }
  }
}
```

## Update

`projects.update(strproject_id, ProjectUpdateParams**kwargs)  -> ProjectUpdateResponse`

**put** `/projects/{projectId}`

Update the name of a Project

### Parameters

- `project_id: str`

- `avatar_asset_id: Optional[str]`

  The project's avatar asset ID (must be kind image)

- `description: Optional[str]`

  High-level markdown description of the project
  Set to null to clear the description

- `disable_ip_detection: Optional[bool]`

  Switch IP detection off for this project only.
  The team's posture (see PUT /teams/{teamId}) applies to every project by
  default; set this to true to opt this project out of it, false to opt it
  back in. A project cannot choose a posture of its own. Team-admin only.

- `max_consumption: Optional[float]`

  Max consumption (CU) for this project over the billing period.
  Set to null to remove the cap. Team admins only, or a team API key holding
  `team.members.manage`, which may then send this field alone.

- `name: Optional[str]`

  The project name (example: "Default Project")

- `privacy_mode: Optional[bool]`

  Toggle the privacyMode mode
  When enabled, users can only see their own generated assets (except admins)

- `quality_gate_auto_detect: Optional[bool]`

  Quality Gate auto-detection override for this project (wins over the team
  default). Set to null to clear the override.

- `settings: Optional[Settings]`

  Project settings. Set `homepage` to a layout object to publish it, or to
  `null` to unpublish it. Team admins and project admins only.

  - `homepage: Optional[object]`

    Homepage layout. An object publishes it; `null` unpublishes it.

### Returns

- `class ProjectUpdateResponse: …`

  - `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.update(
    project_id="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"
      }
    }
  }
}
```

## Domain Types

### Project Create Response

- `class ProjectCreateResponse: …`

  - `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.

### Project List Response

- `class ProjectListResponse: …`

  - `id: str`

    The project ID (example: "project_eyVcnFJcR92BxBkz7N6g5w")

  - `created_at: str`

  - `keys: List[Key]`

    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[KeyProject]]`

      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[User]`

    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[UserAvatar]`

      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[Avatar]`

    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[Settings]`

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

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

      Published homepage layout.

### Project Retrieve Response

- `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.

### Project Update Response

- `class ProjectUpdateResponse: …`

  - `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.

# API Keys

## Create

`projects.api_keys.create(strproject_id, APIKeyCreateParams**kwargs)  -> APIKeyCreateResponse`

**post** `/projects/{projectId}/api-keys`

Create an API key for a particular project

### Parameters

- `project_id: str`

- `max_consumption: Optional[float]`

  Optional spending cap (CU) for this key over the billing period: a value >= 0 to cap, or -1 for unlimited. Omit to inherit the default.

- `name: Optional[str]`

  The API Key name

- `role: Optional[str]`

  Project role: a built-in role (admin | editor | reader) or a custom inline ";"-separated scope list (e.g. "assets.read;workflows.run"). Defaults to editor.

### Returns

- `class APIKeyCreateResponse: …`

  - `id: str`

  - `author_id: str`

  - `created_at: str`

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

    - `"project"`

    - `"team"`

  - `secret: str`

  - `user_id: str`

    The key's member id (`apiu_...`), taken by the member routes; the
    api-keys routes take `id`.

  - `owner_id: Optional[str]`

  - `team_id: Optional[str]`

### 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
)
api_key = client.projects.api_keys.create(
    project_id="projectId",
)
print(api_key.id)
```

#### Response

```json
{
  "id": "id",
  "authorId": "authorId",
  "createdAt": "createdAt",
  "ownerType": "project",
  "secret": "secret",
  "userId": "userId",
  "ownerId": "ownerId",
  "teamId": "teamId"
}
```

## Delete

`projects.api_keys.delete(strkey_id, APIKeyDeleteParams**kwargs)  -> object`

**delete** `/projects/{projectId}/api-keys/{keyId}`

Delete a particular api key

### Parameters

- `project_id: str`

- `key_id: str`

### Returns

- `object`

### 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
)
api_key = client.projects.api_keys.delete(
    key_id="keyId",
    project_id="projectId",
)
print(api_key)
```

#### Response

```json
{}
```

## Domain Types

### API Key Create Response

- `class APIKeyCreateResponse: …`

  - `id: str`

  - `author_id: str`

  - `created_at: str`

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

    - `"project"`

    - `"team"`

  - `secret: str`

  - `user_id: str`

    The key's member id (`apiu_...`), taken by the member routes; the
    api-keys routes take `id`.

  - `owner_id: Optional[str]`

  - `team_id: Optional[str]`

# Brief

## Delete

`projects.brief.delete(strproject_id)  -> BriefDeleteResponse`

**delete** `/projects/{projectId}/brief`

Delete the project's Quality Gate brief

### Parameters

- `project_id: str`

### Returns

- `class BriefDeleteResponse: …`

  - `deleted: bool`

### 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
)
brief = client.projects.brief.delete(
    "projectId",
)
print(brief.deleted)
```

#### Response

```json
{
  "deleted": true
}
```

## Retrieve

`projects.brief.retrieve(strproject_id)  -> BriefRetrieveResponse`

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

Get the project's Quality Gate brief

### Parameters

- `project_id: str`

### Returns

- `class BriefRetrieveResponse: …`

  - `brief: Brief`

    A brand-style / project-rules / campaign-context brief stored at one scope.

    - `id: str`

      Stable identifier derived from level + scopeId

    - `body: str`

      Free-text brief: brand style, rules, campaign context

    - `created_at: str`

      ISO-8601 creation timestamp

    - `created_by: str`

      User id that last wrote the brief

    - `enabled: bool`

      Whether the brief is applied during verification

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

      Scope this brief applies to: team or project

      - `"project"`

      - `"team"`

    - `reference_asset_ids: List[str]`

      Reference assets the verifier compares the image against

    - `scope_id: str`

      The id of the team or project that owns this brief

    - `updated_at: str`

      ISO-8601 last-update timestamp

    - `sensitivity: Optional[Literal["high", "low", "medium"]]`

      Threshold strictness applied when verifying against this scope

      - `"high"`

      - `"low"`

      - `"medium"`

### 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
)
brief = client.projects.brief.retrieve(
    "projectId",
)
print(brief.brief)
```

#### Response

```json
{
  "brief": {
    "id": "id",
    "body": "body",
    "createdAt": "createdAt",
    "createdBy": "createdBy",
    "enabled": true,
    "level": "project",
    "referenceAssetIds": [
      "string"
    ],
    "scopeId": "scopeId",
    "updatedAt": "updatedAt",
    "sensitivity": "high"
  }
}
```

## Update

`projects.brief.update(strproject_id, BriefUpdateParams**kwargs)  -> BriefUpdateResponse`

**put** `/projects/{projectId}/brief`

Create or update the project's Quality Gate brief

### Parameters

- `project_id: str`

- `body: str`

  Free-text brief content

- `enabled: Optional[bool]`

  Whether the brief is applied during verification (default true)

- `reference_asset_ids: Optional[Sequence[str]]`

  Reference assets the verifier compares against (max 10). Send [] to clear.

- `sensitivity: Optional[Literal["high", "low", "medium"]]`

  Threshold strictness stored for this scope: low, medium, or high. Applied
  to verifications unless the verify call passes its own sensitivity.

  - `"high"`

  - `"low"`

  - `"medium"`

### Returns

- `class BriefUpdateResponse: …`

  - `brief: Brief`

    A brand-style / project-rules / campaign-context brief stored at one scope.

    - `id: str`

      Stable identifier derived from level + scopeId

    - `body: str`

      Free-text brief: brand style, rules, campaign context

    - `created_at: str`

      ISO-8601 creation timestamp

    - `created_by: str`

      User id that last wrote the brief

    - `enabled: bool`

      Whether the brief is applied during verification

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

      Scope this brief applies to: team or project

      - `"project"`

      - `"team"`

    - `reference_asset_ids: List[str]`

      Reference assets the verifier compares the image against

    - `scope_id: str`

      The id of the team or project that owns this brief

    - `updated_at: str`

      ISO-8601 last-update timestamp

    - `sensitivity: Optional[Literal["high", "low", "medium"]]`

      Threshold strictness applied when verifying against this scope

      - `"high"`

      - `"low"`

      - `"medium"`

### 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
)
brief = client.projects.brief.update(
    project_id="projectId",
    body="x",
)
print(brief.brief)
```

#### Response

```json
{
  "brief": {
    "id": "id",
    "body": "body",
    "createdAt": "createdAt",
    "createdBy": "createdBy",
    "enabled": true,
    "level": "project",
    "referenceAssetIds": [
      "string"
    ],
    "scopeId": "scopeId",
    "updatedAt": "updatedAt",
    "sensitivity": "high"
  }
}
```

## Domain Types

### Brief Delete Response

- `class BriefDeleteResponse: …`

  - `deleted: bool`

### Brief Retrieve Response

- `class BriefRetrieveResponse: …`

  - `brief: Brief`

    A brand-style / project-rules / campaign-context brief stored at one scope.

    - `id: str`

      Stable identifier derived from level + scopeId

    - `body: str`

      Free-text brief: brand style, rules, campaign context

    - `created_at: str`

      ISO-8601 creation timestamp

    - `created_by: str`

      User id that last wrote the brief

    - `enabled: bool`

      Whether the brief is applied during verification

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

      Scope this brief applies to: team or project

      - `"project"`

      - `"team"`

    - `reference_asset_ids: List[str]`

      Reference assets the verifier compares the image against

    - `scope_id: str`

      The id of the team or project that owns this brief

    - `updated_at: str`

      ISO-8601 last-update timestamp

    - `sensitivity: Optional[Literal["high", "low", "medium"]]`

      Threshold strictness applied when verifying against this scope

      - `"high"`

      - `"low"`

      - `"medium"`

### Brief Update Response

- `class BriefUpdateResponse: …`

  - `brief: Brief`

    A brand-style / project-rules / campaign-context brief stored at one scope.

    - `id: str`

      Stable identifier derived from level + scopeId

    - `body: str`

      Free-text brief: brand style, rules, campaign context

    - `created_at: str`

      ISO-8601 creation timestamp

    - `created_by: str`

      User id that last wrote the brief

    - `enabled: bool`

      Whether the brief is applied during verification

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

      Scope this brief applies to: team or project

      - `"project"`

      - `"team"`

    - `reference_asset_ids: List[str]`

      Reference assets the verifier compares the image against

    - `scope_id: str`

      The id of the team or project that owns this brief

    - `updated_at: str`

      ISO-8601 last-update timestamp

    - `sensitivity: Optional[Literal["high", "low", "medium"]]`

      Threshold strictness applied when verifying against this scope

      - `"high"`

      - `"low"`

      - `"medium"`

# Instructions

## Retrieve

`projects.instructions.retrieve(strproject_id)  -> InstructionRetrieveResponse`

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

Get the project's assistant instructions (markdown). Returns 404 if not set. Any project member can read.

### Parameters

- `project_id: str`

### Returns

- `class InstructionRetrieveResponse: …`

  - `memory: Memory`

    Public JSON shape returned by GET endpoints

    - `id: str`

      The memory ID — deterministic from scope + parent IDs (example: "mem_team_team_abc")

    - `content: str`

      Markdown content of the memory

    - `created_at: str`

      ISO 8601 timestamp when the memory was first written

    - `size_bytes: float`

      UTF-8 byte length of the content — used for quota enforcement

    - `updated_at: str`

      ISO 8601 timestamp when the memory was last updated

    - `updated_by: str`

      The userId of the last writer — useful for audit/UI

### 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
)
instruction = client.projects.instructions.retrieve(
    "projectId",
)
print(instruction.memory)
```

#### Response

```json
{
  "memory": {
    "id": "id",
    "content": "content",
    "createdAt": "createdAt",
    "sizeBytes": 0,
    "updatedAt": "updatedAt",
    "updatedBy": "updatedBy"
  }
}
```

## Update

`projects.instructions.update(strproject_id, InstructionUpdateParams**kwargs)  -> InstructionUpdateResponse`

**put** `/projects/{projectId}/instructions`

Set the project's assistant instructions (markdown, max 50KB). Set content to null to clear. Team or project admins only.

### Parameters

- `project_id: str`

- `content: Optional[str]`

  Markdown content of the memory. Set to null to clear.
  Max size depends on the scope (20-50 KB).

### Returns

- `class InstructionUpdateResponse: …`

  - `memory: Optional[Memory]`

    Public JSON shape returned by GET endpoints

    - `id: str`

      The memory ID — deterministic from scope + parent IDs (example: "mem_team_team_abc")

    - `content: str`

      Markdown content of the memory

    - `created_at: str`

      ISO 8601 timestamp when the memory was first written

    - `size_bytes: float`

      UTF-8 byte length of the content — used for quota enforcement

    - `updated_at: str`

      ISO 8601 timestamp when the memory was last updated

    - `updated_by: str`

      The userId of the last writer — useful for audit/UI

### 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
)
instruction = client.projects.instructions.update(
    project_id="projectId",
)
print(instruction.memory)
```

#### Response

```json
{
  "memory": {
    "id": "id",
    "content": "content",
    "createdAt": "createdAt",
    "sizeBytes": 0,
    "updatedAt": "updatedAt",
    "updatedBy": "updatedBy"
  }
}
```

## Domain Types

### Instruction Retrieve Response

- `class InstructionRetrieveResponse: …`

  - `memory: Memory`

    Public JSON shape returned by GET endpoints

    - `id: str`

      The memory ID — deterministic from scope + parent IDs (example: "mem_team_team_abc")

    - `content: str`

      Markdown content of the memory

    - `created_at: str`

      ISO 8601 timestamp when the memory was first written

    - `size_bytes: float`

      UTF-8 byte length of the content — used for quota enforcement

    - `updated_at: str`

      ISO 8601 timestamp when the memory was last updated

    - `updated_by: str`

      The userId of the last writer — useful for audit/UI

### Instruction Update Response

- `class InstructionUpdateResponse: …`

  - `memory: Optional[Memory]`

    Public JSON shape returned by GET endpoints

    - `id: str`

      The memory ID — deterministic from scope + parent IDs (example: "mem_team_team_abc")

    - `content: str`

      Markdown content of the memory

    - `created_at: str`

      ISO 8601 timestamp when the memory was first written

    - `size_bytes: float`

      UTF-8 byte length of the content — used for quota enforcement

    - `updated_at: str`

      ISO 8601 timestamp when the memory was last updated

    - `updated_by: str`

      The userId of the last writer — useful for audit/UI

# Members

## Create

`projects.members.create(strproject_id, MemberCreateParams**kwargs)  -> MemberCreateResponse`

**post** `/projects/{projectId}/members`

Add a member to the project

### Parameters

- `project_id: str`

- `role: str`

  The role you want to give the user

- `user_id: str`

  The userId of the user you want to add to your project

### Returns

- `class MemberCreateResponse: …`

  - `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
)
member = client.projects.members.create(
    project_id="projectId",
    role="role",
    user_id="userId",
)
print(member.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"
      }
    }
  }
}
```

## Delete

`projects.members.delete(strmember_id, MemberDeleteParams**kwargs)  -> MemberDeleteResponse`

**delete** `/projects/{projectId}/members/{memberId}`

Remove a member from the project

### Parameters

- `project_id: str`

- `member_id: str`

### Returns

- `class MemberDeleteResponse: …`

  - `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
)
member = client.projects.members.delete(
    member_id="memberId",
    project_id="projectId",
)
print(member.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"
      }
    }
  }
}
```

## Update

`projects.members.update(strmember_id, MemberUpdateParams**kwargs)  -> MemberUpdateResponse`

**put** `/projects/{projectId}/members/{memberId}`

Change a member role

### Parameters

- `project_id: str`

- `member_id: str`

- `role: Optional[str]`

  The role you want to give the member

### Returns

- `class MemberUpdateResponse: …`

  - `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
)
member = client.projects.members.update(
    member_id="memberId",
    project_id="projectId",
)
print(member.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"
      }
    }
  }
}
```

## Domain Types

### Member Create Response

- `class MemberCreateResponse: …`

  - `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.

### Member Delete Response

- `class MemberDeleteResponse: …`

  - `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.

### Member Update Response

- `class MemberUpdateResponse: …`

  - `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.

# Memory

## Retrieve

`projects.memory.retrieve(strproject_id)  -> MemoryRetrieveResponse`

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

Get the caller's assistant memory scoped to this project (auto-learned). Returns 404 if empty.

### Parameters

- `project_id: str`

### Returns

- `class MemoryRetrieveResponse: …`

  - `memory: Memory`

    Public JSON shape returned by GET endpoints

    - `id: str`

      The memory ID — deterministic from scope + parent IDs (example: "mem_team_team_abc")

    - `content: str`

      Markdown content of the memory

    - `created_at: str`

      ISO 8601 timestamp when the memory was first written

    - `size_bytes: float`

      UTF-8 byte length of the content — used for quota enforcement

    - `updated_at: str`

      ISO 8601 timestamp when the memory was last updated

    - `updated_by: str`

      The userId of the last writer — useful for audit/UI

### 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
)
memory = client.projects.memory.retrieve(
    "projectId",
)
print(memory.memory)
```

#### Response

```json
{
  "memory": {
    "id": "id",
    "content": "content",
    "createdAt": "createdAt",
    "sizeBytes": 0,
    "updatedAt": "updatedAt",
    "updatedBy": "updatedBy"
  }
}
```

## Update

`projects.memory.update(strproject_id, MemoryUpdateParams**kwargs)  -> MemoryUpdateResponse`

**put** `/projects/{projectId}/memory`

Set the caller's assistant memory scoped to this project (markdown, max 30KB). Set content to null to clear.

### Parameters

- `project_id: str`

- `content: Optional[str]`

  Markdown content of the memory. Set to null to clear.
  Max size depends on the scope (20-50 KB).

### Returns

- `class MemoryUpdateResponse: …`

  - `memory: Optional[Memory]`

    Public JSON shape returned by GET endpoints

    - `id: str`

      The memory ID — deterministic from scope + parent IDs (example: "mem_team_team_abc")

    - `content: str`

      Markdown content of the memory

    - `created_at: str`

      ISO 8601 timestamp when the memory was first written

    - `size_bytes: float`

      UTF-8 byte length of the content — used for quota enforcement

    - `updated_at: str`

      ISO 8601 timestamp when the memory was last updated

    - `updated_by: str`

      The userId of the last writer — useful for audit/UI

### 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
)
memory = client.projects.memory.update(
    project_id="projectId",
)
print(memory.memory)
```

#### Response

```json
{
  "memory": {
    "id": "id",
    "content": "content",
    "createdAt": "createdAt",
    "sizeBytes": 0,
    "updatedAt": "updatedAt",
    "updatedBy": "updatedBy"
  }
}
```

## Domain Types

### Memory Retrieve Response

- `class MemoryRetrieveResponse: …`

  - `memory: Memory`

    Public JSON shape returned by GET endpoints

    - `id: str`

      The memory ID — deterministic from scope + parent IDs (example: "mem_team_team_abc")

    - `content: str`

      Markdown content of the memory

    - `created_at: str`

      ISO 8601 timestamp when the memory was first written

    - `size_bytes: float`

      UTF-8 byte length of the content — used for quota enforcement

    - `updated_at: str`

      ISO 8601 timestamp when the memory was last updated

    - `updated_by: str`

      The userId of the last writer — useful for audit/UI

### Memory Update Response

- `class MemoryUpdateResponse: …`

  - `memory: Optional[Memory]`

    Public JSON shape returned by GET endpoints

    - `id: str`

      The memory ID — deterministic from scope + parent IDs (example: "mem_team_team_abc")

    - `content: str`

      Markdown content of the memory

    - `created_at: str`

      ISO 8601 timestamp when the memory was first written

    - `size_bytes: float`

      UTF-8 byte length of the content — used for quota enforcement

    - `updated_at: str`

      ISO 8601 timestamp when the memory was last updated

    - `updated_by: str`

      The userId of the last writer — useful for audit/UI

# Watermark

## Delete

`projects.watermark.delete(strproject_id)  -> WatermarkDeleteResponse`

**delete** `/projects/{projectId}/watermark`

Delete the project's forced watermark configuration

### Parameters

- `project_id: str`

### Returns

- `class WatermarkDeleteResponse: …`

  - `deleted: bool`

### 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
)
watermark = client.projects.watermark.delete(
    "projectId",
)
print(watermark.deleted)
```

#### Response

```json
{
  "deleted": true
}
```

## Delete Logo

`projects.watermark.delete_logo(strproject_id)  -> WatermarkDeleteLogoResponse`

**delete** `/projects/{projectId}/watermark/logo`

Remove the project's watermark logo, falling back to its configured text

### Parameters

- `project_id: str`

### Returns

- `class WatermarkDeleteLogoResponse: …`

  - `watermark: Watermark`

    Forced-watermark configuration stored at one scope.

    - `id: str`

      Stable identifier derived from level + scopeId

    - `created_at: str`

      ISO-8601 creation timestamp

    - `created_by: str`

      User id that last wrote the configuration

    - `enabled: bool`

      Whether the watermark is enforced on assets generated in this scope. A
      disabled project configuration falls back to its team's.

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

      Scope this configuration applies to: team or project

      - `"project"`

      - `"team"`

    - `opacity: float`

      Mark opacity, 0.05 (barely visible) to 1 (opaque)

    - `placement: Literal["bottom-left", "bottom-right", "center", 3 more]`

      Where the mark sits on the image

      - `"bottom-left"`

      - `"bottom-right"`

      - `"center"`

      - `"tiled"`

      - `"top-left"`

      - `"top-right"`

    - `rotation: float`

      Mark rotation in degrees, -90 to 90. 0 is horizontal.

    - `scale: float`

      Mark width as a fraction of the image width

    - `scope_id: str`

      The id of the team or project that owns this configuration

    - `spacing: float`

      Gap between repetitions, as a fraction of the mark's own size. Tiled
      placement only; 0 repeats the mark edge to edge.

    - `updated_at: str`

      ISO-8601 last-update timestamp

    - `version: float`

      Bumped on every write.

    - `deleted_at: Optional[str]`

      Set when the configuration has been deleted.

    - `logo_is_opaque: Optional[bool]`

      Whether the stored logo has no transparency at all.

      Recorded at upload so the UI can warn without decoding the image again: an
      opaque logo draws its whole rectangle, which a rotated tiled mark turns
      into a very visible diamond.

    - `logo_key: Optional[str]`

      Where the uploaded logo lives, when one is set.

    - `text: Optional[str]`

      Text rendered as the mark, when no logo is set

### 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
)
response = client.projects.watermark.delete_logo(
    "projectId",
)
print(response.watermark)
```

#### Response

```json
{
  "watermark": {
    "id": "id",
    "createdAt": "createdAt",
    "createdBy": "createdBy",
    "enabled": true,
    "level": "project",
    "opacity": 0,
    "placement": "bottom-left",
    "rotation": 0,
    "scale": 0,
    "scopeId": "scopeId",
    "spacing": 0,
    "updatedAt": "updatedAt",
    "version": 0,
    "deletedAt": "deletedAt",
    "logoIsOpaque": true,
    "logoKey": "logoKey",
    "text": "text"
  }
}
```

## Preview

`projects.watermark.preview(strproject_id, WatermarkPreviewParams**kwargs)  -> WatermarkPreviewResponse`

**post** `/projects/{projectId}/watermark/preview`

Draw the given watermark settings on a sample image, without saving them

### Parameters

- `project_id: str`

- `opacity: Optional[float]`

  Mark opacity, 0.05 (barely visible) to 1 (opaque)

- `placement: Optional[Literal["bottom-left", "bottom-right", "center", 3 more]]`

  Where the mark sits on the image

  - `"bottom-left"`

  - `"bottom-right"`

  - `"center"`

  - `"tiled"`

  - `"top-left"`

  - `"top-right"`

- `rotation: Optional[float]`

  Mark rotation in degrees. 0 is horizontal, negative tilts it up.

- `scale: Optional[float]`

  Mark width as a fraction of the image width

- `spacing: Optional[float]`

  Gap between repetitions, as a fraction of the mark's own size. Only drawn
  for the tiled placement; 0 repeats the mark edge to edge.

- `text: Optional[str]`

  Text to draw. Optional only because a logo can stand in for it.

### Returns

- `class WatermarkPreviewResponse: …`

  Response of the watermark preview routes.

  - `image: str`

    The sample image with the mark drawn on it, base64-encoded.

### 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
)
response = client.projects.watermark.preview(
    project_id="projectId",
)
print(response.image)
```

#### Response

```json
{
  "image": "image"
}
```

## Retrieve

`projects.watermark.retrieve(strproject_id)  -> WatermarkRetrieveResponse`

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

Get the project's forced watermark configuration

### Parameters

- `project_id: str`

### Returns

- `class WatermarkRetrieveResponse: …`

  - `watermark: Watermark`

    Forced-watermark configuration stored at one scope.

    - `id: str`

      Stable identifier derived from level + scopeId

    - `created_at: str`

      ISO-8601 creation timestamp

    - `created_by: str`

      User id that last wrote the configuration

    - `enabled: bool`

      Whether the watermark is enforced on assets generated in this scope. A
      disabled project configuration falls back to its team's.

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

      Scope this configuration applies to: team or project

      - `"project"`

      - `"team"`

    - `opacity: float`

      Mark opacity, 0.05 (barely visible) to 1 (opaque)

    - `placement: Literal["bottom-left", "bottom-right", "center", 3 more]`

      Where the mark sits on the image

      - `"bottom-left"`

      - `"bottom-right"`

      - `"center"`

      - `"tiled"`

      - `"top-left"`

      - `"top-right"`

    - `rotation: float`

      Mark rotation in degrees, -90 to 90. 0 is horizontal.

    - `scale: float`

      Mark width as a fraction of the image width

    - `scope_id: str`

      The id of the team or project that owns this configuration

    - `spacing: float`

      Gap between repetitions, as a fraction of the mark's own size. Tiled
      placement only; 0 repeats the mark edge to edge.

    - `updated_at: str`

      ISO-8601 last-update timestamp

    - `version: float`

      Bumped on every write.

    - `deleted_at: Optional[str]`

      Set when the configuration has been deleted.

    - `logo_is_opaque: Optional[bool]`

      Whether the stored logo has no transparency at all.

      Recorded at upload so the UI can warn without decoding the image again: an
      opaque logo draws its whole rectangle, which a rotated tiled mark turns
      into a very visible diamond.

    - `logo_key: Optional[str]`

      Where the uploaded logo lives, when one is set.

    - `text: Optional[str]`

      Text rendered as the mark, when no logo is set

### 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
)
watermark = client.projects.watermark.retrieve(
    "projectId",
)
print(watermark.watermark)
```

#### Response

```json
{
  "watermark": {
    "id": "id",
    "createdAt": "createdAt",
    "createdBy": "createdBy",
    "enabled": true,
    "level": "project",
    "opacity": 0,
    "placement": "bottom-left",
    "rotation": 0,
    "scale": 0,
    "scopeId": "scopeId",
    "spacing": 0,
    "updatedAt": "updatedAt",
    "version": 0,
    "deletedAt": "deletedAt",
    "logoIsOpaque": true,
    "logoKey": "logoKey",
    "text": "text"
  }
}
```

## Update

`projects.watermark.update(strproject_id, WatermarkUpdateParams**kwargs)  -> WatermarkUpdateResponse`

**put** `/projects/{projectId}/watermark`

Create or update the project's forced watermark configuration

### Parameters

- `project_id: str`

- `enabled: bool`

  Whether the watermark is enforced on assets generated in this scope. A
  disabled project configuration falls back to its team's.

- `opacity: Optional[float]`

  Mark opacity, 0.05 (barely visible) to 1 (opaque)

- `placement: Optional[Literal["bottom-left", "bottom-right", "center", 3 more]]`

  Where the mark sits on the image

  - `"bottom-left"`

  - `"bottom-right"`

  - `"center"`

  - `"tiled"`

  - `"top-left"`

  - `"top-right"`

- `rotation: Optional[float]`

  Mark rotation in degrees. 0 is horizontal, negative tilts it up.

- `scale: Optional[float]`

  Mark width as a fraction of the image width

- `spacing: Optional[float]`

  Gap between repetitions, as a fraction of the mark's own size. Only drawn
  for the tiled placement; 0 repeats the mark edge to edge.

- `text: Optional[str]`

  Text rendered as the mark. Ignored while a logo is set.

### Returns

- `class WatermarkUpdateResponse: …`

  - `watermark: Watermark`

    Forced-watermark configuration stored at one scope.

    - `id: str`

      Stable identifier derived from level + scopeId

    - `created_at: str`

      ISO-8601 creation timestamp

    - `created_by: str`

      User id that last wrote the configuration

    - `enabled: bool`

      Whether the watermark is enforced on assets generated in this scope. A
      disabled project configuration falls back to its team's.

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

      Scope this configuration applies to: team or project

      - `"project"`

      - `"team"`

    - `opacity: float`

      Mark opacity, 0.05 (barely visible) to 1 (opaque)

    - `placement: Literal["bottom-left", "bottom-right", "center", 3 more]`

      Where the mark sits on the image

      - `"bottom-left"`

      - `"bottom-right"`

      - `"center"`

      - `"tiled"`

      - `"top-left"`

      - `"top-right"`

    - `rotation: float`

      Mark rotation in degrees, -90 to 90. 0 is horizontal.

    - `scale: float`

      Mark width as a fraction of the image width

    - `scope_id: str`

      The id of the team or project that owns this configuration

    - `spacing: float`

      Gap between repetitions, as a fraction of the mark's own size. Tiled
      placement only; 0 repeats the mark edge to edge.

    - `updated_at: str`

      ISO-8601 last-update timestamp

    - `version: float`

      Bumped on every write.

    - `deleted_at: Optional[str]`

      Set when the configuration has been deleted.

    - `logo_is_opaque: Optional[bool]`

      Whether the stored logo has no transparency at all.

      Recorded at upload so the UI can warn without decoding the image again: an
      opaque logo draws its whole rectangle, which a rotated tiled mark turns
      into a very visible diamond.

    - `logo_key: Optional[str]`

      Where the uploaded logo lives, when one is set.

    - `text: Optional[str]`

      Text rendered as the mark, when no logo is set

### 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
)
watermark = client.projects.watermark.update(
    project_id="projectId",
    enabled=True,
)
print(watermark.watermark)
```

#### Response

```json
{
  "watermark": {
    "id": "id",
    "createdAt": "createdAt",
    "createdBy": "createdBy",
    "enabled": true,
    "level": "project",
    "opacity": 0,
    "placement": "bottom-left",
    "rotation": 0,
    "scale": 0,
    "scopeId": "scopeId",
    "spacing": 0,
    "updatedAt": "updatedAt",
    "version": 0,
    "deletedAt": "deletedAt",
    "logoIsOpaque": true,
    "logoKey": "logoKey",
    "text": "text"
  }
}
```

## Update Logo

`projects.watermark.update_logo(strproject_id, WatermarkUpdateLogoParams**kwargs)  -> WatermarkUpdateLogoResponse`

**put** `/projects/{projectId}/watermark/logo`

Upload the project's watermark logo, used as the mark instead of its text

### Parameters

- `project_id: str`

- `logo: str`

  The logo image, base64-encoded, at most 1 MB and 4 megapixels once decoded.
  PNG, JPEG and WebP are accepted; SVG is refused. Stored as PNG.

### Returns

- `class WatermarkUpdateLogoResponse: …`

  - `watermark: Watermark`

    Forced-watermark configuration stored at one scope.

    - `id: str`

      Stable identifier derived from level + scopeId

    - `created_at: str`

      ISO-8601 creation timestamp

    - `created_by: str`

      User id that last wrote the configuration

    - `enabled: bool`

      Whether the watermark is enforced on assets generated in this scope. A
      disabled project configuration falls back to its team's.

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

      Scope this configuration applies to: team or project

      - `"project"`

      - `"team"`

    - `opacity: float`

      Mark opacity, 0.05 (barely visible) to 1 (opaque)

    - `placement: Literal["bottom-left", "bottom-right", "center", 3 more]`

      Where the mark sits on the image

      - `"bottom-left"`

      - `"bottom-right"`

      - `"center"`

      - `"tiled"`

      - `"top-left"`

      - `"top-right"`

    - `rotation: float`

      Mark rotation in degrees, -90 to 90. 0 is horizontal.

    - `scale: float`

      Mark width as a fraction of the image width

    - `scope_id: str`

      The id of the team or project that owns this configuration

    - `spacing: float`

      Gap between repetitions, as a fraction of the mark's own size. Tiled
      placement only; 0 repeats the mark edge to edge.

    - `updated_at: str`

      ISO-8601 last-update timestamp

    - `version: float`

      Bumped on every write.

    - `deleted_at: Optional[str]`

      Set when the configuration has been deleted.

    - `logo_is_opaque: Optional[bool]`

      Whether the stored logo has no transparency at all.

      Recorded at upload so the UI can warn without decoding the image again: an
      opaque logo draws its whole rectangle, which a rotated tiled mark turns
      into a very visible diamond.

    - `logo_key: Optional[str]`

      Where the uploaded logo lives, when one is set.

    - `text: Optional[str]`

      Text rendered as the mark, when no logo is set

### 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
)
response = client.projects.watermark.update_logo(
    project_id="projectId",
    logo="logo",
)
print(response.watermark)
```

#### Response

```json
{
  "watermark": {
    "id": "id",
    "createdAt": "createdAt",
    "createdBy": "createdBy",
    "enabled": true,
    "level": "project",
    "opacity": 0,
    "placement": "bottom-left",
    "rotation": 0,
    "scale": 0,
    "scopeId": "scopeId",
    "spacing": 0,
    "updatedAt": "updatedAt",
    "version": 0,
    "deletedAt": "deletedAt",
    "logoIsOpaque": true,
    "logoKey": "logoKey",
    "text": "text"
  }
}
```

## Domain Types

### Watermark Delete Response

- `class WatermarkDeleteResponse: …`

  - `deleted: bool`

### Watermark Delete Logo Response

- `class WatermarkDeleteLogoResponse: …`

  - `watermark: Watermark`

    Forced-watermark configuration stored at one scope.

    - `id: str`

      Stable identifier derived from level + scopeId

    - `created_at: str`

      ISO-8601 creation timestamp

    - `created_by: str`

      User id that last wrote the configuration

    - `enabled: bool`

      Whether the watermark is enforced on assets generated in this scope. A
      disabled project configuration falls back to its team's.

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

      Scope this configuration applies to: team or project

      - `"project"`

      - `"team"`

    - `opacity: float`

      Mark opacity, 0.05 (barely visible) to 1 (opaque)

    - `placement: Literal["bottom-left", "bottom-right", "center", 3 more]`

      Where the mark sits on the image

      - `"bottom-left"`

      - `"bottom-right"`

      - `"center"`

      - `"tiled"`

      - `"top-left"`

      - `"top-right"`

    - `rotation: float`

      Mark rotation in degrees, -90 to 90. 0 is horizontal.

    - `scale: float`

      Mark width as a fraction of the image width

    - `scope_id: str`

      The id of the team or project that owns this configuration

    - `spacing: float`

      Gap between repetitions, as a fraction of the mark's own size. Tiled
      placement only; 0 repeats the mark edge to edge.

    - `updated_at: str`

      ISO-8601 last-update timestamp

    - `version: float`

      Bumped on every write.

    - `deleted_at: Optional[str]`

      Set when the configuration has been deleted.

    - `logo_is_opaque: Optional[bool]`

      Whether the stored logo has no transparency at all.

      Recorded at upload so the UI can warn without decoding the image again: an
      opaque logo draws its whole rectangle, which a rotated tiled mark turns
      into a very visible diamond.

    - `logo_key: Optional[str]`

      Where the uploaded logo lives, when one is set.

    - `text: Optional[str]`

      Text rendered as the mark, when no logo is set

### Watermark Preview Response

- `class WatermarkPreviewResponse: …`

  Response of the watermark preview routes.

  - `image: str`

    The sample image with the mark drawn on it, base64-encoded.

### Watermark Retrieve Response

- `class WatermarkRetrieveResponse: …`

  - `watermark: Watermark`

    Forced-watermark configuration stored at one scope.

    - `id: str`

      Stable identifier derived from level + scopeId

    - `created_at: str`

      ISO-8601 creation timestamp

    - `created_by: str`

      User id that last wrote the configuration

    - `enabled: bool`

      Whether the watermark is enforced on assets generated in this scope. A
      disabled project configuration falls back to its team's.

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

      Scope this configuration applies to: team or project

      - `"project"`

      - `"team"`

    - `opacity: float`

      Mark opacity, 0.05 (barely visible) to 1 (opaque)

    - `placement: Literal["bottom-left", "bottom-right", "center", 3 more]`

      Where the mark sits on the image

      - `"bottom-left"`

      - `"bottom-right"`

      - `"center"`

      - `"tiled"`

      - `"top-left"`

      - `"top-right"`

    - `rotation: float`

      Mark rotation in degrees, -90 to 90. 0 is horizontal.

    - `scale: float`

      Mark width as a fraction of the image width

    - `scope_id: str`

      The id of the team or project that owns this configuration

    - `spacing: float`

      Gap between repetitions, as a fraction of the mark's own size. Tiled
      placement only; 0 repeats the mark edge to edge.

    - `updated_at: str`

      ISO-8601 last-update timestamp

    - `version: float`

      Bumped on every write.

    - `deleted_at: Optional[str]`

      Set when the configuration has been deleted.

    - `logo_is_opaque: Optional[bool]`

      Whether the stored logo has no transparency at all.

      Recorded at upload so the UI can warn without decoding the image again: an
      opaque logo draws its whole rectangle, which a rotated tiled mark turns
      into a very visible diamond.

    - `logo_key: Optional[str]`

      Where the uploaded logo lives, when one is set.

    - `text: Optional[str]`

      Text rendered as the mark, when no logo is set

### Watermark Update Response

- `class WatermarkUpdateResponse: …`

  - `watermark: Watermark`

    Forced-watermark configuration stored at one scope.

    - `id: str`

      Stable identifier derived from level + scopeId

    - `created_at: str`

      ISO-8601 creation timestamp

    - `created_by: str`

      User id that last wrote the configuration

    - `enabled: bool`

      Whether the watermark is enforced on assets generated in this scope. A
      disabled project configuration falls back to its team's.

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

      Scope this configuration applies to: team or project

      - `"project"`

      - `"team"`

    - `opacity: float`

      Mark opacity, 0.05 (barely visible) to 1 (opaque)

    - `placement: Literal["bottom-left", "bottom-right", "center", 3 more]`

      Where the mark sits on the image

      - `"bottom-left"`

      - `"bottom-right"`

      - `"center"`

      - `"tiled"`

      - `"top-left"`

      - `"top-right"`

    - `rotation: float`

      Mark rotation in degrees, -90 to 90. 0 is horizontal.

    - `scale: float`

      Mark width as a fraction of the image width

    - `scope_id: str`

      The id of the team or project that owns this configuration

    - `spacing: float`

      Gap between repetitions, as a fraction of the mark's own size. Tiled
      placement only; 0 repeats the mark edge to edge.

    - `updated_at: str`

      ISO-8601 last-update timestamp

    - `version: float`

      Bumped on every write.

    - `deleted_at: Optional[str]`

      Set when the configuration has been deleted.

    - `logo_is_opaque: Optional[bool]`

      Whether the stored logo has no transparency at all.

      Recorded at upload so the UI can warn without decoding the image again: an
      opaque logo draws its whole rectangle, which a rotated tiled mark turns
      into a very visible diamond.

    - `logo_key: Optional[str]`

      Where the uploaded logo lives, when one is set.

    - `text: Optional[str]`

      Text rendered as the mark, when no logo is set

### Watermark Update Logo Response

- `class WatermarkUpdateLogoResponse: …`

  - `watermark: Watermark`

    Forced-watermark configuration stored at one scope.

    - `id: str`

      Stable identifier derived from level + scopeId

    - `created_at: str`

      ISO-8601 creation timestamp

    - `created_by: str`

      User id that last wrote the configuration

    - `enabled: bool`

      Whether the watermark is enforced on assets generated in this scope. A
      disabled project configuration falls back to its team's.

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

      Scope this configuration applies to: team or project

      - `"project"`

      - `"team"`

    - `opacity: float`

      Mark opacity, 0.05 (barely visible) to 1 (opaque)

    - `placement: Literal["bottom-left", "bottom-right", "center", 3 more]`

      Where the mark sits on the image

      - `"bottom-left"`

      - `"bottom-right"`

      - `"center"`

      - `"tiled"`

      - `"top-left"`

      - `"top-right"`

    - `rotation: float`

      Mark rotation in degrees, -90 to 90. 0 is horizontal.

    - `scale: float`

      Mark width as a fraction of the image width

    - `scope_id: str`

      The id of the team or project that owns this configuration

    - `spacing: float`

      Gap between repetitions, as a fraction of the mark's own size. Tiled
      placement only; 0 repeats the mark edge to edge.

    - `updated_at: str`

      ISO-8601 last-update timestamp

    - `version: float`

      Bumped on every write.

    - `deleted_at: Optional[str]`

      Set when the configuration has been deleted.

    - `logo_is_opaque: Optional[bool]`

      Whether the stored logo has no transparency at all.

      Recorded at upload so the UI can warn without decoding the image again: an
      opaque logo draws its whole rectangle, which a rotated tiled mark turns
      into a very visible diamond.

    - `logo_key: Optional[str]`

      Where the uploaded logo lives, when one is set.

    - `text: Optional[str]`

      Text rendered as the mark, when no logo is set

# Webhook Endpoints

## Create

`projects.webhook_endpoints.create(strproject_id, WebhookEndpointCreateParams**kwargs)  -> WebhookEndpointCreateResponse`

**post** `/projects/{projectId}/webhook-endpoints`

Register a new webhook endpoint for the project

### Parameters

- `project_id: str`

- `enabled_events: List[Literal["*", "asset.download.completed", "asset.download.created", 16 more]]`

  The events that trigger the webhook. ['*'] indicates that all events are enabled

  - `"*"`

  - `"asset.download.completed"`

  - `"asset.download.created"`

  - `"asset.download.failed"`

  - `"generation.completed"`

  - `"generation.created"`

  - `"generation.failed"`

  - `"inference.cancelled"`

  - `"inference.completed"`

  - `"inference.created"`

  - `"inference.failed"`

  - `"model.download.completed"`

  - `"model.download.created"`

  - `"model.download.failed"`

  - `"model.training.cancelled"`

  - `"model.training.completed"`

  - `"model.training.failed"`

  - `"model.training.started"`

  - `"team.credit.threshold.crossed"`

- `url: str`

  The URL of the webhook endpoint. Must be an absolute http(s) URL

- `description: Optional[str]`

  A description of the webhook endpoint

### Returns

- `class WebhookEndpointCreateResponse: …`

  - `webhook_endpoint: WebhookEndpoint`

    The creation response, and the only one that carries the secret: it is
    generated once and never returned again, so a client that loses it has to
    recreate the endpoint.

    - `id: str`

      The ID of the webhook endpoint

    - `created_at: str`

      The date and time the webhook endpoint was created

    - `enabled: bool`

      Whether the webhook is enabled

    - `enabled_events: List[Literal["*", "asset.download.completed", "asset.download.created", 16 more]]`

      The events that trigger the webhook. ['*'] indicates that all events are enabled

      - `"*"`

      - `"asset.download.completed"`

      - `"asset.download.created"`

      - `"asset.download.failed"`

      - `"generation.completed"`

      - `"generation.created"`

      - `"generation.failed"`

      - `"inference.cancelled"`

      - `"inference.completed"`

      - `"inference.created"`

      - `"inference.failed"`

      - `"model.download.completed"`

      - `"model.download.created"`

      - `"model.download.failed"`

      - `"model.training.cancelled"`

      - `"model.training.completed"`

      - `"model.training.failed"`

      - `"model.training.started"`

      - `"team.credit.threshold.crossed"`

    - `nb_failed_calls: float`

      The number of calls to the webhook endpoint that have failed

    - `nb_total_calls: float`

      The number of calls to the webhook endpoint

    - `owner_id: str`

      The ID of the owner of the webhook endpoint: a project id for job
      lifecycle events, a team id for alert events

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

      Whether the owner is a project or a team. Required to tell them apart: a
      project created before the team/project split shares its team's id

      - `"project"`

      - `"team"`

    - `secret: str`

      The endpoint's secret, used to generate webhook signatures

    - `updated_at: str`

      The date and time the webhook endpoint was updated

    - `url: str`

      The URL of the webhook endpoint

    - `description: Optional[str]`

      A description of the webhook endpoint

### 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
)
webhook_endpoint = client.projects.webhook_endpoints.create(
    project_id="projectId",
    enabled_events=["*"],
    url="url",
)
print(webhook_endpoint.webhook_endpoint)
```

#### Response

```json
{
  "webhookEndpoint": {
    "id": "id",
    "createdAt": "createdAt",
    "enabled": true,
    "enabledEvents": [
      "*"
    ],
    "nbFailedCalls": 0,
    "nbTotalCalls": 0,
    "ownerId": "ownerId",
    "ownerType": "project",
    "secret": "secret",
    "updatedAt": "updatedAt",
    "url": "url",
    "description": "description"
  }
}
```

## Delete

`projects.webhook_endpoints.delete(strwebhook_endpoint_id, WebhookEndpointDeleteParams**kwargs)  -> object`

**delete** `/projects/{projectId}/webhook-endpoints/{webhookEndpointId}`

Delete a particular webhook endpoint by its Id

### Parameters

- `project_id: str`

- `webhook_endpoint_id: str`

### Returns

- `object`

### 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
)
webhook_endpoint = client.projects.webhook_endpoints.delete(
    webhook_endpoint_id="webhookEndpointId",
    project_id="projectId",
)
print(webhook_endpoint)
```

#### Response

```json
{}
```

## List

`projects.webhook_endpoints.list(strproject_id)  -> WebhookEndpointListResponse`

**get** `/projects/{projectId}/webhook-endpoints`

List the project's webhook endpoints

### Parameters

- `project_id: str`

### Returns

- `class WebhookEndpointListResponse: …`

  - `webhook_endpoints: List[WebhookEndpoint]`

    A list of the project webhooks

    - `id: str`

      The ID of the webhook endpoint

    - `created_at: str`

      The date and time the webhook endpoint was created

    - `enabled: bool`

      Whether the webhook is enabled

    - `enabled_events: List[Literal["*", "asset.download.completed", "asset.download.created", 16 more]]`

      The events that trigger the webhook. ['*'] indicates that all events are enabled

      - `"*"`

      - `"asset.download.completed"`

      - `"asset.download.created"`

      - `"asset.download.failed"`

      - `"generation.completed"`

      - `"generation.created"`

      - `"generation.failed"`

      - `"inference.cancelled"`

      - `"inference.completed"`

      - `"inference.created"`

      - `"inference.failed"`

      - `"model.download.completed"`

      - `"model.download.created"`

      - `"model.download.failed"`

      - `"model.training.cancelled"`

      - `"model.training.completed"`

      - `"model.training.failed"`

      - `"model.training.started"`

      - `"team.credit.threshold.crossed"`

    - `nb_failed_calls: float`

      The number of calls to the webhook endpoint that have failed

    - `nb_total_calls: float`

      The number of calls to the webhook endpoint

    - `owner_id: str`

      The ID of the owner of the webhook endpoint: a project id for job
      lifecycle events, a team id for alert events

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

      Whether the owner is a project or a team. Required to tell them apart: a
      project created before the team/project split shares its team's id

      - `"project"`

      - `"team"`

    - `updated_at: str`

      The date and time the webhook endpoint was updated

    - `url: str`

      The URL of the webhook endpoint

    - `description: Optional[str]`

      A description of the webhook endpoint

### 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
)
webhook_endpoints = client.projects.webhook_endpoints.list(
    "projectId",
)
print(webhook_endpoints.webhook_endpoints)
```

#### Response

```json
{
  "webhookEndpoints": [
    {
      "id": "id",
      "createdAt": "createdAt",
      "enabled": true,
      "enabledEvents": [
        "*"
      ],
      "nbFailedCalls": 0,
      "nbTotalCalls": 0,
      "ownerId": "ownerId",
      "ownerType": "project",
      "updatedAt": "updatedAt",
      "url": "url",
      "description": "description"
    }
  ]
}
```

## Update

`projects.webhook_endpoints.update(strwebhook_endpoint_id, WebhookEndpointUpdateParams**kwargs)  -> WebhookEndpointUpdateResponse`

**put** `/projects/{projectId}/webhook-endpoints/{webhookEndpointId}`

Update a particular webhook endpoint for a project

### Parameters

- `project_id: str`

- `webhook_endpoint_id: str`

- `description: Optional[str]`

  A description of the webhook endpoint

- `enabled: Optional[bool]`

  Whether the webhook is enabled

- `enabled_events: Optional[List[Literal["*", "asset.download.completed", "asset.download.created", 16 more]]]`

  The events that trigger the webhook. ['*'] indicates that all events are enabled

  - `"*"`

  - `"asset.download.completed"`

  - `"asset.download.created"`

  - `"asset.download.failed"`

  - `"generation.completed"`

  - `"generation.created"`

  - `"generation.failed"`

  - `"inference.cancelled"`

  - `"inference.completed"`

  - `"inference.created"`

  - `"inference.failed"`

  - `"model.download.completed"`

  - `"model.download.created"`

  - `"model.download.failed"`

  - `"model.training.cancelled"`

  - `"model.training.completed"`

  - `"model.training.failed"`

  - `"model.training.started"`

  - `"team.credit.threshold.crossed"`

- `url: Optional[str]`

  The URL of the webhook endpoint. Must be an absolute http(s) URL

### Returns

- `class WebhookEndpointUpdateResponse: …`

  - `webhook_endpoint: WebhookEndpoint`

    - `id: str`

      The ID of the webhook endpoint

    - `created_at: str`

      The date and time the webhook endpoint was created

    - `enabled: bool`

      Whether the webhook is enabled

    - `enabled_events: List[Literal["*", "asset.download.completed", "asset.download.created", 16 more]]`

      The events that trigger the webhook. ['*'] indicates that all events are enabled

      - `"*"`

      - `"asset.download.completed"`

      - `"asset.download.created"`

      - `"asset.download.failed"`

      - `"generation.completed"`

      - `"generation.created"`

      - `"generation.failed"`

      - `"inference.cancelled"`

      - `"inference.completed"`

      - `"inference.created"`

      - `"inference.failed"`

      - `"model.download.completed"`

      - `"model.download.created"`

      - `"model.download.failed"`

      - `"model.training.cancelled"`

      - `"model.training.completed"`

      - `"model.training.failed"`

      - `"model.training.started"`

      - `"team.credit.threshold.crossed"`

    - `nb_failed_calls: float`

      The number of calls to the webhook endpoint that have failed

    - `nb_total_calls: float`

      The number of calls to the webhook endpoint

    - `owner_id: str`

      The ID of the owner of the webhook endpoint: a project id for job
      lifecycle events, a team id for alert events

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

      Whether the owner is a project or a team. Required to tell them apart: a
      project created before the team/project split shares its team's id

      - `"project"`

      - `"team"`

    - `updated_at: str`

      The date and time the webhook endpoint was updated

    - `url: str`

      The URL of the webhook endpoint

    - `description: Optional[str]`

      A description of the webhook endpoint

### 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
)
webhook_endpoint = client.projects.webhook_endpoints.update(
    webhook_endpoint_id="webhookEndpointId",
    project_id="projectId",
)
print(webhook_endpoint.webhook_endpoint)
```

#### Response

```json
{
  "webhookEndpoint": {
    "id": "id",
    "createdAt": "createdAt",
    "enabled": true,
    "enabledEvents": [
      "*"
    ],
    "nbFailedCalls": 0,
    "nbTotalCalls": 0,
    "ownerId": "ownerId",
    "ownerType": "project",
    "updatedAt": "updatedAt",
    "url": "url",
    "description": "description"
  }
}
```

## Domain Types

### Webhook Endpoint Create Response

- `class WebhookEndpointCreateResponse: …`

  - `webhook_endpoint: WebhookEndpoint`

    The creation response, and the only one that carries the secret: it is
    generated once and never returned again, so a client that loses it has to
    recreate the endpoint.

    - `id: str`

      The ID of the webhook endpoint

    - `created_at: str`

      The date and time the webhook endpoint was created

    - `enabled: bool`

      Whether the webhook is enabled

    - `enabled_events: List[Literal["*", "asset.download.completed", "asset.download.created", 16 more]]`

      The events that trigger the webhook. ['*'] indicates that all events are enabled

      - `"*"`

      - `"asset.download.completed"`

      - `"asset.download.created"`

      - `"asset.download.failed"`

      - `"generation.completed"`

      - `"generation.created"`

      - `"generation.failed"`

      - `"inference.cancelled"`

      - `"inference.completed"`

      - `"inference.created"`

      - `"inference.failed"`

      - `"model.download.completed"`

      - `"model.download.created"`

      - `"model.download.failed"`

      - `"model.training.cancelled"`

      - `"model.training.completed"`

      - `"model.training.failed"`

      - `"model.training.started"`

      - `"team.credit.threshold.crossed"`

    - `nb_failed_calls: float`

      The number of calls to the webhook endpoint that have failed

    - `nb_total_calls: float`

      The number of calls to the webhook endpoint

    - `owner_id: str`

      The ID of the owner of the webhook endpoint: a project id for job
      lifecycle events, a team id for alert events

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

      Whether the owner is a project or a team. Required to tell them apart: a
      project created before the team/project split shares its team's id

      - `"project"`

      - `"team"`

    - `secret: str`

      The endpoint's secret, used to generate webhook signatures

    - `updated_at: str`

      The date and time the webhook endpoint was updated

    - `url: str`

      The URL of the webhook endpoint

    - `description: Optional[str]`

      A description of the webhook endpoint

### Webhook Endpoint List Response

- `class WebhookEndpointListResponse: …`

  - `webhook_endpoints: List[WebhookEndpoint]`

    A list of the project webhooks

    - `id: str`

      The ID of the webhook endpoint

    - `created_at: str`

      The date and time the webhook endpoint was created

    - `enabled: bool`

      Whether the webhook is enabled

    - `enabled_events: List[Literal["*", "asset.download.completed", "asset.download.created", 16 more]]`

      The events that trigger the webhook. ['*'] indicates that all events are enabled

      - `"*"`

      - `"asset.download.completed"`

      - `"asset.download.created"`

      - `"asset.download.failed"`

      - `"generation.completed"`

      - `"generation.created"`

      - `"generation.failed"`

      - `"inference.cancelled"`

      - `"inference.completed"`

      - `"inference.created"`

      - `"inference.failed"`

      - `"model.download.completed"`

      - `"model.download.created"`

      - `"model.download.failed"`

      - `"model.training.cancelled"`

      - `"model.training.completed"`

      - `"model.training.failed"`

      - `"model.training.started"`

      - `"team.credit.threshold.crossed"`

    - `nb_failed_calls: float`

      The number of calls to the webhook endpoint that have failed

    - `nb_total_calls: float`

      The number of calls to the webhook endpoint

    - `owner_id: str`

      The ID of the owner of the webhook endpoint: a project id for job
      lifecycle events, a team id for alert events

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

      Whether the owner is a project or a team. Required to tell them apart: a
      project created before the team/project split shares its team's id

      - `"project"`

      - `"team"`

    - `updated_at: str`

      The date and time the webhook endpoint was updated

    - `url: str`

      The URL of the webhook endpoint

    - `description: Optional[str]`

      A description of the webhook endpoint

### Webhook Endpoint Update Response

- `class WebhookEndpointUpdateResponse: …`

  - `webhook_endpoint: WebhookEndpoint`

    - `id: str`

      The ID of the webhook endpoint

    - `created_at: str`

      The date and time the webhook endpoint was created

    - `enabled: bool`

      Whether the webhook is enabled

    - `enabled_events: List[Literal["*", "asset.download.completed", "asset.download.created", 16 more]]`

      The events that trigger the webhook. ['*'] indicates that all events are enabled

      - `"*"`

      - `"asset.download.completed"`

      - `"asset.download.created"`

      - `"asset.download.failed"`

      - `"generation.completed"`

      - `"generation.created"`

      - `"generation.failed"`

      - `"inference.cancelled"`

      - `"inference.completed"`

      - `"inference.created"`

      - `"inference.failed"`

      - `"model.download.completed"`

      - `"model.download.created"`

      - `"model.download.failed"`

      - `"model.training.cancelled"`

      - `"model.training.completed"`

      - `"model.training.failed"`

      - `"model.training.started"`

      - `"team.credit.threshold.crossed"`

    - `nb_failed_calls: float`

      The number of calls to the webhook endpoint that have failed

    - `nb_total_calls: float`

      The number of calls to the webhook endpoint

    - `owner_id: str`

      The ID of the owner of the webhook endpoint: a project id for job
      lifecycle events, a team id for alert events

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

      Whether the owner is a project or a team. Required to tell them apart: a
      project created before the team/project split shares its team's id

      - `"project"`

      - `"team"`

    - `updated_at: str`

      The date and time the webhook endpoint was updated

    - `url: str`

      The URL of the webhook endpoint

    - `description: Optional[str]`

      A description of the webhook endpoint

# Events

## List

`projects.webhook_endpoints.events.list(strwebhook_endpoint_id, EventListParams**kwargs)  -> EventListResponse`

**get** `/projects/{projectId}/webhook-endpoints/{webhookEndpointId}/events`

List the project's webhook events

### Parameters

- `project_id: str`

- `webhook_endpoint_id: str`

- `pagination_token: Optional[str]`

  A token you received in a previous request to query the next page of items

### Returns

- `class EventListResponse: …`

  - `items: List[Item]`

    A list of the project webhook events

    - `id: str`

    - `endpoint_id: str`

    - `status: Literal["created", "failed", "retrying", "success"]`

      - `"created"`

      - `"failed"`

      - `"retrying"`

      - `"success"`

    - `type: Literal["*", "asset.download.completed", "asset.download.created", 16 more]`

      Every event a webhook endpoint can subscribe to: a project endpoint takes the
      job lifecycle events, a team endpoint takes the alert events.

      - `"*"`

      - `"asset.download.completed"`

      - `"asset.download.created"`

      - `"asset.download.failed"`

      - `"generation.completed"`

      - `"generation.created"`

      - `"generation.failed"`

      - `"inference.cancelled"`

      - `"inference.completed"`

      - `"inference.created"`

      - `"inference.failed"`

      - `"model.download.completed"`

      - `"model.download.created"`

      - `"model.download.failed"`

      - `"model.training.cancelled"`

      - `"model.training.completed"`

      - `"model.training.failed"`

      - `"model.training.started"`

      - `"team.credit.threshold.crossed"`

    - `updated_at: str`

  - `next_pagination_token: Optional[str]`

    A token to query the next page of events

### 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
)
events = client.projects.webhook_endpoints.events.list(
    webhook_endpoint_id="webhookEndpointId",
    project_id="projectId",
)
print(events.items)
```

#### Response

```json
{
  "items": [
    {
      "id": "id",
      "endpointId": "endpointId",
      "status": "created",
      "type": "*",
      "updatedAt": "updatedAt"
    }
  ],
  "nextPaginationToken": "nextPaginationToken"
}
```

## Retrieve

`projects.webhook_endpoints.events.retrieve(strevent_id, EventRetrieveParams**kwargs)  -> EventRetrieveResponse`

**get** `/projects/{projectId}/webhook-endpoints/{webhookEndpointId}/events/{eventId}`

Retrieve one delivery event of one of the project's webhook endpoints

### Parameters

- `project_id: str`

- `webhook_endpoint_id: str`

- `event_id: str`

### Returns

- `class EventRetrieveResponse: …`

  - `webhook_event: WebhookEvent`

    - `id: str`

    - `attempts: List[WebhookEventAttempt]`

      - `response_status_code: float`

      - `sent_at: str`

    - `created_at: str`

    - `endpoint_id: str`

    - `payload: object`

    - `sent_at: str`

    - `status: Literal["created", "failed", "retrying", "success"]`

      - `"created"`

      - `"failed"`

      - `"retrying"`

      - `"success"`

    - `type: Literal["*", "asset.download.completed", "asset.download.created", 16 more]`

      Every event a webhook endpoint can subscribe to: a project endpoint takes the
      job lifecycle events, a team endpoint takes the alert events.

      - `"*"`

      - `"asset.download.completed"`

      - `"asset.download.created"`

      - `"asset.download.failed"`

      - `"generation.completed"`

      - `"generation.created"`

      - `"generation.failed"`

      - `"inference.cancelled"`

      - `"inference.completed"`

      - `"inference.created"`

      - `"inference.failed"`

      - `"model.download.completed"`

      - `"model.download.created"`

      - `"model.download.failed"`

      - `"model.training.cancelled"`

      - `"model.training.completed"`

      - `"model.training.failed"`

      - `"model.training.started"`

      - `"team.credit.threshold.crossed"`

    - `updated_at: str`

### 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
)
event = client.projects.webhook_endpoints.events.retrieve(
    event_id="eventId",
    project_id="projectId",
    webhook_endpoint_id="webhookEndpointId",
)
print(event.webhook_event)
```

#### Response

```json
{
  "webhookEvent": {
    "id": "id",
    "attempts": [
      {
        "responseStatusCode": 0,
        "sentAt": "sentAt"
      }
    ],
    "createdAt": "createdAt",
    "endpointId": "endpointId",
    "payload": {},
    "sentAt": "sentAt",
    "status": "created",
    "type": "*",
    "updatedAt": "updatedAt"
  }
}
```

## Domain Types

### Event List Response

- `class EventListResponse: …`

  - `items: List[Item]`

    A list of the project webhook events

    - `id: str`

    - `endpoint_id: str`

    - `status: Literal["created", "failed", "retrying", "success"]`

      - `"created"`

      - `"failed"`

      - `"retrying"`

      - `"success"`

    - `type: Literal["*", "asset.download.completed", "asset.download.created", 16 more]`

      Every event a webhook endpoint can subscribe to: a project endpoint takes the
      job lifecycle events, a team endpoint takes the alert events.

      - `"*"`

      - `"asset.download.completed"`

      - `"asset.download.created"`

      - `"asset.download.failed"`

      - `"generation.completed"`

      - `"generation.created"`

      - `"generation.failed"`

      - `"inference.cancelled"`

      - `"inference.completed"`

      - `"inference.created"`

      - `"inference.failed"`

      - `"model.download.completed"`

      - `"model.download.created"`

      - `"model.download.failed"`

      - `"model.training.cancelled"`

      - `"model.training.completed"`

      - `"model.training.failed"`

      - `"model.training.started"`

      - `"team.credit.threshold.crossed"`

    - `updated_at: str`

  - `next_pagination_token: Optional[str]`

    A token to query the next page of events

### Event Retrieve Response

- `class EventRetrieveResponse: …`

  - `webhook_event: WebhookEvent`

    - `id: str`

    - `attempts: List[WebhookEventAttempt]`

      - `response_status_code: float`

      - `sent_at: str`

    - `created_at: str`

    - `endpoint_id: str`

    - `payload: object`

    - `sent_at: str`

    - `status: Literal["created", "failed", "retrying", "success"]`

      - `"created"`

      - `"failed"`

      - `"retrying"`

      - `"success"`

    - `type: Literal["*", "asset.download.completed", "asset.download.created", 16 more]`

      Every event a webhook endpoint can subscribe to: a project endpoint takes the
      job lifecycle events, a team endpoint takes the alert events.

      - `"*"`

      - `"asset.download.completed"`

      - `"asset.download.created"`

      - `"asset.download.failed"`

      - `"generation.completed"`

      - `"generation.created"`

      - `"generation.failed"`

      - `"inference.cancelled"`

      - `"inference.completed"`

      - `"inference.created"`

      - `"inference.failed"`

      - `"model.download.completed"`

      - `"model.download.created"`

      - `"model.download.failed"`

      - `"model.training.cancelled"`

      - `"model.training.completed"`

      - `"model.training.failed"`

      - `"model.training.started"`

      - `"team.credit.threshold.crossed"`

    - `updated_at: str`
