Service Requests

Manage facility maintenance and service requests. Track work orders from submission through completion with support for comments, time logging, and activity tracking.

GET /api/v1/service-requests

List all service requests with optional filtering and search.

Scope: service_requests:read

Query Parameters

Parameter Type Description
status string Filter by status (pending, in-progress, completed)
priority string Filter by priority (low, normal, high, urgent)
assigned_to uuid Filter by assigned user ID
category string Filter by request category
created_after date Filter requests created after date (ISO 8601)
created_before date Filter requests created before date (ISO 8601)
search string Search in title and description
limit integer Items per page (max 100, default 50)
offset integer Number of items to skip

Response

200 OK
{
  "data": [
    {
      "id": "uuid",
      "title": "Fix AC in Room 302",
      "description": "Air conditioning unit not cooling properly",
      "status": "pending",
      "priority": "high",
      "category": "HVAC",
      "assigned_to": "uuid",
      "created_by": "uuid",
      "created_at": "2026-02-12T10:30:00Z",
      "updated_at": "2026-02-12T10:30:00Z"
    }
  ],
  "meta": {
    "total": 150,
    "limit": 50,
    "offset": 0,
    "request_id": "req_abc123"
  }
}

Example

cURL
curl -X GET "https://mafm.app/api/v1/service-requests?status=pending&priority=high" \
  -H "Authorization: Bearer mafm_live_..." \
  -H "Content-Type: application/json"
POST /api/v1/service-requests

Create a new service request.

Scope: service_requests:write

Request Body

JSON
{
  "title": "Fix AC in Room 302",          // required
  "description": "AC not cooling",
  "priority": "high",                     // low, normal, high, urgent
  "category": "HVAC",
  "assigned_to": "uuid",
  "building_id": "uuid",
  "floor": "3",
  "room": "302"
}

Response

201 Created
{
  "data": {
    "id": "uuid",
    "title": "Fix AC in Room 302",
    "status": "pending",
    "created_at": "2026-02-12T10:30:00Z"
  },
  "meta": {
    "request_id": "req_abc123"
  }
}

Example

cURL
curl -X POST "https://mafm.app/api/v1/service-requests" \
  -H "Authorization: Bearer mafm_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Fix AC in Room 302",
    "description": "AC not cooling properly",
    "priority": "high",
    "category": "HVAC"
  }'
GET /api/v1/service-requests/:id

Retrieve a single service request by ID.

Scope: service_requests:read

Response

200 OK
{
  "data": {
    "id": "uuid",
    "title": "Fix AC in Room 302",
    "description": "AC not cooling properly",
    "status": "in-progress",
    "priority": "high",
    "created_at": "2026-02-12T10:30:00Z"
  },
  "meta": {
    "request_id": "req_abc123"
  }
}
PATCH /api/v1/service-requests/:id

Update an existing service request.

Scope: service_requests:write

Request Body

JSON (partial update)
{
  "status": "in-progress",
  "assigned_to": "uuid"
}

Response

200 OK
{
  "data": {
    "id": "uuid",
    "status": "in-progress",
    "updated_at": "2026-02-12T11:00:00Z"
  },
  "meta": {
    "request_id": "req_abc123"
  }
}
DELETE /api/v1/service-requests/:id

Delete a service request.

Scope: service_requests:write

Response

204 No Content
// No response body
GET /api/v1/service-requests/:id/comments

List all comments for a service request.

Scope: service_requests:read
POST /api/v1/service-requests/:id/comments

Add a comment to a service request.

Scope: service_requests:write

Request Body

{
  "comment": "Working on this now"  // required
}
GET /api/v1/service-requests/:id/watchers

List users watching this service request.

Scope: service_requests:read
POST /api/v1/service-requests/:id/watchers

Add a watcher to the service request.

Scope: service_requests:write

Request Body

{
  "user_id": "uuid"  // required
}
DELETE /api/v1/service-requests/:id/watchers

Remove a watcher from the service request.

Scope: service_requests:write

Request Body

{
  "user_id": "uuid"  // required
}
GET /api/v1/service-requests/:id/time-logs

List time logs for the service request.

Scope: service_requests:read
POST /api/v1/service-requests/:id/time-logs

Log time spent on the service request.

Scope: service_requests:write

Request Body

{
  "hours": 2.5,
  "description": "Replaced AC filter and recharged coolant"
}
GET /api/v1/service-requests/:id/activity

Get activity history for the service request (read-only).

Scope: service_requests:read

Response

