# Watermark

## Delete

`client.projects.watermark.delete(stringprojectID, RequestOptionsoptions?): WatermarkDeleteResponse`

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

Delete the project's forced watermark configuration

### Parameters

- `projectID: string`

### Returns

- `WatermarkDeleteResponse`

  - `deleted: boolean`

### Example

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

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

const watermark = await client.projects.watermark.delete('projectId');

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

#### Response

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

## Delete Logo

`client.projects.watermark.deleteLogo(stringprojectID, RequestOptionsoptions?): WatermarkDeleteLogoResponse`

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

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

### Parameters

- `projectID: string`

### Returns

- `WatermarkDeleteLogoResponse`

  - `watermark: Watermark`

    Forced-watermark configuration stored at one scope.

    - `id: string`

      Stable identifier derived from level + scopeId

    - `createdAt: string`

      ISO-8601 creation timestamp

    - `createdBy: string`

      User id that last wrote the configuration

    - `enabled: boolean`

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

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

      Scope this configuration applies to: team or project

      - `"project"`

      - `"team"`

    - `opacity: number`

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

    - `placement: "bottom-left" | "bottom-right" | "center" | 3 more`

      Where the mark sits on the image

      - `"bottom-left"`

      - `"bottom-right"`

      - `"center"`

      - `"tiled"`

      - `"top-left"`

      - `"top-right"`

    - `rotation: number`

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

    - `scale: number`

      Mark width as a fraction of the image width

    - `scopeId: string`

      The id of the team or project that owns this configuration

    - `spacing: number`

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

    - `updatedAt: string`

      ISO-8601 last-update timestamp

    - `version: number`

      Bumped on every write.

    - `deletedAt?: string`

      Set when the configuration has been deleted.

    - `logoIsOpaque?: boolean`

      Whether the stored logo has no transparency at all.

      Recorded at upload so the UI can warn without decoding the image again: an
      opaque logo draws its whole rectangle, which a rotated tiled mark turns
      into a very visible diamond.

    - `logoKey?: string`

      Where the uploaded logo lives, when one is set.

    - `text?: string`

      Text rendered as the mark, when no logo is set

### Example

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

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

const response = await client.projects.watermark.deleteLogo('projectId');

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

#### Response

```json
{
  "watermark": {
    "id": "id",
    "createdAt": "createdAt",
    "createdBy": "createdBy",
    "enabled": true,
    "level": "project",
    "opacity": 0,
    "placement": "bottom-left",
    "rotation": 0,
    "scale": 0,
    "scopeId": "scopeId",
    "spacing": 0,
    "updatedAt": "updatedAt",
    "version": 0,
    "deletedAt": "deletedAt",
    "logoIsOpaque": true,
    "logoKey": "logoKey",
    "text": "text"
  }
}
```

## Preview

`client.projects.watermark.preview(stringprojectID, WatermarkPreviewParamsbody, RequestOptionsoptions?): WatermarkPreviewResponse`

**post** `/projects/{projectId}/watermark/preview`

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

### Parameters

- `projectID: string`

- `body: WatermarkPreviewParams`

  - `opacity?: number`

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

  - `placement?: "bottom-left" | "bottom-right" | "center" | 3 more`

    Where the mark sits on the image

    - `"bottom-left"`

    - `"bottom-right"`

    - `"center"`

    - `"tiled"`

    - `"top-left"`

    - `"top-right"`

  - `rotation?: number`

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

  - `scale?: number`

    Mark width as a fraction of the image width

  - `spacing?: number`

    Gap between repetitions, as a fraction of the mark's own size. Only drawn
    for the tiled placement; 0 repeats the mark edge to edge.

  - `text?: string`

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

### Returns

- `WatermarkPreviewResponse`

  Response of the watermark preview routes.

  - `image: string`

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

### Example

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

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

const response = await client.projects.watermark.preview('projectId');

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

#### Response

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

## Retrieve

`client.projects.watermark.retrieve(stringprojectID, RequestOptionsoptions?): WatermarkRetrieveResponse`

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

Get the project's forced watermark configuration

### Parameters

- `projectID: string`

### Returns

