# Create a watermark template

POST https://services.leadconnectorhq.com/social-media-posting/{locationId}/watermarks

Create a new reusable watermark template for a location. The template stores the watermark image URL, position, scale, opacity, padding, and the connected accounts it applies to.

At post-publish time, the template is resolved for a given connected account via the `accountIds` binding — the `accountId` you provide here maps a connected social account to this template. To fetch account IDs, use the [Get Accounts](./get-account) endpoint.

## Authentication

Send `Authorization: Bearer <token>` using:

- **Sub-Account token: OAuth access token or Private Integration Token.** Scopes: `socialplanner/watermarks.write`

## Parameters

### Header Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Version` | string | Yes | API Version |

### Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `locationId` | string | Yes | Location Id |

## OpenAPI Specification

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "HighLevel API",
    "version": "2021-04-15"
  },
  "servers": [
    {
      "url": "https://services.leadconnectorhq.com"
    }
  ],
  "paths": {
    "/social-media-posting/{locationId}/watermarks": {
      "post": {
        "summary": "Create a watermark template",
        "operationId": "createAWatermarkTemplate",
        "description": "Create a new reusable watermark template for a location. The template stores the watermark image URL, position, scale, opacity, padding, and the connected accounts it applies to.\n\nAt post-publish time, the template is resolved for a given connected account via the `accountIds` binding — the `accountId` you provide here maps a connected social account to this template. To fetch account IDs, use the [Get Accounts](./get-account) endpoint.",
        "parameters": [
          {
            "name": "Version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "2021-04-15"
              ]
            }
          },
          {
            "name": "locationId",
            "required": true,
            "in": "path",
            "description": "Location Id",
            "schema": {
              "example": "ve9EPM428h8vShlRW1KT",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWatermarkTemplateRequestDTO"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Watermark template successfully created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WatermarkTemplateResponseDTO"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestDTO"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedDTO"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnprocessableDTO"
                }
              }
            }
          }
        },
        "security": [
          {
            "Location-Access": [
              "socialplanner/watermarks.write"
            ]
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account.",
        "type": "http"
      },
      "Agency-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency (OR) Private Integration Token of Agency.",
        "type": "http"
      },
      "Agency-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency.",
        "type": "http"
      }
    },
    "schemas": {
      "CreateWatermarkTemplateRequestDTO": {
        "type": "object",
        "properties": {
          "watermarkImageUrl": {
            "type": "string",
            "description": "URL of the watermark image. Must be a PNG or JPG file, minimum 200x200 pixels, and no larger than 5 MB.",
            "example": "http://example.com/watermark.png"
          },
          "position": {
            "type": "string",
            "description": "Watermark position. Position can be one of the following values: top-left, top-center, top-right, left-center, center, right-center, bottom-left, bottom-center, bottom-right",
            "example": "top-left",
            "enum": [
              "top-left",
              "top-right",
              "bottom-left",
              "bottom-right",
              "center",
              "top-center",
              "bottom-center",
              "left-center",
              "right-center"
            ]
          },
          "scale": {
            "type": "number",
            "description": "Scale factor for watermark. scale value must be between 0 - 1",
            "example": 0.5
          },
          "opacity": {
            "type": "number",
            "description": "Watermark opacity. opacity value must be between 0 - 1",
            "example": 0.7
          },
          "padding": {
            "type": "boolean",
            "description": "Whether padding is applied around the watermark",
            "example": true
          },
          "templateName": {
            "type": "string",
            "description": "Name of the watermark template",
            "example": "DefaultTemplate"
          },
          "accountIds": {
            "description": "Connected account IDs to bind this template to. These IDs map user accounts to this template at post-publish time. Use the [Get Accounts](./get-account) endpoint to look up account IDs.",
            "example": [
              "507f1f77bcf86cd799439011",
              "507f1f77bcf86cd799439012"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "title": "CreateWatermarkTemplateRequestDTO"
      },
      "WatermarkTemplateResponseDTO": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "Success or Failure",
            "example": true
          },
          "statusCode": {
            "type": "number",
            "description": "Status Code",
            "example": 201
          },
          "message": {
            "type": "string",
            "description": "Message",
            "example": "Created Watermark Image"
          },
          "results": {
            "description": "Requested Results",
            "example": {
              "_id": "665f1bac78fda9b6c5f48012",
              "watermarkImageUrl": "http://example.com/watermark.png",
              "position": "top-left",
              "scale": 0.5,
              "opacity": 0.7,
              "padding": true,
              "templateName": "DefaultTemplate",
              "locationId": "ve9EPM428h8vShlRW1KT",
              "createdBy": "Lx1EI6YIgQYMQi0ytFXv",
              "accountIds": [
                "507f1f77bcf86cd799439011",
                "507f1f77bcf86cd799439012"
              ],
              "deleted": false,
              "createdAt": "2024-07-24T10:21:00.123Z",
              "updatedAt": "2024-07-24T10:21:00.123Z"
            },
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "_id": {
                    "type": "string",
                    "description": "Template Id",
                    "example": "665f1bac78fda9b6c5f48012"
                  },
                  "watermarkImageUrl": {
                    "type": "string",
                    "description": "Watermark Image URL",
                    "example": "http://example.com/watermark.png"
                  },
                  "position": {
                    "type": "string",
                    "description": "Watermark position. Position can be one of the following values: top-left, top-center, top-right, left-center, center, right-center, bottom-left, bottom-center, bottom-right",
                    "enum": [
                      "top-left",
                      "top-right",
                      "bottom-left",
                      "bottom-right",
                      "center",
                      "top-center",
                      "bottom-center",
                      "left-center",
                      "right-center"
                    ],
                    "example": "top-left"
                  },
                  "scale": {
                    "type": "number",
                    "description": "Scale factor for watermark. scale value must be between 0 - 1",
                    "example": 0.5
                  },
                  "opacity": {
                    "type": "number",
                    "description": "Watermark opacity. opacity value must be between 0 - 1",
                    "example": 0.7
                  },
                  "padding": {
                    "type": "boolean",
                    "description": "Whether padding is applied around the watermark",
                    "example": true
                  },
                  "templateName": {
                    "type": "string",
                    "description": "Name of the watermark template",
                    "example": "DefaultTemplate"
                  },
                  "locationId": {
                    "type": "string",
                    "description": "Location ID this template belongs to",
                    "example": "ve9EPM428h8vShlRW1KT"
                  },
                  "createdBy": {
                    "type": "string",
                    "description": "User ID that created the template",
                    "example": "Lx1EI6YIgQYMQi0ytFXv"
                  },
                  "accountIds": {
                    "description": "Connected account IDs the template is bound to. These IDs map user accounts to this template at post-publish time. Use the [Get Accounts](./get-account) endpoint to look up account IDs.",
                    "example": [
                      "507f1f77bcf86cd799439011",
                      "507f1f77bcf86cd799439012"
                    ],
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "deleted": {
                    "type": "boolean",
                    "description": "Indicates whether template is soft deleted",
                    "example": false
                  },
                  "createdAt": {
                    "format": "date-time",
                    "type": "string",
                    "description": "Template created timestamp",
                    "example": "2024-07-24T10:21:00.123Z"
                  },
                  "updatedAt": {
                    "format": "date-time",
                    "type": "string",
                    "description": "Template updated timestamp",
                    "example": "2024-07-24T10:21:00.123Z"
                  }
                },
                "required": [
                  "_id",
                  "watermarkImageUrl",
                  "position",
                  "scale",
                  "opacity",
                  "padding",
                  "templateName",
                  "locationId",
                  "createdBy",
                  "accountIds",
                  "deleted"
                ],
                "title": "WatermarkTemplateSchema"
              }
            ]
          }
        },
        "required": [
          "success",
          "statusCode",
          "message"
        ],
        "title": "WatermarkTemplateResponseDTO"
      },
      "BadRequestDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 400
          },
          "message": {
            "type": "string",
            "example": "Bad Request"
          }
        },
        "title": "BadRequestDTO"
      },
      "UnauthorizedDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 401
          },
          "message": {
            "type": "string",
            "example": "Invalid token: access token is invalid"
          },
          "error": {
            "type": "string",
            "example": "Unauthorized"
          }
        },
        "title": "UnauthorizedDTO"
      },
      "UnprocessableDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 422
          },
          "message": {
            "example": [
              "Unprocessable Entity"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "error": {
            "type": "string",
            "example": "Unprocessable Entity"
          }
        },
        "title": "UnprocessableDTO"
      }
    }
  }
}
```

## HighLevel SDK Examples

**Node.js** (`@gohighlevel/api-client`)

```javascript
import HighLevel from '@gohighlevel/api-client';

