# Teams

## Delete Invitations

`teams.delete_invitations(strteam_id, TeamDeleteInvitationsParams**kwargs)  -> object`

**delete** `/teams/{teamId}/invitations`

Withdraw a user invitation on the team

### Parameters

- `team_id: str`

- `email: str`

  The invitation email to withdraw from the team

### 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
)
response = client.teams.delete_invitations(
    team_id="teamId",
    email="email",
)
print(response)
```

#### Response

```json
{}
```

## List

`teams.list()  -> TeamListResponse`

**get** `/teams`

List the teams the user belongs to

### Returns

- `class TeamListResponse: …`

  - `teams: List[Team]`

    A list of the teams the user belongs to

    - `id: str`

      The team ID (example: "eyVcnFJcR92BxBkz7N6g5w")

    - `context: TeamContext`

      The context of the team for the current authenticated user

      - `invitations_count: float`

        The number of invitations on this team

      - `keys_count: float`

        The number of API keys on this team

      - `user_role: Literal["admin", "key", "member"]`

        The authenticated user's role for this team

        - `"admin"`

        - `"key"`

        - `"member"`

      - `users_count: float`

        The number of users on this team

    - `created_at: str`

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

    - `name: str`

      The team name (example: "Scenario")

    - `plan: Literal["cu-basic", "cu-creator", "cu-max", 9 more]`

      The team plan

      - `"cu-basic"`

      - `"cu-creator"`

      - `"cu-max"`

      - `"cu-pro"`

      - `"cu-pro-q3-25"`

      - `"cu-team"`

      - `"cu-team-v2"`

      - `"enterprise"`

      - `"essential"`

      - `"free"`

      - `"premium"`

      - `"pro"`

    - `projects: List[TeamProject]`

      Projects of the team

      - `id: str`

      - `created_at: str`

      - `name: str`

      - `updated_at: str`

      - `avatar: Optional[TeamProjectAvatar]`

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

      - `disable_ip_detection: Optional[bool]`

        When true, IP detection is switched off for this project.

      - `quality_gate_auto_detect: Optional[bool]`

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

    - `type: Literal["personal", "shared"]`

      The team type

      - `"personal"`

      - `"shared"`

    - `updated_at: str`

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

    - `avatar: Optional[TeamAvatar]`

      The team'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

    - `byok: Optional[TeamByok]`

      BYOK pricing override. Admin-only — omitted for non-admin callers.

      - `markup_multiplier: float`

      - `updated_at: Optional[str]`

        ISO timestamp of the last update. Optional — legacy rows may lack it.

      - `updated_by: Optional[str]`

        Human-readable handle of who last updated the markup (display name).

    - `default_user_max_consumption: Optional[float]`

      Team-wide default max consumption (CU) applied to every member over the
      billing period, unless overridden per member. Absent when no team-wide
      default is set.

    - `ip_detection_enforcement: Optional[Literal["active-fail-closed", "active-fail-open", "disabled"]]`

      The IP detection enforcement posture for the team.
      'disabled': IP detection is not performed.
      'active-fail-open': IP detection runs; on detector error the request is allowed through.
      'active-fail-closed': IP detection runs; on detector error the request is blocked.

      - `"active-fail-closed"`

      - `"active-fail-open"`

      - `"disabled"`

    - `quality_gate_auto_detect: Optional[bool]`

      Quality Gate auto-detection default for the team.

### 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
)
teams = client.teams.list()
print(teams.teams)
```

#### Response

```json
{
  "teams": [
    {
      "id": "id",
      "context": {
        "invitationsCount": 0,
        "keysCount": 0,
        "userRole": "admin",
        "usersCount": 0
      },
      "createdAt": "createdAt",
      "name": "name",
      "plan": "cu-basic",
      "projects": [
        {
          "id": "id",
          "createdAt": "createdAt",
          "name": "name",
          "updatedAt": "updatedAt",
          "avatar": {
            "assetId": "assetId",
            "url": "url"
          },
          "disableIpDetection": true,
          "qualityGateAutoDetect": true
        }
      ],
      "type": "personal",
      "updatedAt": "updatedAt",
      "avatar": {
        "assetId": "assetId",
        "url": "url"
      },
      "byok": {
        "markupMultiplier": 0,
        "updatedAt": "updatedAt",
        "updatedBy": "updatedBy"
      },
      "defaultUserMaxConsumption": 0,
      "ipDetectionEnforcement": "active-fail-closed",
      "qualityGateAutoDetect": true
    }
  ]
}
```

## Retrieve

`teams.retrieve(strteam_id)  -> TeamRetrieveResponse`

**get** `/teams/{teamId}`

Get the details of a team

### Parameters

- `team_id: str`

### Returns

