Cancel InsightFaceSwap job
Table of contents
Cancel execution of job created by
- faceswap/headshot
- faceswap/changebg
- faceswap/picsi with initial jobs status returned
started
https://api.useapi.net/v1/faceswap/jobs/cancel/?jobid=
jobid
Request Headers
Authorization: Bearer {API token}
API token
is required, see Setup useapi.net for details.
Query Parameter
jobid
is required, use value returned by
- faceswap/headshot
- faceswap/changebg
- faceswap/picsi with initial jobs status returned
started
Responses
-
{ "jobid": "<jobid>", "status": "cancelled" } "code": 200
-
{ "error": "Query param jobid not provided", "code": 400 }
-
{ "error": "Unauthorized", "code": 401 }
-
{ "error": "Account has no subscription or subscription expired", "code": 402 }
-
{ "error": "Unable to locate job <jobid>", "code": 404 }
Model
{ // TypeScript, all fields are optional
jobid: string,
status: 'created' | 'started' | 'moderated' | 'progress' |
'completed' | 'failed' | 'cancelled',
error: string,
errorDetails: string,
code: number
}
Examples
-
curl https://api.useapi.net/v1/faceswap/jobs/cancel/?jobid=… \ -H "Accept: application/json" \ -H "Authorization: Bearer …"
-
const token = "API token"; const jobid = "jobid returned by faceswap/changebg, faceswap/headshot or faceswap/picsi"; const apiUrl = `https://api.useapi.net/v1/faceswap/jobs/cancel/?jobid=${jobid}`; const response = await fetch(apiUrl, { headers: { "Authorization": `Bearer ${token}`, }, }); const result = await response.json(); console.log("response", {response, result});
-
import requests token = "API token" jobid = "jobid returned by faceswap/changebg, faceswap/headshot or faceswap/picsi" apiUrl = f"https://api.useapi.net/v1/faceswap/jobs/cancel/?jobid={jobid}" headers = { "Content-Type": "application/json", "Authorization" : f"Bearer {token}" } response = requests.get(apiUrl, headers=headers) print(response, response.json())