- `WatermarkRetrieveResponse`

  - `watermark: Watermark`

    Forced-watermark configuration stored at one scope.

    - `id: string`

      Stable identifier derived from level + scopeId

    - `createdAt: string`

      ISO-8601 creation timestamp

    - `createdBy: string`

      User id that last wrote the configuration

    - `enabled: boolean`

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

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

      Scope this configuration applies to: team or project

      - `"project"`

      - `"team"`

    - `opacity: number`

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

    - `placement: "bottom-left" | "bottom-right" | "center" | 3 more`

      Where the mark sits on the image

      - `"bottom-left"`

      - `"bottom-right"`

      - `"center"`

      - `"tiled"`

      - `"top-left"`

      - `"top-right"`

    - `rotation: number`

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

    - `scale: number`

      Mark width as a fraction of the image width

    - `scopeId: string`

      The id of the team or project that owns this configuration

    - `spacing: number`

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

    - `updatedAt: string`

      ISO-8601 last-update timestamp

    - `version: number`

      Bumped on every write.

    - `deletedAt?: string`

      Set when the configuration has been deleted.

    - `logoIsOpaque?: boolean`

      Whether the stored logo has no transparency at all.

      Recorded at upload so the UI can warn without decoding the image again: an
      opaque logo draws its whole rectangle, which a rotated tiled mark turns
      into a very visible diamond.

    - `logoKey?: string`

      Where the uploaded logo lives, when one is set.

    - `text?: string`

      Text rendered as the mark, when no logo is set

### Example

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

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

const watermark = await client.projects.watermark.retrieve('projectId');

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

#### Response

```json
{
  "watermark": {
    "id": "id",
    "createdAt": "createdAt",
    "createdBy": "createdBy",
    "enabled": true,
    "level": "project",
    "opacity": 0,
    "placement": "bottom-left",
    "rotation": 0,
    "scale": 0,
    "scopeId": "scopeId",
    "spacing": 0,
    "updatedAt": "updatedAt",
    "version": 0,
    "deletedAt": "deletedAt",
    "logoIsOpaque": true,
    "logoKey": "logoKey",
    "text": "text"
  }
}
```

## Update

`client.projects.watermark.update(stringprojectID, WatermarkUpdateParamsbody, RequestOptionsoptions?): WatermarkUpdateResponse`

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

Create or update the project's forced watermark configuration

### Parameters

- `projectID: string`

- `body: WatermarkUpdateParams`

  - `enabled: boolean`

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

  - `opacity?: number`

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

  - `placement?: "bottom-left" | "bottom-right" | "center" | 3 more`

    Where the mark sits on the image

    - `"bottom-left"`

    - `"bottom-right"`

    - `"center"`

    - `"tiled"`

    - `"top-left"`

    - `"top-right"`

  - `rotation?: number`

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

  - `scale?: number`

    Mark width as a fraction of the image width

  - `spacing?: number`

    Gap between repetitions, as a fraction of the mark's own size. Only drawn
    for the tiled placement; 0 repeats the mark edge to edge.

  - `text?: string`

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

### Returns

- `WatermarkUpdateResponse`

  - `watermark: Watermark`

    Forced-watermark configuration stored at one scope.

    - `id: string`

      Stable identifier derived from level + scopeId

    - `createdAt: string`

      ISO-8601 creation timestamp

    - `createdBy: string`

      User id that last wrote the configuration

    - `enabled: boolean`

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

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

      Scope this configuration applies to: team or project

      - `"project"`

      - `"team"`

    - `opacity: number`

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

    - `placement: "bottom-left" | "bottom-right" | "center" | 3 more`

      Where the mark sits on the image

      - `"bottom-left"`

      - `"bottom-right"`

      - `"center"`

      - `"tiled"`

      - `"top-left"`

      - `"top-right"`

    - `rotation: number`

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

    - `scale: number`

      Mark width as a fraction of the image width

    - `scopeId: string`

      The id of the team or project that owns this configuration

    - `spacing: number`

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

    - `updatedAt: string`

      ISO-8601 last-update timestamp

    - `version: number`

      Bumped on every write.

    - `deletedAt?: string`

      Set when the configuration has been deleted.

    - `logoIsOpaque?: boolean`

      Whether the stored logo has no transparency at all.

      Recorded at upload so the UI can warn without decoding the image again: an
      opaque logo draws its whole rectangle, which a rotated tiled mark turns
      into a very visible diamond.

    - `logoKey?: string`

      Where the uploaded logo lives, when one is set.

    - `text?: string`

      Text rendered as the mark, when no logo is set

### Example

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

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

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

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

#### Response

```json
{
  "watermark": {
    "id": "id",
    "createdAt": "createdAt",
    "createdBy": "createdBy",
    "enabled": true,
    "level": "project",
    "opacity": 0,
    "placement": "bottom-left",
    "rotation": 0,
    "scale": 0,
    "scopeId": "scopeId",
    "spacing": 0,
    "updatedAt": "updatedAt",
    "version": 0,
    "deletedAt": "deletedAt",
    "logoIsOpaque": true,
    "logoKey": "logoKey",
    "text": "text"
  }
}
```