{
  "data": [
    {
      "id": "uuid",
      "action": "status_changed",
      "from_value": "pending",
      "to_value": "in-progress",
      "user_id": "uuid",
      "created_at": "2026-02-12T11:00:00Z"
    }
  ]
}

Move Requests

Manage office moves and relocations. Track move requests with the same sub-resources as service requests: comments, watchers, time logs, and activity.

GET /api/v1/move-requests

List all move requests with filtering.

Scope: move_requests:read

Query Parameters

Parameter Type Description
status string Filter by status
priority string Filter by priority
assigned_to uuid Filter by assigned user
created_after date Filter by creation date
created_before date Filter by creation date
search string Search in title and description
POST /api/v1/move-requests

Create a new move request.

Scope: move_requests:write

Request Body

{
  "title": "Move Sales Team to 5th Floor",  // required
  "description": "Relocate 10 workstations",
  "priority": "normal",
  "scheduled_date": "2026-02-20",
  "from_location": "Building A, Floor 3",
  "to_location": "Building A, Floor 5"
}
GET /api/v1/move-requests/:id

Get a single move request.

Scope: move_requests:read
PATCH /api/v1/move-requests/:id

Update a move request.

Scope: move_requests:write
DELETE /api/v1/move-requests/:id

Delete a move request.

Scope: move_requests:write

Sub-resources: Move requests support the same nested endpoints as service requests: /comments, /watchers, /time-logs, and /activity.

Inventory

Manage inventory items across multiple storage locations. Track stock levels, adjustments, and receive low-stock alerts.

GET /api/v1/inventory

List all inventory items.

Scope: inventory:read

Query Parameters

Parameter Type Description
status string Filter by status (active, inactive)
category string Filter by category
location_id uuid Filter by storage location
low_stock boolean Filter items below reorder point
created_after date Filter by creation date
created_before date Filter by creation date
search string Search in name, description, SKU

Example

cURL
curl -X GET "https://mafm.app/api/v1/inventory?low_stock=true&category=supplies" \
  -H "Authorization: Bearer mafm_live_..."
POST /api/v1/inventory

Create a new inventory item.

Scope: inventory:write

Request Body

{
  "name": "Office Paper A4",
  "description": "White 80gsm printer paper",
  "sku": "PPR-A4-80",
  "category": "supplies",
  "quantity": 500,
  "unit": "sheets",
  "reorder_point": 100,
  "location_id": "uuid",
  "unit_cost": 0.02
}
GET /api/v1/inventory/:id

Get a single inventory item.

Scope: inventory:read
PATCH /api/v1/inventory/:id

Update an inventory item.

Scope: inventory:write
DELETE /api/v1/inventory/:id

Delete an inventory item.

Scope: inventory:write
GET /api/v1/inventory/:id/adjustments

List stock adjustment history for an item.

Scope: inventory:read

Query Parameters

Parameter Type Description
type string Filter by adjustment type (addition, removal, correction)
created_after date Filter by date
created_before date Filter by date
POST /api/v1/inventory/:id/adjustments

Record a stock adjustment.

Scope: inventory:write

Request Body

{
  "type": "addition",
  "quantity": 100,
  "reason": "New shipment received",
  "reference": "PO-2026-001"
}
POST /api/v1/inventory/batch

Create multiple inventory items in one request.

Scope: inventory:write

Request Body

{
  "items": [
    {
      "name": "Item 1",
      "sku": "ITM-001",
      "quantity": 100
    },
    {
      "name": "Item 2",
      "sku": "ITM-002",
      "quantity": 50
    }
  ]
}

Procurement - Requisitions

Create and manage purchase requisitions. Requisitions are requests for purchasing items that need approval before becoming purchase orders.

GET /api/v1/procurement/requisitions

List all purchase requisitions.

Scope: procurement:read

Query Parameters

Parameter Type Description
status string Filter by status (draft, pending, approved, rejected)
requested_by uuid Filter by requester
created_after date Filter by creation date
created_before date Filter by creation date
search string Search in title and description

Response

{
  "data": [
    {
      "id": "uuid",
      "title": "Office Supplies Q1",
      "status": "pending",
      "requested_by": "uuid",
      "line_items": [...],
      "vendor": {...},
      "total_amount": 1500.00,
      "created_at": "2026-02-12T10:00:00Z"
    }
  ]
}
POST /api/v1/procurement/requisitions

Create a new requisition.

Scope: procurement:write
GET /api/v1/procurement/requisitions/:id

Get a single requisition.

Scope: procurement:read
PATCH /api/v1/procurement/requisitions/:id

Update a requisition.

Scope: procurement:write
DELETE /api/v1/procurement/requisitions/:id

Delete a requisition.

Scope: procurement:write

