> ## Documentation Index
> Fetch the complete documentation index at: https://docs.amlok.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Server SDKs

> Download AMLOK API clients for seven backend languages, configure workspace authentication, and use the same Insights, Signal, and reporting contract.

Use AMLOK's server SDKs to call Insights, Signal, shared data, and reporting operations from your backend. Each client follows API version **1.4.2** and includes generated API methods, request and response models, and an operation index.

## Choose your language

| Language | Runtime | Download |
| - | - | - |
| TypeScript / JavaScript | Node.js 20+ | [Source ZIP](https://raw.githubusercontent.com/amloktech/docs/5edc18effb8fdd047e94692dc2214fbfdcc7feab/downloads/sdks/amlok-typescript-1.4.2.zip) |
| Python | Python 3.9+ | [Source ZIP](https://raw.githubusercontent.com/amloktech/docs/5edc18effb8fdd047e94692dc2214fbfdcc7feab/downloads/sdks/amlok-python-1.4.2.zip) |
| Java | Java 11+ and Maven 3 | [Source ZIP](https://raw.githubusercontent.com/amloktech/docs/5edc18effb8fdd047e94692dc2214fbfdcc7feab/downloads/sdks/amlok-java-1.4.2.zip) |
| C# / .NET | .NET 8+ | [Source ZIP](https://raw.githubusercontent.com/amloktech/docs/5edc18effb8fdd047e94692dc2214fbfdcc7feab/downloads/sdks/amlok-csharp-1.4.2.zip) |
| Go | Go 1.23+ | [Source ZIP](https://raw.githubusercontent.com/amloktech/docs/5edc18effb8fdd047e94692dc2214fbfdcc7feab/downloads/sdks/amlok-go-1.4.2.zip) |
| PHP | PHP 8.1+ and Composer, with cURL, JSON, and mbstring | [Source ZIP](https://raw.githubusercontent.com/amloktech/docs/5edc18effb8fdd047e94692dc2214fbfdcc7feab/downloads/sdks/amlok-php-1.4.2.zip) |
| Ruby | Ruby 2.7+ and Bundler | [Source ZIP](https://raw.githubusercontent.com/amloktech/docs/5edc18effb8fdd047e94692dc2214fbfdcc7feab/downloads/sdks/amlok-ruby-1.4.2.zip) |

Use a currently supported release of your chosen runtime. TypeScript and JavaScript share one client; you do not need separate packages.

> [!NOTE]
>
> These are versioned source distributions installed from the downloaded folder. They are not published npm, PyPI, Maven Central, NuGet, Packagist, or RubyGems releases. Use the local installation commands below.

The [download manifest](https://docs.amlok.io/downloads/sdks/manifest.json) includes SHA-256 checksums and the source contract hash. Each archive contains a `BUILD.json` file and an `operation-index.json` file so you can match your client to the reference.

## Before your first request

Your account manager provides client portal access and your institution-issued environment URL. An authorized administrator creates an API key in the portal. Each key belongs to exactly one workspace, institution, and environment.

Set `AMLOK_API_BASE_URL` to that HTTPS origin without a trailing slash or `/v1`, and load `AMLOK_API_KEY` from your server's secret manager. The SDK adds the endpoint path. Never use the specification's `api.example.com` placeholder as a live service address.

Download your language's ZIP and extract its `amlok-<language>-1.4.2` folder into your application's `clients` directory. The examples below retrieve your environment configuration. They do not start an underwriting or activate monitoring.

## Install and connect

> [tab] TypeScript / JavaScript
>
> From your application directory, build and install the local package:
>
> ```bash theme={null}
> cd clients/amlok-typescript-1.4.2
> npm install
> npm run build
> cd ../..
> npm install ./clients/amlok-typescript-1.4.2
> ```
>
> ```typescript theme={null}
> import { Configuration, PlatformApi } from "@amlok/api-client";
>
> const basePath = process.env.AMLOK_API_BASE_URL;
> const apiKey = process.env.AMLOK_API_KEY;
> if (!basePath || !apiKey) throw new Error("Set AMLOK environment and key");
>
> const configuration = new Configuration({
>   basePath,
>   accessToken: apiKey,
>   fetchApi: (url, options) => fetch(url, {
>     ...options,
>     redirect: "error",
>     signal: AbortSignal.timeout(30_000),
>   }),
> });
>
> async function main() {
>   const result = await new PlatformApi(configuration).iR007();
>   console.log(result.data.revision);
> }
> main().catch(console.error);
> ```
>
> CommonJS applications can use `const { Configuration, PlatformApi } = require("@amlok/api-client")`. Keep this client in server code, including when your frontend also uses TypeScript.

> [tab] Python
>
> Install into your application's virtual environment:
>
> ```bash theme={null}
> python -m pip install ./clients/amlok-python-1.4.2
> ```
>
> ```python theme={null}
> import os
> import amlok
>
> configuration = amlok.Configuration(
>     host=os.environ["AMLOK_API_BASE_URL"]
> )
> configuration.access_token = os.environ["AMLOK_API_KEY"]
>
> with amlok.ApiClient(configuration) as client:
>     platform = amlok.PlatformApi(client)
>     result = platform.i_r007(_request_timeout=30)
>     print(result.data.revision)
> ```
>
> Use `_with_http_info` methods when you need response headers. Catch `amlok.ApiException` to inspect the HTTP status, response headers, and response body.

> [tab] Java
>
> Install the downloaded source into your local Maven repository:
>
> ```bash theme={null}
> mvn -f clients/amlok-java-1.4.2/pom.xml -DskipTests install
> ```
>
> Add the locally installed artifact to your application's `pom.xml`:
>
> ```xml theme={null}
> <dependency>
>   <groupId>io.amlok</groupId>
>   <artifactId>amlok-api-client</artifactId>
>   <version>1.4.2</version>
> </dependency>
> ```
>
> ```java theme={null}
> import io.amlok.ApiClient;
> import io.amlok.api.PlatformApi;
> import java.net.URI;
> import java.net.http.HttpClient;
> import java.time.Duration;
>
> public class AmlokExample {
>   public static void main(String[] args) throws Exception {
>     URI origin = URI.create(System.getenv("AMLOK_API_BASE_URL"));
>     String key = System.getenv("AMLOK_API_KEY");
>     if (!"https".equals(origin.getScheme()) || key == null || key.isBlank()) {
>       throw new IllegalArgumentException("Set AMLOK HTTPS origin and key");
>     }
>     ApiClient client = new ApiClient()
>         .setScheme("https")
>         .setHost(origin.getHost())
>         .setPort(origin.getPort())
>         .setBasePath("")
>         .setHttpClientBuilder(HttpClient.newBuilder()
>             .followRedirects(HttpClient.Redirect.NEVER))
>         .setConnectTimeout(Duration.ofSeconds(10))
>         .setReadTimeout(Duration.ofSeconds(30))
>         .setRequestInterceptor(request ->
>             request.header("Authorization", "Bearer " + key));
>
>     var result = new PlatformApi(client).iR007();
>     System.out.println(result.getData().getRevision());
>   }
> }
> ```
>
> For shared builds, distribute the artifact through your institution's private Maven repository. The coordinates above do not refer to a Maven Central release.

> [tab] C# / .NET
>
> Add a project reference from the directory containing your application's `.csproj` file:
>
> ```bash theme={null}
> dotnet add reference clients/amlok-csharp-1.4.2/src/Amlok/Amlok.csproj
> dotnet restore
> ```
>
> ```csharp theme={null}
> using Amlok.Api;
> using Amlok.Client;
>
> var configuration = new Configuration
> {
>     BasePath = Environment.GetEnvironmentVariable("AMLOK_API_BASE_URL")
>         ?? throw new InvalidOperationException("Set AMLOK_API_BASE_URL"),
>     AccessToken = Environment.GetEnvironmentVariable("AMLOK_API_KEY")
>         ?? throw new InvalidOperationException("Set AMLOK_API_KEY"),
>     Timeout = TimeSpan.FromSeconds(30)
> };
>
> var platform = new PlatformApi(configuration);
> var result = await platform.IR007Async();
> Console.WriteLine(result.Data.Revision);
> ```
>
> Pass a cancellation token to asynchronous methods when your application needs to cancel a local wait. Cancelling a client wait does not prove that an accepted server command was cancelled.

> [tab] Go
>
> Use a local module replacement from your application's Go module:
>
> ```bash theme={null}
> go mod edit -require=amlok.local/client@v1.4.2
> go mod edit -replace=amlok.local/client=./clients/amlok-go-1.4.2
> ```
>
> ```go theme={null}
> package main
>
> import (
>     "context"
>     "fmt"
>     "net/http"
>     "os"
>     "time"
>     amlok "amlok.local/client"
> )
>
> func main() {
>     configuration := amlok.NewConfiguration()
>     configuration.Servers = amlok.ServerConfigurations{
>         {URL: os.Getenv("AMLOK_API_BASE_URL")},
>     }
>     configuration.HTTPClient = &http.Client{
>         Timeout: 30 * time.Second,
>         CheckRedirect: func(*http.Request, []*http.Request) error {
>             return http.ErrUseLastResponse
>         },
>     }
>     client := amlok.NewAPIClient(configuration)
>     ctx := context.WithValue(context.Background(),
>         amlok.ContextAccessToken, os.Getenv("AMLOK_API_KEY"))
>     result, response, err := client.PlatformAPI.IR007(ctx).Execute()
>     if response != nil && response.Body != nil {
>         defer response.Body.Close()
>     }
>     if err != nil { panic(err) }
>     fmt.Println(result.Data.Revision)
> }
> ```
>
> Run `go mod tidy` after adding the import. `amlok.local/client` is a local module identifier resolved by the replacement above, not a public download host. If your project uses Go's vendoring mode, keep the SDK outside the reserved `clients` directory and adjust the replacement path.

> [tab] PHP
>
> Register the extracted folder as a Composer path repository:
>
> ```bash theme={null}
> composer config repositories.amlok path ./clients/amlok-php-1.4.2
> composer require "amlok/api-client:1.4.2"
> ```
>
> ```php theme={null}
> <?php
> require __DIR__ . '/vendor/autoload.php';
>
> $configuration = Amlok\Configuration::getDefaultConfiguration()
>     ->setHost(getenv('AMLOK_API_BASE_URL'))
>     ->setAccessToken(getenv('AMLOK_API_KEY'));
>
> $http = new GuzzleHttp\Client([
>     'timeout' => 30,
>     'allow_redirects' => false,
> ]);
> $platform = new Amlok\Api\PlatformApi($http, $configuration);
> $result = $platform->iR007();
> echo $result->getData()->getRevision();
> ```
>
> Keep the extracted source folder when Composer creates a symlink to it. In the PHP `ProcessingContext` model, use `workflow_run_id` for Insights or `monitoring_period_id` for Signal; the canonical schema and API enforce that product-specific requirement.

> [tab] Ruby
>
> Add this local source to your application's `Gemfile`, then run `bundle install`:
>
> ```ruby theme={null}
> gem 'amlok-api-client', path: 'clients/amlok-ruby-1.4.2'
> ```
>
> ```ruby theme={null}
> require 'amlok-api-client'
> require 'uri'
>
> origin = URI(ENV.fetch('AMLOK_API_BASE_URL'))
> raise 'Use the supplied HTTPS origin' unless origin.scheme == 'https'
>
> configuration = Amlok::Configuration.new
> configuration.scheme = origin.scheme
> configuration.host = origin.host + (origin.port == 443 ? '' : ":#{origin.port}")
> configuration.base_path = ''
> configuration.access_token = ENV.fetch('AMLOK_API_KEY')
> configuration.timeout = 30
>
> platform = Amlok::PlatformApi.new(Amlok::ApiClient.new(configuration))
> result = platform.i_r007
> puts result.data.revision
> ```
>
> Keep redirect and automatic retry middleware disabled. Use `_with_http_info` methods when you need the status and response headers.

## Find an operation

The SDKs preserve the stable operation IDs in the [OpenAPI specification](https://docs.amlok.io/overview/openapi-spec.md). For example, `IR007` retrieves environment configuration. Its method name follows each language's conventions: `iR007`, `i_r007`, or `IR007`.

Use the archive's `operation-index.json` to find an operation by its summary, HTTP method, or path. API classes group operations by the same endpoint categories used in the reference. Language naming does not create new endpoints or permissions.

## Build a complete integration

| Concern | What your application must do |
| - | - |
| Authentication | Keep keys on the server and select the provisioned workspace and environment. |
| Insights and Signal | Follow the [product workflows](https://docs.amlok.io/api-reference/workflows.md), including readiness, baselines, and processing context. |
| Pagination | Pass returned cursors as documented in [pagination and filtering](https://docs.amlok.io/api-reference/pagination.md). |
| Accepted commands | Persist idempotency keys and use [request recovery](https://docs.amlok.io/api-reference/request-recovery.md) before resubmitting an uncertain action. |
| Background processing | Treat an accepted job as pending and follow the [processing lifecycle](https://docs.amlok.io/api-reference/processing-lifecycle.md). |
| Webhooks | Verify the exact raw body and use a durable event inbox. Start with the [webhook guide](https://docs.amlok.io/api-reference/webhooks.md). |
| Errors and limits | Inspect HTTP status, request ID, and `Retry-After`; use [rate limits and retries](https://docs.amlok.io/api-reference/rate-limits.md). |
| Money | Preserve decimal strings and the documented rounding rules. Do not convert financial amounts to binary floating point. |

These clients wrap API calls. They do not automatically walk every page, retry chargeable commands, poll jobs, verify incoming webhooks, or orchestrate underwriting and monitoring. The [developer tools](https://docs.amlok.io/api-reference/downloads.md) include separate webhook verification helpers.

The SDKs preserve AMLOK's product boundaries: Signal reassessments do not create a second Insights charge, included stages are not independent paid products, and financial access is reporting-only. Portal payment settings, top-ups, and cancellation do not become SDK commands.

## Compatibility and verification

The clients are generated from AMLOK's published contract using a pinned OpenAPI Generator release. Language models represent the request and response shapes; they do not replace the full JSON Schema conditional rules or server authorization checks. Keep the [OpenAPI contract](https://docs.amlok.io/openapi/amlok-v1.json) as the validation authority.

Source builds, serialization checks, and synthetic transport tests validate the client code. They do not establish a live backend result. Complete the [sandbox journeys](https://docs.amlok.io/api-reference/sandbox-journeys.md) in your provisioned environment before enabling production processing.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.