Skip to main content
UnitClear/API Documentation
Dashboard

REST API v1

Programmatically manage vehicles, rig checks, users, checklists, inventory, and more. The UnitClear API uses standard REST conventions with JSON request and response bodies.

Base URL

https://www.unitclearems.com/api/v1

Authentication

All API requests require an API key passed via the x-api-key header. API keys can be created from Dashboard → Billing → API Keys or via the POST /api/v1/api-keys endpoint.

curl
curl https://www.unitclearems.com/api/v1/vehicles \
  -H "x-api-key: uc_live_abc123..."

Pagination

List endpoints return paginated results. Use page and per_page query parameters (max 100 items per page).

{
  "data": [...],
  "meta": {
    "page": 1,
    "per_page": 25,
    "total": 42,
    "total_pages": 2
  }
}

API Keys

GET/api/v1/api-keys

List all API keys for the organization. Full key is never shown again after creation.

Response

[ { id, name, key_prefix, role, created_by, last_used_at, expires_at, is_active, created_at } ]
POST/api/v1/api-keys

Create a new API key. The full key is returned only on creation.

Request Body

  • name (string, required)
  • role (string, default: "manager")
  • expires_in_days (number, optional)

Response

{ id, name, key, role, created_at }
DELETE/api/v1/api-keys/:id

Delete (revoke) an API key.

Vehicles

GET/api/v1/vehicles

List vehicles for the organization with pagination and filtering.

Query Parameters

  • page (default: 1)
  • per_page (default: 25, max: 100)
  • status (green | yellow | red)
  • in_service (true | false)
  • on_shift (true | false)
  • sort_by (rig_number | status | created_at | last_checked_at)
  • order (asc | desc)

Response

{ data: [ { id, rig_number, unit_number, status, in_service, on_shift_since, lat, lng, ... } ], meta: { page, per_page, total, total_pages } }
POST/api/v1/vehicles

Create a new vehicle. Checks against subscription vehicle limits.

Request Body

  • rig_number (string, required)
  • unit_number (string, optional)

Response

{ id, rig_number, unit_number, status, ... }
GET/api/v1/vehicles/:id

Get a single vehicle by ID.

PATCH/api/v1/vehicles/:id

Update vehicle fields.

Request Body

  • rig_number (string)
  • unit_number (string)
  • in_service (boolean)
DELETE/api/v1/vehicles/:id

Delete a vehicle. Returns 204 No Content.

PATCH/api/v1/vehicles/:id/status

Update vehicle status (green, yellow, red).

Request Body

  • status (string, required: green | yellow | red)
POST/api/v1/vehicles/:id/shift

Start a shift on a vehicle.

DELETE/api/v1/vehicles/:id/shift

End a shift on a vehicle.

Rig Checks

GET/api/v1/rig-checks

List rig checks with vehicle and user details.

Query Parameters

  • page e
  • per_page e
  • vehicle_id d
  • severity (green | yellow | red)
  • emt_id d
  • since (ISO date)
  • until (ISO date)

Response

{ data: [ { id, vehicle_id, emt_id, damage_notes, ai_damage_severity, ai_analysis_notes, created_at, vehicles, users } ], meta }
POST/api/v1/rig-checks

Submit a new rig check.

Request Body

  • vehicle_id (string, required)
  • checklist_id (string)
  • answers (object)
  • damage_notes (string)
  • crew_last_name (string)
GET/api/v1/rig-checks/:id

Get a single rig check by ID.

Users

GET/api/v1/users

List users in the organization. Requires manager role.

Query Parameters

  • page e
  • per_page e
  • role e

Response

{ data: [ { id, username, email, first_name, last_name, role, created_at } ], meta }
POST/api/v1/users

Create a new user. Returns a temporary password.

Request Body

  • first_name (string, required)
  • last_name (string, required)
  • role (string, required: emt | paramedic | nurse | manager | director)
  • recovery_email (string, optional)

Response

{ id, username, role, temp_password }
GET/api/v1/users/:id

Get a single user by ID.

PATCH/api/v1/users/:id

Update user fields.

Request Body

  • first_name (string)
  • last_name (string)
  • role (string)
  • recovery_email (string)
DELETE/api/v1/users/:id

Delete a user.

POST/api/v1/users/:id/reset-password

Reset a user's password. Returns the new temporary password.

Response

{ temp_password }

Checklists

GET/api/v1/checklists

List checklists. By default returns only active checklists.

Query Parameters

  • active (default: true)
  • vehicle_id d