Procurement - Purchase Orders

Manage purchase orders sent to vendors. Track order status from creation through fulfillment.

GET /api/v1/procurement/orders

List all purchase orders.

Scope: procurement:read
POST /api/v1/procurement/orders

Create a new purchase order.

Scope: procurement:write
GET /api/v1/procurement/orders/:id

Get a single purchase order.

Scope: procurement:read
PATCH /api/v1/procurement/orders/:id

Update a purchase order.

Scope: procurement:write
DELETE /api/v1/procurement/orders/:id

Delete a purchase order.

Scope: procurement:write

Procurement - Receiving

Record receipt of goods and materials against purchase orders.

GET /api/v1/procurement/receiving

List all receiving records.

Scope: procurement:read
POST /api/v1/procurement/receiving

Create a new receiving record.

Scope: procurement:write
GET /api/v1/procurement/receiving/:id

Get a single receiving record.

Scope: procurement:read
PATCH /api/v1/procurement/receiving/:id

Update a receiving record.

Scope: procurement:write
DELETE /api/v1/procurement/receiving/:id

Delete a receiving record.

Scope: procurement:write

Procurement - Invoices

Manage vendor invoices and track payment status.

GET /api/v1/procurement/invoices

List all invoices.

Scope: procurement:read
POST /api/v1/procurement/invoices

Create a new invoice.

Scope: procurement:write
GET /api/v1/procurement/invoices/:id

Get a single invoice.

Scope: procurement:read
PATCH /api/v1/procurement/invoices/:id

Update an invoice.

Scope: procurement:write
DELETE /api/v1/procurement/invoices/:id

Delete an invoice.

Scope: procurement:write

Procurement - Inventory Transfers

Track inventory transfers between locations.

GET /api/v1/procurement/transfers

List all inventory transfers.

Scope: procurement:read
POST /api/v1/procurement/transfers

Create a new transfer.

Scope: procurement:write
GET /api/v1/procurement/transfers/:id

Get a single transfer.

Scope: procurement:read
PATCH /api/v1/procurement/transfers/:id

Update a transfer.

Scope: procurement:write
DELETE /api/v1/procurement/transfers/:id

Delete a transfer.

Scope: procurement:write

Leases

Manage property and equipment leases. Track lease terms, important dates, payment schedules, and associated documents.

GET /api/v1/leases

List all leases with filtering.

Scope: leases:read

Query Parameters

Parameter Type Description
status string Filter by status (active, expired, terminated)
lease_type string Filter by type (property, equipment, vehicle)
created_after date Filter by creation date
created_before date Filter by creation date
search string Search in name, description, lessor, lessee

Example

cURL
curl -X GET "https://mafm.app/api/v1/leases?status=active&lease_type=property" \
  -H "Authorization: Bearer mafm_live_..."
POST /api/v1/leases

Create a new lease.

Scope: leases:write

Request Body

{
  "name": "Main Office Lease",
  "lease_type": "property",
  "lessor": "ABC Properties LLC",
  "lessee": "MAFM Corporation",
  "start_date": "2026-01-01",
  "end_date": "2031-01-01",
  "monthly_payment": 12500.00,
  "description": "5-year lease for main office space"
}

Example

cURL
curl -X POST "https://mafm.app/api/v1/leases" \
  -H "Authorization: Bearer mafm_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Main Office Lease",
    "lease_type": "property",
    "lessor": "ABC Properties LLC",
    "start_date": "2026-01-01",
    "end_date": "2031-01-01",
    "monthly_payment": 12500.00
  }'
GET /api/v1/leases/:id

Get a single lease.

Scope: leases:read
PATCH /api/v1/leases/:id

Update a lease.

Scope: leases:write
DELETE /api/v1/leases/:id

Delete a lease.

Scope: leases:write
GET /api/v1/leases/:id/documents

List all document versions for a lease.

Scope: leases:read
POST /api/v1/leases/:id/documents

Upload a new lease document version.

Scope: leases:write

Request Body

{
  "version": "1.1",
  "file_url": "https://storage.mafm.app/lease-docs/...",
  "notes": "Updated payment terms"
}
GET /api/v1/leases/:id/dates

List important dates for a lease.

Scope: leases:read
POST /api/v1/leases/:id/dates

Add an important date to a lease.

Scope: leases:write

Request Body

{
  "date": "2026-11-01",
  "type": "renewal_option",
  "description": "Last day to exercise renewal option"
}
GET /api/v1/leases/:id/payments

List payment schedules for a lease.

Scope: leases:read
POST /api/v1/leases/:id/payments

Add a payment schedule entry.

