# Teams

## Delete Invitations

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

Withdraw a user invitation on the team

### Path Parameters

- `teamId: string`

### Query Parameters

- `email: string`

  The invitation email to withdraw from the team

### Example

```http
curl https://api.cloud.scenario.com/v1/teams/$TEAM_ID/invitations \
    -X DELETE \
    -u "$SCENARIO_SDK_API_KEY:SCENARIO_SDK_API_SECRET"
```

#### Response

```json
{}
```

## List

**get** `/teams`

List the teams the user belongs to

### Returns

- `teams: array of object { id, context, createdAt, 10 more }`

  A list of the teams the user belongs to

  - `id: string`

    The team ID (example: "eyVcnFJcR92BxBkz7N6g5w")

  - `context: object { 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" or "key" or "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" or "cu-creator" or "cu-max" or 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 of object { id, createdAt, name, 4 more }`

    Projects of the team

    - `id: string`

    - `createdAt: string`

    - `name: string`

    - `updatedAt: string`

    - `avatar: optional object { assetId, url }`

      - `assetId: optional string`

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

      - `url: optional string`

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

    - `disableIpDetection: optional boolean`

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

    - `qualityGateAutoDetect: optional boolean`

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

  - `type: "personal" or "shared"`

    The team type

    - `"personal"`

    - `"shared"`

  - `updatedAt: string`

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

  - `avatar: optional object { assetId, url }`

    The team's avatar

    - `assetId: optional string`

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

    - `url: optional string`

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

  - `byok: optional object { markupMultiplier, updatedAt, updatedBy }`

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

    - `markupMultiplier: number`

    - `updatedAt: optional string`

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

    - `updatedBy: optional string`

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

  - `defaultUserMaxConsumption: optional 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: optional "active-fail-closed" or "active-fail-open" or "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: optional boolean`

    Quality Gate auto-detection default for the team.

### Example

```http
curl https://api.cloud.scenario.com/v1/teams \
    -u "$SCENARIO_SDK_API_KEY:SCENARIO_SDK_API_SECRET"
```

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

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

Get the details of a team

### Path Parameters

- `teamId: string`

### Returns

- `team: object { id, createdAt, invitations, 17 more }`

  - `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 of object { createdAt, email, role, 3 more }`

    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" or "key" or "member"`

      The role of the invited user inside the team

      - `"admin"`

      - `"key"`

      - `"member"`

    - `status: "accepted" or "expired" or "pending" or "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: optional array of string`

      The list of project IDs for which the user is invited

  - `keys: array of object { id, apiKeyId, apiKeyStatus, 11 more }`

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

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

    - `consumption: optional number`

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

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

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

    - `projects: optional array of object { projectId, role }`

      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: optional 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" or "succeeded"`

    The paymentStatus for the team

    - `"failed"`

    - `"succeeded"`

  - `plan: "cu-basic" or "cu-creator" or "cu-max" or 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 of object { id, createdAt, name, 4 more }`

    Projects of the team

    - `id: string`

    - `createdAt: string`

    - `name: string`

    - `updatedAt: string`

    - `avatar: optional object { assetId, url }`

      - `assetId: optional string`

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

      - `url: optional string`

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

    - `disableIpDetection: optional boolean`

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

    - `qualityGateAutoDetect: optional boolean`

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

  - `searchHost: string`

    The search host for the team

  - `searchIndexes: object { assets, models, workflows }`

    The search indexes for the team

    - `assets: object { private, public }`

      - `private: string`

        The private search index for the team

      - `public: string`

        The public search index for the team

    - `models: object { private, public }`

      - `private: string`

        The private search index for the team

      - `public: string`

        The public search index for the team

    - `workflows: object { private, public }`

      - `private: string`

        The private search index for the team

      - `public: string`

        The public search index for the team

  - `type: "personal" or "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 of object { id, createdAt, email, 5 more }`

    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" or "key" or "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: optional object { assetId, url }`

      The user's avatar

      - `assetId: optional string`

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

      - `url: optional string`

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

    - `consumption: optional number`

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

    - `maxConsumption: optional 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: optional object { assetId, url }`

    The team's avatar

    - `assetId: optional string`

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

    - `url: optional string`

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

  - `byok: optional object { markupMultiplier, updatedAt, updatedBy }`

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

    - `markupMultiplier: number`

    - `updatedAt: optional string`

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

    - `updatedBy: optional string`

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

  - `defaultUserMaxConsumption: optional 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: optional "active-fail-closed" or "active-fail-open" or "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: optional boolean`

    Quality Gate auto-detection default for the team.

  - `settings: optional object { homepage }`

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

    - `homepage: optional map[unknown]`

      Published homepage layout.

  - `subscriptionStatus: optional "active" or "inactive" or "paused"`

    The subscriptionStatus for the team

    - `"active"`

    - `"inactive"`

    - `"paused"`

