Retrieve the list of jobs currently running via the API along with the available account capacity

February 17, 2025

Table of contents

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

This endpoint retrieves the list of jobs currently running via the API along with the available account capacity.

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

Request Headers
Authorization: Bearer {API token}
Content-Type: application/json
Responses
  • 200 OK

    {
        "executing": [
            {
                "job_id": "<job_id_1>",
                "user_id": "<user_id_2>",
                "started": "2025-02-12T01:55:16.128Z",
                "elapsed": "03:57",
                "replyUrl": "<optional callback URL>",
                "replyRef": "<optional reference>"
            },
            {
                "job_id": "<job_id_2>",
                "user_id": "<user_id_2>",
                "started": "2025-02-12T01:57:11.228Z",
                "elapsed": "00:35",
                "replyUrl": "<optional callback URL>",
                "replyRef": "<optional reference>"
            }
        ],
        "available": [
            {
                "user_id": "<user_id_1>",
                "maxJobs": 10,
                "executing": 0,
                "available": 10
            },
            {
                "user_id": "<user_id_2>",
                "maxJobs": 10,
                "executing": 2,
                "available": 8
            }
        ]
    }
    
  • 401 Unauthorized

    {
      "error": "Unauthorized",
      "code": 401
    }
    
Model
{ // TypeScript, all fields are optional
    executing: {
        job_id: string
        user_id: string
        started: string 
        elapsed: string 
        replyUrl: string
        replyRef: string
    }[]
    available: {
        user_id: string
        maxJobs: number
        executing: number
        available: number
    }[]
    error: string
    code: number
}
Examples
  • curl "https://api.useapi.net/v1/riffusion/scheduler/available" \
       -H "Accept: application/json" \
       -H "Authorization: Bearer …" 
    
  • const token = "API token";
    const apiUrl = `https://api.useapi.net/v1/riffusion/scheduler/available`; 
    const response = await fetch(apiUrl, {
      headers: {
        "Authorization": `Bearer ${token}`,
      },
    });
    const result = await response.json();
    console.log("response", {response, result});
    
  • import requests
    token = "API token"
    apiUrl = f"https://api.useapi.net/v1/riffusion/scheduler/available"
    headers = {
        "Content-Type": "application/json", 
        "Authorization" : f"Bearer {token}"
    }
    response = requests.get(apiUrl, headers=headers)
    print(response, response.json())
    
Try It