# Projects

## Create

**post** `/projects`

Create a new project

### Query Parameters

- `teamId: optional string`

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

### Body Parameters

- `name: string`

  The name of the project.

- `autoJoin: optional boolean`

  Whether to automatically join the project as admin.

- `privacyMode: optional boolean`

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

### Returns

- `project: object { id, createdAt, keys, 13 more }`

  - `id: string`

    The project ID (example: "project_eyVcnFJcR92BxBkz7N6g5w")

  - `createdAt: string`

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

    The keys of the project (get from the ProjectRoles table)

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

    - `role: string`

      A project role value. Accepted values are:

      - a built-in role: `"admin"`, `"editor"` or `"reader"` (see `ProjectRoles`);
      - a custom inline role: a `;`-separated scope list, e.g.
        `"assets.write;workflows.run"`.

      Resolved to capabilities by `ProjectRole.scopesFromRole()`.

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

  - `name: string`

    The project name (example: "Default Project")

  - `privacyMode: boolean`

    Whether the project is privacyMode
    In a privacyMode project, users can only see their own generated assets (except admins)

  - `teamId: string`

    The team ID (example: "team_eyVcnFJcR92BxBkz7N6g5w")

  - `updatedAt: string`

  - `users: array of object { id, createdAt, email, 5 more }`

    The users of the project (get from the ProjectRoles table)

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

      A project role value. Accepted values are:

      - a built-in role: `"admin"`, `"editor"` or `"reader"` (see `ProjectRoles`);
      - a custom inline role: a `;`-separated scope list, e.g.
        `"assets.write;workflows.run"`.

      Resolved to capabilities by `ProjectRole.scopesFromRole()`.

    - `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 project'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 project over the current billing period.

  - `description: optional string`

    High-level markdown description of the project
    Only returned on single project GET, not on list

  - `descriptionDate: optional string`

    ISO string date when the description was last updated
    Only returned on single project GET, not on list

  - `disableIpDetection: optional boolean`

    When true, IP detection is switched off for this project even if the team
    has an active posture. Absent means the team posture applies.
    The posture itself (disabled / active-fail-open / active-fail-closed) is a
    team-level setting, see the team's ipDetectionEnforcement.

  - `maxConsumption: optional number`

    The project's consumption (CU) cap for the period. Absent when uncapped.

  - `qualityGateAutoDetect: optional boolean`

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

  - `settings: optional object { homepage }`

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

    - `homepage: optional map[unknown]`

      Published homepage layout.

### Example

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

#### Response

```json
{
  "project": {
    "id": "id",
    "createdAt": "createdAt",
    "keys": [
      {
        "id": "id",
        "apiKeyId": "apiKeyId",
        "apiKeyStatus": "active",
        "createdAt": "createdAt",
        "name": "name",
        "role": "role",
        "scope": "project",
        "updatedAt": "updatedAt",
        "authorId": "authorId",
        "consumption": 0,
        "lastUsedAt": "lastUsedAt",
        "maxConsumption": 0,
        "ownerId": "ownerId",
        "projects": [
          {
            "projectId": "projectId",
            "role": "role"
          }
        ]
      }
    ],
    "name": "name",
    "privacyMode": true,
    "teamId": "teamId",
    "updatedAt": "updatedAt",
    "users": [
      {
        "id": "id",
        "createdAt": "createdAt",
        "email": "email",
        "role": "role",
        "updatedAt": "updatedAt",
        "avatar": {
          "assetId": "assetId",
          "url": "url"
        },
        "consumption": 0,
        "maxConsumption": 0
      }
    ],
    "avatar": {
      "assetId": "assetId",
      "url": "url"
    },
    "consumption": 0,
    "description": "description",
    "descriptionDate": "descriptionDate",
    "disableIpDetection": true,
    "maxConsumption": 0,
    "qualityGateAutoDetect": true,
    "settings": {
      "homepage": {
        "foo": "bar"
      }
    }
  }
}
```

## Delete

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

Delete a particular project

### Path Parameters

- `projectId: string`

### Example

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

#### Response

```json
{}
```

## List

**get** `/projects`

List projects of a team

### Query Parameters

- `pageSize: optional number`

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

- `paginationToken: optional string`

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

- `teamId: optional string`

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

### Returns

- `projects: array of object { id, createdAt, keys, 13 more }`

  - `id: string`

    The project ID (example: "project_eyVcnFJcR92BxBkz7N6g5w")

  - `createdAt: string`

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

    The keys of the project (get from the ProjectRoles table)

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

    - `role: string`

      A project role value. Accepted values are:

      - a built-in role: `"admin"`, `"editor"` or `"reader"` (see `ProjectRoles`);
      - a custom inline role: a `;`-separated scope list, e.g.
        `"assets.write;workflows.run"`.

      Resolved to capabilities by `ProjectRole.scopesFromRole()`.

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

  - `name: string`

    The project name (example: "Default Project")

  - `privacyMode: boolean`

    Whether the project is privacyMode
    In a privacyMode project, users can only see their own generated assets (except admins)

  - `teamId: string`

    The team ID (example: "team_eyVcnFJcR92BxBkz7N6g5w")

  - `updatedAt: string`

  - `users: array of object { id, createdAt, email, 5 more }`

    The users of the project (get from the ProjectRoles table)

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

      A project role value. Accepted values are:

      - a built-in role: `"admin"`, `"editor"` or `"reader"` (see `ProjectRoles`);
      - a custom inline role: a `;`-separated scope list, e.g.
        `"assets.write;workflows.run"`.

      Resolved to capabilities by `ProjectRole.scopesFromRole()`.

    - `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 project'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 project over the current billing period.

  - `description: optional string`

    High-level markdown description of the project
    Only returned on single project GET, not on list

  - `descriptionDate: optional string`

    ISO string date when the description was last updated
    Only returned on single project GET, not on list

  - `disableIpDetection: optional boolean`

    When true, IP detection is switched off for this project even if the team
    has an active posture. Absent means the team posture applies.
    The posture itself (disabled / active-fail-open / active-fail-closed) is a
    team-level setting, see the team's ipDetectionEnforcement.

  - `maxConsumption: optional number`

    The project's consumption (CU) cap for the period. Absent when uncapped.

  - `qualityGateAutoDetect: optional boolean`

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

  - `settings: optional object { homepage }`

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

    - `homepage: optional map[unknown]`

      Published homepage layout.