### Example

```http
curl https://api.cloud.scenario.com/v1/teams/$TEAM_ID \
    -u "$SCENARIO_SDK_API_KEY:SCENARIO_SDK_API_SECRET"
```

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

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

Retrieve current limits for a team

### Path Parameters

- `teamId: string`

### Returns

- `limits: object { apiKeys, canvasAssetLayers, canvasAssets, 21 more }`

  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 of object { amount, createdAt, expiration, 2 more }`

  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: object { end, start }`

  The actual billing period start and end dates ISO strings

  - `end: string`

  - `start: string`

- `plan: "cu-basic" or "cu-creator" or "cu-max" or 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: object { apiKeys, canvasAssets, collections, 3 more }`

  The current value for each relevant limit in the billing period

  - `apiKeys: number`

  - `canvasAssets: number`

  - `collections: number`

  - `creativeUnits: number`

  - `projects: number`

  - `seats: number`

### Example

```http
curl https://api.cloud.scenario.com/v1/teams/$TEAM_ID/limits \
    -u "$SCENARIO_SDK_API_KEY:SCENARIO_SDK_API_SECRET"
```

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

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

Update a particular team

### Path Parameters

- `teamId: string`

### Body Parameters

- `avatarAssetId: optional string`

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

- `defaultUserMaxConsumption: optional 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: optional "active-fail-closed" or "active-fail-open" or "disabled"`

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

  - `"active-fail-closed"`

  - `"active-fail-open"`

  - `"disabled"`

- `name: optional string`

  The team name (example: "Scenario")

- `qualityGateAutoDetect: optional boolean`

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

- `settings: optional object { homepage }`

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

  - `homepage: optional unknown`

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

### Returns

- `team: object { id, context, createdAt, 11 more }`

  The updated team.

  - `id: string`

    The team ID (example: "eyVcnFJcR92BxBkz7N6g5w")

  - `context: object { 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" or "key" or "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" or "cu-creator" or "cu-max" or 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 of object { id, createdAt, name, 4 more }`

    Projects of the team

    - `id: string`

    - `createdAt: string`

    - `name: string`

    - `updatedAt: string`

    - `avatar: optional object { assetId, url }`

      - `assetId: optional string`

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

      - `url: optional string`

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

    - `disableIpDetection: optional boolean`

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

    - `qualityGateAutoDetect: optional boolean`

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

  - `type: "personal" or "shared"`

    The team type

    - `"personal"`

    - `"shared"`

  - `updatedAt: string`

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

  - `avatar: optional object { assetId, url }`

    The team's avatar

    - `assetId: optional string`

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

    - `url: optional string`

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

  - `byok: optional object { markupMultiplier, updatedAt, updatedBy }`

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

    - `markupMultiplier: number`

    - `updatedAt: optional string`

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

    - `updatedBy: optional string`

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

  - `defaultUserMaxConsumption: optional 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: optional "active-fail-closed" or "active-fail-open" or "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: optional boolean`

    Quality Gate auto-detection default for the team.

  - `settings: optional object { homepage }`

    Team settings.

    - `homepage: optional map[unknown]`

      Published homepage layout.

### Example

```http
curl https://api.cloud.scenario.com/v1/teams/$TEAM_ID \
    -X PUT \
    -H 'Content-Type: application/json' \
    -u "$SCENARIO_SDK_API_KEY:SCENARIO_SDK_API_SECRET" \
    -d '{}'
```

#### 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 object { teams }`

  - `teams: array of object { id, context, createdAt, 10 more }`

    A list of the teams the user belongs to

    - `id: string`

      The team ID (example: "eyVcnFJcR92BxBkz7N6g5w")

    - `context: object { 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" or "key" or "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" or "cu-creator" or "cu-max" or 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 of object { id, createdAt, name, 4 more }`

      Projects of the team

      - `id: string`

      - `createdAt: string`

      - `name: string`

      - `updatedAt: string`

      - `avatar: optional object { assetId, url }`

        - `assetId: optional string`

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

        - `url: optional string`

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

      - `disableIpDetection: optional boolean`

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

      - `qualityGateAutoDetect: optional boolean`

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

    - `type: "personal" or "shared"`

      The team type

      - `"personal"`

      - `"shared"`

    - `updatedAt: string`

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

    - `avatar: optional object { assetId, url }`

      The team's avatar

      - `assetId: optional string`

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

      - `url: optional string`

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

    - `byok: optional object { markupMultiplier, updatedAt, updatedBy }`

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

      - `markupMultiplier: number`

      - `updatedAt: optional string`

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

      - `updatedBy: optional string`

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

    - `defaultUserMaxConsumption: optional 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: optional "active-fail-closed" or "active-fail-open" or "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: optional boolean`

      Quality Gate auto-detection default for the team.

### Team Retrieve Response

