Cancel a running job
May 15, 2025
Table of contents
This endpoint cancels a running API job from being tracked by the scheduler. The job will still be executed by TemPolor, but the API will no longer track its progress.
https://api.useapi.net/v1/tempolor/scheduler/
job_id
Request Headers
Authorization: Bearer {API token}
API token
is required, see Setup useapi.net for details.
Path Parameters
job_id
is required. The job ID to cancel, as returned from POST music/song, POST music/instrumental, or GET scheduler.
Responses
-
Job was successfully cancelled.
-
The job ID format is invalid.
{ "error": "job_id has incorrect format", "code": 400 }
-
{ "error": "Unauthorized", "code": 401 }
-
The specified job was not found or could not be cancelled.
{ "error": "Unable to locate running job_id", "code": 404 }
Examples
-
curl -X DELETE "https://api.useapi.net/v1/tempolor/scheduler/<job_id>" \ -H "Authorization: Bearer …"
-
const token = "API token"; const job_id = "user:12345-tempolor:user_id-job:abcdef123456789"; const apiUrl = `https://api.useapi.net/v1/tempolor/scheduler/${job_id}`; const response = await fetch(apiUrl, { method: "DELETE", headers: { "Authorization": `Bearer ${token}` } }); if (response.status === 204) { console.log("Job cancelled successfully"); } else { const errorData = await response.json(); console.error("Failed to cancel job:", errorData); }
-
import requests token = "API token" job_id = "user:12345-tempolor:user_id-job:abcdef123456789" api_url = f"https://api.useapi.net/v1/tempolor/scheduler/{job_id}" headers = { 'Authorization': f'Bearer {token}' } response = requests.delete(api_url, headers=headers) if response.status_code == 204: print("Job cancelled successfully") else: try: error_data = response.json() print(f"Failed to cancel job: {error_data}") except: print(f"Failed to cancel job: {response.status_code}")