- `nextPaginationToken: optional string`

  A token to query the next page of projects

### Example

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

#### Response

```json
{
  "projects": [
    {
      "id": "id",
      "createdAt": "createdAt",
      "keys": [
        {
          "id": "id",
          "apiKeyId": "apiKeyId",
          "apiKeyStatus": "active",
          "createdAt": "createdAt",
          "name": "name",
          "role": "role",
          "scope": "project",
          "updatedAt": "updatedAt",
          "authorId": "authorId",
          "consumption": 0,
          "lastUsedAt": "lastUsedAt",
          "maxConsumption": 0,
          "ownerId": "ownerId",
          "projects": [
            {
              "projectId": "projectId",
              "role": "role"
            }
          ]
        }
      ],
      "name": "name",
      "privacyMode": true,
      "teamId": "teamId",
      "updatedAt": "updatedAt",
      "users": [
        {
          "id": "id",
          "createdAt": "createdAt",
          "email": "email",
          "role": "role",
          "updatedAt": "updatedAt",
          "avatar": {
            "assetId": "assetId",
            "url": "url"
          },
          "consumption": 0,
          "maxConsumption": 0
        }
      ],
      "avatar": {
        "assetId": "assetId",
        "url": "url"
      },
      "consumption": 0,
      "description": "description",
      "descriptionDate": "descriptionDate",
      "disableIpDetection": true,
      "maxConsumption": 0,
      "qualityGateAutoDetect": true,
      "settings": {
        "homepage": {
          "foo": "bar"
        }
      }
    }
  ],
  "nextPaginationToken": "nextPaginationToken"
}
```

## Retrieve

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

Get a project by projectId

### Path Parameters

- `projectId: string`

### Returns

- `project: object { id, createdAt, keys, 13 more }`

  - `id: string`

    The project ID (example: "project_eyVcnFJcR92BxBkz7N6g5w")

  - `createdAt: string`

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

    The keys of the project (get from the ProjectRoles table)

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

    - `role: string`

      A project role value. Accepted values are:

      - a built-in role: `"admin"`, `"editor"` or `"reader"` (see `ProjectRoles`);
      - a custom inline role: a `;`-separated scope list, e.g.
        `"assets.write;workflows.run"`.

      Resolved to capabilities by `ProjectRole.scopesFromRole()`.

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

  - `name: string`

    The project name (example: "Default Project")

  - `privacyMode: boolean`

    Whether the project is privacyMode
    In a privacyMode project, users can only see their own generated assets (except admins)

  - `teamId: string`

    The team ID (example: "team_eyVcnFJcR92BxBkz7N6g5w")

  - `updatedAt: string`

  - `users: array of object { id, createdAt, email, 5 more }`

    The users of the project (get from the ProjectRoles table)

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

      A project role value. Accepted values are:

      - a built-in role: `"admin"`, `"editor"` or `"reader"` (see `ProjectRoles`);
      - a custom inline role: a `;`-separated scope list, e.g.
        `"assets.write;workflows.run"`.

      Resolved to capabilities by `ProjectRole.scopesFromRole()`.

    - `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 project'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 project over the current billing period.

  - `description: optional string`

    High-level markdown description of the project
    Only returned on single project GET, not on list

  - `descriptionDate: optional string`

    ISO string date when the description was last updated
    Only returned on single project GET, not on list

  - `disableIpDetection: optional boolean`

    When true, IP detection is switched off for this project even if the team
    has an active posture. Absent means the team posture applies.
    The posture itself (disabled / active-fail-open / active-fail-closed) is a
    team-level setting, see the team's ipDetectionEnforcement.

  - `maxConsumption: optional number`

    The project's consumption (CU) cap for the period. Absent when uncapped.

  - `qualityGateAutoDetect: optional boolean`

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

  - `settings: optional object { homepage }`

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

    - `homepage: optional map[unknown]`

      Published homepage layout.

### Example

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

#### Response

```json
{
  "project": {
    "id": "id",
    "createdAt": "createdAt",
    "keys": [
      {
        "id": "id",
        "apiKeyId": "apiKeyId",
        "apiKeyStatus": "active",
        "createdAt": "createdAt",
        "name": "name",
        "role": "role",
        "scope": "project",
        "updatedAt": "updatedAt",
        "authorId": "authorId",
        "consumption": 0,
        "lastUsedAt": "lastUsedAt",
        "maxConsumption": 0,
        "ownerId": "ownerId",
        "projects": [
          {
            "projectId": "projectId",
            "role": "role"
          }
        ]
      }
    ],
    "name": "name",
    "privacyMode": true,
    "teamId": "teamId",
    "updatedAt": "updatedAt",
    "users": [
      {
        "id": "id",
        "createdAt": "createdAt",
        "email": "email",
        "role": "role",
        "updatedAt": "updatedAt",
        "avatar": {
          "assetId": "assetId",
          "url": "url"
        },
        "consumption": 0,
        "maxConsumption": 0
      }
    ],
    "avatar": {
      "assetId": "assetId",
      "url": "url"
    },
    "consumption": 0,
    "description": "description",
    "descriptionDate": "descriptionDate",
    "disableIpDetection": true,
    "maxConsumption": 0,
    "qualityGateAutoDetect": true,
    "settings": {
      "homepage": {
        "foo": "bar"
      }
    }
  }
}
```

## Update

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

Update the name of a Project

### Path Parameters

- `projectId: string`

### Body Parameters

- `avatarAssetId: optional string`

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

- `description: optional string`

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

- `disableIpDetection: optional boolean`

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

- `maxConsumption: optional number`

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

- `name: optional string`

  The project name (example: "Default Project")

- `privacyMode: optional boolean`

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

- `qualityGateAutoDetect: optional boolean`

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

- `settings: optional object { homepage }`

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

  - `homepage: optional unknown`

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

### Returns

- `project: object { id, createdAt, keys, 13 more }`

  - `id: string`

    The project ID (example: "project_eyVcnFJcR92BxBkz7N6g5w")

  - `createdAt: string`

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

    The keys of the project (get from the ProjectRoles table)

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

    - `role: string`

      A project role value. Accepted values are:

      - a built-in role: `"admin"`, `"editor"` or `"reader"` (see `ProjectRoles`);
      - a custom inline role: a `;`-separated scope list, e.g.
        `"assets.write;workflows.run"`.

      Resolved to capabilities by `ProjectRole.scopesFromRole()`.

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

  - `name: string`

    The project name (example: "Default Project")

  - `privacyMode: boolean`

    Whether the project is privacyMode
    In a privacyMode project, users can only see their own generated assets (except admins)

  - `teamId: string`

    The team ID (example: "team_eyVcnFJcR92BxBkz7N6g5w")

  - `updatedAt: string`

  - `users: array of object { id, createdAt, email, 5 more }`

    The users of the project (get from the ProjectRoles table)

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

      A project role value. Accepted values are:

      - a built-in role: `"admin"`, `"editor"` or `"reader"` (see `ProjectRoles`);
      - a custom inline role: a `;`-separated scope list, e.g.
        `"assets.write;workflows.run"`.

      Resolved to capabilities by `ProjectRole.scopesFromRole()`.

    - `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 project'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 project over the current billing period.

  - `description: optional string`

    High-level markdown description of the project
    Only returned on single project GET, not on list

  - `descriptionDate: optional string`

    ISO string date when the description was last updated
    Only returned on single project GET, not on list

  - `disableIpDetection: optional boolean`

    When true, IP detection is switched off for this project even if the team
    has an active posture. Absent means the team posture applies.
    The posture itself (disabled / active-fail-open / active-fail-closed) is a
    team-level setting, see the team's ipDetectionEnforcement.

  - `maxConsumption: optional number`

    The project's consumption (CU) cap for the period. Absent when uncapped.

  - `qualityGateAutoDetect: optional boolean`

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

  - `settings: optional object { homepage }`

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

    - `homepage: optional map[unknown]`

      Published homepage layout.