- `TeamRetrieveResponse object { team }`

  - `team: object { id, createdAt, invitations, 17 more }`

    - `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 of object { createdAt, email, role, 3 more }`

      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" or "key" or "member"`

        The role of the invited user inside the team

        - `"admin"`

        - `"key"`

        - `"member"`

      - `status: "accepted" or "expired" or "pending" or "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: optional array of string`

        The list of project IDs for which the user is invited

    - `keys: array of object { id, apiKeyId, apiKeyStatus, 11 more }`

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

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

      - `consumption: optional number`

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

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

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

      - `projects: optional array of object { projectId, role }`

        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: optional 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" or "succeeded"`

      The paymentStatus for the team

      - `"failed"`

      - `"succeeded"`

    - `plan: "cu-basic" or "cu-creator" or "cu-max" or 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 of object { id, createdAt, name, 4 more }`

      Projects of the team

      - `id: string`

      - `createdAt: string`

      - `name: string`

      - `updatedAt: string`

      - `avatar: optional object { assetId, url }`

        - `assetId: optional string`

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

        - `url: optional string`

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

      - `disableIpDetection: optional boolean`

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

      - `qualityGateAutoDetect: optional boolean`

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

    - `searchHost: string`

      The search host for the team

    - `searchIndexes: object { assets, models, workflows }`

      The search indexes for the team

      - `assets: object { private, public }`

        - `private: string`

          The private search index for the team

        - `public: string`

          The public search index for the team

      - `models: object { private, public }`

        - `private: string`

          The private search index for the team

        - `public: string`

          The public search index for the team

      - `workflows: object { private, public }`

        - `private: string`

          The private search index for the team

        - `public: string`

          The public search index for the team

    - `type: "personal" or "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 of object { id, createdAt, email, 5 more }`

      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" or "key" or "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: optional object { assetId, url }`

        The user's avatar

        - `assetId: optional string`

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

        - `url: optional string`

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

      - `consumption: optional number`

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

      - `maxConsumption: optional 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: optional object { assetId, url }`

      The team's avatar

      - `assetId: optional string`

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

      - `url: optional string`

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

    - `byok: optional object { markupMultiplier, updatedAt, updatedBy }`

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

      - `markupMultiplier: number`

      - `updatedAt: optional string`

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

      - `updatedBy: optional string`

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

    - `defaultUserMaxConsumption: optional 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: optional "active-fail-closed" or "active-fail-open" or "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: optional boolean`

      Quality Gate auto-detection default for the team.

    - `settings: optional object { homepage }`

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

      - `homepage: optional map[unknown]`

        Published homepage layout.

    - `subscriptionStatus: optional "active" or "inactive" or "paused"`

      The subscriptionStatus for the team

      - `"active"`

      - `"inactive"`

      - `"paused"`

### Team Retrieve Limits Response

