docs: add bind/trace endpoint to 07_identity.md

This commit is contained in:
Accusys
2026-05-22 10:41:34 +08:00
parent 883535c4f7
commit 832dc2c45b
2 changed files with 84 additions and 0 deletions

View File

@@ -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

View File

@@ -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