### Example

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

#### Response

```json
{
  "project": {
    "id": "id",
    "createdAt": "createdAt",
    "keys": [
      {
        "id": "id",
        "apiKeyId": "apiKeyId",
        "apiKeyStatus": "active",
        "createdAt": "createdAt",
        "name": "name",
        "role": "role",
        "scope": "project",
        "updatedAt": "updatedAt",
        "authorId": "authorId",
        "consumption": 0,
        "lastUsedAt": "lastUsedAt",
        "maxConsumption": 0,
        "ownerId": "ownerId",
        "projects": [
          {
            "projectId": "projectId",
            "role": "role"
          }
        ]
      }
    ],
    "name": "name",
    "privacyMode": true,
    "teamId": "teamId",
    "updatedAt": "updatedAt",
    "users": [
      {
        "id": "id",
        "createdAt": "createdAt",
        "email": "email",
        "role": "role",
        "updatedAt": "updatedAt",
        "avatar": {
          "assetId": "assetId",
          "url": "url"
        },
        "consumption": 0,
        "maxConsumption": 0
      }
    ],
    "avatar": {
      "assetId": "assetId",
      "url": "url"
    },
    "consumption": 0,
    "description": "description",
    "descriptionDate": "descriptionDate",
    "disableIpDetection": true,
    "maxConsumption": 0,
    "qualityGateAutoDetect": true,
    "settings": {
      "homepage": {
        "foo": "bar"
      }
    }
  }
}
```

## Domain Types

### Project Create Response

- `ProjectCreateResponse object { project }`

  - `project: object { id, createdAt, keys, 13 more }`

    - `id: string`

      The project ID (example: "project_eyVcnFJcR92BxBkz7N6g5w")

    - `createdAt: string`

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

      The keys of the project (get from the ProjectRoles table)

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

      - `role: string`

        A project role value. Accepted values are:

        - a built-in role: `"admin"`, `"editor"` or `"reader"` (see `ProjectRoles`);
        - a custom inline role: a `;`-separated scope list, e.g.
          `"assets.write;workflows.run"`.

        Resolved to capabilities by `ProjectRole.scopesFromRole()`.

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

    - `name: string`

      The project name (example: "Default Project")

    - `privacyMode: boolean`

      Whether the project is privacyMode
      In a privacyMode project, users can only see their own generated assets (except admins)

    - `teamId: string`

      The team ID (example: "team_eyVcnFJcR92BxBkz7N6g5w")

    - `updatedAt: string`

    - `users: array of object { id, createdAt, email, 5 more }`

      The users of the project (get from the ProjectRoles table)

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

        A project role value. Accepted values are:

        - a built-in role: `"admin"`, `"editor"` or `"reader"` (see `ProjectRoles`);
        - a custom inline role: a `;`-separated scope list, e.g.
          `"assets.write;workflows.run"`.

        Resolved to capabilities by `ProjectRole.scopesFromRole()`.

      - `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 project'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 project over the current billing period.

    - `description: optional string`

      High-level markdown description of the project
      Only returned on single project GET, not on list

    - `descriptionDate: optional string`

      ISO string date when the description was last updated
      Only returned on single project GET, not on list

    - `disableIpDetection: optional boolean`

      When true, IP detection is switched off for this project even if the team
      has an active posture. Absent means the team posture applies.
      The posture itself (disabled / active-fail-open / active-fail-closed) is a
      team-level setting, see the team's ipDetectionEnforcement.

    - `maxConsumption: optional number`

      The project's consumption (CU) cap for the period. Absent when uncapped.

    - `qualityGateAutoDetect: optional boolean`

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

    - `settings: optional object { homepage }`

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

      - `homepage: optional map[unknown]`

        Published homepage layout.

### Project Delete Response

- `ProjectDeleteResponse = unknown`

### Project List Response

- `ProjectListResponse object { id, createdAt, keys, 13 more }`

  - `id: string`

    The project ID (example: "project_eyVcnFJcR92BxBkz7N6g5w")

  - `createdAt: string`

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

    The keys of the project (get from the ProjectRoles table)

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

    - `role: string`

      A project role value. Accepted values are:

      - a built-in role: `"admin"`, `"editor"` or `"reader"` (see `ProjectRoles`);
      - a custom inline role: a `;`-separated scope list, e.g.
        `"assets.write;workflows.run"`.

      Resolved to capabilities by `ProjectRole.scopesFromRole()`.

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

  - `name: string`

    The project name (example: "Default Project")

  - `privacyMode: boolean`

    Whether the project is privacyMode
    In a privacyMode project, users can only see their own generated assets (except admins)

  - `teamId: string`

    The team ID (example: "team_eyVcnFJcR92BxBkz7N6g5w")

  - `updatedAt: string`

  - `users: array of object { id, createdAt, email, 5 more }`

    The users of the project (get from the ProjectRoles table)

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

      A project role value. Accepted values are:

      - a built-in role: `"admin"`, `"editor"` or `"reader"` (see `ProjectRoles`);
      - a custom inline role: a `;`-separated scope list, e.g.
        `"assets.write;workflows.run"`.

      Resolved to capabilities by `ProjectRole.scopesFromRole()`.

    - `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 project'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 project over the current billing period.

  - `description: optional string`

    High-level markdown description of the project
    Only returned on single project GET, not on list

  - `descriptionDate: optional string`

    ISO string date when the description was last updated
    Only returned on single project GET, not on list

  - `disableIpDetection: optional boolean`

    When true, IP detection is switched off for this project even if the team
    has an active posture. Absent means the team posture applies.
    The posture itself (disabled / active-fail-open / active-fail-closed) is a
    team-level setting, see the team's ipDetectionEnforcement.

  - `maxConsumption: optional number`

    The project's consumption (CU) cap for the period. Absent when uncapped.

  - `qualityGateAutoDetect: optional boolean`

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

  - `settings: optional object { homepage }`

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

    - `homepage: optional map[unknown]`

      Published homepage layout.

