Request services from a pro: Gyms, Landscaping, and Website Development
Documentation / HTTP API reference

Labored HTTP API reference

Everything you can call with a company lbr_* key or a partner lead key: profile, reviews, media read/upload, sponsors, timeclock, and platform provision.

Overview

Labored exposes JSON HTTP APIs for company integrations (Compacter, partner sites, CRM sync) and partner lead ingestion.

Production base URL: /app/labored/api/

Clean URLs: public API paths never include a .php suffix. Use /api/submit_request, /api/media, /api/media_upload. Legacy paths that still end in .php resolve for old clients.

Full docs hub: /app/labored/documentation/

Every JSON response includes a timestamp field (ISO-8601 UTC). Successful responses use "success": true.

Auth typeKey formatUsed for
Company API keylbr_ + 48 hexYour organization listing - profile, reviews, media read/upload, sponsors, timeclock
Partner requests key64-char hexMaster leads table (submit_request, search_requests)
Checkout status secretEnv secretStripe checkout session sync (server-only)
Compacter / platform secretEnv secretEE/Compacter user + company provisioning (server-only)

Not a secret: company_key is a public claim ID for dashboard onboarding - never use it as an API key.

What you can do now

With a company lbr_* key + matching company_id:

CapabilityEndpointMethod
Pull full company bundlecompany_profileGET/POST
List / create reviewsreviewsGET / POST JSON
Read portfolio (singles, before/after, galleries)mediaGET/POST
Upload single or before/after photosmedia_uploadPOST multipart
List sponsorssponsorsGET/POST
Jobsite units, clock in/out, unit photostimeclockGET/POST JSON

With a partner hex key (separate from lbr_*):

CapabilityEndpoint
Ingest a lead / service requestsubmit_request
Search / dedupe requestssearch_requests
Delete request (allowlisted)delete_request

Partner sites typically store both keys: LABORED_API_KEY (leads) and LABORED_COMPANY_API_KEY (media). MP Backyard Solutions is the reference: dashboard gallery uploads call media_upload; the public gallery merges media.

Company API keys (organization)

Create keys in Dashboard → Company → API keys. Requires the Labored Business plan ($25/mo). Each key is scoped to one company (company_id).

Issuing tips: label keys by destination (e.g. gogreenges-production, timeclock-van-1). Create a fresh key per integration; deactivate old keys instead of sharing one secret. The dashboard shows the full lbr_* secret once - copy it into your app .env immediately.

Send the key on every company-scoped request using one of:

Always pass company_id (or business_id). If the key belongs to a different company, the API returns 403 forbidden.

One company key unlocks: profile, reviews, media read (media), media upload (media_upload), sponsors, and timeclock (units, clock, unit photos).

The full secret is shown once at creation. Labored stores only a SHA-256 hash. Put it in partner .env as LABORED_COMPANY_API_KEY with LABORED_COMPANY_ID.

Company profile

GET|POST /app/labored/api/company_profile

Full public-style bundle: company row, summary, services, locations, brand kit, products, sponsors, images, portfolio, review summary, approved reviews, safe Stripe fields.

Parameters

NameRequiredNotes
company_idYesInteger company ID
API keyYesCompany lbr_* key

Example

curl -s "/app/labored/api/company_profile?company_id=123" \
  -H "X-API-Key: lbr_YOUR_KEY"

Reviews in this response are approved only (max 100). Image paths may be relative - use the Media API for absolute URLs and before/after fields.

Reviews

GET|POST /app/labored/api/reviews

List and create customer reviews for your company using your organization API key.

List reviews (GET)

ParamDefaultDescription
company_id - Required
statusapprovedapproved, pending, or all
limit251-100
curl -s "/app/labored/api/reviews?company_id=123&status=approved&limit=25" \
  -H "X-API-Key: lbr_YOUR_KEY"

Create review (POST JSON)

FieldRequiredNotes
company_idYesMust match API key
reviewer_nameYesDisplay name
ratingYesInteger 1-5
review_textYesReview body
review_titleNoShort headline
reviewer_emailNoFor moderation contact
review_image_urlNoPublic HTTPS image URL
auto_approveNotrue publishes immediately; default false (pending moderation)
curl -s -X POST "/app/labored/api/reviews" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: lbr_YOUR_KEY" \
  -d '{
    "company_id": 123,
    "reviewer_name": "Jane Customer",
    "rating": 5,
    "review_title": "Excellent work",
    "review_text": "Professional team, great results.",
    "auto_approve": false
  }'

Success 201: { "success": true, "review_id": 456, "status": "pending" }

Media & portfolio

GET|POST /app/labored/api/media

Fetch branding images and portfolio items with absolute URLs. Every call requires your company lbr_* API key plus company_id (or business_id). Before/after projects return before_url and after_url; single photos return image_url.

Parameters

ParamDefaultDescription
company_id - Required - must match API key
business_id - Alias for company_id
id / portfolio_id - Return one portfolio item (404 if missing)
includeimages,portfolio,brandComma-separated: images, portfolio, brand, sponsors, all_urls
kindall kindsFilter: before_after, single_image (aliases singles, single), image_gallery
grouped1When listing all kinds, also return before_after, singles, galleries arrays
all_urls01 adds flat all_image_urls list
include_inactive01 includes hidden portfolio rows

Portfolio kinds

All before/after

curl -s "/app/labored/api/media?company_id=123&include=portfolio&kind=before_after" \
  -H "X-API-Key: lbr_YOUR_KEY"

