# API Reference

***

### ✅ Prerequisites

Before you start, make sure you have:

* An **Akowe Issuance account.**
* Your **API key** (available in the Akowe issuance profile section).
* Basic knowledge of **JavaScript** (for SDK) or **HTTP requests** (for REST API).

***

### 🧩 How the API is Structured

* **Interactive Widget (SDK)** – Embed the certificate editor in your web app for drag-and-drop template design.
* **REST API Endpoints** – Programmatically manage organizations, templates, balances, and certificate issuance.
* **Event Callbacks** – Get real-time events like `onLoad`, `onSuccess`, `onClose`, and `onError`.

***

### 🔑 Authentication & Credentials

Every request requires authentication headers:

* **x-api-key** *(required)* – Your unique API key.
* **x-subaccount-email** *(optional)* – Identifies a specific sub-account. Useful for scoping templates or certificates to a user.

👉 Always include these credentials making API requests.

***

### ⚡ Example: Initializing the SDK

```html
<script src="https://issuance.akowe.app/sdk"></script>

<script>
  const certApp = new CertificateSDK({
    onLoad: (res) => {
      console.log("SDK Loaded:", res);
    },
    onCreateCompleted: (data) => {
      console.log("New template created:", data);
      // Send this `data` to your Template Create API
    },
    onEditCompleted: (data) => {
      console.log("Template edited:", data);
      // Send this `data` to your Template Edit API
    },
    onClose: () => {
      console.log("Modal closed");
      // Call this when after a successful request to template Create or Edit endpoint
    },
    onError: (err) => {
      console.error("SDK error:", err);
    }
  });
</script>
```

***

### 🚀 Getting Started Steps

1. **Obtain API credentials** from your Akowe issuance dashboard.
2. **Embed the SDK** in your frontend or call API endpoints directly.
3. **Test integration** in development before moving to production.

With clear endpoints, event callbacks, and a ready-to-use SDK, you can integrate **Akowe Issuance in minutes—not hours**.

<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.akowe.app/api-reference/readme.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