- `TeamRetrieveLimitsResponse object { limits, oneShotCreativeUnits, period, 2 more }`

  - `limits: object { apiKeys, canvasAssetLayers, canvasAssets, 21 more }`

    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 of object { amount, createdAt, expiration, 2 more }`

    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: object { end, start }`

    The actual billing period start and end dates ISO strings

    - `end: string`

    - `start: string`

  - `plan: "cu-basic" or "cu-creator" or "cu-max" or 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: object { apiKeys, canvasAssets, collections, 3 more }`

    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 object { team }`

  - `team: object { id, context, createdAt, 11 more }`

    The updated team.

    - `id: string`

      The team ID (example: "eyVcnFJcR92BxBkz7N6g5w")

    - `context: object { 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" or "key" or "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" or "cu-creator" or "cu-max" or 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 of object { id, createdAt, name, 4 more }`

      Projects of the team

      - `id: string`

      - `createdAt: string`

      - `name: string`

      - `updatedAt: string`

      - `avatar: optional object { assetId, url }`

        - `assetId: optional string`

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

        - `url: optional string`

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

      - `disableIpDetection: optional boolean`

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

      - `qualityGateAutoDetect: optional boolean`

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

    - `type: "personal" or "shared"`

      The team type

      - `"personal"`

      - `"shared"`

    - `updatedAt: string`

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

    - `avatar: optional object { assetId, url }`

      The team's avatar

      - `assetId: optional string`

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

      - `url: optional string`

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

    - `byok: optional object { markupMultiplier, updatedAt, updatedBy }`

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

      - `markupMultiplier: number`

      - `updatedAt: optional string`

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

      - `updatedBy: optional string`

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

    - `defaultUserMaxConsumption: optional 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: optional "active-fail-closed" or "active-fail-open" or "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: optional boolean`

      Quality Gate auto-detection default for the team.

    - `settings: optional object { homepage }`

      Team settings.

      - `homepage: optional map[unknown]`

        Published homepage layout.

# Brief

## Delete

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

Delete the team's Quality Gate brief

### Path Parameters

- `teamId: string`

### Returns

- `deleted: boolean`

### Example

```http
curl https://api.cloud.scenario.com/v1/teams/$TEAM_ID/brief \
    -X DELETE \
    -u "$SCENARIO_SDK_API_KEY:SCENARIO_SDK_API_SECRET"
```

#### Response

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

## Retrieve

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

Get the team's Quality Gate brief

### Path Parameters

- `teamId: string`

### Returns

- `brief: object { id, body, createdAt, 7 more }`

  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" or "team"`

    Scope this brief applies to: team or project

    - `"project"`

    - `"team"`

  - `referenceAssetIds: array of 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: optional "high" or "low" or "medium"`

    Threshold strictness applied when verifying against this scope

    - `"high"`

    - `"low"`

    - `"medium"`

### Example

```http
curl https://api.cloud.scenario.com/v1/teams/$TEAM_ID/brief \
    -u "$SCENARIO_SDK_API_KEY:SCENARIO_SDK_API_SECRET"
```

#### Response

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

## Update

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

Create or update the team's Quality Gate brief

### Path Parameters

- `teamId: string`

### Body Parameters

- `body: string`

  Free-text brief content

- `enabled: optional boolean`

  Whether the brief is applied during verification (default true)

- `referenceAssetIds: optional array of string`

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

- `sensitivity: optional "high" or "low" or "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

- `brief: object { id, body, createdAt, 7 more }`

  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" or "team"`

    Scope this brief applies to: team or project

    - `"project"`

    - `"team"`

  - `referenceAssetIds: array of 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: optional "high" or "low" or "medium"`

    Threshold strictness applied when verifying against this scope

    - `"high"`

    - `"low"`

    - `"medium"`

### Example

```http
curl https://api.cloud.scenario.com/v1/teams/$TEAM_ID/brief \
    -X PUT \
    -H 'Content-Type: application/json' \
    -u "$SCENARIO_SDK_API_KEY:SCENARIO_SDK_API_SECRET" \
    -d '{
          "body": "x"
        }'
```

#### 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 object { deleted }`

  - `deleted: boolean`

### Brief Retrieve Response

- `BriefRetrieveResponse object { brief }`

  - `brief: object { id, body, createdAt, 7 more }`

    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" or "team"`

      Scope this brief applies to: team or project

      - `"project"`

      - `"team"`

    - `referenceAssetIds: array of 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: optional "high" or "low" or "medium"`

      Threshold strictness applied when verifying against this scope

      - `"high"`

      - `"low"`

      - `"medium"`

### Brief Update Response

- `BriefUpdateResponse object { brief }`

  - `brief: object { id, body, createdAt, 7 more }`

    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" or "team"`

      Scope this brief applies to: team or project

      - `"project"`

      - `"team"`

    - `referenceAssetIds: array of 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: optional "high" or "low" or "medium"`

      Threshold strictness applied when verifying against this scope

      - `"high"`

      - `"low"`

      - `"medium"`

# IP Filters

## Create

**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})

### Path Parameters

- `teamId: string`

### Body Parameters

- `category: "artist-style" or "brand-trademark" or "celebrity-likeness" or 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: optional boolean`

  Whether the filter is active

- `instruction: optional string`

  Natural-language detection instruction (required for custom filters)

- `sourceAssetIds: optional array of string`

  Optional reference assets used only to generate the instruction

### Returns

- `filter: unknown`

  The created custom filter, including its enabled state

### Example

```http
curl https://api.cloud.scenario.com/v1/teams/$TEAM_ID/ip-filters \
    -H 'Content-Type: application/json' \
    -u "$SCENARIO_SDK_API_KEY:SCENARIO_SDK_API_SECRET" \
    -d '{
          "category": "artist-style",
          "name": "name"
        }'
```

#### Response

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

## Delete

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

Delete a custom IP-detection filter for a team

### Path Parameters

- `teamId: string`

- `filterId: string`

### Returns

- `deleted: boolean`

  True when the filter was deleted

### Example

```http
curl https://api.cloud.scenario.com/v1/teams/$TEAM_ID/ip-filters/$FILTER_ID \
    -X DELETE \
    -u "$SCENARIO_SDK_API_KEY:SCENARIO_SDK_API_SECRET"
```

#### Response

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

## Draft Instruction

**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)

### Path Parameters

- `teamId: string`

### Body Parameters

- `assetIds: array of string`

  Reference assets whose imagery seeds the drafted detection instruction

### Returns

- `instruction: string`

  Drafted natural-language detection instruction derived from the reference assets

### Example

```http
curl https://api.cloud.scenario.com/v1/teams/$TEAM_ID/ip-filters/draft-instruction \
    -H 'Content-Type: application/json' \
    -u "$SCENARIO_SDK_API_KEY:SCENARIO_SDK_API_SECRET" \
    -d '{
          "assetIds": [
            "string"
          ]
        }'
```

#### Response

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

