## Create watermark profiles via basic upload `client.Stream.Watermarks.New(ctx, params) (*Watermark, error)` **post** `/accounts/{account_id}/stream/watermarks` Creates watermark profiles using a single `HTTP POST multipart/form-data` request. ### Parameters - `params WatermarkNewParams` - `AccountID param.Field[string]` Path param: The account identifier tag. - `File param.Field[string]` Body param: The image file to upload. - `Name param.Field[string]` Body param: A short description of the watermark profile. - `Opacity param.Field[float64]` Body param: 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. - `Padding param.Field[float64]` Body param: 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. - `Position param.Field[string]` Body param: The location of the image. Valid positions are: `upperRight`, `upperLeft`, `lowerLeft`, `lowerRight`, and `center`. Note that `center` ignores the `padding` parameter. - `Scale param.Field[float64]` Body param: 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. ### Returns - `type Watermark struct{…}` - `Created Time` The date and a time a watermark profile was created. - `DownloadedFrom string` The source URL for a downloaded image. If the watermark profile was created via direct upload, this field is null. - `Height int64` The height of the image in pixels. - `Name string` A short description of the watermark profile. - `Opacity float64` 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. - `Padding float64` 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. - `Position string` The location of the image. Valid positions are: `upperRight`, `upperLeft`, `lowerLeft`, `lowerRight`, and `center`. Note that `center` ignores the `padding` parameter. - `Scale float64` 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. - `Size float64` The size of the image in bytes. - `UID string` The unique identifier for a watermark profile. - `Width int64` The width of the image in pixels. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/stream" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) watermark, err := client.Stream.Watermarks.New(context.TODO(), stream.WatermarkNewParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), File: cloudflare.F("@/Users/rchen/Downloads/watermark.png"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", watermark.UID) } ``` #### Response ```json { "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 } } ```