GET
/
parent
/
cost-analysis
Cost Analysis
curl --request GET \
  --url https://api.authiqa.com/parent/cost-analysis \
  --header 'Authorization: <authorization>'

Overview

This endpoint calculates detailed costs for all database operations, including both parent and child account activities. Only accessible to parent accounts.

API Details

Authentication

Authorization
string
required
Bearer YOUR_JWT_TOKEN

Try It Out

Test the API using your JWT token:

Code Examples

curl -X GET https://api.authiqa.com/parent/cost-analysis \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Response Format

200: Success
{
  "operationCounts": {
    "parent": {
      "emailConfirmation": 1,
      "resendConfirmation": 0,
      "resetPassword": 1,
      "updatePassword": 1,
      "signIn": 10,
      "organizationUpdate": 2,
      "organizationDetailsRetrieval": 5,
      "childAccountsListRetrieval": 8,
      "childAccounts": 2
    },
    "children": {
      "emailConfirmation": 2,
      "resendConfirmation": 1,
      "resetPassword": 1,
      "updatePassword": 1,
      "signIn": 15
    },
    "totalAccounts": 2,
    "totalOperationsCount": 50
  },
  "costs": {
    "baseCost": 0.000425,
    "margin": 0.00017,
    "total": 0.000595,
    "breakdown": {
      "emailConfirmation": 0.0001,
      "resendConfirmation": 0.00005,
      "resetPassword": 0.00005,
      "updatePassword": 0.00005,
      "signIn": 0.0001,
      "organizationUpdate": 0.00005,
      "organizationDetailsRetrieval": 0.00005,
      "childAccountsListRetrieval": 0.0001,
      "childAccounts": 0.00007,
      "costCalculator": 0.000005,
      "IOassociatedCost": 0.00045
    }
  },
  "balance": {
    "accountBalance": 3.00,
    "availableBalance": 2.999405,
    "currentCharges": 0.000595,
    "usagePercentage": 0.02,
    "lowBalanceAlert": false
  },
  "currency": "USD"
}

Operation Types

{
  "emailConfirmation": { "reads": 2, "writes": 1 },
  "resendConfirmation": { "reads": 1, "writes": 1 },
  "resetPassword": { "reads": 1, "writes": 1 },
  "updatePassword": { "reads": 1, "writes": 1 },
  "childAccounts": { "reads": 2, "writes": 1 },
  "signIn": { "reads": 2, "writes": 1 },
  "organizationUpdate": { "reads": 1, "writes": 1 },
  "organizationDetailsRetrieval": { "reads": 1, "writes": 1 },
  "childAccountsListRetrieval": { "reads": 2, "writes": 1 }
}

Pricing Structure

Base Costs

  • Reads: $0.1415 per million
  • Writes: $0.705 per million

Margin

  • 40% added to base cost
  • Applied to all operations

Error Codes

401 Unauthorized
  • No authorization token
  • Invalid token
  • Non-parent account access attempt
403 Forbidden
  • INSUFFICIENT_BALANCE - Account has insufficient balance
500 Internal Server Error
  • Failed to calculate costs
  • Database operation errors

Parent-Only Operations

The following operations are exclusive to parent accounts:
  • Organization updates
  • Organization details retrieval
  • Child accounts list retrieval

Calculation Details

1

Base Cost

Calculate raw DynamoDB operation costs:
baseCost = (reads * READ_PRICE + writes * WRITE_PRICE) / 1000000
2

Margin

Apply 40% margin to base cost:
margin = baseCost * 0.40
3

Total

Sum base cost and margin:
total = baseCost + margin

Notes

All costs are calculated with 6 decimal precision and returned in USD.
This endpoint is restricted to parent accounts only. Child accounts will receive a 401 Unauthorized response.