### Project Retrieve Response

- `ProjectRetrieveResponse object { project }`

  - `project: object { id, createdAt, keys, 13 more }`

    - `id: string`

      The project ID (example: "project_eyVcnFJcR92BxBkz7N6g5w")

    - `createdAt: string`

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

      The keys of the project (get from the ProjectRoles table)

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

      - `role: string`

        A project role value. Accepted values are:

        - a built-in role: `"admin"`, `"editor"` or `"reader"` (see `ProjectRoles`);
        - a custom inline role: a `;`-separated scope list, e.g.
          `"assets.write;workflows.run"`.

        Resolved to capabilities by `ProjectRole.scopesFromRole()`.

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

    - `name: string`

      The project name (example: "Default Project")

    - `privacyMode: boolean`

      Whether the project is privacyMode
      In a privacyMode project, users can only see their own generated assets (except admins)

    - `teamId: string`

      The team ID (example: "team_eyVcnFJcR92BxBkz7N6g5w")

    - `updatedAt: string`

    - `users: array of object { id, createdAt, email, 5 more }`

      The users of the project (get from the ProjectRoles table)

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

        A project role value. Accepted values are:

        - a built-in role: `"admin"`, `"editor"` or `"reader"` (see `ProjectRoles`);
        - a custom inline role: a `;`-separated scope list, e.g.
          `"assets.write;workflows.run"`.

        Resolved to capabilities by `ProjectRole.scopesFromRole()`.

      - `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 project'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 project over the current billing period.

    - `description: optional string`

      High-level markdown description of the project
      Only returned on single project GET, not on list

    - `descriptionDate: optional string`

      ISO string date when the description was last updated
      Only returned on single project GET, not on list

    - `disableIpDetection: optional boolean`

      When true, IP detection is switched off for this project even if the team
      has an active posture. Absent means the team posture applies.
      The posture itself (disabled / active-fail-open / active-fail-closed) is a
      team-level setting, see the team's ipDetectionEnforcement.

    - `maxConsumption: optional number`

      The project's consumption (CU) cap for the period. Absent when uncapped.

    - `qualityGateAutoDetect: optional boolean`

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

    - `settings: optional object { homepage }`

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

      - `homepage: optional map[unknown]`

        Published homepage layout.

### Project Update Response

- `ProjectUpdateResponse object { project }`

  - `project: object { id, createdAt, keys, 13 more }`

    - `id: string`

      The project ID (example: "project_eyVcnFJcR92BxBkz7N6g5w")

    - `createdAt: string`

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

      The keys of the project (get from the ProjectRoles table)

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

      - `role: string`

        A project role value. Accepted values are:

        - a built-in role: `"admin"`, `"editor"` or `"reader"` (see `ProjectRoles`);
        - a custom inline role: a `;`-separated scope list, e.g.
          `"assets.write;workflows.run"`.

        Resolved to capabilities by `ProjectRole.scopesFromRole()`.

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

    - `name: string`

      The project name (example: "Default Project")

    - `privacyMode: boolean`

      Whether the project is privacyMode
      In a privacyMode project, users can only see their own generated assets (except admins)

    - `teamId: string`

      The team ID (example: "team_eyVcnFJcR92BxBkz7N6g5w")

    - `updatedAt: string`

    - `users: array of object { id, createdAt, email, 5 more }`

      The users of the project (get from the ProjectRoles table)

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

        A project role value. Accepted values are:

        - a built-in role: `"admin"`, `"editor"` or `"reader"` (see `ProjectRoles`);
        - a custom inline role: a `;`-separated scope list, e.g.
          `"assets.write;workflows.run"`.

        Resolved to capabilities by `ProjectRole.scopesFromRole()`.

      - `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 project'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 project over the current billing period.

    - `description: optional string`

      High-level markdown description of the project
      Only returned on single project GET, not on list

    - `descriptionDate: optional string`

      ISO string date when the description was last updated
      Only returned on single project GET, not on list

    - `disableIpDetection: optional boolean`

      When true, IP detection is switched off for this project even if the team
      has an active posture. Absent means the team posture applies.
      The posture itself (disabled / active-fail-open / active-fail-closed) is a
      team-level setting, see the team's ipDetectionEnforcement.

    - `maxConsumption: optional number`

      The project's consumption (CU) cap for the period. Absent when uncapped.

    - `qualityGateAutoDetect: optional boolean`

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

    - `settings: optional object { homepage }`

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

      - `homepage: optional map[unknown]`

        Published homepage layout.

# API Keys

## Create

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

Create an API key for a particular project

### Path Parameters

- `projectId: string`

### Body Parameters

- `maxConsumption: optional number`

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

- `name: optional string`

  The API Key name

- `role: optional string`

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

### Returns

- `id: string`

- `authorId: string`

- `createdAt: string`

- `ownerType: "project" or "team"`

  - `"project"`

  - `"team"`

- `secret: string`

- `userId: string`

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

- `ownerId: optional string`

- `teamId: optional string`

### Example

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

#### Response

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

## Delete

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

Delete a particular api key

### Path Parameters

- `projectId: string`

- `keyId: string`

### Example

```http
curl https://api.cloud.scenario.com/v1/projects/$PROJECT_ID/api-keys/$KEY_ID \
    -X DELETE \
    -u "$SCENARIO_SDK_API_KEY:SCENARIO_SDK_API_SECRET"
```

