Skip to content

Quick Start

This guide walks you through the typical workflow of creating a user account and generating API credentials for them.

Prerequisites

  • Your admin key (iiak_admin_*)
  • curl or any HTTP client

Step 1: Create a User Account

Create a user account for your customer:

bash
curl -X POST "https://api.iagon.io/v1/admin/users" \
  -H "Authorization: Bearer YOUR_ADMIN_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Acme Corp",
    "external_id": "customer_12345",
    "email": "api@acme.com",
    "billing_plan": "pro"
  }'

Response:

json
{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Acme Corp",
    "external_id": "customer_12345",
    "email": "api@acme.com",
    "status": "active",
    "billing_plan": "pro",
    "created_at": "2026-01-26T12:00:00Z"
  }
}

Save the id - you'll need it to create credentials for this user.

Step 2: Create API Credentials

Generate an API key for the user:

bash
curl -X POST "https://api.iagon.io/v1/admin/credentials" \
  -H "Authorization: Bearer YOUR_ADMIN_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Acme Corp Production Key",
    "user_account_id": "550e8400-e29b-41d4-a716-446655440000",
    "network_id": 0,
    "rate_limit_per_minute": 120
  }'

Network ID

The network_id specifies which Cardano network this credential can access:

  • 0 - Cardano Mainnet
  • 1 - Cardano Preview (testnet)
  • 2 - Cardano Preprod (testnet)

Response:

json
{
  "success": true,
  "data": {
    "credential": {
      "id": "660e8400-e29b-41d4-a716-446655440001",
      "name": "Acme Corp Production Key",
      "api_key_prefix": "iiak_a1b2c3d4",
      "user_account_id": "550e8400-e29b-41d4-a716-446655440000",
      "user_account_name": "Acme Corp",
      "admin_key_id": "770e8400-e29b-41d4-a716-446655440002",
      "admin_entity_name": "YourCompany",
      "network_id": 0,
      "rate_limit_per_minute": 120
    },
    "api_key": "iiak_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4"
  },
  "message": "API key created. Store the api_key securely - it will not be shown again."
}

Important

The full api_key is only shown once at creation time. Store it securely and provide it to your customer.

Step 3: Monitor Usage

Check usage statistics for your users:

bash
# Get usage for all users
curl "https://api.iagon.io/v1/admin/users/usage/summary" \
  -H "Authorization: Bearer YOUR_ADMIN_KEY"

# Get usage for a specific user
curl "https://api.iagon.io/v1/admin/users/550e8400-e29b-41d4-a716-446655440000/usage" \
  -H "Authorization: Bearer YOUR_ADMIN_KEY"

Response:

json
{
  "success": true,
  "data": {
    "user_account_id": "550e8400-e29b-41d4-a716-446655440000",
    "user_name": "Acme Corp",
    "external_id": "customer_12345",
    "total_requests": 15420,
    "successful_requests": 15200,
    "failed_requests": 220,
    "credential_count": 2,
    "period_start": "2026-01-01T00:00:00Z",
    "period_end": "2026-01-26T23:59:59Z"
  }
}

Step 4: Look Up by External ID

Use your own customer ID to find users:

bash
curl "https://api.iagon.io/v1/admin/users/by-external-id/customer_12345" \
  -H "Authorization: Bearer YOUR_ADMIN_KEY"

Next Steps