API Documentation

Integrate Livestock Runner with thousands of external apps via our Zapier-compatible REST API. Use API keys for authentication and automate your farm workflows.

Authentication

All API requests must include your API key in the X-API-Key header.

X-API-Key: lr_live_your_api_key_here

Generate an API key from your Profile → API Keys section.
For Zapier integration, leave the Allowed Domains field empty when creating your API key.

Base URL
https://livestockrunner.com/api/zapier
Auth Test
GET /api/zapier/me

Verify your API key works. Returns your user info.

Response 200

{
    "id": 1,
    "name": "Jane Farmer",
    "email": "jane@example.com",
    "farm_name": "Green Acres Farm"
}
Triggers (Outbound Webhooks)

Subscribe to events and receive real-time webhook notifications when things happen on your farm.

Available Events
Event Key Fires When
animal.createdNew animal added (cattle, dog, goat, poultry)
litter.bornLitter birth date is set
task.createdNew farm task created
task.completedFarm task marked complete
waitlist.new_entryNew waitlist signup
transaction.createdNew income or expense logged

POST /api/zapier/subscribe

Subscribe to an event. The target_url will receive POST requests when the event fires.

Request Body

{
    "target_url": "https://hooks.zapier.com/hooks/catch/123456/abcdef/",
    "event": "litter.born"
}

Response 201

{
    "id": 42
}

DELETE /api/zapier/subscribe/{id}

Remove a webhook subscription.

Response 204 No Content


GET /api/zapier/triggers/{event}

Returns recent items for the given event type, or sample data if no real data exists. Used by Zapier for deduplication and the Zap editor preview.

Response 200

[
    {
        "id": 1,
        "event": "litter.born",
        "name": "Luna x Rex Spring 2026",
        "status": "born",
        "birth_date": "2026-02-15",
        "actual_count": 6,
        ...
    }
]
Actions (Inbound API)

Create data in Livestock Runner from external apps and automations.

POST /api/zapier/actions/tasks

Create a farm task.

Request Body

{
    "title": "Vaccinate new calves",
    "type": "health",
    "due_date": "2026-03-01",
    "priority": "high",
    "description": "Spring vaccination round"
}

Response 201

{
    "id": 15,
    "title": "Vaccinate new calves",
    "type": "health",
    "due_date": "2026-03-01",
    "priority": "high",
    "status": "pending",
    ...
}

POST /api/zapier/actions/transactions

Log an income or expense transaction.

Request Body

{
    "type": "income",
    "amount": 500.00,
    "transaction_category_id": 3,
    "transaction_date": "2026-02-27",
    "description": "Sold 2 goats",
    "payee_payer": "John Doe",
    "notes": "Cash payment"
}

Response 201

{
    "id": 22,
    "type": "income",
    "amount": 500.00,
    "description": "Sold 2 goats",
    ...
}
Metadata Endpoints

These endpoints return dynamic dropdown values for building Zapier integrations.

Method Endpoint Returns
GET /api/zapier/event-types Available trigger event types
GET /api/zapier/animal-types Supported animal types
GET /api/zapier/task-types Available task types
GET /api/zapier/categories Your transaction categories
Error Handling
Status Meaning
401Missing or invalid API key
403Zapier not enabled for your account, or free plan restriction
404Resource not found
422Validation error (check response body for details)
503Zapier integration is globally disabled

All error responses include an "error" field with a human-readable message.

Requirements
  • Zapier integration requires a Starter plan ($79/year) or above.
  • Your account admin must enable Zapier integration in Admin Settings.
  • API keys used for Zapier should have the Allowed Domains field left empty.