API Referencev1

Java SDK

Install the Nexra Java SDK, sign in, start runs, follow cursor pages and verify event webhooks from Java or Kotlin.

Updated 14/10/2026

On this page

Install

The Java SDK is awaiting publication to Maven Central. Registry installation will be available here once the release is verified.

For access to the prepared package, contact contact@amakoragroup.com. You can also use the REST API.

Quickstart

Sign in once with the Nexra CLI (nexra auth login) to get an access token.

The token acts with your own role in the workspace.

java
import com.amakoragroup.nexra.NexraClient;
import com.amakoragroup.nexra.model.Execution;
import com.amakoragroup.nexra.model.ExecutionDetail;
import com.amakoragroup.nexra.model.Integration;

NexraClient nexra = NexraClient.builder()
    .token(System.getenv("NEXRA_TOKEN"))             // the default
    .workspaceId(System.getenv("NEXRA_WORKSPACE_ID")) // the default
    .build();

for (Integration integration : nexra.integrations().listIntegrations()) {
  System.out.println(integration.getName() + " " + integration.getStatus());
}

// Start a run. An idempotency key is added for you, so a retry never starts a second run.
Execution run = nexra.startRun("cmflow01orders");

ExecutionDetail detail = nexra.runs().getRun(run.getId());
System.out.println(detail.getStatus() + ": " + detail.getRecordsSucceeded() + " succeeded");

Each area of the API has an accessor: integrations(), flows(), runs(),

connections(), triggers(), reconciliation(), approvals(),

eventWebhooks(), governance(), lifecycle(), schedules(),

failedRecords(), templates(), catalogue(), endUsers(), records(),

pensions(), research(), companyData() and mcp(). Models are in

com.amakoragroup.nexra.model. Every method also has a WithHttpInfo form

that returns the status and headers.

Errors

Refusals throw an unchecked NexraApiException subclass with getStatus(),

getCode(), getRequestId() and Nexra's message. Network failures throw the

generated, checked ApiException.

StatusException
400, 422NexraApiException.BadRequest
401NexraApiException.Authentication
403NexraApiException.Permission
404NexraApiException.NotFound
409NexraApiException.Conflict
429NexraApiException.RateLimit (with getRetryAfter())
5xxNexraApiException.Server
java
try {
  Flow flow = nexra.flows().getFlow("cmflow01orders");
} catch (NexraApiException.NotFound error) {
  System.out.println("No such flow (request " + error.getRequestId() + ")");
}

Retries

Requests are retried up to 3 times with exponential backoff and jitter on

network errors and on 408, 425, 429, 500, 502, 503 and 504, honouring

Retry-After. A POST or PATCH is only retried when Nexra did not act on it

(429) or when its body has an idempotencyKey. Change this with

.retry(new RetryOptions(5, Duration.ofMillis(500), Duration.ofSeconds(20))),

or turn it off with .retry(RetryOptions.NONE).

Cursor pages

Most lists return the newest items as a list. Governance lists return

items and nextCursor; NexraPagination follows the cursor:

java
NexraPagination.stream(cursor -> {
  EvidencePage page = nexra.governance().listEvidence(null, null, null, null, null, cursor);
  return new Page<>(page.getItems(), page.getNextCursor());
}).forEach(entry -> System.out.println(entry.getSequence() + " " + entry.getEventType()));

Verify event webhooks

Nexra signs each event delivery with your endpoint's signing secret. Verify

against the raw body before parsing it:

java
// Spring: @PostMapping("/nexra/events") with @RequestBody byte[] rawBody
// and @RequestHeader(NexraWebhooks.SIGNATURE_HEADER) String signature
try {
  NexraWebhooks.NexraEvent event = NexraWebhooks.constructEvent(rawBody, signature, secret);
  // De-duplicate on event.getId(), queue the work, answer 204 quickly.
} catch (NexraWebhooks.WebhookVerificationException e) {
  // answer 400
}

Signatures older than 5 minutes are refused. Answer with a 2xx within 8

seconds. event.as(EventFlowRunFailed.class) gives a typed event.

Send events to a webhook trigger

java
String body = "{\"orderId\":\"1001\"}";
Map<String, String> headers = NexraWebhooks.signTriggerRequest(body, triggerSecret, "order-1001-0001", null);

Versioning

This package follows semantic versioning from 1.0.0. The API it is built from

is dated (2026-10-01); Nexra adds operations and optional fields without a

new date, and a minor SDK release picks them up. A breaking API change gets a

new dated version and a new major SDK version.

Reference

Platform API: sign-in, headers, errors and limits

Platform API reference: every operation and field

Need a hand?

Ask Nexra Agent for implementation steps or error guidance.

Ask Nexra Agent