docsAPI ReferenceOverview

API Overview

The LawnLedger CRM API is a RESTful JSON API that allows you to integrate with your LawnLedger data programmatically. All endpoints are prefixed with /api/ and return JSON responses.

Base URL

https://api.lawnledgercrm.com

For local development:

http://localhost:3000

Authentication

LawnLedger uses cookie-based session authentication. All API requests must include valid session cookies.

Logging In

To authenticate, send a POST request to the auth endpoint:

curl -X POST https://api.lawnledgercrm.com/api/auth/sign-in/email \
  -H "Content-Type: application/json" \
  -c cookies.txt \
  -d '{
    "email": "you@example.com",
    "password": "your-password"
  }'

The -c cookies.txt flag saves the session cookie to a file. Use -b cookies.txt on subsequent requests to include it.

Authenticated Requests

curl https://api.lawnledgercrm.com/api/customers \
  -b cookies.txt
⚠️

All API requests (except auth endpoints) require authentication. Unauthenticated requests return a 401 Unauthorized response.

Response Format

All successful responses follow a consistent envelope format:

{
  "data": { ... }
}

The data field contains the response payload (an object, array, or primitive).

Error Responses

Errors return an error object with a message and code:

{
  "error": {
    "message": "Customer not found",
    "code": "NOT_FOUND"
  }
}

HTTP status codes:

CodeMeaning
200Success
201Created
204No Content (empty body)
400Bad Request (validation error)
401Unauthorized (not logged in)
403Forbidden (insufficient permissions)
404Not Found
429Too Many Requests (rate limited)
500Internal Server Error

Multi-Tenancy

LawnLedger is a multi-tenant application. All data is scoped to your organization automatically based on your session. You do not need to pass an organization ID in most requests.

Rate Limiting

API requests are rate-limited to prevent abuse. If you exceed the rate limit, you will receive a 429 response. Wait and retry after the indicated period.

The API is designed for integration purposes. For high-volume data access, consider using the bulk export features available in the app settings.

Available Endpoints

ResourceBase Path
Customers/api/customers
Invoices/api/invoices
Estimates/api/estimates
Contracts/api/contracts
Jobs/api/jobs
Webhooks/api/webhooks
Properties/api/properties
Services/api/services
Payments/api/payments
Equipment/api/equipment
Time Tracking/api/crew-tracking
Winter Routes/api/winter-routes
Dashboard/api/dashboard
Settings/api/settings