#### Response

```json
{}
```

## Domain Types

### API Key Create Response

- `APIKeyCreateResponse object { id, authorId, createdAt, 5 more }`

  - `id: string`

  - `authorId: string`

  - `createdAt: string`

  - `ownerType: "project" or "team"`

    - `"project"`

    - `"team"`

  - `secret: string`

  - `userId: string`

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

  - `ownerId: optional string`

  - `teamId: optional string`

### API Key Delete Response

- `APIKeyDeleteResponse = unknown`

# Brief

## Delete

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

Delete the project's Quality Gate brief

### Path Parameters

- `projectId: string`

### Returns

- `deleted: boolean`

### Example

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

#### Response

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

## Retrieve

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

Get the project's Quality Gate brief

### Path Parameters

- `projectId: 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/projects/$PROJECT_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** `/projects/{projectId}/brief`

Create or update the project's Quality Gate brief

### Path Parameters

- `projectId: 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/projects/$PROJECT_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"`

# Instructions

## Retrieve

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

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

### Path Parameters

- `projectId: string`

### Returns

- `memory: object { id, content, createdAt, 3 more }`

  Public JSON shape returned by GET endpoints

  - `id: string`

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

  - `content: string`

    Markdown content of the memory

  - `createdAt: string`

    ISO 8601 timestamp when the memory was first written

  - `sizeBytes: number`

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

  - `updatedAt: string`

    ISO 8601 timestamp when the memory was last updated

  - `updatedBy: string`

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

### Example

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

#### Response

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

## Update

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

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

### Path Parameters

- `projectId: string`

### Body Parameters

- `content: optional string`

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

### Returns

- `memory: optional object { id, content, createdAt, 3 more }`

  Public JSON shape returned by GET endpoints

  - `id: string`

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

  - `content: string`

    Markdown content of the memory

  - `createdAt: string`

    ISO 8601 timestamp when the memory was first written

  - `sizeBytes: number`

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

  - `updatedAt: string`

    ISO 8601 timestamp when the memory was last updated

  - `updatedBy: string`

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

### Example

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

#### Response

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

## Domain Types

### Instruction Retrieve Response

- `InstructionRetrieveResponse object { memory }`

  - `memory: object { id, content, createdAt, 3 more }`

    Public JSON shape returned by GET endpoints

    - `id: string`

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

    - `content: string`

      Markdown content of the memory

    - `createdAt: string`

      ISO 8601 timestamp when the memory was first written

    - `sizeBytes: number`

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

    - `updatedAt: string`

      ISO 8601 timestamp when the memory was last updated

    - `updatedBy: string`

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

### Instruction Update Response

- `InstructionUpdateResponse object { memory }`

  - `memory: optional object { id, content, createdAt, 3 more }`

    Public JSON shape returned by GET endpoints

    - `id: string`

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

    - `content: string`

      Markdown content of the memory

    - `createdAt: string`

      ISO 8601 timestamp when the memory was first written

    - `sizeBytes: number`

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

    - `updatedAt: string`

      ISO 8601 timestamp when the memory was last updated

    - `updatedBy: string`

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

# Members

## Create

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

Add a member to the project

### Path Parameters

- `projectId: string`

### Body Parameters

- `role: string`

  The role you want to give the user

- `userId: string`

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

### Returns

- `project: object { id, createdAt, keys, 13 more }`

  - `id: string`

    The project ID (example: "project_eyVcnFJcR92BxBkz7N6g5w")

  - `createdAt: string`

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

    The keys of the project (get from the ProjectRoles table)

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

    - `role: string`

      A project role value. Accepted values are:

      - a built-in role: `"admin"`, `"editor"` or `"reader"` (see `ProjectRoles`);
      - a custom inline role: a `;`-separated scope list, e.g.
        `"assets.write;workflows.run"`.

      Resolved to capabilities by `ProjectRole.scopesFromRole()`.

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

  - `name: string`

    The project name (example: "Default Project")

  - `privacyMode: boolean`

    Whether the project is privacyMode
    In a privacyMode project, users can only see their own generated assets (except admins)

  - `teamId: string`

    The team ID (example: "team_eyVcnFJcR92BxBkz7N6g5w")

  - `updatedAt: string`

  - `users: array of object { id, createdAt, email, 5 more }`

    The users of the project (get from the ProjectRoles table)

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

      A project role value. Accepted values are:

      - a built-in role: `"admin"`, `"editor"` or `"reader"` (see `ProjectRoles`);
      - a custom inline role: a `;`-separated scope list, e.g.
        `"assets.write;workflows.run"`.

      Resolved to capabilities by `ProjectRole.scopesFromRole()`.

    - `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 project'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 project over the current billing period.

  - `description: optional string`

    High-level markdown description of the project
    Only returned on single project GET, not on list

  - `descriptionDate: optional string`

    ISO string date when the description was last updated
    Only returned on single project GET, not on list

  - `disableIpDetection: optional boolean`

    When true, IP detection is switched off for this project even if the team
    has an active posture. Absent means the team posture applies.
    The posture itself (disabled / active-fail-open / active-fail-closed) is a
    team-level setting, see the team's ipDetectionEnforcement.

  - `maxConsumption: optional number`

    The project's consumption (CU) cap for the period. Absent when uncapped.

  - `qualityGateAutoDetect: optional boolean`

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

  - `settings: optional object { homepage }`

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

    - `homepage: optional map[unknown]`

      Published homepage layout.

### Example

```http
curl https://api.cloud.scenario.com/v1/projects/$PROJECT_ID/members \
    -H 'Content-Type: application/json' \
    -u "$SCENARIO_SDK_API_KEY:SCENARIO_SDK_API_SECRET" \
    -d '{
          "role": "role",
          "userId": "userId"
        }'
