Skip to content
Niu DocsNiu 牛元文档
Dashboard控制台

Preview explicitly consented workspace image processing

Generated from the checked-in source. Do not edit this reference by hand.

POST /api/v1/organizations/{organization}/projects/{project}/guardrails/image-detectors/{detector}/preview

Workspace write access required. Sends the supplied inline PNG, JPEG or WebP image to a deployment-configured image detector only after workspace authorization, current explicit consent and declared-unmetered checks. Route request body limit is 2 MiB. Decode errors are 400; decode-worker busy/failure is 503. Inspection unavailability is a 200 indeterminate outcome. Does not save or activate a policy, grant dispatch access or integrate customer billing. Cache-Control: no-store.

Operation: previewWorkspaceImageDetector.

Use the credential and permission scope described above. Each object below is an alternative; schemes within one object are required together.

JSON
[
{
"bearerAuth": []
}
]

Set NIU_ORIGIN to your installation origin (without /v1). Replace path, query and header placeholders with the required values. Query examples use curl 7.87 or newer to encode values with --url-query. Use the credential scope described above; a bearer token must have the authority required by this operation.

Shell
curl --fail-with-body -X POST "$NIU_ORIGIN/api/v1/organizations/{organization}/projects/{project}/guardrails/image-detectors/{detector}/preview" \
-H "Authorization: Bearer $NIU_BEARER_TOKEN" \
-H 'Content-Type: application/json' \
--data @request.json

Location: path. Required.

JSON
{
"type": "string",
"format": "uuid"
}

Location: path. Required.

JSON
{
"type": "string",
"format": "uuid"
}

Location: path. Required.

JSON
{
"type": "string"
}

Required.

JSON
{
"type": "object",
"additionalProperties": false,
"required": [
"consent",
"image"
],
"properties": {
"consent": {
"type": "object",
"additionalProperties": false,
"required": [
"configuration_fingerprint",
"consent_to_image_processing"
],
"properties": {
"configuration_fingerprint": {
"type": "string"
},
"consent_to_image_processing": {
"type": "boolean"
}
}
},
"image": {
"type": "string",
"description": "Inline data:image reference; bounded PNG, JPEG or WebP decoding."
}
}
}

Declared metadata or synthetic result; Cache-Control: no-store

Response headers:

JSON
{
"Cache-Control": {
"schema": {
"type": "string"
},
"description": "no-store"
}
}

Content type: application/json.

JSON
{
"type": "object",
"required": [
"outcome",
"reason",
"synthetic",
"enforcement",
"policy_activation"
],
"properties": {
"outcome": {
"type": "string",
"enum": [
"clear",
"matched",
"indeterminate"
]
},
"reason": {
"type": "string",
"enum": [
"inspected_image",
"image_match",
"inspection_unavailable"
]
},
"synthetic": {
"type": "boolean",
"enum": [
true
]
},
"enforcement": {
"type": "boolean",
"enum": [
false
]
},
"policy_activation": {
"type": "boolean",
"enum": [
false
]
}
}
}

Malformed JSON, unknown fields, invalid content, oversized body or missing/stale explicit consent

Invalid management credential; inference credentials cannot access management endpoints

Insufficient workspace permission or installation administrator authorization

Workspace or configured detector not found

Authorization/storage unavailable or image decode workers unavailable

Workspace write access required. Sends the supplied inline PNG, JPEG or WebP image to a deployment-configured image detector only after workspace authorization, current explicit consent and declared-unmetered checks. Route request body limit is 2 MiB. Decode errors are 400; decode-worker busy/failure is 503. Inspection unavailability is a 200 indeterminate outcome. Does not save or activate a policy, grant dispatch access or integrate customer billing. Cache-Control: no-store.

Supported scope: implemented