## List

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

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

### Path Parameters

- `teamId: string`

### Returns

- `filters: array of unknown`

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

### Example

```http
curl https://api.cloud.scenario.com/v1/teams/$TEAM_ID/ip-filters \
    -u "$SCENARIO_SDK_API_KEY:SCENARIO_SDK_API_SECRET"
```

#### Response

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

## Update

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

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

### Path Parameters

- `teamId: string`

- `filterId: string`

### Body Parameters

- `enabled: optional boolean`

  Whether the filter is active

- `instruction: optional string`

  Natural-language detection instruction

- `name: optional string`

  Display name for the filter

### Returns

- `filter: unknown`

  The updated filter, including its enabled state

### Example

```http
curl https://api.cloud.scenario.com/v1/teams/$TEAM_ID/ip-filters/$FILTER_ID \
    -X PUT \
    -H 'Content-Type: application/json' \
    -u "$SCENARIO_SDK_API_KEY:SCENARIO_SDK_API_SECRET" \
    -d '{}'
```

#### Response

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

## Domain Types

### IP Filter Create Response

- `IPFilterCreateResponse object { filter }`

  - `filter: unknown`

    The created custom filter, including its enabled state

### IP Filter Delete Response

- `IPFilterDeleteResponse object { deleted }`

  - `deleted: boolean`

    True when the filter was deleted

### IP Filter Draft Instruction Response

- `IPFilterDraftInstructionResponse object { instruction }`

  - `instruction: string`

    Drafted natural-language detection instruction derived from the reference assets

### IP Filter List Response

- `IPFilterListResponse object { filters }`

  - `filters: array of unknown`

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

### IP Filter Update Response

- `IPFilterUpdateResponse object { filter }`

  - `filter: unknown`

    The updated filter, including its enabled state

# Members

## Create

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

Add a member to the team

### Path Parameters

- `teamId: string`

### Body Parameters

- `email: string`

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

- `projectIds: optional array of string`

  The project IDs for which the user is invited

- `role: optional "admin" or "member"`

  The role you want to give the user

  - `"admin"`

  - `"member"`

### Returns

- `team: object { id, context, createdAt, 10 more }`

  - `id: string`

    The team ID (example: "eyVcnFJcR92BxBkz7N6g5w")

  - `context: object { 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" or "key" or "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" or "cu-creator" or "cu-max" or 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 of object { id, createdAt, name, 4 more }`

    Projects of the team

    - `id: string`

    - `createdAt: string`

    - `name: string`

    - `updatedAt: string`

    - `avatar: optional object { assetId, url }`

      - `assetId: optional string`

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

      - `url: optional string`

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

    - `disableIpDetection: optional boolean`

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

    - `qualityGateAutoDetect: optional boolean`

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

  - `type: "personal" or "shared"`

    The team type

    - `"personal"`

    - `"shared"`

  - `updatedAt: string`

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

  - `avatar: optional object { assetId, url }`

    The team's avatar

    - `assetId: optional string`

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

    - `url: optional string`

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

  - `byok: optional object { markupMultiplier, updatedAt, updatedBy }`

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

    - `markupMultiplier: number`

    - `updatedAt: optional string`

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

    - `updatedBy: optional string`

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

  - `defaultUserMaxConsumption: optional 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: optional "active-fail-closed" or "active-fail-open" or "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: optional boolean`

    Quality Gate auto-detection default for the team.

### Example

```http
curl https://api.cloud.scenario.com/v1/teams/$TEAM_ID/members \
    -H 'Content-Type: application/json' \
    -u "$SCENARIO_SDK_API_KEY:SCENARIO_SDK_API_SECRET" \
    -d '{
          "email": "email"
        }'
```

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

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

Remove a member from the team

### Path Parameters

- `teamId: string`

- `memberId: string`

### Example

```http
curl https://api.cloud.scenario.com/v1/teams/$TEAM_ID/members/$MEMBER_ID \
    -X DELETE \
    -u "$SCENARIO_SDK_API_KEY:SCENARIO_SDK_API_SECRET"
```

#### Response

```json
{}
```

## Update

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

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

### Path Parameters

- `teamId: string`

- `memberId: string`

### Body Parameters

- `maxConsumption: optional number`

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

- `role: optional string`

  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.

### Example

```http
curl https://api.cloud.scenario.com/v1/teams/$TEAM_ID/members/$MEMBER_ID \
    -X PUT \
    -H 'Content-Type: application/json' \
    -u "$SCENARIO_SDK_API_KEY:SCENARIO_SDK_API_SECRET" \
    -d '{}'
```

#### Response

```json
{}
```

## Domain Types

### Member Create Response

