curl --request GET \
--url https://api.recoupable.dev/api/admins/credits/rollup \
--header 'x-api-key: <api-key>'import requests
url = "https://api.recoupable.dev/api/admins/credits/rollup"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.recoupable.dev/api/admins/credits/rollup', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.recoupable.dev/api/admins/credits/rollup",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.recoupable.dev/api/admins/credits/rollup"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.recoupable.dev/api/admins/credits/rollup")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.recoupable.dev/api/admins/credits/rollup")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": "success",
"period": "all",
"page": 2,
"limit": 2,
"total_count": 1,
"rows": [
{
"account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"total_credits_deducted": 123,
"event_count": 123,
"account_name": "<string>",
"account_email": "jsmith@example.com"
}
],
"error": "<string>"
}{
"status": "error",
"message": "<string>"
}{
"status": "error",
"message": "<string>"
}Credit Usage Rollup (Admin)
Returns the per-account rollup of credit usage over the selected period, sorted by total credits deducted descending. Each row carries the account identity (UUID + display name + primary email) and the aggregated spend so the admin dashboard can render a top-spenders table without joining client-side. Pair with GET /api/admins/credits/events?account_id=…&period=… to drill into the individual usage_events rows for a single account. Requires the authenticated account to be a Recoup admin.
curl --request GET \
--url https://api.recoupable.dev/api/admins/credits/rollup \
--header 'x-api-key: <api-key>'import requests
url = "https://api.recoupable.dev/api/admins/credits/rollup"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.recoupable.dev/api/admins/credits/rollup', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.recoupable.dev/api/admins/credits/rollup",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.recoupable.dev/api/admins/credits/rollup"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.recoupable.dev/api/admins/credits/rollup")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.recoupable.dev/api/admins/credits/rollup")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": "success",
"period": "all",
"page": 2,
"limit": 2,
"total_count": 1,
"rows": [
{
"account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"total_credits_deducted": 123,
"event_count": 123,
"account_name": "<string>",
"account_email": "jsmith@example.com"
}
],
"error": "<string>"
}{
"status": "error",
"message": "<string>"
}{
"status": "error",
"message": "<string>"
}Authorizations
Your Recoup API key. Learn more.
Query Parameters
Rollup window. daily = today (last 1 day), weekly = last 7 days, monthly = last 30 days, all = no cutoff (every event ever recorded). Defaults to monthly. Follows the existing admin period convention.
all, daily, weekly, monthly Page size — number of accounts to return per request, sorted by total credits deducted descending. Defaults to 100; max 500.
1 <= x <= 5001-indexed page number. Server returns rows (page - 1) * limit through page * limit - 1. Defaults to 1. Use total_count in the response to drive a 'load more' control (page * limit < total_count).
x >= 1Response
Credit usage rollup retrieved successfully
Status of the request
success, error The period the response was computed over (echoes the request)
all, daily, weekly, monthly 1-indexed page returned (echoes the request, or 1 if omitted)
x >= 1Page size used for this response (echoes the request, or the default if omitted)
x >= 1Total number of distinct accounts with at least one usage_events row in the selected period (i.e. the size of the full result set before pagination). The client derives has_more as page * limit < total_count and shows 'X of Y accounts'. Computed via a COUNT(DISTINCT account_id) query alongside the paginated row fetch.
x >= 0Per-account credit usage totals, sorted by total_credits_deducted descending
Show child attributes
Show child attributes
Error message (only present if status is 'error')
Was this page helpful?
