# Teams

## Delete Invitations

`client.teams.deleteInvitations(stringteamID, TeamDeleteInvitationsParamsparams, RequestOptionsoptions?): TeamDeleteInvitationsResponse`

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

Withdraw a user invitation on the team

### Parameters

- `teamID: string`

- `params: TeamDeleteInvitationsParams`

  - `email: string`

    The invitation email to withdraw from the team

### Returns

- `TeamDeleteInvitationsResponse = unknown`

### Example

```typescript
import Scenario from '@scenario-labs/sdk';

const client = new Scenario({
  apiKey: process.env['SCENARIO_SDK_API_KEY'], // This is the default and can be omitted
  apiSecret: process.env['SCENARIO_SDK_API_SECRET'], // This is the default and can be omitted
});

const response = await client.teams.deleteInvitations('teamId', { email: 'email' });

console.log(response);
```

#### Response

```json
{}
```

## List

`client.teams.list(RequestOptionsoptions?): TeamListResponse`

**get** `/teams`

List the teams the user belongs to

### Returns

- `TeamListResponse`

  - `teams: Array<Team>`

    A list of the teams the user belongs to

    - `id: string`

      The team ID (example: "eyVcnFJcR92BxBkz7N6g5w")

    - `context: Context`

      The context of the team for the current authenticated user

      - `invitationsCount: number`

        The number of invitations on this team

      - `keysCount: number`

        The number of API keys on this team

      - `userRole: "admin" | "key" | "member"`

        The authenticated user's role for this team

        - `"admin"`

        - `"key"`

        - `"member"`

      - `usersCount: number`

        The number of users on this team

    - `createdAt: string`

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

    - `name: string`

      The team name (example: "Scenario")

    - `plan: "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: Array<Project>`

      Projects of the team

      - `id: string`

      - `createdAt: string`

      - `name: string`

      - `updatedAt: string`

      - `avatar?: Avatar`

        - `assetId?: string`

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

        - `url?: string`

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

      - `disableIpDetection?: boolean`

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

      - `qualityGateAutoDetect?: boolean`

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

    - `type: "personal" | "shared"`

      The team type

      - `"personal"`

      - `"shared"`

    - `updatedAt: string`

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

    - `avatar?: Avatar`

      The team's avatar

      - `assetId?: string`

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

      - `url?: string`

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

    - `byok?: Byok`

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

      - `markupMultiplier: number`

      - `updatedAt?: string`

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

      - `updatedBy?: string`

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

    - `defaultUserMaxConsumption?: number`

      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.

    - `ipDetectionEnforcement?: "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"`

    - `qualityGateAutoDetect?: boolean`

      Quality Gate auto-detection default for the team.

### Example

```typescript
import Scenario from '@scenario-labs/sdk';

const client = new Scenario({
  apiKey: process.env['SCENARIO_SDK_API_KEY'], // This is the default and can be omitted
  apiSecret: process.env['SCENARIO_SDK_API_SECRET'], // This is the default and can be omitted
});

const teams = await client.teams.list();

console.log(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

`client.teams.retrieve(stringteamID, RequestOptionsoptions?): TeamRetrieveResponse`

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

Get the details of a team

### Parameters

- `teamID: string`

### Returns

- `TeamRetrieveResponse`

  - `team: Team`

    - `id: string`

      The team ID (example: "eyVcnFJcR92BxBkz7N6g5w")

    - `createdAt: string`

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

    - `invitations: Array<Invitation>`

      The list of pending invitations

      - `createdAt: string`

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

      - `email: string`

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

      - `role: "admin" | "key" | "member"`

        The role of the invited user inside the team

        - `"admin"`

        - `"key"`

        - `"member"`

      - `status: "accepted" | "expired" | "pending" | "withdrawn"`

        The status of the invitation

        - `"accepted"`

        - `"expired"`

        - `"pending"`

        - `"withdrawn"`

      - `url: string`

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

      - `projectIds?: Array<string>`

        The list of project IDs for which the user is invited

    - `keys: Array<Key>`

      The list of API keys

      - `id: string`

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

      - `apiKeyId: string`

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

      - `apiKeyStatus: "active" | "inactive"`

        The status of the API key

        - `"active"`

        - `"inactive"`

      - `createdAt: string`

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

      - `name: string`

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

      - `scope: "project" | "team"`

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

        - `"project"`

        - `"team"`

      - `updatedAt: string`

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

      - `authorId?: string`

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

      - `consumption?: number`

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

      - `lastUsedAt?: string`

        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.

      - `maxConsumption?: number`

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

      - `ownerId?: string`

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

      - `projects?: Array<Project>`

        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.

        - `projectId: string`

          The project the key has a role on

        - `role: string`

          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?: string`

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

      The team name (example: "Scenario")

    - `paymentStatus: "failed" | "succeeded"`

      The paymentStatus for the team

      - `"failed"`

      - `"succeeded"`

    - `plan: "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: Array<Project>`

      Projects of the team

      - `id: string`

      - `createdAt: string`

      - `name: string`

      - `updatedAt: string`

      - `avatar?: Avatar`

        - `assetId?: string`

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

        - `url?: string`

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

      - `disableIpDetection?: boolean`

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

      - `qualityGateAutoDetect?: boolean`

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

    - `searchHost: string`

      The search host for the team

    - `searchIndexes: SearchIndexes`

      The search indexes for the team

      - `assets: Assets`

        - `private: string`

          The private search index for the team

        - `public: string`

          The public search index for the team

      - `models: Models`

        - `private: string`

          The private search index for the team

        - `public: string`

          The public search index for the team

      - `workflows: Workflows`

        - `private: string`

          The private search index for the team

        - `public: string`

          The public search index for the team

    - `type: "personal" | "shared"`

      The team type

      - `"personal"`

      - `"shared"`

    - `updatedAt: string`

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

    - `users: Array<User>`

      The list of teams members and their role

      - `id: string`

        The user ID (example: "eyVcnFJcR92BxBkz7N6g5w")

      - `createdAt: string`

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

      - `email: string`

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

      - `role: "admin" | "key" | "member"`

        The role of the user inside the team

        - `"admin"`

        - `"key"`

        - `"member"`

      - `updatedAt: string`

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

      - `avatar?: Avatar`

        The user's avatar

        - `assetId?: string`

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

        - `url?: string`

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

      - `consumption?: number`

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

      - `maxConsumption?: number`

        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?: Avatar`

      The team's avatar

      - `assetId?: string`

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

      - `url?: string`

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

    - `byok?: Byok`

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

      - `markupMultiplier: number`

      - `updatedAt?: string`

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

      - `updatedBy?: string`

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

    - `defaultUserMaxConsumption?: number`

      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.

    - `ipDetectionEnforcement?: "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"`

    - `qualityGateAutoDetect?: boolean`

      Quality Gate auto-detection default for the team.

    - `settings?: Settings`

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

      - `homepage?: Record<string, unknown>`

        Published homepage layout.

    - `subscriptionStatus?: "active" | "inactive" | "paused"`

      The subscriptionStatus for the team

      - `"active"`

      - `"inactive"`

      - `"paused"`

### Example

```typescript
import Scenario from '@scenario-labs/sdk';

const client = new Scenario({
  apiKey: process.env['SCENARIO_SDK_API_KEY'], // This is the default and can be omitted
  apiSecret: process.env['SCENARIO_SDK_API_SECRET'], // This is the default and can be omitted
});

const team = await client.teams.retrieve('teamId');

