InsightFaceSwap /delid command
Table of contents
Use this endpoint to submit the InsightFaceSwap /delid command to your InsightFaceSwap Discord channel. The result will be returned in the response body and can also be sent as a callback to an optional replyUrl.
This is a blocking call, you will not be able to make another call to the same InsightFaceSwap Discord channel until the current call is completed. The average execution time is approximately 3 to 10 seconds. If you expect high load and need to make multiple concurrent calls, please consider setting up multiple InsightFaceSwap accounts.
It is important not to use the InsightFaceSwap account setup for API access for any purposes other than its intended use, such as executing /delid or any other InsightFaceSwap commands manually or in conjunction with any other automation tools. The useapi.net API internally tracks the usage of the InsightFaceSwap account, including the number of currently active executions. Using it for other activities may cause API to function incorrectly.
https://api.useapi.net/v1/faceswap/delid
Request Headers
Authorization: Bearer {API token}
Content-Type: multipart/form-data
- API tokenis required, see Setup useapi.net for details.
Request Body
{
    "channel": "Discord channel id",
    "idname": "idname param",
}
-  channelis optional when only one faceswap/account configured. However, if you have multiple accounts configured, this parameter becomes required.
-  idnameis required, please refer to InsightFaceSwap /delid for details.
-  replyUrlis optional, if not provided value from useapi.net account will be used.
 Place here your callback URL. API will call the providedreplyUrlonce job completed or failed.
 Maximum length 1024 characters.
 We recommend using sites like webhook.site to test callback URL functionality.
-  replyRefis optional, place here your reference id which will be stored and returned along with this job response / result.
 Maximum length 1024 characters.
Responses
-   Field contentcontains message generated by InsightFaceSwap.{ "jobid": "<jobid>", "verb": "faceswap-delid", "status": "completed", "idname": "me", "created": "2023-09-09T02:04:49.667Z", "updated": "2023-09-09T02:04:53.490Z", "discord": "<ABC…secured…xyz>", "server": "<Discord server id>", "channel": "<Discord channel id>", "replyUrl": "https://webhook.site/abc", "replyRef": "<your optional reference id>", "messageId": "<Discord message id>", "content": "idname me deleted", "timestamp": "2023-09-09T02:04:51.926000+00:00", "code": 200 }
-   { "error": "Required param idname is missing or empty" "Optional param replyRef is too long" "Optional param replyUrl is too long" "Required param channel is missing or empty" "Configuration not found for channel <channel>, to create POST v1/faceswap/account/<channel>" "code": 400 }
-   { "error": "Unauthorized", "code": 401 }
-   { "error": "Account has no subscription or subscription expired", "code": 402 }
-   Wait in a loop for at least 10..30 seconds and retry again. There are two possible cases for API response 429. - API query is full and can not accept new faceswap/delid requests. { "error": "Unable to lock Discord after <attempts> attempts", "code": 429 }
- The API received an HTTP status 429 from the Discord API when it attempted to POST to the /interactionsendpoint. Under normal circumstances, this should be a rare occurrence because the API is designed to strictly adhere to Discord rate limits. However, in certain scenarios, Discord may still issue a 429 response.{ "error": "Discord /interactions failed with HTTP status 429", "errorDetails": "{\"global\":true,\"message\":\"You are being rate limited.\",\"retry_after\":10}", "code": 429 }
 
- API query is full and can not accept new faceswap/delid requests. 
Model
{ // TypeScript, all fields are optional
  jobid: string, 
  verb: 'faceswap-delid',
  status: 'completed' | 'failed',
  idname: string,
  created: string, // YYYY-MM-DDTHH:mm:ss.sssZ, IS0 8601, UTC
  updated: string, // YYYY-MM-DDTHH:mm:ss.sssZ, IS0 8601, UTC
  discord: string, // Provided for debugging purposes only, contains the first 3 and the last 3 characters of the original value
  server: string,
  channel: string,
  replyUrl: string,
  replyRef: string,
  messageId: string,
  content: string, // Contains message generated by InsightFaceSwap 
  timestamp: string,
  error: string,
  errorDetails: string,
  code: number
}
Examples
-  curl -H "Accept: application/json" \ -H "Authorization: Bearer …" \ -X DELETE https://api.useapi.net/v1/faceswap/delid \ -F "channel=<Discord channel id>" \ -F "idname=<idname>"
-  const main = async () => { const apiUrl = "https://api.useapi.net/v1/faceswap/delid"; const token = "API token"; const channel = "Discord channel"; const idname = "idname"; const data = { method: 'DELETE', headers: { 'Authorization': `Bearer ${token}` } }; const formData = new FormData(); formData.append("channel", channel); formData.append("idname", idname); data.body = formData; const response = await fetch(apiUrl, data); const result = await response.json(); console.log("response", { response, result }); }; main()
-  import requests api_url = "https://api.useapi.net/v1/faceswap/delid" token = "API token" channel = "Discord channel" idname = "idname" headers = { 'Authorization': f'Bearer {token}' } files = { 'channel': (None, channel), 'idname': (None, idname) } response = requests.delete(api_url, headers=headers, files=files) print(response, response.json())