## Update Logo

`client.projects.watermark.updateLogo(stringprojectID, WatermarkUpdateLogoParamsbody, RequestOptionsoptions?): WatermarkUpdateLogoResponse`

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

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

### Parameters

- `projectID: string`

- `body: WatermarkUpdateLogoParams`

  - `logo: string`

    The logo image, base64-encoded, at most 1 MB and 4 megapixels once decoded.
    PNG, JPEG and WebP are accepted; SVG is refused. Stored as PNG.

### Returns

- `WatermarkUpdateLogoResponse`

  - `watermark: Watermark`

    Forced-watermark configuration stored at one scope.

    - `id: string`

      Stable identifier derived from level + scopeId

    - `createdAt: string`

      ISO-8601 creation timestamp

    - `createdBy: string`

      User id that last wrote the configuration

    - `enabled: boolean`

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

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

      Scope this configuration applies to: team or project

      - `"project"`

      - `"team"`

    - `opacity: number`

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

    - `placement: "bottom-left" | "bottom-right" | "center" | 3 more`

      Where the mark sits on the image

      - `"bottom-left"`

      - `"bottom-right"`

      - `"center"`

      - `"tiled"`

      - `"top-left"`

      - `"top-right"`

    - `rotation: number`

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

    - `scale: number`

      Mark width as a fraction of the image width

    - `scopeId: string`

      The id of the team or project that owns this configuration

    - `spacing: number`

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

    - `updatedAt: string`

      ISO-8601 last-update timestamp

    - `version: number`

      Bumped on every write.

    - `deletedAt?: string`

      Set when the configuration has been deleted.

    - `logoIsOpaque?: boolean`

      Whether the stored logo has no transparency at all.

      Recorded at upload so the UI can warn without decoding the image again: an
      opaque logo draws its whole rectangle, which a rotated tiled mark turns
      into a very visible diamond.

    - `logoKey?: string`

      Where the uploaded logo lives, when one is set.

    - `text?: string`

      Text rendered as the mark, when no logo is set

### Example

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

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

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

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

#### Response

```json
{
  "watermark": {
    "id": "id",
    "createdAt": "createdAt",
    "createdBy": "createdBy",
    "enabled": true,
    "level": "project",
    "opacity": 0,
    "placement": "bottom-left",
    "rotation": 0,
    "scale": 0,
    "scopeId": "scopeId",
    "spacing": 0,
    "updatedAt": "updatedAt",
    "version": 0,
    "deletedAt": "deletedAt",
    "logoIsOpaque": true,
    "logoKey": "logoKey",
    "text": "text"
  }
}
```

## Domain Types

### Watermark Delete Response

- `WatermarkDeleteResponse`

  - `deleted: boolean`

### Watermark Delete Logo Response

- `WatermarkDeleteLogoResponse`

  - `watermark: Watermark`

    Forced-watermark configuration stored at one scope.

    - `id: string`

      Stable identifier derived from level + scopeId

    - `createdAt: string`

      ISO-8601 creation timestamp

    - `createdBy: string`

      User id that last wrote the configuration

    - `enabled: boolean`

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

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

      Scope this configuration applies to: team or project

      - `"project"`

      - `"team"`

    - `opacity: number`

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

    - `placement: "bottom-left" | "bottom-right" | "center" | 3 more`

      Where the mark sits on the image

      - `"bottom-left"`

      - `"bottom-right"`

      - `"center"`

      - `"tiled"`

      - `"top-left"`

      - `"top-right"`

    - `rotation: number`

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

    - `scale: number`

      Mark width as a fraction of the image width

    - `scopeId: string`

      The id of the team or project that owns this configuration

    - `spacing: number`

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

    - `updatedAt: string`

      ISO-8601 last-update timestamp

    - `version: number`

      Bumped on every write.

    - `deletedAt?: string`

      Set when the configuration has been deleted.

    - `logoIsOpaque?: boolean`

      Whether the stored logo has no transparency at all.

      Recorded at upload so the UI can warn without decoding the image again: an
      opaque logo draws its whole rectangle, which a rotated tiled mark turns
      into a very visible diamond.

    - `logoKey?: string`

      Where the uploaded logo lives, when one is set.

    - `text?: string`

      Text rendered as the mark, when no logo is set

### Watermark Preview Response

- `WatermarkPreviewResponse`

  Response of the watermark preview routes.

  - `image: string`

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

### Watermark Retrieve Response

