Andamio Logo
Developer Guides

API Integration

API setup and making requests to the Andamio Gateway

API Integration

API Reference: Preprod API Docs for endpoint schemas. For production, use mainnet.api.andamio.io.

Authentication Headers

Most Andamio API requests require two authentication headers. Public endpoints (developer registration, billing plans, health checks) have reduced or no auth requirements.

HeaderPurposeHow to get
X-API-KeyApplication-level (your app)Getting Started
Authorization: Bearer <jwt>User-level (wallet signature)Authentication
const headers = {
  "Content-Type": "application/json",
  "X-API-Key": APP_API_KEY,
  "Authorization": `Bearer ${userJwt}`,
};

Making Requests

Once authenticated, include both headers in all requests:

const headers = {
  "Content-Type": "application/json",
  "X-API-Key": APP_API_KEY,
  "Authorization": `Bearer ${userJwt}`,
};

// Example: List user's courses
const res = await fetch(`${API}/course/owner/courses/list`, {
  method: "GET",
  headers,
});
const courses = await res.json();

API Endpoints

The Andamio Gateway provides approximately 120 endpoints across these categories:

CategoryBase PathDescriptionGuide
User Auth/api/v2/auth/login/*Wallet challenge/verify, User JWTAuthentication
Developer Auth/api/v2/auth/developer/*Registration, email verification, Developer JWTDeveloper Accounts
API Keys/api/v2/apikey/*Key request, rotation, profile, usageAPI Keys
Billing/api/v2/billing/*Plans, checkout, subscription managementBilling
Verification/api/v2/verify/*Access token ownership proofVerification
Courses/api/v2/course/*Course CRUD, modules, enrollments, merged views
Projects/api/v2/project/*Project CRUD, tasks, contributors, merged views
Transactions/api/v2/tx/*Build, register, status, SSE stream (17 build endpoints)Transactions
Users/api/v2/users/*User state, owned/enrolled/completed resources
Events/api/v2/events/*Parse what happened in a confirmed transactionAPI Concepts
Token Registry/api/v2/token/*Native asset registration and listing
Dashboard/api/v2/user/dashboardConsolidated user view (courses + projects)

For the complete endpoint reference with request/response schemas, see the Preprod API Docs.

For transaction building and submission, see Transaction Handling.

Environment URLs

Start on preprod — it uses test ADA.

EnvironmentGateway URLApp URLNetwork
Preprod (start here)preprod.api.andamio.iopreprod.app.andamio.ioCardano Preprod
Productionmainnet.api.andamio.ioapp.andamio.ioCardano Mainnet

All code examples in these docs use preprod URLs.

Ready for Mainnet?

When your app is tested and ready for production:

  1. Generate a mainnet API key at app.andamio.io/api-setup
  2. Update your environment variables:
    NEXT_PUBLIC_ANDAMIO_GATEWAY_URL="https://mainnet.api.andamio.io"
    NEXT_PUBLIC_CARDANO_NETWORK="mainnet"
  3. Update the Access Token policy ID (contact team for mainnet ID)

See Environment Reference for full configuration details.

Error Responses

API errors return JSON with error and message fields:

{
  "error": "UNAUTHORIZED",
  "message": "Invalid or expired JWT"
}

Common error codes:

CodeMeaning
UNAUTHORIZEDMissing or invalid auth headers
FORBIDDENUser lacks permission for this action
NOT_FOUNDResource doesn't exist
VALIDATION_ERRORInvalid request body
TX_BUILD_FAILEDTransaction building failed

See Error Handling for recovery patterns.

Next Steps