Scope: leases:write

Request Body

{
  "due_date": "2026-03-01",
  "amount": 12500.00,
  "description": "March 2026 rent",
  "status": "pending"
}
GET /api/v1/leases/:id/accounting

Get accounting summary for a lease (read-only).

Scope: leases:read

Response

{
  "data": {
    "total_paid": 150000.00,
    "total_due": 750000.00,
    "remaining_balance": 600000.00,
    "next_payment_due": "2026-03-01",
    "next_payment_amount": 12500.00
  }
}

Fixed Assets

Track fixed assets including equipment, furniture, and vehicles. Manage maintenance schedules, warranties, documents, and asset transfers.

GET /api/v1/assets

List all fixed assets.

Scope: assets:read

Query Parameters

Parameter Type Description
status string Filter by status (active, retired, disposed)
category_id uuid Filter by asset category
location uuid Filter by building ID
assigned_to uuid Filter by assigned user
condition string Filter by condition (excellent, good, fair, poor)
created_after date Filter by creation date
search string Search in asset_name, description, serial_number, model
POST /api/v1/assets

Create a new fixed asset.

Scope: assets:write

Request Body

{
  "asset_name": "Dell Latitude 5520 Laptop",
  "description": "15-inch business laptop",
  "serial_number": "DL5520-2026-001",
  "model": "Latitude 5520",
  "category_id": "uuid",
  "purchase_date": "2026-02-01",
  "purchase_price": 1200.00,
  "condition": "excellent",
  "building_id": "uuid",
  "assigned_to": "uuid"
}
GET /api/v1/assets/:id

Get a single asset.

Scope: assets:read
PATCH /api/v1/assets/:id

Update an asset.

Scope: assets:write
DELETE /api/v1/assets/:id

Delete an asset.

Scope: assets:write
GET /api/v1/assets/:id/maintenance

List maintenance schedules and history.

Scope: assets:read

Query Parameters

Parameter Type Description
status string Filter by status (scheduled, completed, overdue)
maintenance_type string Filter by type (preventive, corrective, inspection)
POST /api/v1/assets/:id/maintenance

Schedule maintenance for an asset.

Scope: assets:write

Request Body

{
  "maintenance_type": "preventive",
  "scheduled_date": "2026-08-01",
  "description": "Annual hardware checkup",
  "estimated_cost": 150.00
}
GET /api/v1/assets/:id/warranties

List warranties for an asset.

Scope: assets:read
POST /api/v1/assets/:id/warranties

Add a warranty record.

Scope: assets:write

Request Body

{
  "warranty_type": "manufacturer",
  "start_date": "2026-02-01",
  "end_date": "2029-02-01",
  "provider": "Dell Inc.",
  "coverage": "Parts and labor"
}
GET /api/v1/assets/:id/documents

List documents for an asset.

Scope: assets:read
POST /api/v1/assets/:id/documents

Upload a document for an asset.

Scope: assets:write
GET /api/v1/assets/:id/transfers

List transfer history for an asset.

Scope: assets:read
POST /api/v1/assets/:id/transfers

Record an asset transfer.

Scope: assets:write

Request Body

{
  "from_location": "uuid",
  "to_location": "uuid",
  "from_user": "uuid",
  "to_user": "uuid",
  "transfer_date": "2026-02-15",
  "reason": "Department reorganization"
}

Vendors

Manage vendor relationships, track invoices, and view purchase order history.

GET /api/v1/vendors

List all vendors.

Scope: vendors:read

Query Parameters

Parameter Type Description
status string Filter by status (active, inactive)
vendor_type string Filter by vendor type
created_after date Filter by creation date
search string Search in company_name, contact_name, email
POST /api/v1/vendors

Create a new vendor.

Scope: vendors:write

Request Body

{
  "company_name": "ABC Office Supplies",
  "contact_name": "John Smith",
  "email": "john@abcoffice.com",
  "phone": "+1-555-0100",
  "vendor_type": "supplies",
  "payment_terms": "Net 30",
  "address": "123 Supply St, City, ST 12345"
}
GET /api/v1/vendors/:id

Get a single vendor.

Scope: vendors:read
PATCH /api/v1/vendors/:id

Update a vendor.

Scope: vendors:write
DELETE /api/v1/vendors/:id

Delete a vendor.

Scope: vendors:write
GET /api/v1/vendors/:id/invoices

List invoices from a vendor.

Scope: vendors:read
POST /api/v1/vendors/:id/invoices

Record a new invoice from a vendor.

Scope: vendors:write
GET /api/v1/vendors/:id/purchase-orders

