Get available capacity

May 15, 2025

Table of contents

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

Get information about currently executing jobs and available capacity for all configured accounts.

https://api.useapi.net/v1/tempolor/scheduler/available

Request Headers
Authorization: Bearer {API token}
Responses
  • 200 OK

    The response contains information about currently executing jobs and available capacity.

    {
      "executing": [
        {
          "job_id": "user:12345-tempolor:12345-job:abcdef123456789",
          "started": "2025-05-15T12:34:56.789Z",
          "elapsed": "01:23",
          "replyUrl": "https://example.com/callback",
          "replyRef": "my-reference"
        }
      ],
      "available": [
        {
          "user_id": "12345",
          "maxJobs": 10,
          "executing": 1,
          "available": 9
        },
        {
          "user_id": "67890",
          "maxJobs": 5,
          "executing": 0,
          "available": 5
        }
      ]
    }
    
  • 401 Unauthorized

    {
      "error": "Unauthorized",
      "code": 401
    }
    
Model
{
  executing: [ // Currently executing jobs
    {
      job_id: string
      started: string  // ISO timestamp when the job started
      elapsed: string  // Time elapsed since start in MM:SS format
      replyUrl?: string  // Optional callback URL if specified during job creation
      replyRef?: string  // Optional reference if specified during job creation
    }
  ],
  available: [ // Accounts with available capacity
    {
      user_id: string  // Account identifier
      maxJobs: number  // Maximum concurrent jobs allowed for this account
      executing: number  // Number of currently executing jobs
      available: number  // Number of available job slots (maxJobs - executing)
    }
  ]
}
Examples
  • curl "https://api.useapi.net/v1/tempolor/scheduler/available" \
      -H "Authorization: Bearer …"
    
  • const token = "API token";
    const apiUrl = "https://api.useapi.net/v1/tempolor/scheduler/available";
    
    const response = await fetch(apiUrl, {
      headers: {
        "Authorization": `Bearer ${token}`
      }
    });
    
    const result = await response.json();
    console.log("Scheduler info:", result);
    
    // Find account with most available capacity
    if (result.available && result.available.length > 0) {
      const bestAccount = result.available[0]; // Sorted by availability
      console.log(`Best account to use: ${bestAccount.user_id} (${bestAccount.available} slots available)`);
    }
    
  • import requests
    
    token = "API token"
    api_url = "https://api.useapi.net/v1/tempolor/scheduler/available"
    
    headers = {
        'Authorization': f'Bearer {token}'
    }
    
    response = requests.get(api_url, headers=headers)
    result = response.json()
    print("Scheduler info:", result)
    
    # Find account with most available capacity
    if result.get('available') and len(result['available']) > 0:
        best_account = result['available'][0]  # Sorted by availability
        print(f"Best account to use: {best_account['user_id']} ({best_account['available']} slots available)")
    
Try It