{
  "info": {
    "_postman_id": "4f903f40-b439-4bc1-91b7-241240869617",
    "name": "DeepSwapAI Face Swap API",
    "description": "Server-side request examples for the five production DeepSwapAI face swap workflows. Set apiKey, select local files, submit a task, then run the matching poll request. This collection is an example asset, not an official language SDK. Webhook callbacks are not currently supported.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{apiKey}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://deepswapai.com",
      "type": "string"
    },
    {
      "key": "apiKey",
      "value": "",
      "type": "secret"
    },
    {
      "key": "taskId",
      "value": "",
      "type": "string"
    }
  ],
  "item": [
    {
      "name": "Photo face swap",
      "description": "Costs 6 credits. Each image can be up to 30 MB. Accepted inputs are JPEG/JPG, PNG, WebP, GIF, BMP, HEIC, or HEIF with validated image content.",
      "item": [
        {
          "name": "Create Photo face swap task",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Task accepted', function () { pm.expect(pm.response.code).to.eql(200); });",
                  "const payload = pm.response.json();",
                  "pm.expect(payload.taskId).to.be.a('string');",
                  "pm.collectionVariables.set('taskId', payload.taskId);"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "sourceImage",
                  "type": "file",
                  "src": "",
                  "description": "Face reference image; maximum 30 MB."
                },
                {
                  "key": "targetImage",
                  "type": "file",
                  "src": "",
                  "description": "Target scene image; maximum 30 MB."
                }
              ]
            },
            "url": "{{baseUrl}}/api/ai-tasks",
            "description": "Costs 6 credits. Each image can be up to 30 MB. Accepted inputs are JPEG/JPG, PNG, WebP, GIF, BMP, HEIC, or HEIF with validated image content.\n\nRequires a verified account email and sufficient credits."
          },
          "response": []
        },
        {
          "name": "Poll Photo face swap task",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{baseUrl}}/api/ai-tasks?taskId={{taskId}}",
            "description": "Poll this endpoint until status is COMPLETED, FAILED, or CANCELLED. Polling is the currently supported completion mechanism; webhook callbacks are not available. Start near 5 seconds, use bounded exponential backoff with jitter, honor Retry-After, and cap the interval at 30 seconds. A local polling deadline is not a terminal task state: retain taskId and resume GET polling instead of submitting a duplicate POST."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Batch photo face swap",
      "description": "Costs 6 credits per generated output. A request can contain at most 20 total input images across sourceImages and targetImages, 30 MB per image, and 95 MB combined. JPEG, PNG, WebP, AVIF, HEIC, and HEIF are accepted.",
      "item": [
        {
          "name": "Create Batch photo face swap task",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Task accepted', function () { pm.expect(pm.response.code).to.eql(200); });",
                  "const payload = pm.response.json();",
                  "pm.expect(payload.taskId).to.be.a('string');",
                  "pm.collectionVariables.set('taskId', payload.taskId);"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "mode",
                  "type": "text",
                  "value": "singleToMulti",
                  "description": "singleToMulti requires one source image and one or more targets. multiToSingle requires one or more source images and one target."
                },
                {
                  "key": "sourceImages",
                  "type": "file",
                  "src": "",
                  "description": "Source face image."
                },
                {
                  "key": "targetImages",
                  "type": "file",
                  "src": "",
                  "description": "Target image."
                }
              ]
            },
            "url": "{{baseUrl}}/api/ai-tasks/batch-face-swap",
            "description": "Costs 6 credits per generated output. A request can contain at most 20 total input images across sourceImages and targetImages, 30 MB per image, and 95 MB combined. JPEG, PNG, WebP, AVIF, HEIC, and HEIF are accepted.\n\nRequires a verified account email and sufficient credits."
          },
          "response": []
        },
        {
          "name": "Poll Batch photo face swap task",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{baseUrl}}/api/ai-tasks/batch-face-swap?taskId={{taskId}}",
            "description": "Poll this endpoint until status is COMPLETED, FAILED, or CANCELLED. Polling is the currently supported completion mechanism; webhook callbacks are not available. Start near 5 seconds, use bounded exponential backoff with jitter, honor Retry-After, and cap the interval at 30 seconds. A local polling deadline is not a terminal task state: retain taskId and resume GET polling instead of submitting a duplicate POST. When status is COMPLETED, result.urls contains the ordered per-output URLs. result.zipUrl contains a ZIP download when more than one output was produced and is null for a single output."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Mapped group-photo face swap",
      "description": "Costs 6 credits per replacement face. Supply one group photo, contiguous targetFace0 through targetFace9 fields, and one corresponding faceBox mapping for every replacement. The total request can be up to 95 MB.",
      "item": [
        {
          "name": "Create Mapped group-photo face swap task",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Task accepted', function () { pm.expect(pm.response.code).to.eql(200); });",
                  "const payload = pm.response.json();",
                  "pm.expect(payload.taskId).to.be.a('string');",
                  "pm.collectionVariables.set('taskId', payload.taskId);"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "sourceImage",
                  "type": "file",
                  "src": "",
                  "description": "Group photo containing the people to replace. JPEG, PNG, or WebP; maximum 30 MB."
                },
                {
                  "key": "targetFace0",
                  "type": "file",
                  "src": "",
                  "description": "Replacement identity image 0. Numbered fields must be contiguous from targetFace0. JPEG, PNG, or WebP; maximum 30 MB."
                },
                {
                  "key": "faceBox0",
                  "type": "text",
                  "value": "{\"x\":120,\"y\":80,\"width\":180,\"height\":180}",
                  "description": "Required when targetFace0 is supplied. JSON face mapping: {\"x\":number,\"y\":number,\"width\":number,\"height\":number}. Supply exactly one mapping for every replacement face."
                }
              ]
            },
            "url": "{{baseUrl}}/api/ai-tasks/multi-face-swap",
            "description": "Costs 6 credits per replacement face. Supply one group photo, contiguous targetFace0 through targetFace9 fields, and one corresponding faceBox mapping for every replacement. The total request can be up to 95 MB.\n\nRequires a verified account email and sufficient credits."
          },
          "response": []
        },
        {
          "name": "Poll Mapped group-photo face swap task",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{baseUrl}}/api/ai-tasks/multi-face-swap?taskId={{taskId}}",
            "description": "Poll this endpoint until status is COMPLETED, FAILED, or CANCELLED. Polling is the currently supported completion mechanism; webhook callbacks are not available. Start near 5 seconds, use bounded exponential backoff with jitter, honor Retry-After, and cap the interval at 30 seconds. A local polling deadline is not a terminal task state: retain taskId and resume GET polling instead of submitting a duplicate POST."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Video face swap",
      "description": "The face image can be up to 30 MB. The MP4, MOV, or WebM target can be up to 95 MB and 600 seconds, and both uploaded files must be 95 MB or smaller combined. One face reference is applied to the primary on-camera person; separate reference mapping for multiple people in one video is not supported. The workflow changes the face only and preserves the original body, clothing, hands, products, text, logos, framing, and scene. Output is fixed to the highest supported 1080p tier. Duration is rounded up. Processing costs 3 credits per second with a 12-credit minimum.",
      "item": [
        {
          "name": "Create Video face swap task",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Task accepted', function () { pm.expect(pm.response.code).to.eql(200); });",
                  "const payload = pm.response.json();",
                  "pm.expect(payload.taskId).to.be.a('string');",
                  "pm.collectionVariables.set('taskId', payload.taskId);"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "sourceImage",
                  "type": "file",
                  "src": "",
                  "description": "Face reference image; JPEG, PNG, WebP, HEIC, or HEIF; maximum 30 MB."
                },
                {
                  "key": "targetVideo",
                  "type": "file",
                  "src": "",
                  "description": "Target MP4, MOV, or WebM video; maximum 95 MB and 600 seconds."
                },
                {
                  "key": "quality",
                  "type": "text",
                  "value": "1080p",
                  "description": "Output is fixed to the highest supported 1080p tier."
                }
              ]
            },
            "url": "{{baseUrl}}/api/ai-tasks/video",
            "description": "The face image can be up to 30 MB. The MP4, MOV, or WebM target can be up to 95 MB and 600 seconds, and both uploaded files must be 95 MB or smaller combined. One face reference is applied to the primary on-camera person; separate reference mapping for multiple people in one video is not supported. The workflow changes the face only and preserves the original body, clothing, hands, products, text, logos, framing, and scene. Output is fixed to the highest supported 1080p tier. Duration is rounded up. Processing costs 3 credits per second with a 12-credit minimum.\n\nRequires a verified account email and sufficient credits."
          },
          "response": []
        },
        {
          "name": "Poll Video face swap task",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{baseUrl}}/api/ai-tasks/video?taskId={{taskId}}",
            "description": "Poll this endpoint until status is COMPLETED, FAILED, or CANCELLED. Polling is the currently supported completion mechanism; webhook callbacks are not available. Start near 5 seconds, use bounded exponential backoff with jitter, honor Retry-After, and cap the interval at 30 seconds. A local polling deadline is not a terminal task state: retain taskId and resume GET polling instead of submitting a duplicate POST."
          },
          "response": []
        }
      ]
    },
    {
      "name": "GIF or short-clip face swap",
      "description": "The face image can be up to 30 MB. The GIF, MP4, or WebM target can be up to 95 MB and 30 seconds, and both uploaded files must be 95 MB or smaller combined. Duration is rounded up. Cost is 3 credits per second with a 12-credit minimum.",
      "item": [
        {
          "name": "Create GIF or short-clip face swap task",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Task accepted', function () { pm.expect(pm.response.code).to.eql(200); });",
                  "const payload = pm.response.json();",
                  "pm.expect(payload.taskId).to.be.a('string');",
                  "pm.collectionVariables.set('taskId', payload.taskId);"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "sourceImage",
                  "type": "file",
                  "src": "",
                  "description": "Face reference image; JPEG, PNG, WebP, HEIC, or HEIF; maximum 30 MB."
                },
                {
                  "key": "targetGif",
                  "type": "file",
                  "src": "",
                  "description": "Target GIF, MP4, or WebM animation; maximum 95 MB and 30 seconds. Target and face-reference uploads must be 95 MB or smaller combined."
                }
              ]
            },
            "url": "{{baseUrl}}/api/ai-tasks/gif",
            "description": "The face image can be up to 30 MB. The GIF, MP4, or WebM target can be up to 95 MB and 30 seconds, and both uploaded files must be 95 MB or smaller combined. Duration is rounded up. Cost is 3 credits per second with a 12-credit minimum.\n\nRequires a verified account email and sufficient credits."
          },
          "response": []
        },
        {
          "name": "Poll GIF or short-clip face swap task",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{baseUrl}}/api/ai-tasks/gif?taskId={{taskId}}",
            "description": "Poll this endpoint until status is COMPLETED, FAILED, or CANCELLED. Polling is the currently supported completion mechanism; webhook callbacks are not available. Start near 5 seconds, use bounded exponential backoff with jitter, honor Retry-After, and cap the interval at 30 seconds. A local polling deadline is not a terminal task state: retain taskId and resume GET polling instead of submitting a duplicate POST."
          },
          "response": []
        }
      ]
    }
  ]
}