List purchase orders sent to a vendor (read-only).

Scope: vendors:read

Daily Checklists

Create and manage recurring daily checklists for routine tasks. Organize tasks into groups and track completion history.

GET /api/v1/checklists

List all checklists.

Scope: checklists:read

Query Parameters

Parameter Type Description
status string Filter by status (active, inactive)
assigned_to uuid Filter by assigned user
created_after date Filter by creation date
created_before date Filter by creation date
search string Search in name and description
POST /api/v1/checklists

Create a new checklist template.

Scope: checklists:write

Request Body

{
  "name": "Morning Opening Procedures",
  "description": "Daily checklist for facility opening",
  "assigned_to": "uuid",
  "recurrence": "daily"
}
GET /api/v1/checklists/:id

Get a single checklist.

Scope: checklists:read
PATCH /api/v1/checklists/:id

Update a checklist.

Scope: checklists:write
DELETE /api/v1/checklists/:id

Delete a checklist.

Scope: checklists:write
GET /api/v1/checklists/:id/tasks

List all tasks in a checklist.

Scope: checklists:read
POST /api/v1/checklists/:id/tasks

Add a task to a checklist.

Scope: checklists:write

Request Body

{
  "title": "Check all entry doors are unlocked",
  "description": "Verify all main entrance doors",
  "order": 1,
  "group_id": "uuid"
}
GET /api/v1/checklists/:id/tasks/:taskId

Get a single task.

Scope: checklists:read
PATCH /api/v1/checklists/:id/tasks/:taskId

Update a task.

Scope: checklists:write
DELETE /api/v1/checklists/:id/tasks/:taskId

Delete a task.

Scope: checklists:write
GET /api/v1/checklists/:id/groups

List task groups in a checklist.

Scope: checklists:read
POST /api/v1/checklists/:id/groups

Create a task group.

Scope: checklists:write

Request Body

{
  "name": "Security Checks",
  "order": 1
}
GET /api/v1/checklists/:id/completions

List completion history for a checklist.

Scope: checklists:read
POST /api/v1/checklists/:id/completions

Mark a checklist as completed for a date.

Scope: checklists:write

Request Body

{
  "completion_date": "2026-02-12",
  "completed_by": "uuid",
  "notes": "All tasks completed successfully"
}

Time Clock

Track employee time entries with clock in/out records. Manage work locations and company-wide time tracking settings.

GET /api/v1/time-clock/records

List all time clock records.

Scope: time_clock:read

Query Parameters

Parameter Type Description
user_id uuid Filter by user
type string Filter by type (regular, overtime, break)
date date Filter by specific date
created_after date Filter by creation date
created_before date Filter by creation date
search string Search in notes
POST /api/v1/time-clock/records

Create a new time clock record.

Scope: time_clock:write

Request Body

{
  "user_id": "uuid",
  "clock_in_time": "2026-02-12T08:00:00Z",
  "clock_out_time": "2026-02-12T17:00:00Z",
  "type": "regular",
  "location_id": "uuid",
  "notes": "Regular shift"
}
GET /api/v1/time-clock/records/:id

Get a single time clock record.

Scope: time_clock:read
PATCH /api/v1/time-clock/records/:id

Update a time clock record (no deletion allowed).

Scope: time_clock:write
GET /api/v1/time-clock/settings

Get company time clock settings.

Scope: time_clock:read
PATCH /api/v1/time-clock/settings

Update time clock settings.

Scope: time_clock:write

Request Body

{
  "require_location": true,
  "allow_overtime": true,
  "rounding_minutes": 15,
  "grace_period_minutes": 5
}
GET /api/v1/time-clock/locations

List approved clock-in locations.

Scope: time_clock:read
POST /api/v1/time-clock/locations

Add a clock-in location.

Scope: time_clock:write

Request Body

{
  "name": "Main Office",
  "address": "123 Main St, City, ST 12345",
  "latitude": 40.7128,
  "longitude": -74.0060,
  "radius_meters": 100
}

Shipping

Track inbound and outbound shipments with carrier information and tracking numbers.

GET /api/v1/shipping

List all shipments.

Scope: shipping:read

Query Parameters

Parameter Type Description
status string Filter by status (pending, shipped, delivered)
type string Filter by type (inbound, outbound)
tracking_number string Search by tracking number
created_after date Filter by creation date
search string Search in description, tracking number, sender, recipient
POST /api/v1/shipping

Create a new shipment record.

Scope: shipping:write

Request Body

