Integrate your organization with Labored using per-company API keys - sync profile data, reviews, before/after photos, portfolio galleries, and uploads. Partner keys handle inbound leads separately.
Canonical API docs at /documentation/api/ - same reference, plus the docs hub for diagrams and workflows.
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 type | Key format | Used for |
|---|---|---|
| Company API key | lbr_ + 48 hex | Your organization listing - profile, reviews, media read/upload, sponsors, timeclock |
| Partner requests key | 64-char hex | Master leads table (submit_request, search_requests) |
| Checkout status secret | Env secret | Stripe checkout session sync (server-only) |
| Compacter / platform secret | Env secret | EE/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.
With a company lbr_* key + matching company_id:
| Capability | Endpoint | Method |
|---|---|---|
| Pull full company bundle | company_profile | GET/POST |
| List / create reviews | reviews | GET / POST JSON |
| Read portfolio (singles, before/after, galleries) | media | GET/POST |
| Upload single or before/after photos | media_upload | POST multipart |
| List sponsors | sponsors | GET/POST |
| Jobsite units, clock in/out, unit photos | timeclock | GET/POST JSON |
With a partner hex key (separate from lbr_*):
| Capability | Endpoint |
|---|---|
| Ingest a lead / service request | submit_request |
| Search / dedupe requests | search_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.
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:
X-API-Key: lbr_... (recommended)Authorization: Bearer lbr_...api_key query parameter or JSON body fieldAlways 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.
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.
| Name | Required | Notes |
|---|---|---|
company_id | Yes | Integer company ID |
| API key | Yes | Company lbr_* key |
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.
GET|POST /app/labored/api/reviews
List and create customer reviews for your company using your organization API key.
| Param | Default | Description |
|---|---|---|
company_id | - | Required |
status | approved | approved, pending, or all |
limit | 25 | 1-100 |
curl -s "/app/labored/api/reviews?company_id=123&status=approved&limit=25" \
-H "X-API-Key: lbr_YOUR_KEY"
| Field | Required | Notes |
|---|---|---|
company_id | Yes | Must match API key |
reviewer_name | Yes | Display name |
rating | Yes | Integer 1-5 |
review_text | Yes | Review body |
review_title | No | Short headline |
reviewer_email | No | For moderation contact |
review_image_url | No | Public HTTPS image URL |
auto_approve | No | true 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" }
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.
| Param | Default | Description |
|---|---|---|
company_id | - | Required - must match API key |
business_id | - | Alias for company_id |
id / portfolio_id | - | Return one portfolio item (404 if missing) |
include | images,portfolio,brand | Comma-separated: images, portfolio, brand, sponsors, all_urls |
kind | all kinds | Filter: before_after, single_image (aliases singles, single), image_gallery |
grouped | 1 | When listing all kinds, also return before_after, singles, galleries arrays |
all_urls | 0 | 1 adds flat all_image_urls list |
include_inactive | 0 | 1 includes hidden portfolio rows |
before_after - before_url, after_urlsingle_image - image_urlimage_gallery - gallery_urls arrayvideo_embed / video_upload - video URLsproject_spotlight - featured project blockcurl -s "/app/labored/api/media?company_id=123&include=portfolio&kind=before_after" \
-H "X-API-Key: lbr_YOUR_KEY"
curl -s "/app/labored/api/media?company_id=123&include=portfolio&kind=singles" \
-H "X-API-Key: lbr_YOUR_KEY"
curl -s "/app/labored/api/media?company_id=123&id=9" \
-H "X-API-Key: lbr_YOUR_KEY"
{
"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
}
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.
| Field | Required | Notes |
|---|---|---|
company_id | Yes | Must match API key |
kind | Yes | single_image or before_after (aliases: single, add_single, add_before_after) |
image | For single | Image file (jpg, png, webp, gif) |
image_before / image_after | For before_after | Aliases: before_image, after_image |
title / label | No | Portfolio title |
description | No | Short description |
category | No | Default general |
display_order | No | Integer sort order |
is_featured | No | Any truthy value marks featured |
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"
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.
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.
| action | Notes |
|---|---|
units | List units/jobsites |
entries | Optional unit_id, status (open/closed), limit |
photos | Requires unit_id |
| action | Required fields |
|---|---|
upsert_unit | unit_code, name (optional address, notes, is_active) |
clock_in | unit_id, worker_name (optional worker_ref, notes) |
clock_out | entry_id |
add_photo | unit_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"}'
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.
| Param | Default | Description |
|---|---|---|
company_id | - | Required |
id / sponsor_id | - | Return one sponsor |
include_inactive | 0 | 1 includes hidden rows |
curl -s "/app/labored/api/sponsors?company_id=123" \
-H "X-API-Key: lbr_YOUR_KEY"
{
"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
}
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]"}'
These use environment secrets - never expose in browser or mobile apps.
checkout_session_status - X-Labored-Checkout-Key + Stripe session idcompacter_provision - X-Labored-Compacter-Key for EE/Compacter checkout user linkingConfigure in labored_secrets.php (copy from labored_secrets.example.php).
| HTTP | error | Meaning |
|---|---|---|
| 400 | missing_company_id | No company_id passed |
| 401 | missing_api_key | No API key header/param |
| 403 | forbidden | Key does not match company_id |
| 404 | company_not_found, portfolio_not_found, sponsor_not_found | Invalid company or item id |
| 405 | method_not_allowed | Wrong HTTP method |
| 422 | validation_error | Invalid review fields |
| 500 | db_error | Server/database failure |