Updated on 2026-08-19 GMT+08:00

Querying Watermark Templates

Function

This API is used to query watermark templates that meet the specified criteria.

Calling Method

For details, see Calling APIs.

URI

GET /v1/{project_id}/watermark/templates

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain the project ID, see Obtaining a Project ID.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

name

No

String

Definition

Watermark template name.

Constraints

N/A

Range

Length: 1 to 255 characters

Default Value

N/A

scene

No

String

Definition

Service attribute.

Constraints

N/A

Range

  • cloud_live: Cloud Live

  • media_live: Media Live, which is only available on the International website.

Default value:

cloud_live

offset

No

Integer

Definition

Offset where the query starts.

Constraints

N/A

Value range:

0~4096

Default value:

0

limit

No

Integer

Definition

Number of records on each page.

Constraints

N/A

Value range:

1~100

Default value:

10

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

No

String

User token. This parameter is mandatory when token authentication is used. The token can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Authorization

No

String

Authentication information. This parameter is mandatory for AK/SK authentication.

X-Sdk-Date

No

String

Time when the request is sent. This parameter is mandatory for AK/SK authentication.

X-Project-Id

No

String

Project ID. This parameter is mandatory for AK/SK authentication.

Response Parameters

Status code: 200

Table 4 Response header parameters

Parameter

Type

Description

X-request-id

String

Request ID for task tracing. Format: request_id-timestamp-hostname. (request_id is the UUID generated on the server. timestamp is the current timestamp. hostname is the name of the server that handles the current request.)

Table 5 Response body parameters

Parameter

Type

Description

total

Integer

Definition

Total number of records.

Range

N/A

template_infos

Array of WatermarkTemplate objects

Definition

Watermark template list.

Table 6 WatermarkTemplate

Parameter

Type

Description

name

String

Definition

Watermark template name.

Range

Length: 1 to 255 characters

type

Integer

Definition

Watermark type.

  • 0: image

  • 1: text

  • 2: image and text

Value range:

0~2

description

String

Definition

Template description.

Range

Length: 0 to 512 characters

picture_url

String

Definition

Image download path.

Range

Length: 1 to 2,048 characters

width

Number

Definition

  • Integer: width of the watermark image, in pixels. The value can be 0 or an integer from 8 to 4,096.

  • Decimal: ratio of the watermark width to the output video width. Value range: [0, 1)

0, the original width and height of the watermark image are used.

  • The ratio can contain a maximum of four decimal places. The width and height must both be in pixels or ratios.

Value range:

0~4096

height

Number

Definition

Watermark image height. Options:

  • Integer: height of the watermark image, in pixels. The value can be 0 or an integer from 8 to 4,096.

  • Decimal: ratio of the watermark height to the output video width. Value range: [0, 1)

0, the original width and height of the watermark image are used.

  • The ratio can contain a maximum of four decimal places. The width and height must both be in pixels or ratios.

Value range:

0~4096

location

WatermarkLocation object

Definition

Watermark position.

text

WordWaterMarkInfo object

Definition

Text watermark information.

scene

String

Definition

Service attribute.

Range

  • cloud_live: Cloud Live

  • media_live: Media Live, which is only available on the International website.

Table 7 WordWaterMarkInfo

Parameter

Type

Description

format

String

Definition

Text content.

type is set to 1 or 2. This parameter is optional when type is set to 0.

Range

Length: 1 to 64 characters

font_color

String

Definition

Text color.

Range

Parameter verification: The value must start with a #, followed by 6 or 8 characters. Only digits (0–9), uppercase letters (A–F), and lowercase letters (a–f) are allowed. [Verification is mandatory. If the input is invalid, the text will be displayed in white by default.]

font_size

Integer

Definition

Font size.

Value range:

4~72

font

String

Definition

Font.

Range

  • harmonyRegular: HarmonyOS Sans Regular

  • douyu2.0: DOUYU Font

Length: 1 to 20 characters

time_zone

String

Definition

Time zone.

Range

The value ranges from UTC-1200 to UTC+1200. The first three characters are UTC, the fourth character is + or -, the fifth and sixth characters indicate the hour, and the seventh and eighth characters are fixed at 00.

shadow_color

String

Definition

Shadow color.

Range

Parameter verification: The value must start with a #, followed by 6 or 8 characters. Only digits (0–9), uppercase letters (A–F), and lowercase letters (a–f) are allowed. [Verification is mandatory. If the input is invalid, the text will be displayed in black by default.]

none.

location

WatermarkLocation object

Definition

Location.

Table 8 WatermarkLocation

Parameter

Type

Description

location

String

Definition

Watermark position.

Range

  • TOPLEFT: upper left

  • TOPRIGHT: upper right

  • BOTTOMLEFT: lower left

  • BOTTOMRIGHT: lower right

  • RANDOM: random If you select the random mode, the image watermark will appear randomly in the upper left, upper right, lower left, or lower right corner of the video stream. The specific position is further determined by the values of x_offset and y_offset. The watermark position changes every 5 to 30 minutes.

x_offset

Number

Definition

Horizontal offset between the watermark and the output video.

Options:

  • An integer indicates the offset in pixels. Value range: [1, 4096]

  • A decimal indicates the ratio of the horizontal offset to the output video width. Value range: [0, 1)

Value range:

0~4096

y_offset

Number

Definition

Vertical offset between the watermark and the output video.

Options:

  • An integer indicates the offset in pixels. Value range: [1, 4096]

  • A decimal indicates the ratio of the vertical offset to the output video height. Value range: [0, 1)

Value range:

0~4096

Status code: 400

Table 9 Response header parameters

Parameter

Type

Description

X-request-id

String

Request ID for task tracing. Format: request_id-timestamp-hostname. (request_id is the UUID generated on the server. timestamp is the current timestamp. hostname is the name of the server that handles the current request.)

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Example Requests

GET https://live.hwcloud.com/v1/{project_id}/watermark/templates

Example Responses

Status code: 200

Watermark templates queried.

{
  "total" : 1,
  "template_infos" : [ {
    "name" : "MyWatermarkTemplate",
    "type" : 0,
    "description" : "my demo template",
    "picture_url" : "http://example.com/picture",
    "width" : 0.1,
    "height" : 0.1,
    "location" : {
      "location" : "TOPLEFT",
      "x_offset" : 20,
      "y_offset" : 10
    }
  } ]
}

Status code: 400

Invalid parameter.

{
  "error_code" : "LIVE.100011001",
  "error_msg" : "Request Illegal"
}

Status Codes

Status Code

Description

200

Watermark templates queried.

400

Invalid parameter.

Error Codes

See Error Codes.