Submit images and create an asynchronous search task. Provide single-image url/target_image_base64 or an image_urls/image_base64s list. Do not mix the two modes or supply both lists. URL takes precedence when both single-image fields are supplied.
For multiple images, recognize main/auxiliary views before optional LOC prediction. Manual loc_items take priority. Automatic LOC runs only when auto_loc_enabled=true, description is nonblank and manual LOC is empty. Preprocessing increases submit latency. After receiving task_id, use the existing status and stage-result APIs; the remaining workflow runs automatically.
On automatic LOC failure or no result, continue with other filters and no automatic LOC restriction; check preprocessing.auto_loc.status. If all multi-view recognition attempts fail, use only the first image. Validation failures do not create a task; other submission failures do not guarantee that no task record exists.
Request (single URL, manual LOC):
```json
{
"url": "https://static-open.zhihuiya.com/sample/common_demo.png",
"description": "目标产品描述",
"lang": "cn",
"country": [
"CN",
"EU"
],
"loc_items": [
{
"id": "14-03",
"desc": "电信设备、无线遥控设备和无线电放大器"
}
],
"apply_start_time": "20200101",
"apply_end_time": "20260917",
"simple_legal_status": "1,2",
"auto_loc_enabled": false
}
```
Request (single Base64):
```json
{
"target_image_base64": "",
"description": "目标产品描述",
"lang": "cn"
}
```
Request (automatic LOC, no manual LOC):
```json
{
"url": "https://static-open.zhihuiya.com/sample/common_demo.png",
"description": "目标产品描述",
"auto_loc_enabled": true
}
```
Request (multiple URLs, automatic LOC):
```json
{
"image_urls": [
"https://static-open.zhihuiya.com/sample/common_demo.png",
"https://example.com/product-side.png"
],
"description": "目标产品描述",
"auto_loc_enabled": true
}
```
Request (multiple Base64 images, automatic LOC):
```json
{
"image_base64s": [
"",
""
],
"description": "目标产品描述",
"auto_loc_enabled": true
}
```
Success (legacy single image):
```json
{
"code": 0,
"success": true,
"task_id": "task_0123456789ab",
"country": [
"CN",
"EU"
],
"message": "工作流任务已提交",
"status": true
}
```
Success (multi-view and automatic LOC completed):
```json
{
"code": 0,
"success": true,
"task_id": "task_0123456789ab",
"country": [
"CN",
"EU"
],
"message": "工作流任务已提交",
"status": true,
"preprocessing": {
"multi_view": {
"can_use_single_product_multi_view": true,
"main_image_index": 1,
"auxiliary_image_indexes": [
0
],
"excluded_image_indexes": [],
"reason": "同一产品的不同视角"
},
"auto_loc": {
"status": "completed",
"loc_items": [
{
"id": "14-03",
"desc": "电信设备、无线遥控设备和无线电放大器"
}
]
}
}
}
```
Failure response:
```json
{
"code": 1,
"success": false,
"task_id": null,
"message": "提交工作流失败: 图片读取失败",
"status": false
}
```
Validation failure (HTTP 422):
```json
{
"detail": [
{
"loc": [
"body",
"country"
],
"msg": "Input should be a valid list",
"type": "list_type",
"input": "EU"
}
],
"code": 1,
"status": false,
"success": false
}
```
Replace the example.com additional-view URL, task IDs and Base64 placeholders with real data. Use each image-input example separately; do not combine different modes into one request. Example message values are not guaranteed to be translated according to lang.
Overview
Submit images and create an asynchronous search task. Provide single-image url/target_image_base64 or an image_urls/image_base64s list. Do not mix the two modes or supply both lists. URL takes precedence when both single-image fields are supplied.
For multiple images, recognize main/auxiliary views before optional LOC prediction. Manual loc_items take priority. Automatic LOC runs only when auto_loc_enabled=true, description is nonblank and manual LOC is empty. Preprocessing increases submit latency. After receiving task_id, use the existing status and stage-result APIs; the remaining workflow runs automatically.
On automatic LOC failure or no result, continue with other filters and no automatic LOC restriction; check preprocessing.auto_loc.status. If all multi-view recognition attempts fail, use only the first image. Validation failures do not create a task; other submission failures do not guarantee that no task record exists.
Request (single URL, manual LOC):
```json
{
"url": "https://static-open.zhihuiya.com/sample/common_demo.png",
"description": "目标产品描述",
"lang": "cn",
"country": [
"CN",
"EU"
],
"loc_items": [
{
"id": "14-03",
"desc": "电信设备、无线遥控设备和无线电放大器"
}
],
"apply_start_time": "20200101",
"apply_end_time": "20260917",
"simple_legal_status": "1,2",
"auto_loc_enabled": false
}
```
Request (single Base64):
```json
{
"target_image_base64": "",
"description": "目标产品描述",
"lang": "cn"
}
```
Request (automatic LOC, no manual LOC):
```json
{
"url": "https://static-open.zhihuiya.com/sample/common_demo.png",
"description": "目标产品描述",
"auto_loc_enabled": true
}
```
Request (multiple URLs, automatic LOC):
```json
{
"image_urls": [
"https://static-open.zhihuiya.com/sample/common_demo.png",
"https://example.com/product-side.png"
],
"description": "目标产品描述",
"auto_loc_enabled": true
}
```
Request (multiple Base64 images, automatic LOC):
```json
{
"image_base64s": [
"",
""
],
"description": "目标产品描述",
"auto_loc_enabled": true
}
```
Success (legacy single image):
```json
{
"code": 0,
"success": true,
"task_id": "task_0123456789ab",
"country": [
"CN",
"EU"
],
"message": "工作流任务已提交",
"status": true
}
```
Success (multi-view and automatic LOC completed):
```json
{
"code": 0,
"success": true,
"task_id": "task_0123456789ab",
"country": [
"CN",
"EU"
],
"message": "工作流任务已提交",
"status": true,
"preprocessing": {
"multi_view": {
"can_use_single_product_multi_view": true,
"main_image_index": 1,
"auxiliary_image_indexes": [
0
],
"excluded_image_indexes": [],
"reason": "同一产品的不同视角"
},
"auto_loc": {
"status": "completed",
"loc_items": [
{
"id": "14-03",
"desc": "电信设备、无线遥控设备和无线电放大器"
}
]
}
}
}
```
Failure response:
```json
{
"code": 1,
"success": false,
"task_id": null,
"message": "提交工作流失败: 图片读取失败",
"status": false
}
```
Validation failure (HTTP 422):
```json
{
"detail": [
{
"loc": [
"body",
"country"
],
"msg": "Input should be a valid list",
"type": "list_type",
"input": "EU"
}
],
"code": 1,
"status": false,
"success": false
}
```
Replace the example.com additional-view URL, task IDs and Base64 placeholders with real data. Use each image-input example separately; do not combine different modes into one request. Example message values are not guaranteed to be translated according to lang.
Endpoint
post https://connect.patsnap.com/api/mcp/submit-workflow
View OpenAPI schema/openapi.json#/paths/~1api~1mcp~1submit-workflow/post
Authentication
All Patsnap Open Platform REST APIs require a valid API key in the Authorization header as a Bearer token.
Authentication guide