Cancel a running job

May 15, 2025

Table of contents

  1. Request Headers
  2. Path Parameters
  3. Responses
  4. Examples
  5. Try It

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}
Path Parameters
Responses
  • 204 No Content

    Job was successfully cancelled.

  • 400 Bad Request

    The job ID format is invalid.

    {
      "error": "job_id has incorrect format",
      "code": 400
    }
    
  • 401 Unauthorized

    {
      "error": "Unauthorized",
      "code": 401
    }
    
  • 404 Not Found

    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}")
    
Try It