- `class TeamRetrieveResponse: …`

  - `team: Team`

    - `id: str`

      The team ID (example: "eyVcnFJcR92BxBkz7N6g5w")

    - `created_at: str`

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

    - `invitations: List[TeamInvitation]`

      The list of pending invitations

      - `created_at: str`

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

      - `email: str`

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

      - `role: Literal["admin", "key", "member"]`

        The role of the invited user inside the team

        - `"admin"`

        - `"key"`

        - `"member"`

      - `status: Literal["accepted", "expired", "pending", "withdrawn"]`

        The status of the invitation

        - `"accepted"`

        - `"expired"`

        - `"pending"`

        - `"withdrawn"`

      - `url: str`

        The link the invited user opens to accept the invitation, as sent by email

      - `project_ids: Optional[List[str]]`

        The list of project IDs for which the user is invited

    - `keys: List[TeamKey]`

      The list of API keys

      - `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")

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

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

      - `role: Optional[str]`

        The key's role. For a TEAM key: its effective team-plane scopes as a
        `;`-separated list (e.g. `"team.read;team.usage.read"`). Project keys
        carry their project-plane role(s) per project in `projects` instead.

    - `name: str`

      The team name (example: "Scenario")

    - `payment_status: Literal["failed", "succeeded"]`

      The paymentStatus for the team

      - `"failed"`

      - `"succeeded"`

    - `plan: Literal["cu-basic", "cu-creator", "cu-max", 9 more]`

      The team plan

      - `"cu-basic"`

      - `"cu-creator"`

      - `"cu-max"`

      - `"cu-pro"`

      - `"cu-pro-q3-25"`

      - `"cu-team"`

      - `"cu-team-v2"`

      - `"enterprise"`

      - `"essential"`

      - `"free"`

      - `"premium"`

      - `"pro"`

    - `projects: List[TeamProject]`

      Projects of the team

      - `id: str`

      - `created_at: str`

      - `name: str`

      - `updated_at: str`

      - `avatar: Optional[TeamProjectAvatar]`

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

      - `disable_ip_detection: Optional[bool]`

        When true, IP detection is switched off for this project.

      - `quality_gate_auto_detect: Optional[bool]`

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

    - `search_host: str`

      The search host for the team

    - `search_indexes: TeamSearchIndexes`

      The search indexes for the team

      - `assets: TeamSearchIndexesAssets`

        - `private: str`

          The private search index for the team

        - `public: str`

          The public search index for the team

      - `models: TeamSearchIndexesModels`

        - `private: str`

          The private search index for the team

        - `public: str`

          The public search index for the team

      - `workflows: TeamSearchIndexesWorkflows`

        - `private: str`

          The private search index for the team

        - `public: str`

          The public search index for the team

    - `type: Literal["personal", "shared"]`

      The team type

      - `"personal"`

      - `"shared"`

    - `updated_at: str`

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

    - `users: List[TeamUser]`

      The list of teams members and their role

      - `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: Literal["admin", "key", "member"]`

        The role of the user inside the team

        - `"admin"`

        - `"key"`

        - `"member"`

      - `updated_at: str`

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

      - `avatar: Optional[TeamUserAvatar]`

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

      The team'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

    - `byok: Optional[TeamByok]`

      BYOK pricing override. Admin-only — omitted for non-admin callers.

      - `markup_multiplier: float`

      - `updated_at: Optional[str]`

        ISO timestamp of the last update. Optional — legacy rows may lack it.

      - `updated_by: Optional[str]`

        Human-readable handle of who last updated the markup (display name).

    - `default_user_max_consumption: Optional[float]`

      Team-wide default max consumption (CU) applied to every member over the
      billing period, unless overridden per member. Absent when no team-wide
      default is set.

    - `ip_detection_enforcement: Optional[Literal["active-fail-closed", "active-fail-open", "disabled"]]`

      The IP detection enforcement posture for the team.
      'disabled': IP detection is not performed.
      'active-fail-open': IP detection runs; on detector error the request is allowed through.
      'active-fail-closed': IP detection runs; on detector error the request is blocked.

      - `"active-fail-closed"`

      - `"active-fail-open"`

      - `"disabled"`

    - `quality_gate_auto_detect: Optional[bool]`

      Quality Gate auto-detection default for the team.

    - `settings: Optional[TeamSettings]`

      Team settings. Returned on `GET` and `PUT /teams/{teamId}`, absent from
      the teams list.

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

        Published homepage layout.

    - `subscription_status: Optional[Literal["active", "inactive", "paused"]]`

      The subscriptionStatus for the team

      - `"active"`

      - `"inactive"`

      - `"paused"`

### 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
)
team = client.teams.retrieve(
    "teamId",
)
print(team.team)
```

#### Response

```json
{
  "team": {
    "id": "id",
    "createdAt": "createdAt",
    "invitations": [
      {
        "createdAt": "createdAt",
        "email": "email",
        "role": "admin",
        "status": "accepted",
        "url": "url",
        "projectIds": [
          "string"
        ]
      }
    ],
    "keys": [
      {
        "id": "id",
        "apiKeyId": "apiKeyId",
        "apiKeyStatus": "active",
        "createdAt": "createdAt",
        "name": "name",
        "scope": "project",
        "updatedAt": "updatedAt",
        "authorId": "authorId",
        "consumption": 0,
        "lastUsedAt": "lastUsedAt",
        "maxConsumption": 0,
        "ownerId": "ownerId",
        "projects": [
          {
            "projectId": "projectId",
            "role": "role"
          }
        ],
        "role": "role"
      }
    ],
    "name": "name",
    "paymentStatus": "failed",
    "plan": "cu-basic",
    "projects": [
      {
        "id": "id",
        "createdAt": "createdAt",
        "name": "name",
        "updatedAt": "updatedAt",
        "avatar": {
          "assetId": "assetId",
          "url": "url"
        },
        "disableIpDetection": true,
        "qualityGateAutoDetect": true
      }
    ],
    "searchHost": "searchHost",
    "searchIndexes": {
      "assets": {
        "private": "private",
        "public": "public"
      },
      "models": {
        "private": "private",
        "public": "public"
      },
      "workflows": {
        "private": "private",
        "public": "public"
      }
    },
    "type": "personal",
    "updatedAt": "updatedAt",
    "users": [
      {
        "id": "id",
        "createdAt": "createdAt",
        "email": "email",
        "role": "admin",
        "updatedAt": "updatedAt",
        "avatar": {
          "assetId": "assetId",
          "url": "url"
        },
        "consumption": 0,
        "maxConsumption": 0
      }
    ],
    "avatar": {
      "assetId": "assetId",
      "url": "url"
    },
    "byok": {
      "markupMultiplier": 0,
      "updatedAt": "updatedAt",
      "updatedBy": "updatedBy"
    },
    "defaultUserMaxConsumption": 0,
    "ipDetectionEnforcement": "active-fail-closed",
    "qualityGateAutoDetect": true,
    "settings": {
      "homepage": {
        "foo": "bar"
      }
    },
    "subscriptionStatus": "active"
  }
}
```

## Retrieve Limits

`teams.retrieve_limits(strteam_id)  -> TeamRetrieveLimitsResponse`

**get** `/teams/{teamId}/limits`

Retrieve current limits for a team

### Parameters

- `team_id: str`

### Returns