```

#### Response

```json
{
  "project": {
    "id": "id",
    "createdAt": "createdAt",
    "keys": [
      {
        "id": "id",
        "apiKeyId": "apiKeyId",
        "apiKeyStatus": "active",
        "createdAt": "createdAt",
        "name": "name",
        "role": "role",
        "scope": "project",
        "updatedAt": "updatedAt",
        "authorId": "authorId",
        "consumption": 0,
        "lastUsedAt": "lastUsedAt",
        "maxConsumption": 0,
        "ownerId": "ownerId",
        "projects": [
          {
            "projectId": "projectId",
            "role": "role"
          }
        ]
      }
    ],
    "name": "name",
    "privacyMode": true,
    "teamId": "teamId",
    "updatedAt": "updatedAt",
    "users": [
      {
        "id": "id",
        "createdAt": "createdAt",
        "email": "email",
        "role": "role",
        "updatedAt": "updatedAt",
        "avatar": {
          "assetId": "assetId",
          "url": "url"
        },
        "consumption": 0,
        "maxConsumption": 0
      }
    ],
    "avatar": {
      "assetId": "assetId",
      "url": "url"
    },
    "consumption": 0,
    "description": "description",
    "descriptionDate": "descriptionDate",
    "disableIpDetection": true,
    "maxConsumption": 0,
    "qualityGateAutoDetect": true,
    "settings": {
      "homepage": {
        "foo": "bar"
      }
    }
  }
}
```

## Delete

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

Remove a member from the project

### Path Parameters

- `projectId: string`

- `memberId: string`

### Returns

- `project: object { id, createdAt, keys, 13 more }`

  - `id: string`

    The project ID (example: "project_eyVcnFJcR92BxBkz7N6g5w")

  - `createdAt: string`

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

    The keys of the project (get from the ProjectRoles table)

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

    - `role: string`

      A project role value. Accepted values are:

      - a built-in role: `"admin"`, `"editor"` or `"reader"` (see `ProjectRoles`);
      - a custom inline role: a `;`-separated scope list, e.g.
        `"assets.write;workflows.run"`.

      Resolved to capabilities by `ProjectRole.scopesFromRole()`.

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

  - `name: string`

    The project name (example: "Default Project")

  - `privacyMode: boolean`

    Whether the project is privacyMode
    In a privacyMode project, users can only see their own generated assets (except admins)

  - `teamId: string`

    The team ID (example: "team_eyVcnFJcR92BxBkz7N6g5w")

  - `updatedAt: string`

  - `users: array of object { id, createdAt, email, 5 more }`

    The users of the project (get from the ProjectRoles table)

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

      A project role value. Accepted values are:

      - a built-in role: `"admin"`, `"editor"` or `"reader"` (see `ProjectRoles`);
      - a custom inline role: a `;`-separated scope list, e.g.
        `"assets.write;workflows.run"`.

      Resolved to capabilities by `ProjectRole.scopesFromRole()`.

    - `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 project'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 project over the current billing period.

  - `description: optional string`

    High-level markdown description of the project
    Only returned on single project GET, not on list

  - `descriptionDate: optional string`

    ISO string date when the description was last updated
    Only returned on single project GET, not on list

  - `disableIpDetection: optional boolean`

    When true, IP detection is switched off for this project even if the team
    has an active posture. Absent means the team posture applies.
    The posture itself (disabled / active-fail-open / active-fail-closed) is a
    team-level setting, see the team's ipDetectionEnforcement.

  - `maxConsumption: optional number`

    The project's consumption (CU) cap for the period. Absent when uncapped.

  - `qualityGateAutoDetect: optional boolean`

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

  - `settings: optional object { homepage }`

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

    - `homepage: optional map[unknown]`

      Published homepage layout.

### Example

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

#### Response

```json
{
  "project": {
    "id": "id",
    "createdAt": "createdAt",
    "keys": [
      {
        "id": "id",
        "apiKeyId": "apiKeyId",
        "apiKeyStatus": "active",
        "createdAt": "createdAt",
        "name": "name",
        "role": "role",
        "scope": "project",
        "updatedAt": "updatedAt",
        "authorId": "authorId",
        "consumption": 0,
        "lastUsedAt": "lastUsedAt",
        "maxConsumption": 0,
        "ownerId": "ownerId",
        "projects": [
          {
            "projectId": "projectId",
            "role": "role"
          }
        ]
      }
    ],
    "name": "name",
    "privacyMode": true,
    "teamId": "teamId",
    "updatedAt": "updatedAt",
    "users": [
      {
        "id": "id",
        "createdAt": "createdAt",
        "email": "email",
        "role": "role",
        "updatedAt": "updatedAt",
        "avatar": {
          "assetId": "assetId",
          "url": "url"
        },
        "consumption": 0,
        "maxConsumption": 0
      }
    ],
    "avatar": {
      "assetId": "assetId",
      "url": "url"
    },
    "consumption": 0,
    "description": "description",
    "descriptionDate": "descriptionDate",
    "disableIpDetection": true,
    "maxConsumption": 0,
    "qualityGateAutoDetect": true,
    "settings": {
      "homepage": {
        "foo": "bar"
      }
    }
  }
}
```

## Update

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

Change a member role

### Path Parameters

- `projectId: string`

- `memberId: string`

### Body Parameters

- `role: optional string`

  The role you want to give the member

### Returns

