Skip to content
Start here

Create watermark profiles via basic upload

POST/accounts/{account_id}/stream/watermarks

Creates watermark profiles using a single HTTP POST multipart/form-data request.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
Stream Write
Path ParametersExpand Collapse
account_id: string

The account identifier tag.

maxLength32
Body ParametersForm DataExpand Collapse
file: string

The image file to upload.

name: optional string

A short description of the watermark profile.

opacity: optional number

The translucency of the image. A value of 0.0 makes the image completely transparent, and 1.0 makes the image completely opaque. Note that if the image is already semi-transparent, setting this to 1.0 will not make the image completely opaque.

maximum1
minimum0
padding: optional number

The whitespace between the adjacent edges (determined by position) of the video and the image. 0.0 indicates no padding, and 1.0 indicates a fully padded video width or length, as determined by the algorithm.

maximum1
minimum0
position: optional string

The location of the image. Valid positions are: upperRight, upperLeft, lowerLeft, lowerRight, and center. Note that center ignores the padding parameter.

scale: optional number

The size of the image relative to the overall size of the video. This parameter will adapt to horizontal and vertical videos automatically. 0.0 indicates no scaling (use the size of the image as-is), and 1.0 fills the entire video.

maximum1
minimum0
ReturnsExpand Collapse
errors: array of { code, message, documentation_url, source }
code: number
minimum1000
message: string
documentation_url: optional string
source: optional { pointer }
pointer: optional string
messages: array of { code, message, documentation_url, source }
code: number
minimum1000
message: string
documentation_url: optional string
source: optional { pointer }
pointer: optional string
success: true

Whether the API call was successful.

result: optional Watermark { created, downloadedFrom, height, 8 more }
created: optional string

The date and a time a watermark profile was created.

formatdate-time
downloadedFrom: optional string

The source URL for a downloaded image. If the watermark profile was created via direct upload, this field is null.

height: optional number

The height of the image in pixels.

name: optional string

A short description of the watermark profile.

opacity: optional number

The translucency of the image. A value of 0.0 makes the image completely transparent, and 1.0 makes the image completely opaque. Note that if the image is already semi-transparent, setting this to 1.0 will not make the image completely opaque.

maximum1
minimum0
padding: optional number

The whitespace between the adjacent edges (determined by position) of the video and the image. 0.0 indicates no padding, and 1.0 indicates a fully padded video width or length, as determined by the algorithm.

maximum1
minimum0
position: optional string

The location of the image. Valid positions are: upperRight, upperLeft, lowerLeft, lowerRight, and center. Note that center ignores the padding parameter.

scale: optional number

The size of the image relative to the overall size of the video. This parameter will adapt to horizontal and vertical videos automatically. 0.0 indicates no scaling (use the size of the image as-is), and 1.0 fills the entire video.

maximum1
minimum0
size: optional number

The size of the image in bytes.

uid: optional string

The unique identifier for a watermark profile.

maxLength32
width: optional number

The width of the image in pixels.

Create watermark profiles via basic upload

curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/stream/watermarks \
    -H 'Content-Type: multipart/form-data' \
    -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
    -F file=@/Users/rchen/Downloads/watermark.png \
    -F name='Marketing Videos' \
    -F opacity=0.75 \
    -F padding=0.1 \
    -F position=center \
    -F scale=0.1
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": {
    "created": "2014-01-02T02:20:00Z",
    "downloadedFrom": "https://company.com/logo.png",
    "height": 0,
    "name": "Marketing Videos",
    "opacity": 0.75,
    "padding": 0.1,
    "position": "center",
    "scale": 0.1,
    "size": 29472,
    "uid": "ea95132c15732412d22c1476fa83f27a",
    "width": 0
  }
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": {
    "created": "2014-01-02T02:20:00Z",
    "downloadedFrom": "https://company.com/logo.png",
    "height": 0,
    "name": "Marketing Videos",
    "opacity": 0.75,
    "padding": 0.1,
    "position": "center",
    "scale": 0.1,
    "size": 29472,
    "uid": "ea95132c15732412d22c1476fa83f27a",
    "width": 0
  }
}