Skip to content
Start here

Insert logo query

client.brandProtection.v2.logos.create(LogoCreateParams { account_id, image_data, similarity_threshold, 2 more } params, RequestOptionsoptions?): LogoCreateResponse { message, success, query_id }
POST/accounts/{account_id}/cloudforce-one/v2/brand-protection/logo/queries

Create a new saved brand protection logo query for visual similarity matching

Security

API Token

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

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
Accepted Permissions (at least one required)
Cloudforce One Write
ParametersExpand Collapse
params: LogoCreateParams { account_id, image_data, similarity_threshold, 2 more }
account_id: string

Path param

minLength1
image_data: string

Body param: Base64 encoded image data. Can include data URI prefix (e.g., ‘data:image/png;base64,…’) or just the base64 string.

minLength1
similarity_threshold: number

Body param: Minimum similarity score (0-1) required for visual matches

maximum1
minimum0
tag: string

Body param: Unique identifier for the logo query

minLength1
search_lookback?: boolean

Body param: If true, search historic scanned images for matches above the similarity threshold

ReturnsExpand Collapse
LogoCreateResponse { message, success, query_id }
message: string
success: boolean
query_id?: number

Insert logo query

import Cloudflare from 'cloudflare';

const client = new Cloudflare({
  apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});

const logo = await client.brandProtection.v2.logos.create({
  account_id: 'x',
  image_data: 'x',
  similarity_threshold: 0,
  tag: 'x',
});

console.log(logo.query_id);
{
  "message": "message",
  "success": true,
  "query_id": 0
}
Returns Examples
{
  "message": "message",
  "success": true,
  "query_id": 0
}