- `project: object { id, createdAt, keys, 13 more }`

  - `id: string`

    The project ID (example: "project_eyVcnFJcR92BxBkz7N6g5w")

  - `createdAt: string`

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

    The keys of the project (get from the ProjectRoles table)

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

    - `role: string`

      A project role value. Accepted values are:

      - a built-in role: `"admin"`, `"editor"` or `"reader"` (see `ProjectRoles`);
      - a custom inline role: a `;`-separated scope list, e.g.
        `"assets.write;workflows.run"`.

      Resolved to capabilities by `ProjectRole.scopesFromRole()`.

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

  - `name: string`

    The project name (example: "Default Project")

  - `privacyMode: boolean`

    Whether the project is privacyMode
    In a privacyMode project, users can only see their own generated assets (except admins)

  - `teamId: string`

    The team ID (example: "team_eyVcnFJcR92BxBkz7N6g5w")

  - `updatedAt: string`

  - `users: array of object { id, createdAt, email, 5 more }`

    The users of the project (get from the ProjectRoles table)

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

      A project role value. Accepted values are:

      - a built-in role: `"admin"`, `"editor"` or `"reader"` (see `ProjectRoles`);
      - a custom inline role: a `;`-separated scope list, e.g.
        `"assets.write;workflows.run"`.

      Resolved to capabilities by `ProjectRole.scopesFromRole()`.

    - `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 project'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 project over the current billing period.

  - `description: optional string`

    High-level markdown description of the project
    Only returned on single project GET, not on list

  - `descriptionDate: optional string`

    ISO string date when the description was last updated
    Only returned on single project GET, not on list

  - `disableIpDetection: optional boolean`

    When true, IP detection is switched off for this project even if the team
    has an active posture. Absent means the team posture applies.
    The posture itself (disabled / active-fail-open / active-fail-closed) is a
    team-level setting, see the team's ipDetectionEnforcement.

  - `maxConsumption: optional number`

    The project's consumption (CU) cap for the period. Absent when uncapped.

  - `qualityGateAutoDetect: optional boolean`

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

  - `settings: optional object { homepage }`

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

    - `homepage: optional map[unknown]`

      Published homepage layout.

### Example

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

#### Response

```json
{
  "project": {
    "id": "id",
    "createdAt": "createdAt",
    "keys": [
      {
        "id": "id",
        "apiKeyId": "apiKeyId",
        "apiKeyStatus": "active",
        "createdAt": "createdAt",
        "name": "name",
        "role": "role",
        "scope": "project",
        "updatedAt": "updatedAt",
        "authorId": "authorId",
        "consumption": 0,
        "lastUsedAt": "lastUsedAt",
        "maxConsumption": 0,
        "ownerId": "ownerId",
        "projects": [
          {
            "projectId": "projectId",
            "role": "role"
          }
        ]
      }
    ],
    "name": "name",
    "privacyMode": true,
    "teamId": "teamId",
    "updatedAt": "updatedAt",
    "users": [
      {
        "id": "id",
        "createdAt": "createdAt",
        "email": "email",
        "role": "role",
        "updatedAt": "updatedAt",
        "avatar": {
          "assetId": "assetId",
          "url": "url"
        },
        "consumption": 0,
        "maxConsumption": 0
      }
    ],
    "avatar": {
      "assetId": "assetId",
      "url": "url"
    },
    "consumption": 0,
    "description": "description",
    "descriptionDate": "descriptionDate",
    "disableIpDetection": true,
    "maxConsumption": 0,
    "qualityGateAutoDetect": true,
    "settings": {
      "homepage": {
        "foo": "bar"
      }
    }
  }
}
```

## Domain Types

### Member Create Response

- `MemberCreateResponse object { project }`

  - `project: object { id, createdAt, keys, 13 more }`

    - `id: string`

      The project ID (example: "project_eyVcnFJcR92BxBkz7N6g5w")

    - `createdAt: string`

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

      The keys of the project (get from the ProjectRoles table)

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

      - `role: string`

        A project role value. Accepted values are:

        - a built-in role: `"admin"`, `"editor"` or `"reader"` (see `ProjectRoles`);
        - a custom inline role: a `;`-separated scope list, e.g.
          `"assets.write;workflows.run"`.

        Resolved to capabilities by `ProjectRole.scopesFromRole()`.

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

    - `name: string`

      The project name (example: "Default Project")

    - `privacyMode: boolean`

      Whether the project is privacyMode
      In a privacyMode project, users can only see their own generated assets (except admins)

    - `teamId: string`

      The team ID (example: "team_eyVcnFJcR92BxBkz7N6g5w")

    - `updatedAt: string`

    - `users: array of object { id, createdAt, email, 5 more }`

      The users of the project (get from the ProjectRoles table)

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

        A project role value. Accepted values are:

        - a built-in role: `"admin"`, `"editor"` or `"reader"` (see `ProjectRoles`);
        - a custom inline role: a `;`-separated scope list, e.g.
          `"assets.write;workflows.run"`.

        Resolved to capabilities by `ProjectRole.scopesFromRole()`.

      - `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 project'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 project over the current billing period.

    - `description: optional string`

      High-level markdown description of the project
      Only returned on single project GET, not on list

    - `descriptionDate: optional string`

      ISO string date when the description was last updated
      Only returned on single project GET, not on list

    - `disableIpDetection: optional boolean`

      When true, IP detection is switched off for this project even if the team
      has an active posture. Absent means the team posture applies.
      The posture itself (disabled / active-fail-open / active-fail-closed) is a
      team-level setting, see the team's ipDetectionEnforcement.

    - `maxConsumption: optional number`

      The project's consumption (CU) cap for the period. Absent when uncapped.

    - `qualityGateAutoDetect: optional boolean`

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

    - `settings: optional object { homepage }`

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

      - `homepage: optional map[unknown]`

        Published homepage layout.

### Member Delete Response

- `MemberDeleteResponse object { project }`

  - `project: object { id, createdAt, keys, 13 more }`

    - `id: string`

      The project ID (example: "project_eyVcnFJcR92BxBkz7N6g5w")

    - `createdAt: string`

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

      The keys of the project (get from the ProjectRoles table)

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

      - `role: string`

        A project role value. Accepted values are:

        - a built-in role: `"admin"`, `"editor"` or `"reader"` (see `ProjectRoles`);
        - a custom inline role: a `;`-separated scope list, e.g.
          `"assets.write;workflows.run"`.

        Resolved to capabilities by `ProjectRole.scopesFromRole()`.

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

    - `name: string`

      The project name (example: "Default Project")

    - `privacyMode: boolean`

      Whether the project is privacyMode
      In a privacyMode project, users can only see their own generated assets (except admins)

    - `teamId: string`

      The team ID (example: "team_eyVcnFJcR92BxBkz7N6g5w")

    - `updatedAt: string`

    - `users: array of object { id, createdAt, email, 5 more }`

      The users of the project (get from the ProjectRoles table)

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

        A project role value. Accepted values are:

        - a built-in role: `"admin"`, `"editor"` or `"reader"` (see `ProjectRoles`);
        - a custom inline role: a `;`-separated scope list, e.g.
          `"assets.write;workflows.run"`.

        Resolved to capabilities by `ProjectRole.scopesFromRole()`.

      - `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 project'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 project over the current billing period.

    - `description: optional string`

      High-level markdown description of the project
      Only returned on single project GET, not on list

    - `descriptionDate: optional string`

      ISO string date when the description was last updated
      Only returned on single project GET, not on list

    - `disableIpDetection: optional boolean`

      When true, IP detection is switched off for this project even if the team
      has an active posture. Absent means the team posture applies.
      The posture itself (disabled / active-fail-open / active-fail-closed) is a
      team-level setting, see the team's ipDetectionEnforcement.

    - `maxConsumption: optional number`

      The project's consumption (CU) cap for the period. Absent when uncapped.

    - `qualityGateAutoDetect: optional boolean`

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

    - `settings: optional object { homepage }`

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

      - `homepage: optional map[unknown]`

        Published homepage layout.

### Member Update Response

- `MemberUpdateResponse object { project }`

  - `project: object { id, createdAt, keys, 13 more }`

    - `id: string`

      The project ID (example: "project_eyVcnFJcR92BxBkz7N6g5w")

    - `createdAt: string`

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

      The keys of the project (get from the ProjectRoles table)

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

      - `role: string`

        A project role value. Accepted values are:

        - a built-in role: `"admin"`, `"editor"` or `"reader"` (see `ProjectRoles`);
        - a custom inline role: a `;`-separated scope list, e.g.
          `"assets.write;workflows.run"`.

        Resolved to capabilities by `ProjectRole.scopesFromRole()`.

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

    - `name: string`

      The project name (example: "Default Project")

    - `privacyMode: boolean`

      Whether the project is privacyMode
      In a privacyMode project, users can only see their own generated assets (except admins)

    - `teamId: string`

      The team ID (example: "team_eyVcnFJcR92BxBkz7N6g5w")

    - `updatedAt: string`

    - `users: array of object { id, createdAt, email, 5 more }`

      The users of the project (get from the ProjectRoles table)

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

        A project role value. Accepted values are:

        - a built-in role: `"admin"`, `"editor"` or `"reader"` (see `ProjectRoles`);
        - a custom inline role: a `;`-separated scope list, e.g.
          `"assets.write;workflows.run"`.

        Resolved to capabilities by `ProjectRole.scopesFromRole()`.

      - `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 project'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 project over the current billing period.

    - `description: optional string`

      High-level markdown description of the project
      Only returned on single project GET, not on list

    - `descriptionDate: optional string`

      ISO string date when the description was last updated
      Only returned on single project GET, not on list

    - `disableIpDetection: optional boolean`

      When true, IP detection is switched off for this project even if the team
      has an active posture. Absent means the team posture applies.
      The posture itself (disabled / active-fail-open / active-fail-closed) is a
      team-level setting, see the team's ipDetectionEnforcement.

    - `maxConsumption: optional number`

      The project's consumption (CU) cap for the period. Absent when uncapped.

    - `qualityGateAutoDetect: optional boolean`

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

    - `settings: optional object { homepage }`

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

      - `homepage: optional map[unknown]`

        Published homepage layout.

