Cancel job_id currently being executed by the API
February 17, 2025
Table of contents
https://api.useapi.net/v1/riffusion/scheduler/
job_id
Request Headers
Authorization: Bearer {API token}
API token
is required, see Setup useapi.net for details.
Path parameter
job_id
is required. Specify job_id you want to cancel.
Responses
-
{ "error": "<Error message>", "code": 400 }
-
{ "error": "Unauthorized", "code": 401 }
-
{ "error": "Unable to locate running job_id <job_id>" }
Model
{ // TypeScript, all fields are optional
error: string
code: number
}
Examples
-
curl -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer …" \ -X DELETE "https://api.useapi.net/v1/riffusion/scheduler/<job_id>"
-
const job_id = "job_id to cancel"; const apiUrl = `https://api.useapi.net/v1/riffusion/scheduler/${job_id}`; const token = "API token"; const data = { method: 'DELETE', headers: { 'Authorization': `Bearer ${token}`, 'Content-Type': 'application/json' } }; const response = await fetch(apiUrl, data); const result = await response.json(); console.log("response", {response, result});
-
import requests job_id = "job_id to cancel" apiUrl = f"https://api.useapi.net/v1/riffusion/scheduler/{job_id}" token = "API token" headers = { "Content-Type": "application/json", "Authorization" : f"Bearer {token}" } response = requests.delete(apiUrl, headers=headers) print(response, response.json())