The organization's pentest credit balance
curl --request GET \
--url https://api.hacktron.ai/v1/credits \
--header 'X-Api-Key: <api-key>'import requests
url = "https://api.hacktron.ai/v1/credits"
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.hacktron.ai/v1/credits', 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.hacktron.ai/v1/credits",
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.hacktron.ai/v1/credits"
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.hacktron.ai/v1/credits")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hacktron.ai/v1/credits")
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{
"organization_id": "f336d0bc-b841-465b-8045-024475c079dd",
"balance": 12000,
"total_purchased": 16000,
"total_used": 8000,
"total_refunded": 4000,
"total_granted": 2000,
"used_this_period": 1240,
"is_unlimited": false
}Credits
Get credit balance
Read the organization’s pentest credit balance.
Listen to this pageabout 1 min
GET
/
credits
The organization's pentest credit balance
curl --request GET \
--url https://api.hacktron.ai/v1/credits \
--header 'X-Api-Key: <api-key>'import requests
url = "https://api.hacktron.ai/v1/credits"
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.hacktron.ai/v1/credits', 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.hacktron.ai/v1/credits",
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.hacktron.ai/v1/credits"
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.hacktron.ai/v1/credits")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hacktron.ai/v1/credits")
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{
"organization_id": "f336d0bc-b841-465b-8045-024475c079dd",
"balance": 12000,
"total_purchased": 16000,
"total_used": 8000,
"total_refunded": 4000,
"total_granted": 2000,
"used_this_period": 1240,
"is_unlimited": false
}Returns the pentest credits available to the organization, with totals purchased, used, refunded and granted.
is_unlimited is true for organizations without a credit limit.
Scope required:
readAuthorizations
Response
200 - application/json
Organization UUID
Example:
"f336d0bc-b841-465b-8045-024475c079dd"
Current pentest credit balance available for use
Example:
12000
Total pentest credits purchased across all time
Example:
16000
Total pentest credits deducted for completed/running pentests
Example:
8000
Total pentest credits refunded from cancelled pentests
Example:
4000
Total pentest credits granted at no charge
Example:
2000
Credits deducted since the start of the current billing period, null when the organization has no billing period
Example:
1240
Whether this organization has internal unlimited pentest entitlement
Example:
false
Was this page helpful?
⌘I