- `class TeamRetrieveLimitsResponse: …`

  - `limits: Limits`

    The actual billing limits values related to the plan

    - `api_keys: float`

    - `canvas_asset_layers: float`

    - `canvas_assets: float`

    - `collections: float`

    - `creative_units: float`

      The amount of Compute Units available for the plan

    - `default_seats: float`

    - `download_assets: float`

    - `download_model: float`

    - `inference_batch_size: float`

    - `max_cooldown: float`

      The maximum cooldown applied in case of over head

    - `max_training_datasets: float`

    - `min_cooldown: float`

      The minimum cooldown applied in case of over head

    - `models: float`

      The maximum models a project can have (train/upload/copy/transfer/...)

    - `otp_sessions: float`

    - `parallel_custom_jobs: float`

    - `parallel_inferences: float`

    - `parallel_training: float`

    - `parallel_workflow_runs: float`

    - `premium_generation_samples: float`

    - `projects: float`

      The maximum projects a team can have

    - `scaling_factor: float`

    - `seats: float`

    - `snapshots_retention: float`

    - `upload: float`

  - `one_shot_creative_units: List[OneShotCreativeUnit]`

    The list of one-shot Compute Units

    Can be empty if the team has no one-shot Compute Units

    - `amount: float`

      The Compute Units amount bought

    - `created_at: str`

      The creation date of the Compute Units (buy date)
      ISO string

    - `expiration: str`

      The expiration date of the Compute Units
      ISO string

    - `remaining: float`

      The remaining Compute Units available

    - `updated_at: str`

      The last update date of the Compute Units (use date)
      ISO string

  - `period: Period`

    The actual billing period start and end dates ISO strings

    - `end: str`

    - `start: str`

  - `plan: Literal["cu-basic", "cu-creator", "cu-max", 9 more]`

    The actual plan of the team

    - `"cu-basic"`

    - `"cu-creator"`

    - `"cu-max"`

    - `"cu-pro"`

    - `"cu-pro-q3-25"`

    - `"cu-team"`

    - `"cu-team-v2"`

    - `"enterprise"`

    - `"essential"`

    - `"free"`

    - `"premium"`

    - `"pro"`

  - `values: Values`

    The current value for each relevant limit in the billing period

    - `api_keys: float`

    - `canvas_assets: float`

    - `collections: float`

    - `creative_units: float`

    - `projects: float`

    - `seats: float`

