attest Docs

API reference

Retrieve usage

Returns the all-time Verification Pass total and accrued amount for the key's environment.

GET/usageSandbox and Production differ

Overview #

Returns the all-time Verification Pass total and accrued amount for the key's environment.

Authenticate with an environment API key in the Authorization: Bearer header. See Authentication.

Environments. Sandbox amounts accrue at the unit price for visibility but are never billed.

Request · cURL
curl https://attestinfra.com/usage \
  -H "Authorization: Bearer $ATTEST_API_KEY"
Request · JavaScript
const response = await fetch("https://attestinfra.com/usage", {
  headers: {
    Authorization: `Bearer ${process.env.ATTEST_API_KEY}`,
  },
});
console.log(response.status, await response.json());
Request · Python
import json, os, urllib.request
request = urllib.request.Request(
    "https://attestinfra.com/usage",
    headers={
        "Authorization": "Bearer " + os.environ["ATTEST_API_KEY"],
    },
)
with urllib.request.urlopen(request) as response:
    print(response.status, json.loads(response.read()))

Parameters #

This endpoint takes no parameters.

Response #

200 Usage totals.

Response fields #

FieldTypeDescription
customer_idstringYour account identifier.
environment_idstringThe environment the key belongs to.
verification_passesintegerAll-time Verification Passes in this environment.
amount_usdnumberverification_passes multiplied by the unit price, rounded to 4 decimal places.
Response · 200
{
  "customer_id": "79e99bf5-9836-496a-a846-9533be1c4a16",
  "environment_id": "1f7133e2-ec96-4c4c-89d1-ebdb7ca3dde3",
  "verification_passes": 3,
  "amount_usd": 0.003
}

Errors #

StatuserrorcodeMeaning
401Invalid API key—The API key is missing, unknown, revoked, or belongs to an environment that is not active.

All error bodies and their causes are listed in Errors.

Response · 401
{
  "error": "Invalid API key"
}