- `MemberCreateResponse object { team }`

  - `team: object { id, context, createdAt, 10 more }`

    - `id: string`

      The team ID (example: "eyVcnFJcR92BxBkz7N6g5w")

    - `context: object { 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" or "key" or "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" or "cu-creator" or "cu-max" or 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 of object { id, createdAt, name, 4 more }`

      Projects of the team

      - `id: string`

      - `createdAt: string`

      - `name: string`

      - `updatedAt: string`

      - `avatar: optional object { assetId, url }`

        - `assetId: optional string`

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

        - `url: optional string`

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

      - `disableIpDetection: optional boolean`

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

      - `qualityGateAutoDetect: optional boolean`

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

    - `type: "personal" or "shared"`

      The team type

      - `"personal"`

      - `"shared"`

    - `updatedAt: string`

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

    - `avatar: optional object { assetId, url }`

      The team's avatar

      - `assetId: optional string`

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

      - `url: optional string`

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

    - `byok: optional object { markupMultiplier, updatedAt, updatedBy }`

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

      - `markupMultiplier: number`

      - `updatedAt: optional string`

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

      - `updatedBy: optional string`

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

    - `defaultUserMaxConsumption: optional 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: optional "active-fail-closed" or "active-fail-open" or "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: optional boolean`

      Quality Gate auto-detection default for the team.

### Member Delete Response

- `MemberDeleteResponse = unknown`

### Member Update Response

- `MemberUpdateResponse = unknown`

# Watermark

## Delete

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

Delete the team's forced watermark configuration

### Path Parameters

- `teamId: string`

### Returns

- `deleted: boolean`

### Example

```http
curl https://api.cloud.scenario.com/v1/teams/$TEAM_ID/watermark \
    -X DELETE \
    -u "$SCENARIO_SDK_API_KEY:SCENARIO_SDK_API_SECRET"
```

#### Response

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

## Delete Logo

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

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

### Path Parameters

- `teamId: string`

### Returns

- `watermark: object { id, createdAt, createdBy, 14 more }`

  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" or "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" or "bottom-right" or "center" or 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: optional string`

    Set when the configuration has been deleted.

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

    Where the uploaded logo lives, when one is set.

  - `text: optional string`

    Text rendered as the mark, when no logo is set

### Example

```http
curl https://api.cloud.scenario.com/v1/teams/$TEAM_ID/watermark/logo \
    -X DELETE \
    -u "$SCENARIO_SDK_API_KEY:SCENARIO_SDK_API_SECRET"
```

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

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

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

### Path Parameters

- `teamId: string`

### Body Parameters

- `opacity: optional number`

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

- `placement: optional "bottom-left" or "bottom-right" or "center" or 3 more`

  Where the mark sits on the image

  - `"bottom-left"`

  - `"bottom-right"`

  - `"center"`

  - `"tiled"`

  - `"top-left"`

  - `"top-right"`

- `rotation: optional number`

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

- `scale: optional number`

  Mark width as a fraction of the image width

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

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

### Returns

- `image: string`

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

### Example

```http
curl https://api.cloud.scenario.com/v1/teams/$TEAM_ID/watermark/preview \
    -H 'Content-Type: application/json' \
    -u "$SCENARIO_SDK_API_KEY:SCENARIO_SDK_API_SECRET" \
    -d '{}'
```

#### Response

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

## Retrieve

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

Get the team's forced watermark configuration

### Path Parameters

- `teamId: string`

### Returns

- `watermark: object { id, createdAt, createdBy, 14 more }`

  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" or "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" or "bottom-right" or "center" or 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: optional string`

    Set when the configuration has been deleted.

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

    Where the uploaded logo lives, when one is set.

  - `text: optional string`

    Text rendered as the mark, when no logo is set

### Example

```http
curl https://api.cloud.scenario.com/v1/teams/$TEAM_ID/watermark \
    -u "$SCENARIO_SDK_API_KEY:SCENARIO_SDK_API_SECRET"
```

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

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

Create or update the team's forced watermark configuration

### Path Parameters

- `teamId: string`

### Body Parameters

- `enabled: boolean`

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

- `opacity: optional number`

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

- `placement: optional "bottom-left" or "bottom-right" or "center" or 3 more`

  Where the mark sits on the image

  - `"bottom-left"`

  - `"bottom-right"`

  - `"center"`

  - `"tiled"`

  - `"top-left"`

  - `"top-right"`

- `rotation: optional number`

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

- `scale: optional number`

  Mark width as a fraction of the image width

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

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

### Returns

- `watermark: object { id, createdAt, createdBy, 14 more }`

  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" or "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" or "bottom-right" or "center" or 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: optional string`

    Set when the configuration has been deleted.

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

    Where the uploaded logo lives, when one is set.

  - `text: optional string`

    Text rendered as the mark, when no logo is set

### Example

```http
curl https://api.cloud.scenario.com/v1/teams/$TEAM_ID/watermark \
    -X PUT \
    -H 'Content-Type: application/json' \
    -u "$SCENARIO_SDK_API_KEY:SCENARIO_SDK_API_SECRET" \
    -d '{
          "enabled": true
        }'
```

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

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

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

