curl --request GET \
--url https://platform.runonatlas.com/external/customers/external-id/{externalId}/customPricingUnits/{customPricingUnitId}/usage \
--header 'x-api-key: <api-key>'import requests
url = "https://platform.runonatlas.com/external/customers/external-id/{externalId}/customPricingUnits/{customPricingUnitId}/usage"
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://platform.runonatlas.com/external/customers/external-id/{externalId}/customPricingUnits/{customPricingUnitId}/usage', 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://platform.runonatlas.com/external/customers/external-id/{externalId}/customPricingUnits/{customPricingUnitId}/usage",
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://platform.runonatlas.com/external/customers/external-id/{externalId}/customPricingUnits/{customPricingUnitId}/usage"
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://platform.runonatlas.com/external/customers/external-id/{externalId}/customPricingUnits/{customPricingUnitId}/usage")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform.runonatlas.com/external/customers/external-id/{externalId}/customPricingUnits/{customPricingUnitId}/usage")
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{
"customPricingUnitId": "atlas-internal-custom-pricing-unit-id-123",
"displayName": "API Calls",
"displayNameSingular": "API Call",
"shortName": "calls",
"totalAllocated": 1000,
"totalUsed": 100,
"remaining": 900,
"nextExpiring": {
"amountRemaining": 100,
"expiration": "2025-01-01T00:00:00.000Z"
}
}Get custom pricing unit usage
Get custom pricing unit usage for a customer by external ID (e.g. the customer ID in your system).
curl --request GET \
--url https://platform.runonatlas.com/external/customers/external-id/{externalId}/customPricingUnits/{customPricingUnitId}/usage \
--header 'x-api-key: <api-key>'import requests
url = "https://platform.runonatlas.com/external/customers/external-id/{externalId}/customPricingUnits/{customPricingUnitId}/usage"
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://platform.runonatlas.com/external/customers/external-id/{externalId}/customPricingUnits/{customPricingUnitId}/usage', 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://platform.runonatlas.com/external/customers/external-id/{externalId}/customPricingUnits/{customPricingUnitId}/usage",
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://platform.runonatlas.com/external/customers/external-id/{externalId}/customPricingUnits/{customPricingUnitId}/usage"
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://platform.runonatlas.com/external/customers/external-id/{externalId}/customPricingUnits/{customPricingUnitId}/usage")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform.runonatlas.com/external/customers/external-id/{externalId}/customPricingUnits/{customPricingUnitId}/usage")
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{
"customPricingUnitId": "atlas-internal-custom-pricing-unit-id-123",
"displayName": "API Calls",
"displayNameSingular": "API Call",
"shortName": "calls",
"totalAllocated": 1000,
"totalUsed": 100,
"remaining": 900,
"nextExpiring": {
"amountRemaining": 100,
"expiration": "2025-01-01T00:00:00.000Z"
}
}Authorizations
You can obtain this key from the Atlas dashboard. It must be of type secret
Path Parameters
The external ID of the customer (e.g. the customer ID in your system)
1"external-customer-id-123"
The ID of the custom pricing unit
"custom-pricing-unit-id-123"
Response
The custom pricing unit usage for the customer.
The usage and amount remaining for all custom pricing units this customer has access to for the current billing period
The ID of the custom pricing unit
"atlas-internal-custom-pricing-unit-id-123"
The display name of the custom pricing unit
"API Calls"
The display name singular of the custom pricing unit
"API Call"
The short name of the custom pricing unit
"calls"
The total allocated amount of the custom pricing unit
1000
The total used amount of the custom pricing unit
100
The remaining amount of the custom pricing unit
900
The next expiring allocation block
Show child attributes
Show child attributes

