Skip to content

Watermarks

A watermark layers a transparent PNG (your logo or handle) onto every uploaded image. Sosyabot applies watermarks at upload time so the processed file lands in the Library already branded — not at publish time.

Endpoints

System-wide watermark (admin only):

  • GET /api/v1/watermarks/system — fetch the current system watermark.
  • PUT /api/v1/watermarks/system — upsert (admin permission required).

There is no per-user or per-channel watermark; the workspace has one shared system watermark today.

Watermark model

typescript
{
  team_id: ObjectId | null,            // null = system-wide
  image_url: string,                   // PNG with transparency
  position: "top-left" | "top-right" | "bottom-left" | "bottom-right" | "center",
  opacity: number,                     // 0–100
  size_pct: number,                    // 1–100, % of image width
  enabled: boolean,
}

Defaults: position: "bottom-right", opacity: 60, size_pct: 20.

When the watermark is applied

The applyWatermarkIfEnabled() service runs during media upload (backend/src/services/watermarks.service.ts):

  1. Check if the watermark module is enabled for the workspace.
  2. Fetch the system watermark; bail if disabled.
  3. Resize the watermark to size_pct of the source image's width.
  4. Adjust opacity via alpha blending.
  5. Composite onto the source at position using Sharp.
  6. Return the processed buffer (or the original buffer if any step fails — fail-open by design).

Because watermarking is at upload time, the original (un-watermarked) bytes are not retained. Re-upload a clean copy if you need the unbranded version.