### Path Parameters

- `teamId: string`

### Body Parameters

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

- `watermark: object { id, createdAt, createdBy, 14 more }`

  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" or "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" or "bottom-right" or "center" or 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: optional string`

    Set when the configuration has been deleted.

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

    Where the uploaded logo lives, when one is set.

  - `text: optional string`

    Text rendered as the mark, when no logo is set

### Example

```http
curl https://api.cloud.scenario.com/v1/teams/$TEAM_ID/watermark/logo \
    -X PUT \
    -H 'Content-Type: application/json' \
    -u "$SCENARIO_SDK_API_KEY:SCENARIO_SDK_API_SECRET" \
    -d '{
          "logo": "logo"
        }'
```

#### 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 object { deleted }`

  - `deleted: boolean`

### Watermark Delete Logo Response

- `WatermarkDeleteLogoResponse object { watermark }`

  - `watermark: object { id, createdAt, createdBy, 14 more }`

    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" or "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" or "bottom-right" or "center" or 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: optional string`

      Set when the configuration has been deleted.

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

      Where the uploaded logo lives, when one is set.

    - `text: optional string`

      Text rendered as the mark, when no logo is set

### Watermark Preview Response

- `WatermarkPreviewResponse object { image }`

  Response of the watermark preview routes.

  - `image: string`

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

### Watermark Retrieve Response

- `WatermarkRetrieveResponse object { watermark }`

  - `watermark: object { id, createdAt, createdBy, 14 more }`

    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" or "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" or "bottom-right" or "center" or 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: optional string`

      Set when the configuration has been deleted.

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

      Where the uploaded logo lives, when one is set.

    - `text: optional string`

      Text rendered as the mark, when no logo is set

### Watermark Update Response

- `WatermarkUpdateResponse object { watermark }`

  - `watermark: object { id, createdAt, createdBy, 14 more }`

    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" or "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" or "bottom-right" or "center" or 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: optional string`

      Set when the configuration has been deleted.

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

      Where the uploaded logo lives, when one is set.

    - `text: optional string`

      Text rendered as the mark, when no logo is set

### Watermark Update Logo Response

- `WatermarkUpdateLogoResponse object { watermark }`

  - `watermark: object { id, createdAt, createdBy, 14 more }`

    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" or "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" or "bottom-right" or "center" or 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: optional string`

      Set when the configuration has been deleted.

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

      Where the uploaded logo lives, when one is set.

    - `text: optional string`

      Text rendered as the mark, when no logo is set

# Webhook Endpoints

## Create

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

### Path Parameters

- `teamId: string`

### Body Parameters

- `enabledEvents: array of "*" or "asset.download.completed" or "asset.download.created" or 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: optional string`

  A description of the webhook endpoint

### Returns

- `webhookEndpoint: object { id, createdAt, enabled, 9 more }`

  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 of "*" or "asset.download.completed" or "asset.download.created" or 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" or "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: optional string`

    A description of the webhook endpoint

### Example

```http
curl https://api.cloud.scenario.com/v1/teams/$TEAM_ID/webhook-endpoints \
    -H 'Content-Type: application/json' \
    -u "$SCENARIO_SDK_API_KEY:SCENARIO_SDK_API_SECRET" \
    -d '{
          "enabledEvents": [
            "*"
          ],
          "url": "url"
        }'
```

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

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

Delete a particular webhook endpoint by its Id

### Path Parameters

- `teamId: string`

- `webhookEndpointId: string`

### Example

```http
curl https://api.cloud.scenario.com/v1/teams/$TEAM_ID/webhook-endpoints/$WEBHOOK_ENDPOINT_ID \
    -X DELETE \
    -u "$SCENARIO_SDK_API_KEY:SCENARIO_SDK_API_SECRET"
```

#### Response

```json
{}
```

## List

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

List the team's webhook endpoints

### Path Parameters

- `teamId: string`

### Returns

- `webhookEndpoints: array of object { id, createdAt, enabled, 8 more }`

  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 of "*" or "asset.download.completed" or "asset.download.created" or 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" or "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: optional string`

    A description of the webhook endpoint

### Example

```http
curl https://api.cloud.scenario.com/v1/teams/$TEAM_ID/webhook-endpoints \
    -u "$SCENARIO_SDK_API_KEY:SCENARIO_SDK_API_SECRET"
```

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

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

Update a particular webhook endpoint for a team

### Path Parameters

- `teamId: string`

- `webhookEndpointId: string`

### Body Parameters

- `description: optional string`

  A description of the webhook endpoint

- `enabled: optional boolean`

  Whether the webhook is enabled