### 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.teams.retrieve_limits(
    "teamId",
)
print(response.limits)
```

#### Response

```json
{
  "limits": {
    "apiKeys": 0,
    "canvasAssetLayers": 0,
    "canvasAssets": 0,
    "collections": 0,
    "creativeUnits": 0,
    "defaultSeats": 0,
    "downloadAssets": 0,
    "downloadModel": 0,
    "inferenceBatchSize": 0,
    "maxCooldown": 0,
    "maxTrainingDatasets": 0,
    "minCooldown": 0,
    "models": 0,
    "OTPSessions": 0,
    "parallelCustomJobs": 0,
    "parallelInferences": 0,
    "parallelTraining": 0,
    "parallelWorkflowRuns": 0,
    "premiumGenerationSamples": 0,
    "projects": 0,
    "scalingFactor": 0,
    "seats": 0,
    "snapshotsRetention": 0,
    "upload": 0
  },
  "oneShotCreativeUnits": [
    {
      "amount": 0,
      "createdAt": "createdAt",
      "expiration": "expiration",
      "remaining": 0,
      "updatedAt": "updatedAt"
    }
  ],
  "period": {
    "end": "end",
    "start": "start"
  },
  "plan": "cu-basic",
  "values": {
    "apiKeys": 0,
    "canvasAssets": 0,
    "collections": 0,
    "creativeUnits": 0,
    "projects": 0,
    "seats": 0
  }
}
```

## Update

`teams.update(strteam_id, TeamUpdateParams**kwargs)  -> TeamUpdateResponse`

**put** `/teams/{teamId}`

Update a particular team

### Parameters

- `team_id: str`

- `avatar_asset_id: Optional[str]`

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

- `default_user_max_consumption: Optional[float]`

  Team-wide default max consumption (CU) applied to every member over the
  billing period, overridable per member. Set to null to remove the default.

- `ip_detection_enforcement: Optional[Literal["active-fail-closed", "active-fail-open", "disabled"]]`

  The IP detection enforcement posture for the team.
  'disabled': IP detection is not performed.
  'active-fail-open': IP detection runs; on detector error the request is allowed through.
  'active-fail-closed': IP detection runs; on detector error the request is blocked.

  - `"active-fail-closed"`

  - `"active-fail-open"`

  - `"disabled"`

- `name: Optional[str]`

  The team name (example: "Scenario")

- `quality_gate_auto_detect: Optional[bool]`

  Enable Quality Gate auto-detection on generation for this team (projects can
  override). Set to null to clear the default.

- `settings: Optional[Settings]`

  Team settings. Set `homepage` to a layout object to publish it, or to
  `null` to unpublish it. Team-admin only.

  - `homepage: Optional[object]`

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

### Returns

- `class TeamUpdateResponse: …`

  - `team: Team`

    The updated team.

    - `id: str`

      The team ID (example: "eyVcnFJcR92BxBkz7N6g5w")

    - `context: TeamContext`

      The context of the team for the current authenticated user

      - `invitations_count: float`

        The number of invitations on this team

      - `keys_count: float`

        The number of API keys on this team

      - `user_role: Literal["admin", "key", "member"]`

        The authenticated user's role for this team

        - `"admin"`

        - `"key"`

        - `"member"`

      - `users_count: float`

        The number of users on this team

    - `created_at: str`

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

    - `name: str`

      The team name (example: "Scenario")

    - `plan: Literal["cu-basic", "cu-creator", "cu-max", 9 more]`

      The team plan

      - `"cu-basic"`

      - `"cu-creator"`

      - `"cu-max"`

      - `"cu-pro"`

      - `"cu-pro-q3-25"`

      - `"cu-team"`

      - `"cu-team-v2"`

      - `"enterprise"`

      - `"essential"`

      - `"free"`

      - `"premium"`

      - `"pro"`

    - `projects: List[TeamProject]`

      Projects of the team

      - `id: str`

      - `created_at: str`

      - `name: str`

      - `updated_at: str`

      - `avatar: Optional[TeamProjectAvatar]`

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

      - `disable_ip_detection: Optional[bool]`

        When true, IP detection is switched off for this project.

      - `quality_gate_auto_detect: Optional[bool]`

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

    - `type: Literal["personal", "shared"]`

      The team type

      - `"personal"`

      - `"shared"`

    - `updated_at: str`

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

    - `avatar: Optional[TeamAvatar]`

      The team'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

    - `byok: Optional[TeamByok]`

      BYOK pricing override. Admin-only — omitted for non-admin callers.

      - `markup_multiplier: float`

      - `updated_at: Optional[str]`

        ISO timestamp of the last update. Optional — legacy rows may lack it.

      - `updated_by: Optional[str]`

        Human-readable handle of who last updated the markup (display name).

    - `default_user_max_consumption: Optional[float]`

      Team-wide default max consumption (CU) applied to every member over the
      billing period, unless overridden per member. Absent when no team-wide
      default is set.

    - `ip_detection_enforcement: Optional[Literal["active-fail-closed", "active-fail-open", "disabled"]]`

      The IP detection enforcement posture for the team.
      'disabled': IP detection is not performed.
      'active-fail-open': IP detection runs; on detector error the request is allowed through.
      'active-fail-closed': IP detection runs; on detector error the request is blocked.

      - `"active-fail-closed"`

      - `"active-fail-open"`

      - `"disabled"`

    - `quality_gate_auto_detect: Optional[bool]`

      Quality Gate auto-detection default for the team.

    - `settings: Optional[TeamSettings]`

      Team settings.

      - `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
)
team = client.teams.update(
    team_id="teamId",
)
print(team.team)
```

#### Response

```json
{
  "team": {
    "id": "id",
    "context": {
      "invitationsCount": 0,
      "keysCount": 0,
      "userRole": "admin",
      "usersCount": 0
    },
    "createdAt": "createdAt",
    "name": "name",
    "plan": "cu-basic",
    "projects": [
      {
        "id": "id",
        "createdAt": "createdAt",
        "name": "name",
        "updatedAt": "updatedAt",
        "avatar": {
          "assetId": "assetId",
          "url": "url"
        },
        "disableIpDetection": true,
        "qualityGateAutoDetect": true
      }
    ],
    "type": "personal",
    "updatedAt": "updatedAt",
    "avatar": {
      "assetId": "assetId",
      "url": "url"
    },
    "byok": {
      "markupMultiplier": 0,
      "updatedAt": "updatedAt",
      "updatedBy": "updatedBy"
    },
    "defaultUserMaxConsumption": 0,
    "ipDetectionEnforcement": "active-fail-closed",
    "qualityGateAutoDetect": true,
    "settings": {
      "homepage": {
        "foo": "bar"
      }
    }
  }
}
```

## Domain Types

### Team List Response

- `class TeamListResponse: …`

  - `teams: List[Team]`

    A list of the teams the user belongs to

    - `id: str`

      The team ID (example: "eyVcnFJcR92BxBkz7N6g5w")

    - `context: TeamContext`

      The context of the team for the current authenticated user

      - `invitations_count: float`

        The number of invitations on this team

      - `keys_count: float`

        The number of API keys on this team

      - `user_role: Literal["admin", "key", "member"]`

        The authenticated user's role for this team

        - `"admin"`

        - `"key"`

        - `"member"`

      - `users_count: float`

        The number of users on this team

    - `created_at: str`

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

    - `name: str`

      The team name (example: "Scenario")

    - `plan: Literal["cu-basic", "cu-creator", "cu-max", 9 more]`

      The team plan

      - `"cu-basic"`

      - `"cu-creator"`

      - `"cu-max"`

      - `"cu-pro"`

      - `"cu-pro-q3-25"`

      - `"cu-team"`

      - `"cu-team-v2"`

      - `"enterprise"`

      - `"essential"`

      - `"free"`

      - `"premium"`

      - `"pro"`

    - `projects: List[TeamProject]`

      Projects of the team

      - `id: str`

      - `created_at: str`

      - `name: str`

      - `updated_at: str`

      - `avatar: Optional[TeamProjectAvatar]`

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

      - `disable_ip_detection: Optional[bool]`

        When true, IP detection is switched off for this project.

      - `quality_gate_auto_detect: Optional[bool]`

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

    - `type: Literal["personal", "shared"]`

      The team type

      - `"personal"`

      - `"shared"`

    - `updated_at: str`

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

    - `avatar: Optional[TeamAvatar]`

      The team'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

    - `byok: Optional[TeamByok]`

      BYOK pricing override. Admin-only — omitted for non-admin callers.

      - `markup_multiplier: float`

      - `updated_at: Optional[str]`

        ISO timestamp of the last update. Optional — legacy rows may lack it.

      - `updated_by: Optional[str]`

        Human-readable handle of who last updated the markup (display name).

    - `default_user_max_consumption: Optional[float]`

      Team-wide default max consumption (CU) applied to every member over the
      billing period, unless overridden per member. Absent when no team-wide
      default is set.

    - `ip_detection_enforcement: Optional[Literal["active-fail-closed", "active-fail-open", "disabled"]]`

      The IP detection enforcement posture for the team.
      'disabled': IP detection is not performed.
      'active-fail-open': IP detection runs; on detector error the request is allowed through.
      'active-fail-closed': IP detection runs; on detector error the request is blocked.

      - `"active-fail-closed"`

      - `"active-fail-open"`

      - `"disabled"`

    - `quality_gate_auto_detect: Optional[bool]`

      Quality Gate auto-detection default for the team.

### Team Retrieve Response

- `class TeamRetrieveResponse: …`

  - `team: Team`

    - `id: str`

      The team ID (example: "eyVcnFJcR92BxBkz7N6g5w")

    - `created_at: str`

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

    - `invitations: List[TeamInvitation]`

      The list of pending invitations

      - `created_at: str`

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

      - `email: str`

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

      - `role: Literal["admin", "key", "member"]`

        The role of the invited user inside the team

        - `"admin"`

        - `"key"`

        - `"member"`

      - `status: Literal["accepted", "expired", "pending", "withdrawn"]`

        The status of the invitation

        - `"accepted"`

        - `"expired"`

        - `"pending"`

        - `"withdrawn"`

      - `url: str`

        The link the invited user opens to accept the invitation, as sent by email

      - `project_ids: Optional[List[str]]`

        The list of project IDs for which the user is invited

    - `keys: List[TeamKey]`

      The list of API keys

      - `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")

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

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

      - `role: Optional[str]`

        The key's role. For a TEAM key: its effective team-plane scopes as a
        `;`-separated list (e.g. `"team.read;team.usage.read"`). Project keys
        carry their project-plane role(s) per project in `projects` instead.

    - `name: str`

      The team name (example: "Scenario")

    - `payment_status: Literal["failed", "succeeded"]`

      The paymentStatus for the team

      - `"failed"`

      - `"succeeded"`

    - `plan: Literal["cu-basic", "cu-creator", "cu-max", 9 more]`

      The team plan

      - `"cu-basic"`

      - `"cu-creator"`

      - `"cu-max"`

      - `"cu-pro"`

      - `"cu-pro-q3-25"`

      - `"cu-team"`

      - `"cu-team-v2"`

      - `"enterprise"`

      - `"essential"`

      - `"free"`

      - `"premium"`

      - `"pro"`

    - `projects: List[TeamProject]`

      Projects of the team

      - `id: str`

      - `created_at: str`

      - `name: str`

      - `updated_at: str`

      - `avatar: Optional[TeamProjectAvatar]`

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

      - `disable_ip_detection: Optional[bool]`

        When true, IP detection is switched off for this project.

      - `quality_gate_auto_detect: Optional[bool]`

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

    - `search_host: str`

      The search host for the team

    - `search_indexes: TeamSearchIndexes`

      The search indexes for the team

      - `assets: TeamSearchIndexesAssets`

        - `private: str`

          The private search index for the team

        - `public: str`

          The public search index for the team

      - `models: TeamSearchIndexesModels`

        - `private: str`

          The private search index for the team

        - `public: str`

          The public search index for the team

      - `workflows: TeamSearchIndexesWorkflows`

        - `private: str`

          The private search index for the team

        - `public: str`

          The public search index for the team

    - `type: Literal["personal", "shared"]`

      The team type

      - `"personal"`

      - `"shared"`

    - `updated_at: str`

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

    - `users: List[TeamUser]`

      The list of teams members and their role

      - `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: Literal["admin", "key", "member"]`

        The role of the user inside the team

        - `"admin"`

        - `"key"`

        - `"member"`

      - `updated_at: str`

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

      - `avatar: Optional[TeamUserAvatar]`

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

      The team'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

    - `byok: Optional[TeamByok]`

      BYOK pricing override. Admin-only — omitted for non-admin callers.

      - `markup_multiplier: float`

      - `updated_at: Optional[str]`

        ISO timestamp of the last update. Optional — legacy rows may lack it.

      - `updated_by: Optional[str]`

        Human-readable handle of who last updated the markup (display name).

    - `default_user_max_consumption: Optional[float]`

      Team-wide default max consumption (CU) applied to every member over the
      billing period, unless overridden per member. Absent when no team-wide
      default is set.

    - `ip_detection_enforcement: Optional[Literal["active-fail-closed", "active-fail-open", "disabled"]]`

      The IP detection enforcement posture for the team.
      'disabled': IP detection is not performed.
      'active-fail-open': IP detection runs; on detector error the request is allowed through.
      'active-fail-closed': IP detection runs; on detector error the request is blocked.

      - `"active-fail-closed"`

      - `"active-fail-open"`

      - `"disabled"`

    - `quality_gate_auto_detect: Optional[bool]`

      Quality Gate auto-detection default for the team.

    - `settings: Optional[TeamSettings]`

      Team settings. Returned on `GET` and `PUT /teams/{teamId}`, absent from
      the teams list.

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

        Published homepage layout.

    - `subscription_status: Optional[Literal["active", "inactive", "paused"]]`

      The subscriptionStatus for the team

      - `"active"`

      - `"inactive"`

      - `"paused"`