- `WatermarkRetrieveResponse`

  - `watermark: Watermark`

    Forced-watermark configuration stored at one scope.

    - `id: string`

      Stable identifier derived from level + scopeId

    - `createdAt: string`

      ISO-8601 creation timestamp

    - `createdBy: string`

      User id that last wrote the configuration

    - `enabled: boolean`

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

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

      Scope this configuration applies to: team or project

      - `"project"`

      - `"team"`

    - `opacity: number`

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

    - `placement: "bottom-left" | "bottom-right" | "center" | 3 more`

      Where the mark sits on the image

      - `"bottom-left"`

      - `"bottom-right"`

      - `"center"`

      - `"tiled"`

      - `"top-left"`

      - `"top-right"`

    - `rotation: number`

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

    - `scale: number`

      Mark width as a fraction of the image width

    - `scopeId: string`

      The id of the team or project that owns this configuration

    - `spacing: number`

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

    - `updatedAt: string`

      ISO-8601 last-update timestamp

    - `version: number`

      Bumped on every write.

    - `deletedAt?: string`

      Set when the configuration has been deleted.

    - `logoIsOpaque?: boolean`

      Whether the stored logo has no transparency at all.

      Recorded at upload so the UI can warn without decoding the image again: an
      opaque logo draws its whole rectangle, which a rotated tiled mark turns
      into a very visible diamond.

    - `logoKey?: string`

      Where the uploaded logo lives, when one is set.

    - `text?: string`

      Text rendered as the mark, when no logo is set

### Watermark Update Response

- `WatermarkUpdateResponse`

  - `watermark: Watermark`

    Forced-watermark configuration stored at one scope.

    - `id: string`

      Stable identifier derived from level + scopeId

    - `createdAt: string`

      ISO-8601 creation timestamp

    - `createdBy: string`

      User id that last wrote the configuration

    - `enabled: boolean`

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

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

      Scope this configuration applies to: team or project

      - `"project"`

      - `"team"`

    - `opacity: number`

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

    - `placement: "bottom-left" | "bottom-right" | "center" | 3 more`

      Where the mark sits on the image

      - `"bottom-left"`

      - `"bottom-right"`

      - `"center"`

      - `"tiled"`

      - `"top-left"`

      - `"top-right"`

    - `rotation: number`

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

    - `scale: number`

      Mark width as a fraction of the image width

    - `scopeId: string`

      The id of the team or project that owns this configuration

    - `spacing: number`

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

    - `updatedAt: string`

      ISO-8601 last-update timestamp

    - `version: number`

      Bumped on every write.

    - `deletedAt?: string`

      Set when the configuration has been deleted.

    - `logoIsOpaque?: boolean`

      Whether the stored logo has no transparency at all.

      Recorded at upload so the UI can warn without decoding the image again: an
      opaque logo draws its whole rectangle, which a rotated tiled mark turns
      into a very visible diamond.

    - `logoKey?: string`

      Where the uploaded logo lives, when one is set.

    - `text?: string`

      Text rendered as the mark, when no logo is set

### Watermark Update Logo Response

- `WatermarkUpdateLogoResponse`

  - `watermark: Watermark`

    Forced-watermark configuration stored at one scope.

    - `id: string`

      Stable identifier derived from level + scopeId

    - `createdAt: string`

      ISO-8601 creation timestamp

    - `createdBy: string`

      User id that last wrote the configuration

    - `enabled: boolean`

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

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

      Scope this configuration applies to: team or project

      - `"project"`

      - `"team"`

    - `opacity: number`

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

    - `placement: "bottom-left" | "bottom-right" | "center" | 3 more`

      Where the mark sits on the image

      - `"bottom-left"`

      - `"bottom-right"`

      - `"center"`

      - `"tiled"`

      - `"top-left"`

      - `"top-right"`

    - `rotation: number`

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

    - `scale: number`

      Mark width as a fraction of the image width

    - `scopeId: string`

      The id of the team or project that owns this configuration

    - `spacing: number`

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

    - `updatedAt: string`

      ISO-8601 last-update timestamp

    - `version: number`

      Bumped on every write.

    - `deletedAt?: string`

      Set when the configuration has been deleted.

    - `logoIsOpaque?: boolean`

      Whether the stored logo has no transparency at all.

      Recorded at upload so the UI can warn without decoding the image again: an
      opaque logo draws its whole rectangle, which a rotated tiled mark turns
      into a very visible diamond.

    - `logoKey?: string`

      Where the uploaded logo lives, when one is set.

    - `text?: string`

      Text rendered as the mark, when no logo is set