{
  "type": "outbound",
  "description": "Office supplies shipment",
  "tracking_number": "1Z999AA10123456784",
  "carrier": "UPS",
  "sender": "MAFM Main Office",
  "recipient": "Branch Office",
  "weight_kg": 5.5,
  "estimated_delivery": "2026-02-15"
}
GET /api/v1/shipping/:id

Get a single shipment.

Scope: shipping:read
PATCH /api/v1/shipping/:id

Update a shipment.

Scope: shipping:write
DELETE /api/v1/shipping/:id

Delete a shipment.

Scope: shipping:write

Mailroom

Manage mailroom label templates and package scan events for shipping and receiving operations.

GET /api/v1/mailroom/label-templates

List all label templates.

Scope: shipping:read

Query Parameters

Parameter Type Description
label_size string Filter by label size
is_default boolean Filter by default template flag
search string Search in template name
POST /api/v1/mailroom/label-templates

Create a label template.

Scope: shipping:write
GET /api/v1/mailroom/label-templates/:id

Get a single label template.

Scope: shipping:read
PATCH /api/v1/mailroom/label-templates/:id

Update a label template.

Scope: shipping:write
DELETE /api/v1/mailroom/label-templates/:id

Delete a label template.

Scope: shipping:write
GET /api/v1/mailroom/scan-events

List package scan events.

Scope: shipping:read

Query Parameters

Parameter Type Description
scan_type string Filter by scan type
processing_status string Filter by processing status
tracking_number string Filter by tracking number
scanned_after date Filter by scan date
scanned_before date Filter by scan date
search string Search in barcode, tracking number, and detected carrier
POST /api/v1/mailroom/scan-events

Record a package scan event.

Scope: shipping:write

Locations

Manage buildings and areas within your facility network.

GET /api/v1/locations/buildings

List all buildings.

Scope: locations:read

Query Parameters

Parameter Type Description
search string Search in name, address, code
limit integer Items per page
offset integer Number of items to skip
POST /api/v1/locations/buildings

Create a new building.

Scope: locations:write

Request Body

{
  "name": "Main Office Building",
  "code": "MAIN-01",
  "address": "123 Business Ave, City, ST 12345",
  "floors": 5,
  "square_feet": 50000
}
GET /api/v1/locations/buildings/:id

Get a single building.

Scope: locations:read
PATCH /api/v1/locations/buildings/:id

Update a building.

Scope: locations:write
DELETE /api/v1/locations/buildings/:id

Delete a building.

Scope: locations:write
GET /api/v1/locations/areas

List all areas within buildings (read-only).

Scope: locations:read

Paint Manager

Track paint inventory and map paint colors to specific building locations.

GET /api/v1/paints

List all paints.

Scope: paint:read

Query Parameters

Parameter Type Description
search string Search in name, color_code, brand
POST /api/v1/paints

Create a new paint record.

Scope: paint:write

Request Body

{
  "name": "Eggshell White",
  "color_code": "SW-7005",
  "brand": "Sherwin Williams",
  "finish": "eggshell",
  "gallons_available": 15
}
GET /api/v1/paints/:id

Get a single paint record.

Scope: paint:read
PATCH /api/v1/paints/:id

Update a paint record.

Scope: paint:write
DELETE /api/v1/paints/:id

Delete a paint record.

Scope: paint:write
GET /api/v1/paints/:id/locations

List locations where this paint is used.

Scope: paint:read
POST /api/v1/paints/:id/locations

Map paint to a building location.

Scope: paint:write

Request Body

{
  "building_id": "uuid",
  "floor": "3",
  "room": "Conference Room A",
  "surface_type": "walls",
  "notes": "North and east walls only"
}
GET /api/v1/paints/:id/locations/:locationId

Get a single paint location mapping.

Scope: paint:read
PATCH /api/v1/paints/:id/locations/:locationId

Update a paint location mapping.

Scope: paint:write
DELETE /api/v1/paints/:id/locations/:locationId

Delete a paint location mapping.

Scope: paint:write

Butts in Seats

Manage desks and employee workspace assignments for space planning and occupancy analysis.

GET /api/v1/butts-in-seats/desks

List all desks.

Scope: butts_in_seats:read

Query Parameters

Parameter Type Description
floor string Filter by floor
building_id uuid Filter by building
is_assigned boolean Filter by assignment status
POST /api/v1/butts-in-seats/desks

Create a new desk.

Scope: butts_in_seats:write
GET /api/v1/butts-in-seats/desks/:id

Get a single desk.

Scope: butts_in_seats:read
PATCH /api/v1/butts-in-seats/desks/:id

Update a desk.

Scope: butts_in_seats:write
DELETE /api/v1/butts-in-seats/desks/:id

Delete a desk.