All single photos

curl -s "/app/labored/api/media?company_id=123&include=portfolio&kind=singles" \
  -H "X-API-Key: lbr_YOUR_KEY"

One item by id

curl -s "/app/labored/api/media?company_id=123&id=9" \
  -H "X-API-Key: lbr_YOUR_KEY"

Example response (grouped list)

{
  "success": true,
  "company_id": 123,
  "before_after": [{
    "id": 9,
    "kind": "before_after",
    "title": "Roof replacement",
    "before_url": "https://labored.net/uploads/portfolio/123/before.jpg",
    "after_url": "https://labored.net/uploads/portfolio/123/after.jpg"
  }],
  "before_after_count": 1,
  "singles": [{ "id": 10, "kind": "single_image", "image_url": "https://..." }],
  "singles_count": 1
}

Media upload

POST /app/labored/api/media_upload (multipart form data)

Add a portfolio single image or before/after pair for your company. Same lbr_* key + company_id as media read. Files land under uploads/portfolio/{company_id}/ and return absolute URLs.

Fields

FieldRequiredNotes
company_idYesMust match API key
kindYessingle_image or before_after (aliases: single, add_single, add_before_after)
imageFor singleImage file (jpg, png, webp, gif)
image_before / image_afterFor before_afterAliases: before_image, after_image
title / labelNoPortfolio title
descriptionNoShort description
categoryNoDefault general
display_orderNoInteger sort order
is_featuredNoAny truthy value marks featured

Upload a single photo

curl -s -X POST "/app/labored/api/media_upload" \
  -H "X-API-Key: lbr_YOUR_KEY" \
  -F "company_id=123" \
  -F "kind=single_image" \
  -F "title=Patio install" \
  -F "description=Hingham backyard" \
  -F "image=@/path/photo.jpg"

Upload before / after

curl -s -X POST "/app/labored/api/media_upload" \
  -H "X-API-Key: lbr_YOUR_KEY" \
  -F "company_id=123" \
  -F "kind=before_after" \
  -F "title=Lawn reset" \
  -F "image_before=@/path/before.jpg" \
  -F "image_after=@/path/after.jpg"

Success 201: { "success": true, "portfolio_id": 9, "item": { ... absolute urls ... } }. Singles expose image_url; before/after expose before_url and after_url.

Partner dashboards (e.g. MP Backyard Solutions gallery) should POST here instead of storing gallery files only on the partner host. Then public pages can merge via media.

Timeclock plugin

GET|POST /app/labored/api/timeclock

Built-in field timeclock for company crews: jobsites/units, clock in/out, and per-unit photos (before/after/progress). Same lbr_* company API key as reviews and media.

GET actions

actionNotes
unitsList units/jobsites
entriesOptional unit_id, status (open/closed), limit
photosRequires unit_id

POST actions (JSON)

actionRequired fields
upsert_unitunit_code, name (optional address, notes, is_active)
clock_inunit_id, worker_name (optional worker_ref, notes)
clock_outentry_id
add_photounit_id, photo_url (https); optional entry_id, caption, kind
curl -s -X POST "/app/labored/api/timeclock" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: lbr_YOUR_KEY" \
  -d '{"action":"upsert_unit","company_id":18,"unit_code":"tampa-roof-01","name":"Tampa roof job"}'

curl -s -X POST "/app/labored/api/timeclock" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: lbr_YOUR_KEY" \
  -d '{"action":"clock_in","company_id":18,"unit_id":1,"worker_name":"Alex"}'

curl -s -X POST "/app/labored/api/timeclock" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: lbr_YOUR_KEY" \
  -d '{"action":"add_photo","company_id":18,"unit_id":1,"photo_url":"https://example.com/before.jpg","kind":"before"}'

Sponsors

GET|POST /app/labored/api/sponsors

Per-company sponsor logos with name and optional website URL. Requires company API key + company_id. Manage in Dashboard → Company → Sponsors.

ParamDefaultDescription
company_id - Required
id / sponsor_id - Return one sponsor
include_inactive01 includes hidden rows
curl -s "/app/labored/api/sponsors?company_id=123" \
  -H "X-API-Key: lbr_YOUR_KEY"

Example item

{
  "id": 4,
  "name": "EE Home Systems",
  "logo_url": "https://labored.net/uploads/sponsors/123/sponsor_ab12.jpg",
  "website_url": "https://eehomesystems.com/",
  "display_order": 0,
  "is_active": true
}

Partner leads API

Separate partner keys in requests_api_keys - not company lbr_* keys.

POST /app/labored/api/submit_request - create lead

GET /app/labored/api/search_requests - duplicate check

Required on submit: full_name, service_requested (or service_needed).

curl -X POST "/app/labored/api/submit_request" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: PARTNER_HEX_KEY" \
  -d '{"full_name":"Alex","service_needed":"Roofing Services","email":"[email protected]"}'

Platform APIs (server secrets)

These use environment secrets - never expose in browser or mobile apps.

Configure in labored_secrets.php (copy from labored_secrets.example.php).

Error codes

HTTPerrorMeaning
400missing_company_idNo company_id passed
401missing_api_keyNo API key header/param
403forbiddenKey does not match company_id
404company_not_found, portfolio_not_found, sponsor_not_foundInvalid company or item id
405method_not_allowedWrong HTTP method
422validation_errorInvalid review fields
500db_errorServer/database failure