const ghl = new HighLevel({
  privateIntegrationToken: '<PRIVATE_INTEGRATION_TOKEN>'
});

const body = {
  "watermarkImageUrl": "http://example.com/watermark.png",
  "position": "top-left",
  "scale": 0.5,
  "opacity": 0.7,
  "padding": true,
  "templateName": "DefaultTemplate",
  "accountIds": [
    "507f1f77bcf86cd799439011",
    "507f1f77bcf86cd799439012"
  ]
};

const response = await ghl.socialMediaPosting.createAWatermarkTemplate('<LOCATIONID>', body);
console.log(response);
```

**Python** (`gohighlevel-api-client`)

```python
from highlevel import HighLevel

client = HighLevel(
    private_integration_token='<PRIVATE_INTEGRATION_TOKEN>'
)

body = {
    "watermarkImageUrl": "http://example.com/watermark.png",
    "position": "top-left",
    "scale": 0.5,
    "opacity": 0.7,
    "padding": true,
    "templateName": "DefaultTemplate",
    "accountIds": [
        "507f1f77bcf86cd799439011",
        "507f1f77bcf86cd799439012"
    ]
}

response = await client.socialMediaPosting.create_a_watermark_template('<LOCATIONID>', body=body)
print(response)
```

**PHP** (`gohighlevel/api-client`)

```php
<?php
require_once 'vendor/autoload.php';

