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

All Andamio API requests require two authentication headers:

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 endpoints for:

CategoryBase PathDescription
Auth/api/v2/auth/*Challenge/verify, JWT management
Courses/api/v2/course/*Course CRUD, modules, enrollments
Projects/api/v2/project/*Project CRUD, tasks, contributors
Transactions/api/v2/tx/*Build and register on-chain transactions
Global/api/v2/global/*Access tokens, platform config

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