### Team Retrieve Limits Response

- `class TeamRetrieveLimitsResponse: …`

  - `limits: Limits`

    The actual billing limits values related to the plan

    - `api_keys: float`

    - `canvas_asset_layers: float`

    - `canvas_assets: float`

    - `collections: float`

    - `creative_units: float`

      The amount of Compute Units available for the plan

    - `default_seats: float`

    - `download_assets: float`

    - `download_model: float`

    - `inference_batch_size: float`

    - `max_cooldown: float`

      The maximum cooldown applied in case of over head

    - `max_training_datasets: float`

    - `min_cooldown: float`

      The minimum cooldown applied in case of over head

    - `models: float`

      The maximum models a project can have (train/upload/copy/transfer/...)

    - `otp_sessions: float`

    - `parallel_custom_jobs: float`

    - `parallel_inferences: float`

    - `parallel_training: float`

    - `parallel_workflow_runs: float`

    - `premium_generation_samples: float`

    - `projects: float`

      The maximum projects a team can have

    - `scaling_factor: float`

    - `seats: float`

    - `snapshots_retention: float`

    - `upload: float`

  - `one_shot_creative_units: List[OneShotCreativeUnit]`

    The list of one-shot Compute Units

    Can be empty if the team has no one-shot Compute Units

    - `amount: float`

      The Compute Units amount bought

    - `created_at: str`

      The creation date of the Compute Units (buy date)
      ISO string

    - `expiration: str`

      The expiration date of the Compute Units
      ISO string

    - `remaining: float`

      The remaining Compute Units available

    - `updated_at: str`

      The last update date of the Compute Units (use date)
      ISO string

  - `period: Period`

    The actual billing period start and end dates ISO strings

    - `end: str`

    - `start: str`

  - `plan: Literal["cu-basic", "cu-creator", "cu-max", 9 more]`

    The actual plan of the team

    - `"cu-basic"`

    - `"cu-creator"`

    - `"cu-max"`

    - `"cu-pro"`

    - `"cu-pro-q3-25"`

    - `"cu-team"`

    - `"cu-team-v2"`

    - `"enterprise"`

    - `"essential"`

    - `"free"`

    - `"premium"`

    - `"pro"`

  - `values: Values`

    The current value for each relevant limit in the billing period

    - `api_keys: float`

    - `canvas_assets: float`

    - `collections: float`

    - `creative_units: float`

    - `projects: float`

    - `seats: float`

### Team Update Response

- `class TeamUpdateResponse: …`

  - `team: Team`

    The updated team.

    - `id: str`

      The team ID (example: "eyVcnFJcR92BxBkz7N6g5w")

    - `context: TeamContext`

      The context of the team for the current authenticated user

      - `invitations_count: float`

        The number of invitations on this team

      - `keys_count: float`

        The number of API keys on this team

      - `user_role: Literal["admin", "key", "member"]`

        The authenticated user's role for this team

        - `"admin"`

        - `"key"`

        - `"member"`

      - `users_count: float`

        The number of users on this team

    - `created_at: str`

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

    - `name: str`

      The team name (example: "Scenario")

    - `plan: Literal["cu-basic", "cu-creator", "cu-max", 9 more]`

      The team plan

      - `"cu-basic"`

      - `"cu-creator"`

      - `"cu-max"`

      - `"cu-pro"`

      - `"cu-pro-q3-25"`

      - `"cu-team"`

      - `"cu-team-v2"`

      - `"enterprise"`

      - `"essential"`

      - `"free"`

      - `"premium"`

      - `"pro"`

    - `projects: List[TeamProject]`

      Projects of the team

      - `id: str`

      - `created_at: str`

      - `name: str`

      - `updated_at: str`

      - `avatar: Optional[TeamProjectAvatar]`

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

      - `disable_ip_detection: Optional[bool]`

        When true, IP detection is switched off for this project.

      - `quality_gate_auto_detect: Optional[bool]`

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

    - `type: Literal["personal", "shared"]`

      The team type

      - `"personal"`

      - `"shared"`

    - `updated_at: str`

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

    - `avatar: Optional[TeamAvatar]`

      The team'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

    - `byok: Optional[TeamByok]`

      BYOK pricing override. Admin-only — omitted for non-admin callers.

      - `markup_multiplier: float`

      - `updated_at: Optional[str]`

        ISO timestamp of the last update. Optional — legacy rows may lack it.

      - `updated_by: Optional[str]`

        Human-readable handle of who last updated the markup (display name).

    - `default_user_max_consumption: Optional[float]`

      Team-wide default max consumption (CU) applied to every member over the
      billing period, unless overridden per member. Absent when no team-wide
      default is set.

    - `ip_detection_enforcement: Optional[Literal["active-fail-closed", "active-fail-open", "disabled"]]`

      The IP detection enforcement posture for the team.
      'disabled': IP detection is not performed.
      'active-fail-open': IP detection runs; on detector error the request is allowed through.
      'active-fail-closed': IP detection runs; on detector error the request is blocked.

      - `"active-fail-closed"`

      - `"active-fail-open"`

      - `"disabled"`

    - `quality_gate_auto_detect: Optional[bool]`

      Quality Gate auto-detection default for the team.

    - `settings: Optional[TeamSettings]`

      Team settings.

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

        Published homepage layout.

