From 832dc2c45b59a15e7b36d6c1ae1c4063ebee4096 Mon Sep 17 00:00:00 2001 From: Accusys Date: Fri, 22 May 2026 10:41:34 +0800 Subject: [PATCH] docs: add bind/trace endpoint to 07_identity.md --- .../API_WORKSPACE/modules/07_identity.md | 42 +++++++++++++++++++ docs_v1.0/doc_wasm/modules/07_identity.md | 42 +++++++++++++++++++ 2 files changed, 84 insertions(+) diff --git a/docs_v1.0/API_WORKSPACE/modules/07_identity.md b/docs_v1.0/API_WORKSPACE/modules/07_identity.md index 66dc65a..066428c 100644 --- a/docs_v1.0/API_WORKSPACE/modules/07_identity.md +++ b/docs_v1.0/API_WORKSPACE/modules/07_identity.md @@ -245,6 +245,48 @@ curl -s -X POST "$API/api/v1/identity/$IDENTITY_UUID/bind" \ --- +### `POST /api/v1/identity/:identity_uuid/bind/trace` + +**Auth**: Required +**Scope**: identity-level + +Bind all face detections of a trace to an identity. Updates all rows in `face_detections` with the matching `file_uuid` and `trace_id`. + +#### Request Parameters + +| Field | Type | Required | Description | +|-------|------|----------|-------------| +| `file_uuid` | string | Yes | File where trace exists | +| `trace_id` | integer | Yes | Trace ID (from `face_detections.trace_id`) | + +#### Example + +```bash +curl -s -X POST "$API/api/v1/identity/$IDENTITY_UUID/bind/trace" \ + -H "X-API-Key: $KEY" \ + -H "Content-Type: application/json" \ + -d '{"file_uuid": "'"$FILE_UUID"'", "trace_id": 919}' +``` + +#### Response (200) + +```json +{ + "success": true, + "message": "Bound trace 919 of aeed71342... to Cary Grant", + "data": { "rows_affected": 53 } +} +``` + +#### Error Responses + +| HTTP | When | +|------|------| +| `404` | Identity not found | +| `500` | Database error | + +--- + ### `POST /api/v1/identity/:identity_uuid/unbind` **Auth**: Required diff --git a/docs_v1.0/doc_wasm/modules/07_identity.md b/docs_v1.0/doc_wasm/modules/07_identity.md index 66dc65a..066428c 100644 --- a/docs_v1.0/doc_wasm/modules/07_identity.md +++ b/docs_v1.0/doc_wasm/modules/07_identity.md @@ -245,6 +245,48 @@ curl -s -X POST "$API/api/v1/identity/$IDENTITY_UUID/bind" \ --- +### `POST /api/v1/identity/:identity_uuid/bind/trace` + +**Auth**: Required +**Scope**: identity-level + +Bind all face detections of a trace to an identity. Updates all rows in `face_detections` with the matching `file_uuid` and `trace_id`. + +#### Request Parameters + +| Field | Type | Required | Description | +|-------|------|----------|-------------| +| `file_uuid` | string | Yes | File where trace exists | +| `trace_id` | integer | Yes | Trace ID (from `face_detections.trace_id`) | + +#### Example + +```bash +curl -s -X POST "$API/api/v1/identity/$IDENTITY_UUID/bind/trace" \ + -H "X-API-Key: $KEY" \ + -H "Content-Type: application/json" \ + -d '{"file_uuid": "'"$FILE_UUID"'", "trace_id": 919}' +``` + +#### Response (200) + +```json +{ + "success": true, + "message": "Bound trace 919 of aeed71342... to Cary Grant", + "data": { "rows_affected": 53 } +} +``` + +#### Error Responses + +| HTTP | When | +|------|------| +| `404` | Identity not found | +| `500` | Database error | + +--- + ### `POST /api/v1/identity/:identity_uuid/unbind` **Auth**: Required