# Memory

## Retrieve

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

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

### Path Parameters

- `projectId: string`

### Returns

- `memory: object { id, content, createdAt, 3 more }`

  Public JSON shape returned by GET endpoints

  - `id: string`

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

  - `content: string`

    Markdown content of the memory

  - `createdAt: string`

    ISO 8601 timestamp when the memory was first written

  - `sizeBytes: number`

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

  - `updatedAt: string`

    ISO 8601 timestamp when the memory was last updated

  - `updatedBy: string`

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

### Example

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

#### Response

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

## Update

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

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

### Path Parameters

- `projectId: string`

### Body Parameters

- `content: optional string`

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

### Returns

- `memory: optional object { id, content, createdAt, 3 more }`

  Public JSON shape returned by GET endpoints

  - `id: string`

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

  - `content: string`

    Markdown content of the memory

  - `createdAt: string`

    ISO 8601 timestamp when the memory was first written

  - `sizeBytes: number`

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

  - `updatedAt: string`

    ISO 8601 timestamp when the memory was last updated

  - `updatedBy: string`

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

### Example

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

#### Response

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

## Domain Types

### Memory Retrieve Response

- `MemoryRetrieveResponse object { memory }`

  - `memory: object { id, content, createdAt, 3 more }`

    Public JSON shape returned by GET endpoints

    - `id: string`

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

    - `content: string`

      Markdown content of the memory

    - `createdAt: string`

      ISO 8601 timestamp when the memory was first written

    - `sizeBytes: number`

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

    - `updatedAt: string`

      ISO 8601 timestamp when the memory was last updated

    - `updatedBy: string`

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

### Memory Update Response

- `MemoryUpdateResponse object { memory }`

  - `memory: optional object { id, content, createdAt, 3 more }`

    Public JSON shape returned by GET endpoints

    - `id: string`

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

    - `content: string`

      Markdown content of the memory

    - `createdAt: string`

      ISO 8601 timestamp when the memory was first written

    - `sizeBytes: number`

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

    - `updatedAt: string`

      ISO 8601 timestamp when the memory was last updated

    - `updatedBy: string`

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

# Watermark

## Delete

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

Delete the project's forced watermark configuration

### Path Parameters

- `projectId: string`

### Returns

- `deleted: boolean`

### Example

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

#### Response

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

## Delete Logo

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

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

### Path Parameters

- `projectId: 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/projects/$PROJECT_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** `/projects/{projectId}/watermark/preview`

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

### Path Parameters

- `projectId: 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/projects/$PROJECT_ID/watermark/preview \
    -H 'Content-Type: application/json' \
    -u "$SCENARIO_SDK_API_KEY:SCENARIO_SDK_API_SECRET" \
    -d '{}'
```

#### Response

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

## Retrieve

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

Get the project's forced watermark configuration

### Path Parameters

- `projectId: 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/projects/$PROJECT_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** `/projects/{projectId}/watermark`

Create or update the project's forced watermark configuration

### Path Parameters

- `projectId: 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/projects/$PROJECT_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** `/projects/{projectId}/watermark/logo`

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

### Path Parameters

- `projectId: 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/projects/$PROJECT_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** `/projects/{projectId}/webhook-endpoints`

Register a new webhook endpoint for the project

### Path Parameters

- `projectId: 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/projects/$PROJECT_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** `/projects/{projectId}/webhook-endpoints/{webhookEndpointId}`

Delete a particular webhook endpoint by its Id

### Path Parameters

- `projectId: string`

- `webhookEndpointId: string`

### Example

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

#### Response

```json
{}
```

## List

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

List the project's webhook endpoints

### Path Parameters

- `projectId: string`

### Returns

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

  A list of the project 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/projects/$PROJECT_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** `/projects/{projectId}/webhook-endpoints/{webhookEndpointId}`

Update a particular webhook endpoint for a project

### Path Parameters

- `projectId: 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/projects/$PROJECT_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 project 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** `/projects/{projectId}/webhook-endpoints/{webhookEndpointId}/events`

List the project's webhook events

### Path Parameters

- `projectId: 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 project 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/projects/$PROJECT_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** `/projects/{projectId}/webhook-endpoints/{webhookEndpointId}/events/{eventId}`

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

### Path Parameters

- `projectId: 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/projects/$PROJECT_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 project 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`
