Skip to content
Get started

Update

client.teams.update(stringteamID, TeamUpdateParams { avatarAssetId, defaultUserMaxConsumption, ipDetectionEnforcement, 3 more } body, RequestOptionsoptions?): TeamUpdateResponse { team }
PUT/teams/{teamId}

Update a particular team

ParametersExpand Collapse
teamID: string
body: TeamUpdateParams { avatarAssetId, defaultUserMaxConsumption, ipDetectionEnforcement, 3 more }
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.

One of the following:
"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.

ReturnsExpand Collapse
TeamUpdateResponse { team }
team: Team { id, context, createdAt, 11 more }

The updated team.

id: string

The team ID (example: “eyVcnFJcR92BxBkz7N6g5w”)

context: Context { invitationsCount, keysCount, userRole, usersCount }

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

One of the following:
"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

One of the following:
"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, url }
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

One of the following:
"personal"
"shared"
updatedAt: string

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

avatar?: Avatar { assetId, url }

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 { markupMultiplier, updatedAt, updatedBy }

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.

One of the following:
"active-fail-closed"
"active-fail-open"
"disabled"
qualityGateAutoDetect?: boolean

Quality Gate auto-detection default for the team.

settings?: Settings { homepage }

Team settings.

homepage?: Record<string, unknown>

Published homepage layout.

Update

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);
{
  "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"
      }
    }
  }
}
Returns Examples
{
  "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"
      }
    }
  }
}