Retrieve Riffusion API account configuration for user_id

February 17, 2025

Table of contents

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

https://api.useapi.net/v1/riffusion/accounts/user_id

The user_id value should correspond to an account configured previously via a POST accounts request.

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

    {
      "user_id": "b511d6f4-1e33-45c3-885d-0fa094dd5d70",
      "maxJobs": 6,
      "jwt": {
        "expires_at": 1781234765,
        "expires_in": 604800,
        "refresh_token": "…secured…",
        "access_token": "…secured…",
        "expires_at_UTC": "2025-04-18T12:50:45.000Z",
        "token_type": "bearer",
        "user": {
          "id": "b511d6f4-1e33-45c3-885d-0fa094dd5d70"
        }
      }
    }
    
  • 401 Unauthorized

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

    Configuration not found. To create configuration use POST accounts.

Model
{ // TypeScript, all fields are optional
  user_id: string
  maxJobs: number
  jwt: {
    access_token: string
    token_type: string
    expires_in: number
    expires_at: number
    refresh_token: string
    expires_at_UTC: string
    user: {
      id: string
    }
  }
}
Examples
  • curl https://api.useapi.net/v1/riffusion/accounts/<user_id> \
       -H "Accept: application/json" \
       -H "Authorization: Bearer …" 
    
  • const token = "API token";
    const user_id = "Previously configured account"; 
    const apiUrl = `https://api.useapi.net/v1/riffusion/accounts/${user_id}`; 
    const response = await fetch(apiUrl, {
      headers: {
        "Authorization": `Bearer ${token}`,
      },
    });
    const result = await response.json();
    console.log("response", {response, result});
    
  • import requests
    token = "API token"
    user_id = "Previously configured account"
    apiUrl = f"https://api.useapi.net/v1/riffusion/accounts/{user_id}"
    headers = {
        "Content-Type": "application/json", 
        "Authorization" : f"Bearer {token}"
    }
    response = requests.get(apiUrl, headers=headers)
    print(response, response.json())
    
Try It