Scope: butts_in_seats:write
GET /api/v1/butts-in-seats/employees

List employee workspace records.

Scope: butts_in_seats:read
POST /api/v1/butts-in-seats/employees

Create an employee workspace record.

Scope: butts_in_seats:write

Documents

Centralized document repository for general file storage and management.

GET /api/v1/documents

List all documents.

Scope: documents:read

Query Parameters

Parameter Type Description
status string Filter by processing_status
category string Filter by category
file_type string Filter by file type (pdf, docx, xlsx, etc.)
created_after date Filter by creation date
created_before date Filter by creation date
search string Search in title, description, file_name
POST /api/v1/documents

Upload a new document.

Scope: documents:write

Request Body

{
  "title": "Company Policy Handbook",
  "description": "2026 edition",
  "category": "policies",
  "file_name": "handbook-2026.pdf",
  "file_type": "pdf",
  "file_url": "https://storage.mafm.app/docs/..."
}
GET /api/v1/documents/:id

Get a single document.

Scope: documents:read
PATCH /api/v1/documents/:id

Update document metadata.

Scope: documents:write
DELETE /api/v1/documents/:id

Delete a document.

Scope: documents:write

HR Documents

Manage human resources documents including policies, handbooks, and employee acknowledgments.

GET /api/v1/hr/documents

List all HR documents.

Scope: hr:read

Query Parameters

Parameter Type Description
status string Filter by status
category string Filter by category (policy, handbook, form)
document_type string Filter by document type
created_after date Filter by creation date
search string Search in title and description
POST /api/v1/hr/documents

Create a new HR document.

Scope: hr:write

Request Body

{
  "title": "Employee Handbook 2026",
  "category": "handbook",
  "document_type": "policy",
  "description": "Updated employee handbook",
  "requires_acknowledgment": true,
  "file_url": "https://storage.mafm.app/hr/..."
}
GET /api/v1/hr/documents/:id

Get a single HR document.

Scope: hr:read
PATCH /api/v1/hr/documents/:id

Update an HR document.

Scope: hr:write
DELETE /api/v1/hr/documents/:id

Delete an HR document.

Scope: hr:write
GET /api/v1/hr/acknowledgments

List document acknowledgments.

Scope: hr:read
POST /api/v1/hr/acknowledgments

Record a document acknowledgment.

Scope: hr:write

Request Body

{
  "document_id": "uuid",
  "user_id": "uuid",
  "acknowledged_at": "2026-02-12T10:00:00Z",
  "ip_address": "192.168.1.100"
}

Training

Manage training programs, track employee completions, and create training assessments with questions.

GET /api/v1/training

List all training programs.

Scope: training:read

Query Parameters

Parameter Type Description
status string Filter by status (active, archived)
category string Filter by training_type
created_after date Filter by creation date
search string Search in title and description
POST /api/v1/training

Create a new training program.

Scope: training:write

Request Body

{
  "title": "Safety Training 2026",
  "description": "Annual workplace safety training",
  "training_type": "safety",
  "duration_minutes": 60,
  "passing_score": 80,
  "is_mandatory": true
}
GET /api/v1/training/:id

Get a single training program.

Scope: training:read
PATCH /api/v1/training/:id

Update a training program.

Scope: training:write
DELETE /api/v1/training/:id

Delete a training program.

Scope: training:write
GET /api/v1/training/:id/completions

List training completions.

Scope: training:read
POST /api/v1/training/:id/completions

Record a training completion.

Scope: training:write

Request Body

{
  "user_id": "uuid",
  "completed_at": "2026-02-12T14:00:00Z",
  "score": 85,
  "passed": true
}
GET /api/v1/training/:id/questions

List training assessment questions.

Scope: training:read
POST /api/v1/training/:id/questions

Add a question to training assessment.

Scope: training:write

Request Body

{
  "question_text": "What is the first step in fire safety?",
  "question_type": "multiple_choice",
  "options": ["Call 911", "Pull alarm", "Evacuate", "Use extinguisher"],
  "correct_answer": "Pull alarm",
  "points": 5
}

Notes

Personal and shared notes system with categorization and pinning capabilities.

GET /api/v1/notes

List all notes.

Scope: notes:read

Query Parameters

Parameter Type Description
category_id uuid Filter by category
is_pinned boolean Filter by pinned status
created_after date Filter by creation date
search string Search in title and content
POST /api/v1/notes

Create a new note.

Scope: notes:write

Request Body

{
  "title": "Meeting Notes - Q1 Planning",
  "content": "Discussed goals and budget for Q1...",
  "category_id": "uuid",
  "is_pinned": false,
  "is_shared": true
}
GET /api/v1/notes/:id