console.log(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

`client.teams.retrieveLimits(stringteamID, RequestOptionsoptions?): TeamRetrieveLimitsResponse`

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

Retrieve current limits for a team

### Parameters

- `teamID: string`

### Returns

- `TeamRetrieveLimitsResponse`

  - `limits: Limits`

    The actual billing limits values related to the plan

    - `apiKeys: number`

    - `canvasAssetLayers: number`

    - `canvasAssets: number`

    - `collections: number`

    - `creativeUnits: number`

      The amount of Compute Units available for the plan

    - `defaultSeats: number`

    - `downloadAssets: number`

    - `downloadModel: number`

    - `inferenceBatchSize: number`

    - `maxCooldown: number`

      The maximum cooldown applied in case of over head

    - `maxTrainingDatasets: number`

    - `minCooldown: number`

      The minimum cooldown applied in case of over head

    - `models: number`

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

    - `OTPSessions: number`

    - `parallelCustomJobs: number`

    - `parallelInferences: number`

    - `parallelTraining: number`

    - `parallelWorkflowRuns: number`

    - `premiumGenerationSamples: number`

    - `projects: number`

      The maximum projects a team can have

    - `scalingFactor: number`

    - `seats: number`

    - `snapshotsRetention: number`

    - `upload: number`

  - `oneShotCreativeUnits: Array<OneShotCreativeUnit>`

    The list of one-shot Compute Units

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

    - `amount: number`

      The Compute Units amount bought

    - `createdAt: string`

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

    - `expiration: string`

      The expiration date of the Compute Units
      ISO string

    - `remaining: number`

      The remaining Compute Units available

    - `updatedAt: string`

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

    - `start: string`

  - `plan: "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

    - `apiKeys: number`

    - `canvasAssets: number`

    - `collections: number`

    - `creativeUnits: number`

    - `projects: number`

    - `seats: number`

### Example

```typescript
import Scenario from '@scenario-labs/sdk';

const client = new Scenario({
  apiKey: process.env['SCENARIO_SDK_API_KEY'], // This is the default and can be omitted
  apiSecret: process.env['SCENARIO_SDK_API_SECRET'], // This is the default and can be omitted
});

const response = await client.teams.retrieveLimits('teamId');

console.log(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

`client.teams.update(stringteamID, TeamUpdateParamsbody, RequestOptionsoptions?): TeamUpdateResponse`

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

Update a particular team

### Parameters

- `teamID: string`

- `body: TeamUpdateParams`

  - `avatarAssetId?: string`

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

  - `defaultUserMaxConsumption?: number`

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

  - `ipDetectionEnforcement?: "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?: string`

    The team name (example: "Scenario")

  - `qualityGateAutoDetect?: boolean`

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

  - `settings?: Settings`

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

    - `homepage?: unknown`

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

### Returns

- `TeamUpdateResponse`

  - `team: Team`

    The updated team.

    - `id: string`

      The team ID (example: "eyVcnFJcR92BxBkz7N6g5w")

    - `context: Context`

      The context of the team for the current authenticated user

      - `invitationsCount: number`

        The number of invitations on this team

      - `keysCount: number`

        The number of API keys on this team

      - `userRole: "admin" | "key" | "member"`

        The authenticated user's role for this team

        - `"admin"`

        - `"key"`

        - `"member"`

      - `usersCount: number`

        The number of users on this team

    - `createdAt: string`

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

    - `name: string`

      The team name (example: "Scenario")

    - `plan: "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: Array<Project>`

      Projects of the team

      - `id: string`

      - `createdAt: string`

      - `name: string`

      - `updatedAt: string`

      - `avatar?: Avatar`

        - `assetId?: string`

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

        - `url?: string`

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

      - `disableIpDetection?: boolean`

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

      - `qualityGateAutoDetect?: boolean`

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

    - `type: "personal" | "shared"`

      The team type

      - `"personal"`

      - `"shared"`

    - `updatedAt: string`

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

    - `avatar?: Avatar`

      The team's avatar

      - `assetId?: string`

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

      - `url?: string`

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

    - `byok?: Byok`

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

      - `markupMultiplier: number`

      - `updatedAt?: string`

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

      - `updatedBy?: string`

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

    - `defaultUserMaxConsumption?: number`

      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.

    - `ipDetectionEnforcement?: "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"`

    - `qualityGateAutoDetect?: boolean`

      Quality Gate auto-detection default for the team.

    - `settings?: Settings`

      Team settings.

      - `homepage?: Record<string, unknown>`

        Published homepage layout.

### Example

```typescript
import Scenario from '@scenario-labs/sdk';

const client = new Scenario({
  apiKey: process.env['SCENARIO_SDK_API_KEY'], // This is the default and can be omitted
  apiSecret: process.env['SCENARIO_SDK_API_SECRET'], // This is the default and can be omitted
});

const team = await client.teams.update('teamId');

console.log(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 Delete Invitations Response

- `TeamDeleteInvitationsResponse = unknown`

### Team List Response

- `TeamListResponse`

  - `teams: Array<Team>`

    A list of the teams the user belongs to

    - `id: string`

      The team ID (example: "eyVcnFJcR92BxBkz7N6g5w")

    - `context: Context`

      The context of the team for the current authenticated user

      - `invitationsCount: number`

        The number of invitations on this team

      - `keysCount: number`

        The number of API keys on this team

      - `userRole: "admin" | "key" | "member"`

        The authenticated user's role for this team

        - `"admin"`

        - `"key"`

        - `"member"`

      - `usersCount: number`

        The number of users on this team

    - `createdAt: string`

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

    - `name: string`

      The team name (example: "Scenario")

    - `plan: "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: Array<Project>`

      Projects of the team

      - `id: string`

      - `createdAt: string`

      - `name: string`

      - `updatedAt: string`

      - `avatar?: Avatar`

        - `assetId?: string`

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

        - `url?: string`

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

      - `disableIpDetection?: boolean`

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

      - `qualityGateAutoDetect?: boolean`

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

    - `type: "personal" | "shared"`

      The team type

      - `"personal"`

      - `"shared"`

    - `updatedAt: string`

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

    - `avatar?: Avatar`

      The team's avatar

      - `assetId?: string`

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

      - `url?: string`

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

    - `byok?: Byok`

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

      - `markupMultiplier: number`

      - `updatedAt?: string`

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

      - `updatedBy?: string`

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

    - `defaultUserMaxConsumption?: number`

      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.

    - `ipDetectionEnforcement?: "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"`

    - `qualityGateAutoDetect?: boolean`

      Quality Gate auto-detection default for the team.

### Team Retrieve Response

- `TeamRetrieveResponse`

  - `team: Team`

    - `id: string`

      The team ID (example: "eyVcnFJcR92BxBkz7N6g5w")

    - `createdAt: string`

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

    - `invitations: Array<Invitation>`

      The list of pending invitations

      - `createdAt: string`

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

      - `email: string`

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

      - `role: "admin" | "key" | "member"`

        The role of the invited user inside the team

        - `"admin"`

        - `"key"`

        - `"member"`

      - `status: "accepted" | "expired" | "pending" | "withdrawn"`

        The status of the invitation

        - `"accepted"`

        - `"expired"`

        - `"pending"`

        - `"withdrawn"`

      - `url: string`

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

      - `projectIds?: Array<string>`

        The list of project IDs for which the user is invited

    - `keys: Array<Key>`

      The list of API keys

      - `id: string`

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

      - `apiKeyId: string`

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

      - `apiKeyStatus: "active" | "inactive"`

        The status of the API key

        - `"active"`

        - `"inactive"`

      - `createdAt: string`

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

      - `name: string`

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

      - `scope: "project" | "team"`

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

        - `"project"`

        - `"team"`

      - `updatedAt: string`

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

      - `authorId?: string`

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

      - `consumption?: number`

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

      - `lastUsedAt?: string`

        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.

      - `maxConsumption?: number`

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

      - `ownerId?: string`

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

      - `projects?: Array<Project>`

        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.

        - `projectId: string`

          The project the key has a role on

        - `role: string`

          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?: string`

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

      The team name (example: "Scenario")

    - `paymentStatus: "failed" | "succeeded"`

      The paymentStatus for the team

      - `"failed"`

      - `"succeeded"`

    - `plan: "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: Array<Project>`

      Projects of the team

      - `id: string`

      - `createdAt: string`

      - `name: string`

      - `updatedAt: string`

      - `avatar?: Avatar`

        - `assetId?: string`

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

        - `url?: string`

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

      - `disableIpDetection?: boolean`

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

      - `qualityGateAutoDetect?: boolean`

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

    - `searchHost: string`

      The search host for the team

    - `searchIndexes: SearchIndexes`

      The search indexes for the team

      - `assets: Assets`

        - `private: string`

          The private search index for the team

        - `public: string`

          The public search index for the team

      - `models: Models`

        - `private: string`

          The private search index for the team

        - `public: string`

          The public search index for the team

      - `workflows: Workflows`

        - `private: string`

          The private search index for the team

        - `public: string`

          The public search index for the team

    - `type: "personal" | "shared"`

      The team type

      - `"personal"`

      - `"shared"`

    - `updatedAt: string`

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

    - `users: Array<User>`

      The list of teams members and their role

      - `id: string`

        The user ID (example: "eyVcnFJcR92BxBkz7N6g5w")

      - `createdAt: string`

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

      - `email: string`

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

      - `role: "admin" | "key" | "member"`

        The role of the user inside the team

        - `"admin"`

        - `"key"`

        - `"member"`

      - `updatedAt: string`

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

      - `avatar?: Avatar`

        The user's avatar

        - `assetId?: string`

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

        - `url?: string`

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

      - `consumption?: number`

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

      - `maxConsumption?: number`

        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?: Avatar`

      The team's avatar

      - `assetId?: string`

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

      - `url?: string`

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

    - `byok?: Byok`

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

      - `markupMultiplier: number`

      - `updatedAt?: string`

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

      - `updatedBy?: string`

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

    - `defaultUserMaxConsumption?: number`

      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.

    - `ipDetectionEnforcement?: "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"`

    - `qualityGateAutoDetect?: boolean`

      Quality Gate auto-detection default for the team.

    - `settings?: Settings`

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

      - `homepage?: Record<string, unknown>`

        Published homepage layout.

    - `subscriptionStatus?: "active" | "inactive" | "paused"`

      The subscriptionStatus for the team

      - `"active"`

      - `"inactive"`

      - `"paused"`

### Team Retrieve Limits Response

- `TeamRetrieveLimitsResponse`

  - `limits: Limits`

    The actual billing limits values related to the plan

    - `apiKeys: number`

    - `canvasAssetLayers: number`

    - `canvasAssets: number`

    - `collections: number`

    - `creativeUnits: number`

      The amount of Compute Units available for the plan

    - `defaultSeats: number`

    - `downloadAssets: number`

    - `downloadModel: number`

    - `inferenceBatchSize: number`

    - `maxCooldown: number`

      The maximum cooldown applied in case of over head

    - `maxTrainingDatasets: number`

    - `minCooldown: number`

      The minimum cooldown applied in case of over head

    - `models: number`

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

    - `OTPSessions: number`

    - `parallelCustomJobs: number`

    - `parallelInferences: number`

    - `parallelTraining: number`

    - `parallelWorkflowRuns: number`

    - `premiumGenerationSamples: number`

    - `projects: number`

      The maximum projects a team can have

    - `scalingFactor: number`

    - `seats: number`

    - `snapshotsRetention: number`

    - `upload: number`

  - `oneShotCreativeUnits: Array<OneShotCreativeUnit>`

    The list of one-shot Compute Units

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

    - `amount: number`

      The Compute Units amount bought

    - `createdAt: string`

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

    - `expiration: string`

      The expiration date of the Compute Units
      ISO string

    - `remaining: number`

      The remaining Compute Units available

    - `updatedAt: string`

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

    - `start: string`

  - `plan: "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

    - `apiKeys: number`

    - `canvasAssets: number`

    - `collections: number`

    - `creativeUnits: number`

    - `projects: number`

    - `seats: number`

### Team Update Response

- `TeamUpdateResponse`

  - `team: Team`

    The updated team.

    - `id: string`

      The team ID (example: "eyVcnFJcR92BxBkz7N6g5w")

    - `context: Context`

      The context of the team for the current authenticated user

      - `invitationsCount: number`

        The number of invitations on this team

      - `keysCount: number`

        The number of API keys on this team

      - `userRole: "admin" | "key" | "member"`

        The authenticated user's role for this team

        - `"admin"`

        - `"key"`

        - `"member"`

      - `usersCount: number`

        The number of users on this team

    - `createdAt: string`

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

    - `name: string`

      The team name (example: "Scenario")

    - `plan: "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: Array<Project>`

      Projects of the team

      - `id: string`

      - `createdAt: string`

      - `name: string`

      - `updatedAt: string`

      - `avatar?: Avatar`

        - `assetId?: string`

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

        - `url?: string`

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

      - `disableIpDetection?: boolean`

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

      - `qualityGateAutoDetect?: boolean`

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

    - `type: "personal" | "shared"`

      The team type

      - `"personal"`

      - `"shared"`

    - `updatedAt: string`

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

    - `avatar?: Avatar`

      The team's avatar

      - `assetId?: string`

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

      - `url?: string`

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

    - `byok?: Byok`

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

      - `markupMultiplier: number`

      - `updatedAt?: string`

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

      - `updatedBy?: string`

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

    - `defaultUserMaxConsumption?: number`

      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.

    - `ipDetectionEnforcement?: "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"`

    - `qualityGateAutoDetect?: boolean`

      Quality Gate auto-detection default for the team.

    - `settings?: Settings`

      Team settings.

      - `homepage?: Record<string, unknown>`

        Published homepage layout.

# Brief

## Delete

`client.teams.brief.delete(stringteamID, RequestOptionsoptions?): BriefDeleteResponse`

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

Delete the team's Quality Gate brief

### Parameters

- `teamID: string`

### Returns

- `BriefDeleteResponse`

  - `deleted: boolean`

### Example

```typescript
import Scenario from '@scenario-labs/sdk';

const client = new Scenario({
  apiKey: process.env['SCENARIO_SDK_API_KEY'], // This is the default and can be omitted
  apiSecret: process.env['SCENARIO_SDK_API_SECRET'], // This is the default and can be omitted
});

const brief = await client.teams.brief.delete('teamId');

console.log(brief.deleted);
```

#### Response

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

## Retrieve

`client.teams.brief.retrieve(stringteamID, RequestOptionsoptions?): BriefRetrieveResponse`

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

Get the team's Quality Gate brief

### Parameters

- `teamID: string`

### Returns

- `BriefRetrieveResponse`

  - `brief: Brief`

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

    - `id: string`

      Stable identifier derived from level + scopeId

    - `body: string`

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

    - `createdAt: string`

      ISO-8601 creation timestamp

    - `createdBy: string`

      User id that last wrote the brief

    - `enabled: boolean`

      Whether the brief is applied during verification

    - `level: "project" | "team"`

      Scope this brief applies to: team or project

      - `"project"`

      - `"team"`

    - `referenceAssetIds: Array<string>`

      Reference assets the verifier compares the image against

    - `scopeId: string`

      The id of the team or project that owns this brief

    - `updatedAt: string`

      ISO-8601 last-update timestamp

    - `sensitivity?: "high" | "low" | "medium"`

      Threshold strictness applied when verifying against this scope

      - `"high"`

      - `"low"`

      - `"medium"`

### Example

```typescript
import Scenario from '@scenario-labs/sdk';

const client = new Scenario({
  apiKey: process.env['SCENARIO_SDK_API_KEY'], // This is the default and can be omitted
  apiSecret: process.env['SCENARIO_SDK_API_SECRET'], // This is the default and can be omitted
});

const brief = await client.teams.brief.retrieve('teamId');

console.log(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

`client.teams.brief.update(stringteamID, BriefUpdateParamsbody, RequestOptionsoptions?): BriefUpdateResponse`

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

Create or update the team's Quality Gate brief

### Parameters

- `teamID: string`

- `body: BriefUpdateParams`

  - `body: string`

    Free-text brief content

  - `enabled?: boolean`

    Whether the brief is applied during verification (default true)

  - `referenceAssetIds?: Array<string>`

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

  - `sensitivity?: "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

- `BriefUpdateResponse`

  - `brief: Brief`

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

    - `id: string`

      Stable identifier derived from level + scopeId

    - `body: string`

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

    - `createdAt: string`

      ISO-8601 creation timestamp

    - `createdBy: string`

      User id that last wrote the brief

    - `enabled: boolean`

      Whether the brief is applied during verification

    - `level: "project" | "team"`

      Scope this brief applies to: team or project

      - `"project"`

      - `"team"`

    - `referenceAssetIds: Array<string>`

      Reference assets the verifier compares the image against

    - `scopeId: string`

      The id of the team or project that owns this brief

    - `updatedAt: string`

      ISO-8601 last-update timestamp

    - `sensitivity?: "high" | "low" | "medium"`

      Threshold strictness applied when verifying against this scope

      - `"high"`

      - `"low"`

      - `"medium"`

### Example

```typescript
import Scenario from '@scenario-labs/sdk';

const client = new Scenario({
  apiKey: process.env['SCENARIO_SDK_API_KEY'], // This is the default and can be omitted
  apiSecret: process.env['SCENARIO_SDK_API_SECRET'], // This is the default and can be omitted
});

const brief = await client.teams.brief.update('teamId', { body: 'x' });

console.log(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

- `BriefDeleteResponse`

  - `deleted: boolean`

### Brief Retrieve Response

- `BriefRetrieveResponse`

  - `brief: Brief`

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

    - `id: string`

      Stable identifier derived from level + scopeId

    - `body: string`

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

    - `createdAt: string`

      ISO-8601 creation timestamp

    - `createdBy: string`

      User id that last wrote the brief

    - `enabled: boolean`

      Whether the brief is applied during verification

    - `level: "project" | "team"`

      Scope this brief applies to: team or project

      - `"project"`

      - `"team"`

    - `referenceAssetIds: Array<string>`

      Reference assets the verifier compares the image against

    - `scopeId: string`

      The id of the team or project that owns this brief

    - `updatedAt: string`

      ISO-8601 last-update timestamp

    - `sensitivity?: "high" | "low" | "medium"`

      Threshold strictness applied when verifying against this scope

      - `"high"`

      - `"low"`

      - `"medium"`

### Brief Update Response

- `BriefUpdateResponse`

  - `brief: Brief`

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

    - `id: string`

      Stable identifier derived from level + scopeId

    - `body: string`

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

    - `createdAt: string`

      ISO-8601 creation timestamp

    - `createdBy: string`

      User id that last wrote the brief

    - `enabled: boolean`

      Whether the brief is applied during verification

    - `level: "project" | "team"`

      Scope this brief applies to: team or project

      - `"project"`

      - `"team"`

    - `referenceAssetIds: Array<string>`

      Reference assets the verifier compares the image against

    - `scopeId: string`

      The id of the team or project that owns this brief

    - `updatedAt: string`

      ISO-8601 last-update timestamp

    - `sensitivity?: "high" | "low" | "medium"`

      Threshold strictness applied when verifying against this scope

      - `"high"`

      - `"low"`

      - `"medium"`

# IP Filters

## Create

`client.teams.ipFilters.create(stringteamID, IPFilterCreateParamsbody, RequestOptionsoptions?): 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

- `teamID: string`

- `body: IPFilterCreateParams`

  - `category: "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: string`

    Display name for the filter

  - `enabled?: boolean`

    Whether the filter is active

  - `instruction?: string`

    Natural-language detection instruction (required for custom filters)

  - `sourceAssetIds?: Array<string>`

    Optional reference assets used only to generate the instruction

### Returns

- `IPFilterCreateResponse`

  - `filter: unknown`

    The created custom filter, including its enabled state

### Example

```typescript
import Scenario from '@scenario-labs/sdk';

const client = new Scenario({
  apiKey: process.env['SCENARIO_SDK_API_KEY'], // This is the default and can be omitted
  apiSecret: process.env['SCENARIO_SDK_API_SECRET'], // This is the default and can be omitted
});

const ipFilter = await client.teams.ipFilters.create('teamId', {
  category: 'artist-style',
  name: 'name',
});

console.log(ipFilter.filter);
```

#### Response

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

## Delete

`client.teams.ipFilters.delete(stringfilterID, IPFilterDeleteParamsparams, RequestOptionsoptions?): IPFilterDeleteResponse`

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

Delete a custom IP-detection filter for a team

### Parameters

- `filterID: string`

- `params: IPFilterDeleteParams`

  - `teamId: string`

    The team the filter belongs to

### Returns

- `IPFilterDeleteResponse`

  - `deleted: boolean`

    True when the filter was deleted

### Example

```typescript
import Scenario from '@scenario-labs/sdk';

const client = new Scenario({
  apiKey: process.env['SCENARIO_SDK_API_KEY'], // This is the default and can be omitted
  apiSecret: process.env['SCENARIO_SDK_API_SECRET'], // This is the default and can be omitted
});

const ipFilter = await client.teams.ipFilters.delete('filterId', { teamId: 'teamId' });

console.log(ipFilter.deleted);
```

#### Response

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

## Draft Instruction

`client.teams.ipFilters.draftInstruction(stringteamID, IPFilterDraftInstructionParamsbody, RequestOptionsoptions?): 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

- `teamID: string`

- `body: IPFilterDraftInstructionParams`

  - `assetIds: Array<string>`

    Reference assets whose imagery seeds the drafted detection instruction

### Returns

- `IPFilterDraftInstructionResponse`

  - `instruction: string`

    Drafted natural-language detection instruction derived from the reference assets

### Example

```typescript
import Scenario from '@scenario-labs/sdk';

const client = new Scenario({
  apiKey: process.env['SCENARIO_SDK_API_KEY'], // This is the default and can be omitted
  apiSecret: process.env['SCENARIO_SDK_API_SECRET'], // This is the default and can be omitted
});

const response = await client.teams.ipFilters.draftInstruction('teamId', { assetIds: ['string'] });

console.log(response.instruction);
```

#### Response

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

## List

`client.teams.ipFilters.list(stringteamID, RequestOptionsoptions?): IPFilterListResponse`

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

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

### Parameters

- `teamID: string`

### Returns

- `IPFilterListResponse`

  - `filters: Array<unknown>`

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

### Example

```typescript
import Scenario from '@scenario-labs/sdk';

const client = new Scenario({
  apiKey: process.env['SCENARIO_SDK_API_KEY'], // This is the default and can be omitted
  apiSecret: process.env['SCENARIO_SDK_API_SECRET'], // This is the default and can be omitted
});

const ipFilters = await client.teams.ipFilters.list('teamId');

console.log(ipFilters.filters);
```

#### Response

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

## Update

`client.teams.ipFilters.update(stringfilterID, IPFilterUpdateParamsparams, RequestOptionsoptions?): IPFilterUpdateResponse`

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

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

### Parameters

- `filterID: string`

- `params: IPFilterUpdateParams`

  - `teamId: string`

    Path param: The team the filter belongs to

  - `enabled?: boolean`

    Body param: Whether the filter is active

  - `instruction?: string`

    Body param: Natural-language detection instruction

  - `name?: string`

    Body param: Display name for the filter

### Returns

- `IPFilterUpdateResponse`

  - `filter: unknown`

    The updated filter, including its enabled state

### Example

```typescript
import Scenario from '@scenario-labs/sdk';

const client = new Scenario({
  apiKey: process.env['SCENARIO_SDK_API_KEY'], // This is the default and can be omitted
  apiSecret: process.env['SCENARIO_SDK_API_SECRET'], // This is the default and can be omitted
});

const ipFilter = await client.teams.ipFilters.update('filterId', { teamId: 'teamId' });

console.log(ipFilter.filter);
```

#### Response

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

## Domain Types

### IP Filter Create Response

- `IPFilterCreateResponse`

  - `filter: unknown`

    The created custom filter, including its enabled state

### IP Filter Delete Response

- `IPFilterDeleteResponse`

  - `deleted: boolean`

    True when the filter was deleted

### IP Filter Draft Instruction Response

- `IPFilterDraftInstructionResponse`

  - `instruction: string`

    Drafted natural-language detection instruction derived from the reference assets

### IP Filter List Response

- `IPFilterListResponse`

  - `filters: Array<unknown>`

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

### IP Filter Update Response

- `IPFilterUpdateResponse`

  - `filter: unknown`

    The updated filter, including its enabled state

# Members

## Create

`client.teams.members.create(stringteamID, MemberCreateParamsbody, RequestOptionsoptions?): MemberCreateResponse`

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

Add a member to the team

### Parameters

- `teamID: string`

- `body: MemberCreateParams`

  - `email: string`

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

  - `projectIds?: Array<string>`

    The project IDs for which the user is invited

  - `role?: "admin" | "member"`

    The role you want to give the user

    - `"admin"`

    - `"member"`

### Returns

- `MemberCreateResponse`

  - `team: Team`

    - `id: string`

      The team ID (example: "eyVcnFJcR92BxBkz7N6g5w")

    - `context: Context`

      The context of the team for the current authenticated user

      - `invitationsCount: number`

        The number of invitations on this team

      - `keysCount: number`

        The number of API keys on this team

      - `userRole: "admin" | "key" | "member"`

        The authenticated user's role for this team

        - `"admin"`

        - `"key"`

        - `"member"`

      - `usersCount: number`

        The number of users on this team

    - `createdAt: string`

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

    - `name: string`

      The team name (example: "Scenario")

    - `plan: "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: Array<Project>`

      Projects of the team

      - `id: string`

      - `createdAt: string`

      - `name: string`

      - `updatedAt: string`

      - `avatar?: Avatar`

        - `assetId?: string`

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

        - `url?: string`

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

      - `disableIpDetection?: boolean`

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

      - `qualityGateAutoDetect?: boolean`

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

    - `type: "personal" | "shared"`

      The team type

      - `"personal"`

      - `"shared"`

    - `updatedAt: string`

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

    - `avatar?: Avatar`

      The team's avatar

      - `assetId?: string`

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

      - `url?: string`

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

    - `byok?: Byok`

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

      - `markupMultiplier: number`

      - `updatedAt?: string`

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

      - `updatedBy?: string`

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

    - `defaultUserMaxConsumption?: number`

      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.

    - `ipDetectionEnforcement?: "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"`

    - `qualityGateAutoDetect?: boolean`

      Quality Gate auto-detection default for the team.

### Example

```typescript
import Scenario from '@scenario-labs/sdk';

const client = new Scenario({
  apiKey: process.env['SCENARIO_SDK_API_KEY'], // This is the default and can be omitted
  apiSecret: process.env['SCENARIO_SDK_API_SECRET'], // This is the default and can be omitted
});

const member = await client.teams.members.create('teamId', { email: 'email' });

console.log(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

`client.teams.members.delete(stringmemberID, MemberDeleteParamsparams, RequestOptionsoptions?): MemberDeleteResponse`

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

Remove a member from the team

### Parameters

- `memberID: string`

- `params: MemberDeleteParams`

  - `teamId: string`

    The team Id concerned by the member removal

### Returns

- `MemberDeleteResponse = unknown`

### Example

```typescript
import Scenario from '@scenario-labs/sdk';

const client = new Scenario({
  apiKey: process.env['SCENARIO_SDK_API_KEY'], // This is the default and can be omitted
  apiSecret: process.env['SCENARIO_SDK_API_SECRET'], // This is the default and can be omitted
});

const member = await client.teams.members.delete('memberId', { teamId: 'teamId' });

console.log(member);
```

#### Response

```json
{}
```

## Update

`client.teams.members.update(stringmemberID, MemberUpdateParamsparams, RequestOptionsoptions?): MemberUpdateResponse`

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

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

### Parameters

- `memberID: string`

- `params: MemberUpdateParams`

  - `teamId: string`

    Path param: The team Id the member belongs to

  - `maxConsumption?: number`

    Body param: 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?: string`

    Body param: 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

- `MemberUpdateResponse = unknown`

### Example

```typescript
import Scenario from '@scenario-labs/sdk';

const client = new Scenario({
  apiKey: process.env['SCENARIO_SDK_API_KEY'], // This is the default and can be omitted
  apiSecret: process.env['SCENARIO_SDK_API_SECRET'], // This is the default and can be omitted
});

const member = await client.teams.members.update('memberId', { teamId: 'teamId' });

console.log(member);
```

#### Response

```json
{}
```

## Domain Types

### Member Create Response

- `MemberCreateResponse`

  - `team: Team`

    - `id: string`

      The team ID (example: "eyVcnFJcR92BxBkz7N6g5w")

    - `context: Context`

      The context of the team for the current authenticated user

      - `invitationsCount: number`

        The number of invitations on this team

      - `keysCount: number`

        The number of API keys on this team

      - `userRole: "admin" | "key" | "member"`

        The authenticated user's role for this team

        - `"admin"`

        - `"key"`

        - `"member"`

      - `usersCount: number`

        The number of users on this team

    - `createdAt: string`

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

    - `name: string`

      The team name (example: "Scenario")

    - `plan: "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: Array<Project>`

      Projects of the team

      - `id: string`

      - `createdAt: string`

      - `name: string`

      - `updatedAt: string`

      - `avatar?: Avatar`

        - `assetId?: string`

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

        - `url?: string`

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

      - `disableIpDetection?: boolean`

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

      - `qualityGateAutoDetect?: boolean`

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

    - `type: "personal" | "shared"`

      The team type

      - `"personal"`

      - `"shared"`

    - `updatedAt: string`

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

    - `avatar?: Avatar`

      The team's avatar

      - `assetId?: string`

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

      - `url?: string`

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

    - `byok?: Byok`

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

      - `markupMultiplier: number`

      - `updatedAt?: string`

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

      - `updatedBy?: string`

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

    - `defaultUserMaxConsumption?: number`

      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.

    - `ipDetectionEnforcement?: "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"`

    - `qualityGateAutoDetect?: boolean`

      Quality Gate auto-detection default for the team.

### Member Delete Response

- `MemberDeleteResponse = unknown`

### Member Update Response

- `MemberUpdateResponse = unknown`

# Watermark

## Delete

`client.teams.watermark.delete(stringteamID, RequestOptionsoptions?): WatermarkDeleteResponse`

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

Delete the team's forced watermark configuration

### Parameters

- `teamID: string`

### Returns

- `WatermarkDeleteResponse`

  - `deleted: boolean`

### Example

```typescript
import Scenario from '@scenario-labs/sdk';

const client = new Scenario({
  apiKey: process.env['SCENARIO_SDK_API_KEY'], // This is the default and can be omitted
  apiSecret: process.env['SCENARIO_SDK_API_SECRET'], // This is the default and can be omitted
});

const watermark = await client.teams.watermark.delete('teamId');

console.log(watermark.deleted);
```

#### Response

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

## Delete Logo

`client.teams.watermark.deleteLogo(stringteamID, RequestOptionsoptions?): WatermarkDeleteLogoResponse`

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

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

### Parameters

- `teamID: string`

### Returns

- `WatermarkDeleteLogoResponse`

  - `watermark: Watermark`

    Forced-watermark configuration stored at one scope.

    - `id: string`

      Stable identifier derived from level + scopeId

    - `createdAt: string`

      ISO-8601 creation timestamp

    - `createdBy: string`

      User id that last wrote the configuration

    - `enabled: boolean`

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

    - `level: "project" | "team"`

      Scope this configuration applies to: team or project

      - `"project"`

      - `"team"`

    - `opacity: number`

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

    - `placement: "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: number`

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

    - `scale: number`

      Mark width as a fraction of the image width

    - `scopeId: string`

      The id of the team or project that owns this configuration

    - `spacing: number`

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

    - `updatedAt: string`

      ISO-8601 last-update timestamp

    - `version: number`

      Bumped on every write.

    - `deletedAt?: string`

      Set when the configuration has been deleted.

    - `logoIsOpaque?: boolean`

      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.

    - `logoKey?: string`

      Where the uploaded logo lives, when one is set.

    - `text?: string`

      Text rendered as the mark, when no logo is set

### Example

```typescript
import Scenario from '@scenario-labs/sdk';

const client = new Scenario({
  apiKey: process.env['SCENARIO_SDK_API_KEY'], // This is the default and can be omitted
  apiSecret: process.env['SCENARIO_SDK_API_SECRET'], // This is the default and can be omitted
});

const response = await client.teams.watermark.deleteLogo('teamId');

console.log(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

`client.teams.watermark.preview(stringteamID, WatermarkPreviewParamsbody, RequestOptionsoptions?): WatermarkPreviewResponse`

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

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

### Parameters

- `teamID: string`

- `body: WatermarkPreviewParams`

  - `opacity?: number`

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

  - `placement?: "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?: number`

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

  - `scale?: number`

    Mark width as a fraction of the image width

  - `spacing?: number`

    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?: string`

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

### Returns

- `WatermarkPreviewResponse`

  Response of the watermark preview routes.

  - `image: string`

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

### Example

```typescript
import Scenario from '@scenario-labs/sdk';

const client = new Scenario({
  apiKey: process.env['SCENARIO_SDK_API_KEY'], // This is the default and can be omitted
  apiSecret: process.env['SCENARIO_SDK_API_SECRET'], // This is the default and can be omitted
});

const response = await client.teams.watermark.preview('teamId');

console.log(response.image);
```

#### Response

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

## Retrieve

`client.teams.watermark.retrieve(stringteamID, RequestOptionsoptions?): WatermarkRetrieveResponse`

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

Get the team's forced watermark configuration

### Parameters

- `teamID: string`

### Returns

- `WatermarkRetrieveResponse`

  - `watermark: Watermark`

    Forced-watermark configuration stored at one scope.

    - `id: string`

      Stable identifier derived from level + scopeId

    - `createdAt: string`

      ISO-8601 creation timestamp

    - `createdBy: string`

      User id that last wrote the configuration

    - `enabled: boolean`

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

    - `level: "project" | "team"`

      Scope this configuration applies to: team or project

      - `"project"`

      - `"team"`

    - `opacity: number`

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

    - `placement: "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: number`

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

    - `scale: number`

      Mark width as a fraction of the image width

    - `scopeId: string`

      The id of the team or project that owns this configuration

    - `spacing: number`

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

    - `updatedAt: string`

      ISO-8601 last-update timestamp

    - `version: number`

      Bumped on every write.

    - `deletedAt?: string`

      Set when the configuration has been deleted.

    - `logoIsOpaque?: boolean`

      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.

    - `logoKey?: string`

      Where the uploaded logo lives, when one is set.

    - `text?: string`

      Text rendered as the mark, when no logo is set

### Example

```typescript
import Scenario from '@scenario-labs/sdk';

const client = new Scenario({
  apiKey: process.env['SCENARIO_SDK_API_KEY'], // This is the default and can be omitted
  apiSecret: process.env['SCENARIO_SDK_API_SECRET'], // This is the default and can be omitted
});

const watermark = await client.teams.watermark.retrieve('teamId');

console.log(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

`client.teams.watermark.update(stringteamID, WatermarkUpdateParamsbody, RequestOptionsoptions?): WatermarkUpdateResponse`

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

Create or update the team's forced watermark configuration

### Parameters

- `teamID: string`

- `body: WatermarkUpdateParams`

  - `enabled: boolean`

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

  - `opacity?: number`

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

  - `placement?: "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?: number`

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

  - `scale?: number`

    Mark width as a fraction of the image width

  - `spacing?: number`

    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?: string`

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

### Returns

- `WatermarkUpdateResponse`

  - `watermark: Watermark`

    Forced-watermark configuration stored at one scope.

    - `id: string`

      Stable identifier derived from level + scopeId

    - `createdAt: string`

      ISO-8601 creation timestamp

    - `createdBy: string`

      User id that last wrote the configuration

    - `enabled: boolean`

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

    - `level: "project" | "team"`

      Scope this configuration applies to: team or project

      - `"project"`

      - `"team"`

    - `opacity: number`

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

    - `placement: "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: number`

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

    - `scale: number`

      Mark width as a fraction of the image width

    - `scopeId: string`

      The id of the team or project that owns this configuration

    - `spacing: number`

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

    - `updatedAt: string`

      ISO-8601 last-update timestamp

    - `version: number`

      Bumped on every write.

    - `deletedAt?: string`

      Set when the configuration has been deleted.

    - `logoIsOpaque?: boolean`

      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.

    - `logoKey?: string`

      Where the uploaded logo lives, when one is set.

    - `text?: string`

      Text rendered as the mark, when no logo is set

### Example

```typescript
import Scenario from '@scenario-labs/sdk';

const client = new Scenario({
  apiKey: process.env['SCENARIO_SDK_API_KEY'], // This is the default and can be omitted
  apiSecret: process.env['SCENARIO_SDK_API_SECRET'], // This is the default and can be omitted
});

const watermark = await client.teams.watermark.update('teamId', { enabled: true });

console.log(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

`client.teams.watermark.updateLogo(stringteamID, WatermarkUpdateLogoParamsbody, RequestOptionsoptions?): WatermarkUpdateLogoResponse`

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

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

### Parameters

- `teamID: string`

- `body: WatermarkUpdateLogoParams`

  - `logo: string`

    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

- `WatermarkUpdateLogoResponse`

  - `watermark: Watermark`

    Forced-watermark configuration stored at one scope.

    - `id: string`

      Stable identifier derived from level + scopeId

    - `createdAt: string`

      ISO-8601 creation timestamp

    - `createdBy: string`

      User id that last wrote the configuration

    - `enabled: boolean`

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

    - `level: "project" | "team"`

      Scope this configuration applies to: team or project

      - `"project"`

      - `"team"`

    - `opacity: number`

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

    - `placement: "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: number`

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

    - `scale: number`

      Mark width as a fraction of the image width

    - `scopeId: string`

      The id of the team or project that owns this configuration

    - `spacing: number`

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

    - `updatedAt: string`

      ISO-8601 last-update timestamp

    - `version: number`

      Bumped on every write.

    - `deletedAt?: string`

      Set when the configuration has been deleted.

    - `logoIsOpaque?: boolean`

      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.

    - `logoKey?: string`

      Where the uploaded logo lives, when one is set.

    - `text?: string`

      Text rendered as the mark, when no logo is set

### Example

```typescript
import Scenario from '@scenario-labs/sdk';

const client = new Scenario({
  apiKey: process.env['SCENARIO_SDK_API_KEY'], // This is the default and can be omitted
  apiSecret: process.env['SCENARIO_SDK_API_SECRET'], // This is the default and can be omitted
});

const response = await client.teams.watermark.updateLogo('teamId', { logo: 'logo' });

console.log(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

- `WatermarkDeleteResponse`

  - `deleted: boolean`

### Watermark Delete Logo Response

- `WatermarkDeleteLogoResponse`

  - `watermark: Watermark`

    Forced-watermark configuration stored at one scope.

    - `id: string`

      Stable identifier derived from level + scopeId

    - `createdAt: string`

      ISO-8601 creation timestamp

    - `createdBy: string`

      User id that last wrote the configuration

    - `enabled: boolean`

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

    - `level: "project" | "team"`

      Scope this configuration applies to: team or project

      - `"project"`

      - `"team"`

    - `opacity: number`

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

    - `placement: "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: number`

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

    - `scale: number`

      Mark width as a fraction of the image width

    - `scopeId: string`

      The id of the team or project that owns this configuration

    - `spacing: number`

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

    - `updatedAt: string`

      ISO-8601 last-update timestamp

    - `version: number`

      Bumped on every write.

    - `deletedAt?: string`

      Set when the configuration has been deleted.

    - `logoIsOpaque?: boolean`

      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.

    - `logoKey?: string`

      Where the uploaded logo lives, when one is set.

    - `text?: string`

      Text rendered as the mark, when no logo is set

### Watermark Preview Response

- `WatermarkPreviewResponse`

  Response of the watermark preview routes.

  - `image: string`

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

### Watermark Retrieve Response

- `WatermarkRetrieveResponse`

  - `watermark: Watermark`

    Forced-watermark configuration stored at one scope.

    - `id: string`

      Stable identifier derived from level + scopeId

    - `createdAt: string`

      ISO-8601 creation timestamp

    - `createdBy: string`

      User id that last wrote the configuration

    - `enabled: boolean`

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

    - `level: "project" | "team"`

      Scope this configuration applies to: team or project

      - `"project"`

      - `"team"`

    - `opacity: number`

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

    - `placement: "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: number`

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

    - `scale: number`

      Mark width as a fraction of the image width

    - `scopeId: string`

      The id of the team or project that owns this configuration

    - `spacing: number`

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

    - `updatedAt: string`

      ISO-8601 last-update timestamp

    - `version: number`

      Bumped on every write.

    - `deletedAt?: string`

      Set when the configuration has been deleted.

    - `logoIsOpaque?: boolean`

      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.

    - `logoKey?: string`

      Where the uploaded logo lives, when one is set.

    - `text?: string`

      Text rendered as the mark, when no logo is set

### Watermark Update Response

- `WatermarkUpdateResponse`

  - `watermark: Watermark`

    Forced-watermark configuration stored at one scope.

    - `id: string`

      Stable identifier derived from level + scopeId

    - `createdAt: string`

      ISO-8601 creation timestamp

    - `createdBy: string`

      User id that last wrote the configuration

    - `enabled: boolean`

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

    - `level: "project" | "team"`

      Scope this configuration applies to: team or project

      - `"project"`

      - `"team"`

    - `opacity: number`

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

    - `placement: "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: number`

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

    - `scale: number`

      Mark width as a fraction of the image width

    - `scopeId: string`

      The id of the team or project that owns this configuration

    - `spacing: number`

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

    - `updatedAt: string`

      ISO-8601 last-update timestamp

    - `version: number`

      Bumped on every write.

    - `deletedAt?: string`

      Set when the configuration has been deleted.

    - `logoIsOpaque?: boolean`

      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.

    - `logoKey?: string`

      Where the uploaded logo lives, when one is set.

    - `text?: string`

      Text rendered as the mark, when no logo is set

### Watermark Update Logo Response

- `WatermarkUpdateLogoResponse`

  - `watermark: Watermark`

    Forced-watermark configuration stored at one scope.

    - `id: string`

      Stable identifier derived from level + scopeId

    - `createdAt: string`

      ISO-8601 creation timestamp

    - `createdBy: string`

      User id that last wrote the configuration

    - `enabled: boolean`

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

    - `level: "project" | "team"`

      Scope this configuration applies to: team or project

      - `"project"`

      - `"team"`

    - `opacity: number`

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

    - `placement: "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: number`

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

    - `scale: number`

      Mark width as a fraction of the image width

    - `scopeId: string`

      The id of the team or project that owns this configuration

    - `spacing: number`

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

    - `updatedAt: string`

      ISO-8601 last-update timestamp

    - `version: number`

      Bumped on every write.

    - `deletedAt?: string`

      Set when the configuration has been deleted.

    - `logoIsOpaque?: boolean`

      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.

    - `logoKey?: string`

      Where the uploaded logo lives, when one is set.

    - `text?: string`

      Text rendered as the mark, when no logo is set

# Webhook Endpoints

## Create

`client.teams.webhookEndpoints.create(stringteamID, WebhookEndpointCreateParamsbody, RequestOptionsoptions?): 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

- `teamID: string`

- `body: WebhookEndpointCreateParams`

  - `enabledEvents: Array<"*" | "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: string`

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

  - `description?: string`

    A description of the webhook endpoint

### Returns

- `WebhookEndpointCreateResponse`

  - `webhookEndpoint: 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: string`

      The ID of the webhook endpoint

    - `createdAt: string`

      The date and time the webhook endpoint was created

    - `enabled: boolean`

      Whether the webhook is enabled

    - `enabledEvents: Array<"*" | "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"`

    - `nbFailedCalls: number`

      The number of calls to the webhook endpoint that have failed

    - `nbTotalCalls: number`

      The number of calls to the webhook endpoint

    - `ownerId: string`

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

    - `ownerType: "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: string`

      The endpoint's secret, used to generate webhook signatures

    - `updatedAt: string`

      The date and time the webhook endpoint was updated

    - `url: string`

      The URL of the webhook endpoint

    - `description?: string`

      A description of the webhook endpoint

### Example

```typescript
import Scenario from '@scenario-labs/sdk';

const client = new Scenario({
  apiKey: process.env['SCENARIO_SDK_API_KEY'], // This is the default and can be omitted
  apiSecret: process.env['SCENARIO_SDK_API_SECRET'], // This is the default and can be omitted
});

const webhookEndpoint = await client.teams.webhookEndpoints.create('teamId', {
  enabledEvents: ['*'],
  url: 'url',
});

console.log(webhookEndpoint.webhookEndpoint);
```

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

`client.teams.webhookEndpoints.delete(stringwebhookEndpointID, WebhookEndpointDeleteParamsparams, RequestOptionsoptions?): WebhookEndpointDeleteResponse`

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

Delete a particular webhook endpoint by its Id

### Parameters

- `webhookEndpointID: string`

- `params: WebhookEndpointDeleteParams`

  - `teamId: string`

    The team Id

### Returns

- `WebhookEndpointDeleteResponse = unknown`

### Example

```typescript
import Scenario from '@scenario-labs/sdk';

const client = new Scenario({
  apiKey: process.env['SCENARIO_SDK_API_KEY'], // This is the default and can be omitted
  apiSecret: process.env['SCENARIO_SDK_API_SECRET'], // This is the default and can be omitted
});

const webhookEndpoint = await client.teams.webhookEndpoints.delete('webhookEndpointId', {
  teamId: 'teamId',
});

console.log(webhookEndpoint);
```

#### Response

```json
{}
```

## List

`client.teams.webhookEndpoints.list(stringteamID, RequestOptionsoptions?): WebhookEndpointListResponse`

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

List the team's webhook endpoints

### Parameters

- `teamID: string`

### Returns

- `WebhookEndpointListResponse`

  - `webhookEndpoints: Array<WebhookEndpoint>`

    A list of the team webhooks

    - `id: string`

      The ID of the webhook endpoint

    - `createdAt: string`

      The date and time the webhook endpoint was created

    - `enabled: boolean`

      Whether the webhook is enabled

    - `enabledEvents: Array<"*" | "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"`

    - `nbFailedCalls: number`

      The number of calls to the webhook endpoint that have failed

    - `nbTotalCalls: number`

      The number of calls to the webhook endpoint

    - `ownerId: string`

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

    - `ownerType: "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"`

    - `updatedAt: string`

      The date and time the webhook endpoint was updated

    - `url: string`

      The URL of the webhook endpoint

    - `description?: string`

      A description of the webhook endpoint

### Example

```typescript
import Scenario from '@scenario-labs/sdk';

const client = new Scenario({
  apiKey: process.env['SCENARIO_SDK_API_KEY'], // This is the default and can be omitted
  apiSecret: process.env['SCENARIO_SDK_API_SECRET'], // This is the default and can be omitted
});

const webhookEndpoints = await client.teams.webhookEndpoints.list('teamId');

console.log(webhookEndpoints.webhookEndpoints);
```

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

`client.teams.webhookEndpoints.update(stringwebhookEndpointID, WebhookEndpointUpdateParamsparams, RequestOptionsoptions?): WebhookEndpointUpdateResponse`

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

Update a particular webhook endpoint for a team

### Parameters

- `webhookEndpointID: string`

- `params: WebhookEndpointUpdateParams`

  - `teamId: string`

    Path param: The team Id

  - `description?: string`

    Body param: A description of the webhook endpoint

  - `enabled?: boolean`

    Body param: Whether the webhook is enabled

  - `enabledEvents?: Array<"*" | "asset.download.completed" | "asset.download.created" | 16 more>`

    Body param: 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?: string`

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

### Returns

- `WebhookEndpointUpdateResponse`

  - `webhookEndpoint: WebhookEndpoint`

    - `id: string`

      The ID of the webhook endpoint

    - `createdAt: string`

      The date and time the webhook endpoint was created

    - `enabled: boolean`

      Whether the webhook is enabled

    - `enabledEvents: Array<"*" | "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"`

    - `nbFailedCalls: number`

      The number of calls to the webhook endpoint that have failed

    - `nbTotalCalls: number`

      The number of calls to the webhook endpoint

    - `ownerId: string`

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

    - `ownerType: "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"`

    - `updatedAt: string`

      The date and time the webhook endpoint was updated

    - `url: string`

      The URL of the webhook endpoint

    - `description?: string`

      A description of the webhook endpoint

### Example

```typescript
import Scenario from '@scenario-labs/sdk';

const client = new Scenario({
  apiKey: process.env['SCENARIO_SDK_API_KEY'], // This is the default and can be omitted
  apiSecret: process.env['SCENARIO_SDK_API_SECRET'], // This is the default and can be omitted
});

const webhookEndpoint = await client.teams.webhookEndpoints.update('webhookEndpointId', {
  teamId: 'teamId',
});

console.log(webhookEndpoint.webhookEndpoint);
```

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

- `WebhookEndpointCreateResponse`

  - `webhookEndpoint: 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: string`

      The ID of the webhook endpoint

    - `createdAt: string`

      The date and time the webhook endpoint was created

    - `enabled: boolean`

      Whether the webhook is enabled

    - `enabledEvents: Array<"*" | "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"`

    - `nbFailedCalls: number`

      The number of calls to the webhook endpoint that have failed

    - `nbTotalCalls: number`

      The number of calls to the webhook endpoint

    - `ownerId: string`

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

    - `ownerType: "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: string`

      The endpoint's secret, used to generate webhook signatures

    - `updatedAt: string`

      The date and time the webhook endpoint was updated

    - `url: string`

      The URL of the webhook endpoint

    - `description?: string`

      A description of the webhook endpoint

### Webhook Endpoint Delete Response

- `WebhookEndpointDeleteResponse = unknown`

### Webhook Endpoint List Response

- `WebhookEndpointListResponse`

  - `webhookEndpoints: Array<WebhookEndpoint>`

    A list of the team webhooks

    - `id: string`

      The ID of the webhook endpoint

    - `createdAt: string`

      The date and time the webhook endpoint was created

    - `enabled: boolean`

      Whether the webhook is enabled

    - `enabledEvents: Array<"*" | "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"`

    - `nbFailedCalls: number`

      The number of calls to the webhook endpoint that have failed

    - `nbTotalCalls: number`

      The number of calls to the webhook endpoint

    - `ownerId: string`

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

    - `ownerType: "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"`

    - `updatedAt: string`

      The date and time the webhook endpoint was updated

    - `url: string`

      The URL of the webhook endpoint

    - `description?: string`

      A description of the webhook endpoint

### Webhook Endpoint Update Response

- `WebhookEndpointUpdateResponse`

  - `webhookEndpoint: WebhookEndpoint`

    - `id: string`

      The ID of the webhook endpoint

    - `createdAt: string`

      The date and time the webhook endpoint was created

    - `enabled: boolean`

      Whether the webhook is enabled

    - `enabledEvents: Array<"*" | "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"`

    - `nbFailedCalls: number`

      The number of calls to the webhook endpoint that have failed

    - `nbTotalCalls: number`

      The number of calls to the webhook endpoint

    - `ownerId: string`

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

    - `ownerType: "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"`

    - `updatedAt: string`

      The date and time the webhook endpoint was updated

    - `url: string`

      The URL of the webhook endpoint

    - `description?: string`

      A description of the webhook endpoint

# Events

## List

`client.teams.webhookEndpoints.events.list(stringwebhookEndpointID, EventListParamsparams, RequestOptionsoptions?): EventListResponse`

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

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

### Parameters

- `webhookEndpointID: string`

- `params: EventListParams`

  - `teamId: string`

    Path param: The team Id

  - `paginationToken?: string`

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

### Returns

- `EventListResponse`

  - `items: Array<Item>`

    A list of the team webhook events

    - `id: string`

    - `endpointId: string`

    - `status: "created" | "failed" | "retrying" | "success"`

      - `"created"`

      - `"failed"`

      - `"retrying"`

      - `"success"`

    - `type: "*" | "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"`

    - `updatedAt: string`

  - `nextPaginationToken?: string`

    A token to query the next page of events

### Example

```typescript
import Scenario from '@scenario-labs/sdk';

const client = new Scenario({
  apiKey: process.env['SCENARIO_SDK_API_KEY'], // This is the default and can be omitted
  apiSecret: process.env['SCENARIO_SDK_API_SECRET'], // This is the default and can be omitted
});

const events = await client.teams.webhookEndpoints.events.list('webhookEndpointId', {
  teamId: 'teamId',
});

console.log(events.items);
```

#### Response

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

## Retrieve

`client.teams.webhookEndpoints.events.retrieve(stringeventID, EventRetrieveParamsparams, RequestOptionsoptions?): EventRetrieveResponse`

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

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

### Parameters

- `eventID: string`

- `params: EventRetrieveParams`

  - `teamId: string`

    The team Id

  - `webhookEndpointId: string`

    The webhook endpoint that delivered the event

### Returns

- `EventRetrieveResponse`

  - `webhookEvent: WebhookEvent`

    - `id: string`

    - `attempts: Array<Attempt>`

      - `responseStatusCode: number`

      - `sentAt: string`

    - `createdAt: string`

    - `endpointId: string`

    - `payload: unknown`

    - `sentAt: string`

    - `status: "created" | "failed" | "retrying" | "success"`

      - `"created"`

      - `"failed"`

      - `"retrying"`

      - `"success"`

    - `type: "*" | "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"`

    - `updatedAt: string`

### Example

```typescript
import Scenario from '@scenario-labs/sdk';

const client = new Scenario({
  apiKey: process.env['SCENARIO_SDK_API_KEY'], // This is the default and can be omitted
  apiSecret: process.env['SCENARIO_SDK_API_SECRET'], // This is the default and can be omitted
});

const event = await client.teams.webhookEndpoints.events.retrieve('eventId', {
  teamId: 'teamId',
  webhookEndpointId: 'webhookEndpointId',
});

console.log(event.webhookEvent);
```

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

- `EventListResponse`

  - `items: Array<Item>`

    A list of the team webhook events

    - `id: string`

    - `endpointId: string`

    - `status: "created" | "failed" | "retrying" | "success"`

      - `"created"`

      - `"failed"`

      - `"retrying"`

      - `"success"`

    - `type: "*" | "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"`

    - `updatedAt: string`

  - `nextPaginationToken?: string`

    A token to query the next page of events

### Event Retrieve Response

- `EventRetrieveResponse`

  - `webhookEvent: WebhookEvent`

    - `id: string`

    - `attempts: Array<Attempt>`

      - `responseStatusCode: number`

      - `sentAt: string`

    - `createdAt: string`

    - `endpointId: string`

    - `payload: unknown`

    - `sentAt: string`

    - `status: "created" | "failed" | "retrying" | "success"`

      - `"created"`

      - `"failed"`

      - `"retrying"`

      - `"success"`

    - `type: "*" | "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"`

    - `updatedAt: string`
