Image Blacklist and Whitelist

API Overview

Add images to the blacklist or whitelist to control image moderation results. type=0 selects the blacklist and type=1 selects the whitelist.

Add Images

POSThttps://isafe.ilivedata.com/api/v1/image/stats/black-white-list

Set imageType to 1 for URLs or 2 for Base64 (default, compatible with existing requests). URLs must be public HTTP/HTTPS direct links without redirects. Each download is limited to 10 MiB, with 10-second connect and read timeouts.

Request Parameters

Headers

Header Value Description
Content-Type application/json;charset=UTF-8 Request body format
Accept application/json;charset=UTF-8 Recommended response format
X-AppId — Image project ID; use the same ID as in moderation requests
X-TimeStamp — Current UTC time, e.g. 2026-10-19T02:30:00Z; refresh for each request
Authorization — Signature generated with the project API secret

Request Body

Field Type Required Description
type Integer Yes 0: blacklist; 1: whitelist
imageType Integer No 1: URL; 2: Base64 (default). Cannot be null; independent of list type
images Array<String> Yes Nonempty array using one format per request: image URLs for imageType=1; Base64 or data:image/png;base64,... for imageType=2
tags Array<Integer> Conditional Required and nonempty for a blacklist (type=0). A whitelist may omit it or use null; a supplied array must not be empty. Each element must be a published image category ID available to the project. Null elements, nonpositive values, subcategory IDs, and unknown IDs are rejected; e.g. 120 denotes prohibited content
operator String No Operator name, recommended for traceability

Request Examples

Add by URL

{
  "type": 0,
  "imageType": 1,
  "tags": [
    120
  ],
  "images": [
    "https://example.com/image.png"
  ],
  "operator": "api-user"
}

Replace the URL with an accessible direct image link. The server downloads and archives the image.

Add by Base64

{
  "type": 0,
  "imageType": 2,
  "tags": [
    120
  ],
  "images": [
    "data:image/png;base64,<complete image Base64>"
  ],
  "operator": "api-user"
}

Replace the placeholder with a complete decodable image. Success returns code=0 without the new record ID. Verify the record in the console’s blacklist/whitelist management page for the project. Deduplication is not guaranteed; check the console before retrying an addition after a timeout.

Request Signature

See Request Signature in Help Center. Use the project API secret and these values for this endpoint:

Signing Parameter Value
HTTPMethod POST
HostHeaderInLowercase isafe.ilivedata.com
HTTPRequestURI /api/v1/image/stats/black-white-list

Use isafe.ilivedata.com for both the request domain and signing Host. This endpoint does not require URL query parameters or X-Nonce / X-RtmId headers.

HTTP Response

Content-Type: application/json;charset=UTF-8

Responses use JSON.

Response Fields

Field Type Description
code Number Business status; 0 indicates success
msg String Response message; may be null
data null Null on success; the new record ID is not returned

Response Examples

Successful addition:

{
  "code": 0,
  "msg": null,
  "data": null
}

Error Codes

Check both HTTP status and business code; code=0 indicates success. Gateway authentication failures can return HTTP 401, for example {"errorCode":1107,"errorMessage":"Invalid Token"}. Check the project secret, actual Host, full path, timestamp, and exact JSON bytes used for signing. Request validation failures generally return HTTP 400.

Category configuration is checked before addition. If the configuration service is unavailable, HTTP 503 is returned without uploading images or inserting records.