use HighLevel\HighLevel;
use HighLevel\HighLevelConfig;

$config = new HighLevelConfig([
    'privateIntegrationToken' => '<PRIVATE_INTEGRATION_TOKEN>'
]);
$ghl = new HighLevel($config);

$body = [
    'watermarkImageUrl' => 'http://example.com/watermark.png',
    'position' => 'top-left',
    'scale' => 0.5,
    'opacity' => 0.7,
    'padding' => true,
    'templateName' => 'DefaultTemplate',
    'accountIds' => [
        '507f1f77bcf86cd799439011',
        '507f1f77bcf86cd799439012'
    ]
];

$response = $ghl->socialMediaPosting->createAWatermarkTemplate('<LOCATIONID>', $body);
echo json_encode($response, JSON_PRETTY_PRINT);
```

## Code Examples

**cURL**

```bash
curl -L -X POST 'https://services.leadconnectorhq.com/social-media-posting/<locationId>/watermarks' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Version: 2021-04-15' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "watermarkImageUrl": "http://example.com/watermark.png",
  "position": "top-left",
  "scale": 0.5,
  "opacity": 0.7,
  "padding": true,
  "templateName": "DefaultTemplate",
  "accountIds": [
    "507f1f77bcf86cd799439011",
    "507f1f77bcf86cd799439012"
  ]
}'
```

**Node.js**

```javascript
const options = {
  method: 'POST',
  headers: {
    Authorization: 'Bearer <TOKEN>',
    Version: '2021-04-15',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
      "watermarkImageUrl": "http://example.com/watermark.png",
      "position": "top-left",
      "scale": 0.5,
      "opacity": 0.7,
      "padding": true,
      "templateName": "DefaultTemplate",
      "accountIds": [
        "507f1f77bcf86cd799439011",
        "507f1f77bcf86cd799439012"
      ]
  })
};