POST/api/v1/checklists

Create a checklist.

Request Body

  • title (string, required)
  • categories (array, required)
  • vehicle_ids (array, optional)
  • description (string)
  • restock_items (array)
GET/api/v1/checklists/:id

Get a single checklist by ID.

PATCH/api/v1/checklists/:id

Update a checklist.

Request Body

  • title (string)
  • categories (array)
  • vehicle_ids (array)
  • is_active (boolean)
DELETE/api/v1/checklists/:id

Delete a checklist.

Inventory

GET/api/v1/inventory

List inventory items with optional filters.

Query Parameters

  • category y
  • low_stock (true | false)
POST/api/v1/inventory

Add an inventory item.

Request Body

  • name (string, required)
  • category (string, default: "General")
  • unit (string, default: "unit")
  • quantity (number, default: 0)
  • low_threshold (number)
  • critical_threshold (number)
GET/api/v1/inventory/:id

Get a single inventory item.

PATCH/api/v1/inventory/:id

Update an inventory item.

DELETE/api/v1/inventory/:id

Delete an inventory item.

POST/api/v1/inventory/take

Record an inventory take (consume items).

Request Body

  • item_id (string, required)
  • quantity (number, required)
POST/api/v1/inventory/:id/restock

Restock an inventory item.

Request Body

  • quantity (number, required)
GET/api/v1/inventory/transactions

List inventory transactions (takes and restocks).

Notifications

GET/api/v1/notifications

List notifications for the current user/org.

Query Parameters

  • page e
  • per_page e
  • unread (true | false)
POST/api/v1/notifications/read

Mark specific notifications as read.

Request Body

  • ids (array of strings, required)
POST/api/v1/notifications/read-all

Mark all notifications as read.

Map Points

GET/api/v1/map-points

List map points (stations, hospitals, landmarks).

Query Parameters

  • type (hospital | station | landmark | ...)
POST/api/v1/map-points

Create a map point.

Request Body

  • name (string, required)
  • type (string, required)
  • lat (number, required)
  • lng (number, required)
  • description (string)
PATCH/api/v1/map-points/:id

Update a map point.

DELETE/api/v1/map-points/:id

Delete a map point.

Shift Issues

GET/api/v1/shift-issues

List shift issues. Requires manager role.

Query Parameters

  • page e
  • per_page e
  • status (pending | approved | rejected)
  • vehicle_id d
  • severity y
POST/api/v1/shift-issues

Report a shift issue.

Request Body

  • vehicle_id (string, required)
  • category (string, required)
  • description (string, required)
  • rig_check_id (string)
  • fuel_level (string)
POST/api/v1/shift-issues/:id/review

Review (approve/reject) a shift issue.

Request Body

  • action (string, required: approve | reject)
  • notes (string)

Shift Reports

GET/api/v1/shift-reports

List end-of-shift reports. Requires manager role.

Query Parameters

  • page e
  • per_page e
  • vehicle_id d
  • emt_id d
  • since (ISO date)
  • until (ISO date)
GET/api/v1/shift-reports/:id

Get a single shift report by ID.

Organization

GET/api/v1/organization

Get current organization details with user and vehicle counts.

Response

{ id, name, display_name, slug, subscription_status, user_count, vehicle_count, subscription }
PATCH/api/v1/organization/branding

Update organization branding settings.

Request Body

  • display_name (string)
  • primary_color (string)
  • accent_color (string)
POST/api/v1/organization/logo

Upload organization logo. Send as multipart/form-data.

Request Body

  • logo (File, required)

Audit Log

GET/api/v1/audit-log

List audit log entries. Requires director role.

Query Parameters

  • page e
  • per_page e
  • action n
  • target_type e
  • actor_id d
  • since (ISO date)
  • until (ISO date)

Response

{ data: [ { id, action, target_type, target_id, actor_id, actor_name, changes, created_at } ], meta }

Admin (super_admin)

GET/api/v1/admin/stats

Get platform-wide statistics. Requires super_admin role.

GET/api/v1/admin/organizations

List all organizations on the platform.

GET/api/v1/admin/organizations/:id

Get details for a specific organization.

PATCH/api/v1/admin/organizations/:id

Update an organization (subscription, status, etc.).

Rate Limiting

API requests are rate limited to prevent abuse. If you receive a 429 status, wait before retrying. Rate limits are applied per API key.

UnitClear — Digital Rig Checks for EMS & Fire

Home · Pricing · Get Started