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

# Java SDK

> Install the Leadping Java SDK from Maven, configure Kiota authentication, create a request adapter, and call Leadping API endpoints.

* Package: `ai.leadping:leadping`
* Repository: [leadpingai/leadping-java](https://github.com/leadpingai/leadping-java)

## Install

With Gradle:

```gradle theme={null}
implementation "ai.leadping:leadping:<version>"
```

With Maven:

```xml theme={null}
<dependency>
  <groupId>ai.leadping</groupId>
  <artifactId>leadping</artifactId>
  <version>VERSION</version>
</dependency>
```

Install the Kiota bundle in the application that will call Leadping:

```gradle theme={null}
implementation "com.microsoft.kiota:microsoft-kiota-bundle:1.9.3"
```

## Create a client

The SDK exposes `LeadpingOpenApiClient`. For most SDK integrations, pass it a Kiota request adapter that attaches `Authorization: Bearer lp_...`. Use `Authorization: Bearer <leadping_user_access_token>` only when acting as a signed-in user, and use `Authorization: Bearer lp_src_...` only when intentionally calling lead ingestion endpoints.

```java theme={null}
import ai.leadping.openapi.LeadpingOpenApiClient;
import com.microsoft.kiota.RequestAdapter;

public class App {
    public static void main(String[] args) {
        RequestAdapter requestAdapter = createLeadpingRequestAdapter();
        LeadpingOpenApiClient client = new LeadpingOpenApiClient(requestAdapter);

        var me = client.users().me().get();
    }
}
```

`createLeadpingRequestAdapter` is your application code. The generated SDK does not own token storage or API key handling.

## Common calls

```java theme={null}
var source = client.sources().byId("source-id").get();
var lead = client.leads().byId("lead-id").get();
var currentUser = client.users().me().get();
```

Use generated request body classes from the `ai.leadping.openapi.models` package when creating or updating records.
