Getting Started
Register as a developer, create your first app, and make your first OAuth-authenticated API call.
Step 1: Register as a Developer
Sign up at developers.lend.works to create your developer account. You'll get access to:
- The developer dashboard for managing apps
- A sandbox environment with test data
- API documentation and changelogs
Step 2: Create Your First App
- In the developer dashboard, click Create App
- Fill in the app details:
- App Name — A human-readable name shown during OAuth consent
- Description — What your app does (shown in the marketplace)
- Redirect URIs — Where users are sent after authorizing your app
- Scopes — Select the permissions your app will request (e.g.,
leads:read,contacts:write) - Webhook URL — (Optional) Endpoint for receiving events
- Click Create to generate your app credentials
You'll receive:
| Credential | Description |
|---|---|
| Client ID | Public identifier for your app (lw_app_xxxxxxxxxxxx) |
| Client Secret | Private secret for token exchange — store securely, never expose client-side |
Step 3: Set Up OAuth Credentials
Configure your app's OAuth settings:
- Add at least one Redirect URI (e.g.,
https://yourapp.com/callback) - Select the scopes your app needs (start with the minimum required)
- Save your Client Secret in a secure location — it is only shown once
For local development, you can use http://localhost:3000/callback as a redirect URI.
Step 4: Make Your First API Call
Once a user installs your app and completes the OAuth flow, you'll have an access token. See the OAuth 2.0 Authorization guide for the full flow.
Using the SDK
import { LendWorksClient } from '@lendworks/sdk-node'
const client = new LendWorksClient({
accessToken: 'lw_at_xxxxxxxxxxxxxxxx', // OAuth access token
})
// List leads for the installing organization
const { data: leads, meta } = await client.leads.list({ limit: 10 })
console.log(`Found ${meta.total} leads`)
for (const lead of leads) {
console.log(`${lead.businessName} — ${lead.email}`)
}Using cURL
curl -H "Authorization: Bearer lw_at_xxxxxxxxxxxxxxxx" \
https://api.lend.works/v1/leads?limit=10Using fetch
const response = await fetch('https://api.lend.works/v1/leads?limit=10', {
headers: {
Authorization: 'Bearer lw_at_xxxxxxxxxxxxxxxx',
'Content-Type': 'application/json',
},
})
const { data, meta } = await response.json()
console.log(`Found ${meta.total} leads`)Step 5: Set Up Webhooks
Subscribe to events programmatically using the Webhook Subscriptions API:
const subscription = await client.webhooks.create({
url: 'https://yourapp.com/webhooks/lendworks',
events: ['lead.created', 'deal.funded'],
})
console.log(`Webhook created: ${subscription.data.id}`)
console.log(`Signing secret: ${subscription.data.secret}`)Or configure webhooks in the developer dashboard under your app settings.
Next Steps
- OAuth 2.0 Authorization — Implement the full authorization flow
- OAuth Scopes — Choose the right permissions for your app
- Sandbox — Test your integration with sample data
- App Lifecycle — Understand app states from draft to listed