Get a single note.

Scope: notes:read
PATCH /api/v1/notes/:id

Update a note.

Scope: notes:write
DELETE /api/v1/notes/:id

Delete a note.

Scope: notes:write
GET /api/v1/notes/categories

List note categories.

Scope: notes:read
POST /api/v1/notes/categories

Create a note category.

Scope: notes:write

Request Body

{
  "name": "Meeting Notes",
  "color": "#4A90E2"
}

Reminders

Set up reminders for tasks and events with optional recurrence and entity linking.

GET /api/v1/reminders

List all reminders.

Scope: reminders:read

Query Parameters

Parameter Type Description
status string Filter by status (pending, completed, dismissed)
recurrence string Filter by recurrence (none, daily, weekly, monthly)
linked_entity_type string Filter by linked entity type
due_before date Filter reminders due before date
due_after date Filter reminders due after date
search string Search in title and description
POST /api/v1/reminders

Create a new reminder.

Scope: reminders:write

Request Body

{
  "title": "Review monthly reports",
  "description": "Review and approve monthly financial reports",
  "due_date": "2026-03-01T09:00:00Z",
  "recurrence": "monthly",
  "linked_entity_type": "document",
  "linked_entity_id": "uuid"
}
GET /api/v1/reminders/:id

Get a single reminder.

Scope: reminders:read
PATCH /api/v1/reminders/:id

Update a reminder.

Scope: reminders:write
DELETE /api/v1/reminders/:id

Delete a reminder.

Scope: reminders:write

Users

View user profiles and information (read-only). User management is handled through the authentication system.

GET /api/v1/users

List all users in your company (read-only).

Scope: users:read

Query Parameters

Parameter Type Description
search string Search in full_name and email
limit integer Items per page
offset integer Number of items to skip

Response

{
  "data": [
    {
      "id": "uuid",
      "full_name": "John Doe",
      "email": "john@mafm.app",
      "avatar_url": "https://...",
      "role": "manager",
      "created_at": "2025-01-15T10:00:00Z"
    }
  ]
}
GET /api/v1/users/:id

Get a single user profile (read-only).

Scope: users:read

Companies

View company information (read-only). Company settings are managed through the admin dashboard.

GET /api/v1/companies

List companies (read-only, limited to companies you have access to).

Scope: companies:read

Response

{
  "data": [
    {
      "id": "uuid",
      "name": "MAFM Corporation",
      "slug": "mafm",
      "created_at": "2024-01-01T00:00:00Z"
    }
  ]
}
GET /api/v1/companies/:id

Get a single company (read-only).

Scope: companies:read

Dashboard Analytics

Server-side aggregated analytics for the role-based dashboard. Requires a logged-in user session; API tokens are not supported on this endpoint.

GET /api/v1/dashboard/analytics

Get aggregated dashboard analytics for the active company.

Auth: User session

Query Parameters

Parameter Type Description
startDate date Start of date range (optional)
endDate date End of date range (optional)
mode string Query mode: rpc or batch (default: rpc)

AI Usage

Billing-ready AI usage and cost reporting per company. Requires a logged-in admin or executive session; API tokens are not supported on these endpoints.

GET /api/v1/ai-usage

Get per-feature AI usage and cost breakdown for a date range.

Auth: User session (admin/executive)

Query Parameters

Parameter Type Description
start date Start of billing period (defaults to first day of current month)
end date End of billing period (defaults to first day of next month)
POST /api/v1/ai-usage

Trigger monthly AI usage aggregation.

Auth: User session (admin/executive)

Request Body

{
  "action": "aggregate",
  "month": "2026-06-01"
}

Expected Packages (Public)

Public guest endpoints for expected package tracking. No authentication or API token is required; requests are rate limited per IP address.

POST /api/v1/public/expected-packages

Submit an expected package as a guest.

Auth: None (public)

Request Body

{
  "company_slug": "mafm",
  "guest_name": "Jane Doe",
  "guest_email": "jane@example.com",
  "description": "New office chair",
  "vendor_name": "Amazon",
  "tracking_number": "1Z999AA10123456784",
  "expected_date": "2026-07-10",
  "quantity": 1,
  "notes": "Deliver to reception"
}
GET /api/v1/public/expected-packages/:token

Look up an expected package by its guest tracking token.

Auth: None (public)
GET /api/v1/public/expected-packages/status

List a guest's expected packages by company and email.

Auth: None (public)

Query Parameters

Parameter Type Description
company_slug string Company identifier (required)
email string Guest email used when submitting packages (required)