Reliant Workforce

Cross-App API Integration Guide

Everything the Client/Facility Portal team needs to connect to this Agency Workforce app.

Quick Start
  1. 1

    Generate an API key

    Go to Manage API Keys page → Generate API Key → choose access level and resources → copy the key.

  2. 2

    Store the key as a secret in the Client Portal app

    Never hardcode it. Use AGENCY_API_KEY as the secret name.

  3. 3

    Call the gateway from the Portal's backend functions

    All calls are POST to /functions/facilityPortalApi

Request Format
POST https://reliantworkforceapp.base44.app/functions/facilityPortalApi
Content-Type: application/json

{
  "api_key": "rws_your_key_here",
  "resource": "staffing_requests",
  "action": "list",
  "facility_id": "facility_123"
}

All fields except api_key, resource, and action are optional and depend on the action being performed.

Response Format
{
  "success": true,
  "data": [
    {
      "id": "req_001",
      "facility_id": "facility_123",
      "position_type": "RN",
      "shift_type": "night",
      "status": "pending",
      "start_date": "2026-09-05",
      ...
    }
  ]
}

Errors return { "success": false, "error": "message" } with appropriate HTTP status codes (401, 403, 400, 500).

Available Resources
staffing_requests
4 actions

Create and track facility staffing requests

list
List requests for a facilityfacility_id (optional), filters
get
Get a single requestrecord_id
create
Submit a new staffing requestdata (full request object)
update
Update request status/notesrecord_id, data
assignments
2 actions

View shift assignments at a facility

list
List assignments with sanitized worker infofacility_id (optional), filters
get
Get a single assignmentrecord_id
timesheets
3 actions

View, approve, or dispute timesheets

list
List timesheets for a facilityfacility_id (optional), filters
get
Get a single timesheetrecord_id
update
Approve/dispute (fields restricted)record_id, data
messages
2 actions

Cross-app conversation threading

list
List messages for a facilityfacility_id (optional), filters
create
Send a messagedata (message object)
facilities
3 actions

View and update facility profile

list
List active facilitiesfilters
get
Get facility profilefacility_id or record_id
update
Update facility settingsfacility_id or record_id, data
workers
1 actions

Sanitized view of staff assigned to a facility

list
List assigned workers (name, role, specialty only)facility_id (required)
invoices
2 actions

View invoices for a facility (read-only)

list
List invoicesfacility_id (optional), filters
get
Get a single invoicerecord_id
compliance_status
1 actions

Sanitized compliance summary for assigned workers

list
Per-worker compliance counts (no credential details)facility_id (required)
worker_credentials
1 actions

Sanitized credential verification — status per credential type, no document details

list
Per-worker credential statuses (valid/expiring/expired)facility_id (required)
timesheet_status
1 actions

Aggregate timesheet status counts for a facility dashboard

summary
Counts by status (draft, submitted, approved, etc.)facility_id (required)
Access Levels
read_only
Can only list and get records — no creates or updates
read_write
Can create and update records (field-restricted on timesheets)
admin
Full access to all resources and actions
Client Portal Setup Code
// In the Client Portal app — store the API key as a secret
// Then call the gateway from backend functions:

const response = await fetch(
  "https://reliantworkforceapp.base44.app/functions/facilityPortalApi",
  {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({
      api_key: process.env.AGENCY_API_KEY,
      resource: "staffing_requests",
      action: "list",
      facility_id: facilityId
    })
  }
);
const result = await response.json();
Security Notes
  • • API keys are scoped per resource and access level — grant the minimum needed.
  • • Worker profiles are automatically sanitized — no SSN, credential numbers, or compliance details are exposed.
  • • Timesheet updates from the portal are field-restricted — facilities can approve/dispute but cannot alter hours.
  • • Compliance status returns only aggregate counts (compliant, expiring, expired) — no document details.
  • • Rotate keys regularly and revoke immediately if compromised.