> ## 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.

# PHP SDK

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

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

## Install

```bash theme={null}
composer require leadpingai/sdk
```

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

```bash theme={null}
composer require microsoft/kiota-bundle:^2.0.2
```

## 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.

```php theme={null}
<?php

use Leadping\OpenApiClient\LeadpingOpenApiClient;

$requestAdapter = createLeadpingRequestAdapter();
$client = new LeadpingOpenApiClient($requestAdapter);

$me = $client->users()->me()->get()->wait();
```

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

## Common calls

```php theme={null}
$source = $client->sources()->byId("source-id")->get()->wait();
$lead = $client->leads()->byId("lead-id")->get()->wait();
$currentUser = $client->users()->me()->get()->wait();
```

Use generated request body classes from the `Leadping\OpenApiClient` namespace when creating or updating records.