try {
  const response = await fetch('https://services.leadconnectorhq.com/social-media-posting/<locationId>/watermarks', options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

**Python**

```python
import requests

url = "https://services.leadconnectorhq.com/social-media-posting/{locationId}/watermarks"

headers = {
    "Authorization": "Bearer <TOKEN>",
    "Version": "2021-04-15"
}

payload = {
    "watermarkImageUrl": "http://example.com/watermark.png",
    "position": "top-left",
    "scale": 0.5,
    "opacity": 0.7,
    "padding": true,
    "templateName": "DefaultTemplate",
    "accountIds": [
        "507f1f77bcf86cd799439011",
        "507f1f77bcf86cd799439012"
    ]
}

response = requests.post(url, json=payload, headers=headers)
print(response.json())
```

**PHP**

```php
<?php
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => 'https://services.leadconnectorhq.com/social-media-posting/<locationId>/watermarks',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer <TOKEN>',
    'Version: 2021-04-15',
    'Content-Type: application/json',
  ],
  CURLOPT_POSTFIELDS => '{
  "watermarkImageUrl": "http://example.com/watermark.png",
  "position": "top-left",
  "scale": 0.5,
  "opacity": 0.7,
  "padding": true,
  "templateName": "DefaultTemplate",
  "accountIds": [
    "507f1f77bcf86cd799439011",
    "507f1f77bcf86cd799439012"
  ]
}',
]);

$response = curl_exec($curl);
curl_close($curl);
echo $response;
```

**Java**

```java
HttpResponse<String> response = Unirest
  .post("https://services.leadconnectorhq.com/social-media-posting/<locationId>/watermarks")
  .header("Authorization", "Bearer <TOKEN>")
  .header("Version", "2021-04-15")
  .header("Content-Type", "application/json")
  .body("{\"watermarkImageUrl\":\"http://example.com/watermark.png\",\"position\":\"top-left\",\"scale\":0.5,\"opacity\":0.7,\"padding\":true,\"templateName\":\"DefaultTemplate\",\"accountIds\":[\"507f1f77bcf86cd799439011\",\"507f1f77bcf86cd799439012\"]}")
  .asString();
```

**Go**

```go
package main

import (
  "fmt"
  "net/http"
  "io"
  "strings"
)

func main() {
  url := "https://services.leadconnectorhq.com/social-media-posting/<locationId>/watermarks"
  payload := strings.NewReader(`{
  "watermarkImageUrl": "http://example.com/watermark.png",
  "position": "top-left",
  "scale": 0.5,
  "opacity": 0.7,
  "padding": true,
  "templateName": "DefaultTemplate",
  "accountIds": [
    "507f1f77bcf86cd799439011",
    "507f1f77bcf86cd799439012"
  ]
}`)
  req, _ := http.NewRequest("POST", url, payload)
  req.Header.Add("Authorization", "Bearer <TOKEN>")
  req.Header.Add("Version", "2021-04-15")

  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := io.ReadAll(res.Body)
  fmt.Println(string(body))
}
```

**Ruby**

```ruby
require 'uri'
require 'net/http'

url = URI("https://services.leadconnectorhq.com/social-media-posting/<locationId>/watermarks")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = "Bearer <TOKEN>"
request["Version"] = "2021-04-15"
request["Content-Type"] = "application/json"
request.body = '{
  "watermarkImageUrl": "http://example.com/watermark.png",
  "position": "top-left",
  "scale": 0.5,
  "opacity": 0.7,
  "padding": true,
  "templateName": "DefaultTemplate",
  "accountIds": [
    "507f1f77bcf86cd799439011",
    "507f1f77bcf86cd799439012"
  ]
}'

response = http.request(request)
puts response.read_body
```

**PowerShell**

```powershell
$headers = @{
  "Authorization" = "Bearer <TOKEN>"
  "Version" = "2021-04-15"
}

$body = '{
  "watermarkImageUrl": "http://example.com/watermark.png",
  "position": "top-left",
  "scale": 0.5,
  "opacity": 0.7,
  "padding": true,
  "templateName": "DefaultTemplate",
  "accountIds": [
    "507f1f77bcf86cd799439011",
    "507f1f77bcf86cd799439012"
  ]
}'

$response = Invoke-RestMethod -Uri 'https://services.leadconnectorhq.com/social-media-posting/<locationId>/watermarks' -Method 'POST' -Headers $headers -Body $body -ContentType 'application/json'
$response | ConvertTo-Json
```