- `enabledEvents: optional array of "*" or "asset.download.completed" or "asset.download.created" or 16 more`

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

  - `"*"`

  - `"asset.download.completed"`

  - `"asset.download.created"`

  - `"asset.download.failed"`

  - `"generation.completed"`

  - `"generation.created"`

  - `"generation.failed"`

  - `"inference.cancelled"`

  - `"inference.completed"`

  - `"inference.created"`

  - `"inference.failed"`

  - `"model.download.completed"`

  - `"model.download.created"`

  - `"model.download.failed"`

  - `"model.training.cancelled"`

  - `"model.training.completed"`

  - `"model.training.failed"`

  - `"model.training.started"`

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

- `url: optional string`

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

### Returns

- `webhookEndpoint: object { id, createdAt, enabled, 8 more }`

  - `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 of "*" or "asset.download.completed" or "asset.download.created" or 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" or "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: optional string`

    A description of the webhook endpoint

### Example

```http
curl https://api.cloud.scenario.com/v1/teams/$TEAM_ID/webhook-endpoints/$WEBHOOK_ENDPOINT_ID \
    -X PUT \
    -H 'Content-Type: application/json' \
    -u "$SCENARIO_SDK_API_KEY:SCENARIO_SDK_API_SECRET" \
    -d '{}'
```

#### 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 object { webhookEndpoint }`

  - `webhookEndpoint: object { id, createdAt, enabled, 9 more }`

    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 of "*" or "asset.download.completed" or "asset.download.created" or 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" or "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: optional string`

      A description of the webhook endpoint

### Webhook Endpoint Delete Response

- `WebhookEndpointDeleteResponse = unknown`

### Webhook Endpoint List Response

- `WebhookEndpointListResponse object { webhookEndpoints }`

  - `webhookEndpoints: array of object { id, createdAt, enabled, 8 more }`

    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 of "*" or "asset.download.completed" or "asset.download.created" or 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" or "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: optional string`

      A description of the webhook endpoint

### Webhook Endpoint Update Response

- `WebhookEndpointUpdateResponse object { webhookEndpoint }`

  - `webhookEndpoint: object { id, createdAt, enabled, 8 more }`

    - `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 of "*" or "asset.download.completed" or "asset.download.created" or 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" or "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: optional string`

      A description of the webhook endpoint

# Events

## List

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

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

### Path Parameters

- `teamId: string`

- `webhookEndpointId: string`

### Query Parameters

- `paginationToken: optional string`

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

### Returns

- `items: array of object { id, endpointId, status, 2 more }`

  A list of the team webhook events

  - `id: string`

  - `endpointId: string`

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

    - `"created"`

    - `"failed"`

    - `"retrying"`

    - `"success"`

  - `type: "*" or "asset.download.completed" or "asset.download.created" or 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: optional string`

  A token to query the next page of events

### Example

```http
curl https://api.cloud.scenario.com/v1/teams/$TEAM_ID/webhook-endpoints/$WEBHOOK_ENDPOINT_ID/events \
    -u "$SCENARIO_SDK_API_KEY:SCENARIO_SDK_API_SECRET"
```

#### Response

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

## Retrieve

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

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

### Path Parameters

- `teamId: string`

- `webhookEndpointId: string`

- `eventId: string`

### Returns

- `webhookEvent: object { id, attempts, createdAt, 6 more }`

  - `id: string`

  - `attempts: array of object { responseStatusCode, sentAt }`

    - `responseStatusCode: number`

    - `sentAt: string`

  - `createdAt: string`

  - `endpointId: string`

  - `payload: unknown`

  - `sentAt: string`

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

    - `"created"`

    - `"failed"`

    - `"retrying"`

    - `"success"`

  - `type: "*" or "asset.download.completed" or "asset.download.created" or 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

```http
curl https://api.cloud.scenario.com/v1/teams/$TEAM_ID/webhook-endpoints/$WEBHOOK_ENDPOINT_ID/events/$EVENT_ID \
    -u "$SCENARIO_SDK_API_KEY:SCENARIO_SDK_API_SECRET"
```

#### 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 object { items, nextPaginationToken }`

  - `items: array of object { id, endpointId, status, 2 more }`

    A list of the team webhook events

    - `id: string`

    - `endpointId: string`

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

      - `"created"`

      - `"failed"`

      - `"retrying"`

      - `"success"`

    - `type: "*" or "asset.download.completed" or "asset.download.created" or 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: optional string`

    A token to query the next page of events

### Event Retrieve Response

- `EventRetrieveResponse object { webhookEvent }`

  - `webhookEvent: object { id, attempts, createdAt, 6 more }`

    - `id: string`

    - `attempts: array of object { responseStatusCode, sentAt }`

      - `responseStatusCode: number`

      - `sentAt: string`

    - `createdAt: string`

    - `endpointId: string`

    - `payload: unknown`

    - `sentAt: string`

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

      - `"created"`

      - `"failed"`

      - `"retrying"`

      - `"success"`

    - `type: "*" or "asset.download.completed" or "asset.download.created" or 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`