# Brief

## Delete

`teams.brief.delete(strteam_id)  -> BriefDeleteResponse`

**delete** `/teams/{teamId}/brief`

Delete the team's Quality Gate brief

### Parameters

- `team_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.teams.brief.delete(
    "teamId",
)
print(brief.deleted)
```

#### Response

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

## Retrieve

`teams.brief.retrieve(strteam_id)  -> BriefRetrieveResponse`

**get** `/teams/{teamId}/brief`

Get the team's Quality Gate brief

### Parameters

- `team_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.teams.brief.retrieve(
    "teamId",
)
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

`teams.brief.update(strteam_id, BriefUpdateParams**kwargs)  -> BriefUpdateResponse`

**put** `/teams/{teamId}/brief`

Create or update the team's Quality Gate brief

### Parameters

- `team_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.teams.brief.update(
    team_id="teamId",
    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"`

# IP Filters

## Create

`teams.ip_filters.create(strteam_id, IPFilterCreateParams**kwargs)  -> IPFilterCreateResponse`

**post** `/teams/{teamId}/ip-filters`

Create a custom IP-detection filter for a team (built-in filters are toggled via PUT /teams/{teamId}/ip-filters/{filterId})

### Parameters

- `team_id: str`

- `category: Literal["artist-style", "brand-trademark", "celebrity-likeness", 2 more]`

  Filter category; use "custom" for customer-authored filters

  - `"artist-style"`

  - `"brand-trademark"`

  - `"celebrity-likeness"`

  - `"custom"`

  - `"fictional-character"`

- `name: str`

  Display name for the filter

- `enabled: Optional[bool]`

  Whether the filter is active

- `instruction: Optional[str]`

  Natural-language detection instruction (required for custom filters)

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

  Optional reference assets used only to generate the instruction

### Returns

- `class IPFilterCreateResponse: …`

  - `filter: object`

    The created custom filter, including its enabled state

### 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
)
ip_filter = client.teams.ip_filters.create(
    team_id="teamId",
    category="artist-style",
    name="name",
)
print(ip_filter.filter)
```

#### Response

```json
{
  "filter": {}
}
```

## Delete

`teams.ip_filters.delete(strfilter_id, IPFilterDeleteParams**kwargs)  -> IPFilterDeleteResponse`

**delete** `/teams/{teamId}/ip-filters/{filterId}`

Delete a custom IP-detection filter for a team

### Parameters

- `team_id: str`

- `filter_id: str`

### Returns

- `class IPFilterDeleteResponse: …`

  - `deleted: bool`

    True when the filter was deleted

### 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
)
ip_filter = client.teams.ip_filters.delete(
    filter_id="filterId",
    team_id="teamId",
)
print(ip_filter.deleted)
```

#### Response

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

## Draft Instruction

`teams.ip_filters.draft_instruction(strteam_id, IPFilterDraftInstructionParams**kwargs)  -> IPFilterDraftInstructionResponse`

**post** `/teams/{teamId}/ip-filters/draft-instruction`

Draft a custom IP-detection filter instruction from reference assets (the caller must have read access to every asset)

### Parameters

- `team_id: str`

- `asset_ids: Sequence[str]`

  Reference assets whose imagery seeds the drafted detection instruction

### Returns

- `class IPFilterDraftInstructionResponse: …`

  - `instruction: str`

    Drafted natural-language detection instruction derived from the reference assets

### 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.teams.ip_filters.draft_instruction(
    team_id="teamId",
    asset_ids=["string"],
)
print(response.instruction)
```

#### Response

```json
{
  "instruction": "instruction"
}
```

## List

`teams.ip_filters.list(strteam_id)  -> IPFilterListResponse`

**get** `/teams/{teamId}/ip-filters`

List the built-in and custom IP-detection filters available to a team, with their enabled state

### Parameters

- `team_id: str`

### Returns

- `class IPFilterListResponse: …`

  - `filters: List[object]`

    Built-in and custom IP-detection filters for the team, each with its enabled state

### 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
)
ip_filters = client.teams.ip_filters.list(
    "teamId",
)
print(ip_filters.filters)
```

#### Response

```json
{
  "filters": [
    {}
  ]
}
```

## Update

`teams.ip_filters.update(strfilter_id, IPFilterUpdateParams**kwargs)  -> IPFilterUpdateResponse`

**put** `/teams/{teamId}/ip-filters/{filterId}`

Enable, disable, or override a built-in or custom IP-detection filter for a team

### Parameters

- `team_id: str`

- `filter_id: str`

- `enabled: Optional[bool]`

  Whether the filter is active

- `instruction: Optional[str]`

  Natural-language detection instruction

- `name: Optional[str]`

  Display name for the filter

### Returns

- `class IPFilterUpdateResponse: …`

  - `filter: object`

    The updated filter, including its enabled state

