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

# Use the Go SDK

> Install the Leadping Go module, supply a Kiota request adapter, and call typed API routes.

* Module and repository: [`github.com/leadpingai/leadping-go`](https://github.com/leadpingai/leadping-go)

## Install

```bash theme={null}
go get github.com/leadpingai/leadping-go
go get github.com/microsoft/kiota-http-go@v1.4.0
```

## Create the client

```go theme={null}
package main

import (
    "context"
    "fmt"
    "os"

    leadping "github.com/leadpingai/leadping-go"
    auth "github.com/microsoft/kiota-abstractions-go/authentication"
    kiotahttp "github.com/microsoft/kiota-http-go"
)

func main() {
    credential := os.Getenv("LEADPING_API_KEY")
    if credential == "" {
        panic("LEADPING_API_KEY is not set")
    }

    authProvider, err := auth.NewApiKeyAuthenticationProviderWithValidHosts(
        "Bearer "+credential,
        "Authorization",
        auth.HEADER_KEYLOCATION,
        []string{"api.leadping.ai"},
    )
    if err != nil {
        panic(err)
    }

    adapter, err := kiotahttp.NewNetHttpRequestAdapter(authProvider)
    if err != nil {
        panic(err)
    }

    client := leadping.NewLeadpingOpenApiClient(adapter)

    lead, err := client.Leads().ById("lead-id").Get(context.Background(), nil)
    if err != nil {
        panic(err)
    }

    fmt.Println(lead.GetId())
}
```

The client defaults to `https://api.leadping.ai`. Set `LEADPING_API_KEY` to an organization API key. `client.Users().Me()` requires a user access token; source keys are only for lead intake.

## Call routes

```go theme={null}
ctx := context.Background()
source, err := client.Sources().ById("source-id").Get(ctx, nil)
lead, err := client.Leads().ById("lead-id").Get(ctx, nil)
// Requires a user access token.
currentUser, err := client.Users().Me().Get(ctx, nil)
```

The SDK does not store credentials. Use generated request-body interfaces when creating or updating records, confirm contracts in the [API Reference](/docs/api-reference), and follow the [rate-limit guide](/docs/rate-limits).
