Overview
Swap faces between a source and a target image or video with identity-preserving blending. Handles diverse lighting, pose, and expression conditions.
Primary Endpoint
POST
/api/v1/userFaceSwapTask/addCreate a new face swap task
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Name of the face swap task |
| video_url | string | Yes | URL of the video to swap face in |
| face_url | string | Yes | URL of the face image to swap with |
| cover_url | string | No | Optional cover image URL |
| model_version | enum: v1 | v2 | No | Face swap model version: v1 (JAH pipeline, default), v2 (ComfyUI, image only) |
| webhook_url | string | No | HTTPS URL to receive task.completed / task.failed notifications. Best-effort delivery, single attempt, no retries; clients should treat the detail API as the source of truth. |
| webhook_token | string | No | Optional plaintext token returned in the X-A2e-Webhook-Token header so receivers can verify the request originated from a2e. |
Request Example
curl -X POST "https://www.a2e.com.cn/api/v1/userFaceSwapTask/add" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "My Face Swap Video",
"video_url": "https://example.com/video.mp4",
"face_url": "https://example.com/face.jpg",
"cover_url": "https://example.com/cover.jpg",
"model_version": "v1",
"webhook_url": "https://your-server.example.com/a2e/webhook",
"webhook_token": "a-shared-secret"
}'Related Endpoints
POST
/api/v1/userFaceSwapImage/addAdd a new face image for face swapping
GET
/api/v1/userFaceSwapImage/recordsGet user's face swap image records
DELETE
/api/v1/userFaceSwapImage/{_id}Remove a face swap image
POST
/api/v1/userFaceSwapPreview/addCreate a new face swap preview task
GET
/api/v1/userFaceSwapPreview/statusGet face swap preview status
POST
/api/v1/userFaceSwapTask/addCreate a new face swap task
GET
/api/v1/userFaceSwapTask/recordsGet user's face swap task records
GET
/api/v1/userFaceSwapTask/statusGet user's face swap task status
POST
/api/v1/userFaceSwapTask/batchDetailBatch query task details
GET
/api/v1/userFaceSwapTask/{_id}Get face swap task details
DELETE
/api/v1/userFaceSwapTask/{_id}Delete face swap task
Responses
200
Face swap task created successfully
400
Bad Request - Invalid parameters
401
Unauthorized - Invalid or missing bearer token