### 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
)
ip_filter = client.teams.ip_filters.update(
    filter_id="filterId",
    team_id="teamId",
)
print(ip_filter.filter)
```

#### Response

```json
{
  "filter": {}
}
```

## Domain Types

### IP Filter Create Response

- `class IPFilterCreateResponse: …`

  - `filter: object`

    The created custom filter, including its enabled state

### IP Filter Delete Response

- `class IPFilterDeleteResponse: …`

  - `deleted: bool`

    True when the filter was deleted

### IP Filter Draft Instruction Response

- `class IPFilterDraftInstructionResponse: …`

  - `instruction: str`

    Drafted natural-language detection instruction derived from the reference assets

### IP Filter List Response

- `class IPFilterListResponse: …`

  - `filters: List[object]`

    Built-in and custom IP-detection filters for the team, each with its enabled state

### IP Filter Update Response

- `class IPFilterUpdateResponse: …`

  - `filter: object`

    The updated filter, including its enabled state

# Members

## Create

`teams.members.create(strteam_id, MemberCreateParams**kwargs)  -> MemberCreateResponse`

**post** `/teams/{teamId}/members`

Add a member to the team

### Parameters

- `team_id: str`

- `email: str`

  The email of the user you want to add to your team

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

  The project IDs for which the user is invited

- `role: Optional[Literal["admin", "member"]]`

  The role you want to give the user

  - `"admin"`

  - `"member"`

### Returns

- `class MemberCreateResponse: …`

  - `team: Team`

    - `id: str`

      The team ID (example: "eyVcnFJcR92BxBkz7N6g5w")

    - `context: TeamContext`

      The context of the team for the current authenticated user

      - `invitations_count: float`

        The number of invitations on this team

      - `keys_count: float`

        The number of API keys on this team

      - `user_role: Literal["admin", "key", "member"]`

        The authenticated user's role for this team

        - `"admin"`

        - `"key"`

        - `"member"`

      - `users_count: float`

        The number of users on this team

    - `created_at: str`

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

    - `name: str`

      The team name (example: "Scenario")

    - `plan: Literal["cu-basic", "cu-creator", "cu-max", 9 more]`

      The team plan

      - `"cu-basic"`

      - `"cu-creator"`

      - `"cu-max"`

      - `"cu-pro"`

      - `"cu-pro-q3-25"`

      - `"cu-team"`

      - `"cu-team-v2"`

      - `"enterprise"`

      - `"essential"`

      - `"free"`

      - `"premium"`

      - `"pro"`

    - `projects: List[TeamProject]`

      Projects of the team

      - `id: str`

      - `created_at: str`

      - `name: str`

      - `updated_at: str`

      - `avatar: Optional[TeamProjectAvatar]`

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

      - `disable_ip_detection: Optional[bool]`

        When true, IP detection is switched off for this project.

      - `quality_gate_auto_detect: Optional[bool]`

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

    - `type: Literal["personal", "shared"]`

      The team type

      - `"personal"`

      - `"shared"`

    - `updated_at: str`

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

    - `avatar: Optional[TeamAvatar]`

      The team'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

    - `byok: Optional[TeamByok]`

      BYOK pricing override. Admin-only — omitted for non-admin callers.

      - `markup_multiplier: float`

      - `updated_at: Optional[str]`

        ISO timestamp of the last update. Optional — legacy rows may lack it.

      - `updated_by: Optional[str]`

        Human-readable handle of who last updated the markup (display name).

    - `default_user_max_consumption: Optional[float]`

      Team-wide default max consumption (CU) applied to every member over the
      billing period, unless overridden per member. Absent when no team-wide
      default is set.

    - `ip_detection_enforcement: Optional[Literal["active-fail-closed", "active-fail-open", "disabled"]]`

      The IP detection enforcement posture for the team.
      'disabled': IP detection is not performed.
      'active-fail-open': IP detection runs; on detector error the request is allowed through.
      'active-fail-closed': IP detection runs; on detector error the request is blocked.

      - `"active-fail-closed"`

      - `"active-fail-open"`

      - `"disabled"`

    - `quality_gate_auto_detect: Optional[bool]`

      Quality Gate auto-detection default for the team.

### 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.teams.members.create(
    team_id="teamId",
    email="email",
)
print(member.team)
```

#### Response

```json
{
  "team": {
    "id": "id",
    "context": {
      "invitationsCount": 0,
      "keysCount": 0,
      "userRole": "admin",
      "usersCount": 0
    },
    "createdAt": "createdAt",
    "name": "name",
    "plan": "cu-basic",
    "projects": [
      {
        "id": "id",
        "createdAt": "createdAt",
        "name": "name",
        "updatedAt": "updatedAt",
        "avatar": {
          "assetId": "assetId",
          "url": "url"
        },
        "disableIpDetection": true,
        "qualityGateAutoDetect": true
      }
    ],
    "type": "personal",
    "updatedAt": "updatedAt",
    "avatar": {
      "assetId": "assetId",
      "url": "url"
    },
    "byok": {
      "markupMultiplier": 0,
      "updatedAt": "updatedAt",
      "updatedBy": "updatedBy"
    },
    "defaultUserMaxConsumption": 0,
    "ipDetectionEnforcement": "active-fail-closed",
    "qualityGateAutoDetect": true
  }
}
```

## Delete

`teams.members.delete(strmember_id, MemberDeleteParams**kwargs)  -> object`

**delete** `/teams/{teamId}/members/{memberId}`

Remove a member from the team

### Parameters

- `team_id: str`

- `member_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
)
member = client.teams.members.delete(
    member_id="memberId",
    team_id="teamId",
)
print(member)
```

#### Response

```json
{}
```

## Update

`teams.members.update(strmember_id, MemberUpdateParams**kwargs)  -> object`

**put** `/teams/{teamId}/members/{memberId}`

Update a team member's role and/or consumption limit

### Parameters

- `team_id: str`

- `member_id: str`

- `max_consumption: Optional[float]`

  Max consumption (CU) for this member over the billing period, overriding
  the team-wide default. Use a value `>= 0` to cap, `-1` for unlimited
  (uncapped), or `null` to remove the override and fall back to the team-wide
  default.

- `role: Optional[str]`

  For a human member: a built-in team role (`admin` | `member`).
  For an API-key member: a team-plane role — a `;`-separated list of `team.*`
  scopes (e.g. `"team.members.manage;team.usage.read"`). Only a human team
  admin can grant a write scope; `team.members.manage` also lets a team key
  manage the members, API keys and consumption cap of every project of the
  team.

