APIKlone Documentation

Welcome to the official APIKlone documentation. APIKlone is an enterprise-grade API Virtualization and stateful mocking proxy. Instantly record backend traffic, replay mocked responses conditionally, and auto-generate complex schemas to unblock your frontend and testing teams.

Note: APIKlone runs completely locally or isolated in your cloud. There is no bloated desktop application required; simply configure the proxy via the intuitive web dashboard or headless REST API.

Core Concepts: What is a Config?

Throughout APIKlone, the primary unit of scale is the Configuration (or "Config").

A Config maps exactly to a single target host. When you create a proxy, all endpoints under that host are automatically covered. For instance, pointing APIKlone to your Salesforce instance counts as one config, no matter how many hundreds of Salesforce endpoints you intend to mock or pass-through.

Concept Description
Config A logical grouping tied to a specific upstream base URL (e.g. https://api.stripe.com).
Service Mock An individual endpoint mapping (e.g. /v1/charges) that contains headers, payloads, and matching rules.
Traffic Recording The ability for APIKlone to proxy a request natively, and seamlessly capture both the outbound request and inbound response for future local regeneration.

SaaS Provisioning

If you have selected the SaaS tier, you do not need to deal with Docker or Kubernetes. The APIKlone engineering team automatically spins up an isolated cluster for your organization along a dedicated subdomain (e.g., acme.apiklone.com).

When you complete the Onboarding Flow, your environment enters the provisioning queue. It typically takes less than 24 hours to secure your environment, apply CMEK encryption logic, and validate your IP Address space. Once complete, you will receive an email with your administrative credentials.

Self-Hosted Deployment (Docker / K8s)

For organizations requiring strict data-residency, APIKlone can be deployed inside your own perimeter using Docker. The deployment process is simple and entirely stateless (using a mounted data volume for your mock schemas).

Standard Docker Flow

Pull the latest image from our secure registry and start the container by injecting your Activation Key.

docker pull apiklone/apiklone:latest docker run -d \ --name apiklone-server \ -e ACTIVATION_KEY="eyJhbGciOiJ..." \ -p 3000:3000 \ -v $(pwd)/data:/app/data \ apiklone/apiklone:latest

Always mount a persistent volume (e.g., /app/data) so that your recorded endpoints and uploaded OpenAPI specs survive container restarts!

Activation Keys

For Self-Hosted instances, you must authenticate your server instance using a cryptographic Activation Key. You can generate and view your active keys by clicking "Profile -> My Key" in the top navigation.

Activation keys contain your configs limit data. The server reads this token offline on boot to validate your license. Trials default to a 30-day expiry window with virtually infinite configurability.

Traffic Recording

APIKlone can serve as a man-in-the-middle to automatically scrape realistic payload schemas without manual effort.

  • 1. Create a Config: Set the Target Server to your real backend URL.
  • 2. Enable Recording: Toggle the "Recording Mode" switch on the dashboard.
  • 3. Send Traffic: Point your frontend to the APIKlone proxy address. APIKlone transparently relays the request to the upstream server, intercepts the HTTP 200 JSON response, and saves it.
  • 4. Switch to Mocking: Turn "Recording Mode" off. Future requests matching that URL path will immediately be served locally without hitting the real backend.

OpenAPI Specification Generation

APIKlone can parse standard `swagger.json` or OpenAPI 3.x `yaml` files. From the dashboard, navigate to the Generate via Spec tab. Upload your file, and APIKlone will instantly map hundreds of paths, dynamically inserting structurally correct `faker.js` random data into the response models based on property types.

Polymorphic Responses

To recreate complex business logic, you can configure Polymorphic mapping. This allows you to evaluate specific query parameters, headers, or JSON body fields, and return entirely different HTTP status codes or payloads.

For example, if you send {"amount": 5000}, return an HTTP 200. If you send {"amount": -50}, return an HTTP 400 Validation Error.

Managing Admin Users

Both Self-Hosted and SaaS platforms come with an integrated login portal for your engineering team to collaborate on creating mocks.

For Self-Hosted, user profile data and passwords are mathematically secured using PBKDF2 hashing algorithms inside your local DB. To add a user, administrators can invite them directly via the "Users" panel natively inside the dashboard application.

Headless REST API (CI/CD Integration)

APIKlone was built API-first. You do not have to use the UI dashboard. You can programmatically inject mock configurations as part of an ephemeral GitHub Actions workflow or GitLab CI pipeline.

curl -X POST http://api-proxy:3000/api/mock \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "path": "/api/users/current", "method": "GET", "status": 200, "response": { "id": 1, "name": "CI/CD Test Runner" } }'