### 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
)
member = client.teams.members.update(
    member_id="memberId",
    team_id="teamId",
)
print(member)
```

#### Response

```json
{}
```

## Domain Types

### Member Create Response

- `class MemberCreateResponse: …`

  - `team: Team`

    - `id: str`

      The team ID (example: "eyVcnFJcR92BxBkz7N6g5w")

    - `context: TeamContext`

      The context of the team for the current authenticated user

      - `invitations_count: float`

        The number of invitations on this team

      - `keys_count: float`

        The number of API keys on this team

      - `user_role: Literal["admin", "key", "member"]`

        The authenticated user's role for this team

        - `"admin"`

        - `"key"`

        - `"member"`

      - `users_count: float`

        The number of users on this team

    - `created_at: str`

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

    - `name: str`

      The team name (example: "Scenario")

    - `plan: Literal["cu-basic", "cu-creator", "cu-max", 9 more]`

      The team plan

      - `"cu-basic"`

      - `"cu-creator"`

      - `"cu-max"`

      - `"cu-pro"`

      - `"cu-pro-q3-25"`

      - `"cu-team"`

      - `"cu-team-v2"`

      - `"enterprise"`

      - `"essential"`

      - `"free"`

      - `"premium"`

      - `"pro"`

    - `projects: List[TeamProject]`

      Projects of the team

      - `id: str`

      - `created_at: str`

      - `name: str`

      - `updated_at: str`

      - `avatar: Optional[TeamProjectAvatar]`

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

      - `disable_ip_detection: Optional[bool]`

        When true, IP detection is switched off for this project.

      - `quality_gate_auto_detect: Optional[bool]`

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

    - `type: Literal["personal", "shared"]`

      The team type

      - `"personal"`

      - `"shared"`

    - `updated_at: str`

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

    - `avatar: Optional[TeamAvatar]`

      The team'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

    - `byok: Optional[TeamByok]`

      BYOK pricing override. Admin-only — omitted for non-admin callers.

      - `markup_multiplier: float`

      - `updated_at: Optional[str]`

        ISO timestamp of the last update. Optional — legacy rows may lack it.

      - `updated_by: Optional[str]`

        Human-readable handle of who last updated the markup (display name).

    - `default_user_max_consumption: Optional[float]`

      Team-wide default max consumption (CU) applied to every member over the
      billing period, unless overridden per member. Absent when no team-wide
      default is set.

    - `ip_detection_enforcement: Optional[Literal["active-fail-closed", "active-fail-open", "disabled"]]`

      The IP detection enforcement posture for the team.
      'disabled': IP detection is not performed.
      'active-fail-open': IP detection runs; on detector error the request is allowed through.
      'active-fail-closed': IP detection runs; on detector error the request is blocked.

      - `"active-fail-closed"`

      - `"active-fail-open"`

      - `"disabled"`

    - `quality_gate_auto_detect: Optional[bool]`

      Quality Gate auto-detection default for the team.

# Watermark

## Delete

`teams.watermark.delete(strteam_id)  -> WatermarkDeleteResponse`

**delete** `/teams/{teamId}/watermark`

Delete the team's forced watermark configuration

### Parameters

- `team_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.teams.watermark.delete(
    "teamId",
)
print(watermark.deleted)
```

#### Response

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

## Delete Logo

`teams.watermark.delete_logo(strteam_id)  -> WatermarkDeleteLogoResponse`

**delete** `/teams/{teamId}/watermark/logo`

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

### Parameters

- `team_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.teams.watermark.delete_logo(
    "teamId",
)
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

`teams.watermark.preview(strteam_id, WatermarkPreviewParams**kwargs)  -> WatermarkPreviewResponse`

**post** `/teams/{teamId}/watermark/preview`

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

### Parameters

- `team_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.teams.watermark.preview(
    team_id="teamId",
)
print(response.image)
```

#### Response

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

## Retrieve

`teams.watermark.retrieve(strteam_id)  -> WatermarkRetrieveResponse`

**get** `/teams/{teamId}/watermark`

Get the team's forced watermark configuration

### Parameters

- `team_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.teams.watermark.retrieve(
    "teamId",
)
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

`teams.watermark.update(strteam_id, WatermarkUpdateParams**kwargs)  -> WatermarkUpdateResponse`

**put** `/teams/{teamId}/watermark`

Create or update the team's forced watermark configuration

### Parameters

- `team_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.teams.watermark.update(
    team_id="teamId",
    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

`teams.watermark.update_logo(strteam_id, WatermarkUpdateLogoParams**kwargs)  -> WatermarkUpdateLogoResponse`

**put** `/teams/{teamId}/watermark/logo`

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

### Parameters

- `team_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.teams.watermark.update_logo(
    team_id="teamId",
    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

`teams.webhook_endpoints.create(strteam_id, WebhookEndpointCreateParams**kwargs)  -> WebhookEndpointCreateResponse`

**post** `/teams/{teamId}/webhook-endpoints`

Register a new webhook endpoint for the team, at most 10 of them. The response carries the secret, which is never returned again

### Parameters

- `team_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.teams.webhook_endpoints.create(
    team_id="teamId",
    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

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

**delete** `/teams/{teamId}/webhook-endpoints/{webhookEndpointId}`

Delete a particular webhook endpoint by its Id

### Parameters

- `team_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.teams.webhook_endpoints.delete(
    webhook_endpoint_id="webhookEndpointId",
    team_id="teamId",
)
print(webhook_endpoint)
```

#### Response

```json
{}
```

## List

`teams.webhook_endpoints.list(strteam_id)  -> WebhookEndpointListResponse`

**get** `/teams/{teamId}/webhook-endpoints`

List the team's webhook endpoints

### Parameters

- `team_id: str`

### Returns

- `class WebhookEndpointListResponse: …`

  - `webhook_endpoints: List[WebhookEndpoint]`

    A list of the team 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.teams.webhook_endpoints.list(
    "teamId",
)
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

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

**put** `/teams/{teamId}/webhook-endpoints/{webhookEndpointId}`

Update a particular webhook endpoint for a team

### Parameters

- `team_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.teams.webhook_endpoints.update(
    webhook_endpoint_id="webhookEndpointId",
    team_id="teamId",
)
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 team 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

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

**get** `/teams/{teamId}/webhook-endpoints/{webhookEndpointId}/events`

List the delivery events of one of the team's webhook endpoints

### Parameters

- `team_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 team 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.teams.webhook_endpoints.events.list(
    webhook_endpoint_id="webhookEndpointId",
    team_id="teamId",
)
print(events.items)
```

#### Response

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

## Retrieve

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

**get** `/teams/{teamId}/webhook-endpoints/{webhookEndpointId}/events/{eventId}`

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

### Parameters

- `team_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.teams.webhook_endpoints.events.retrieve(
    event_id="eventId",
    team_id="teamId",
    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 team 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`
