Developer guide for connecting external software to the SecurePort work order platform. Two machine-facing endpoints are documented here: the Work Order Submission API for pushing orders in, and the Cyprexx webhook for receiving Pruvan events. Everything else in SecurePort (invoices, photos, time clock, training) is available to your own signed-in users through the app, and raw record access is available with Base44 API keys.
Base URL: https://secure-port-copy-b80082e7.base44.app
Auth model: server-to-server API key or bearer secret per endpoint. Never put keys in browser code or URLs.
Content type: application/json only, request bodies up to 64 KB.
Push a work order from your own software (Cyprexx, NFR, a CRM, or anything else) into SecurePort. Each accepted submission generates an AI-prepared draft in the admin dashboard's Received Work Orders; an administrator must review, approve the invoice, and assign employees. The API can never approve orders, send employee jobs, or mark invoices paid.
POST https://secure-port-copy-b80082e7.base44.app/functions/submitWorkOrderContent-Type: application/json and X-Work-Order-Key: <your API key> (the key lives in the app's secrets as WORK_ORDER_API_KEY and must be at least 32 characters).Check the connection before you send anything
A GET on the same endpoint with your key confirms the address and the key without creating an order:
curl --request GET "https://secure-port-copy-b80082e7.base44.app/functions/submitWorkOrder" \ --header "X-Work-Order-Key: $WORK_ORDER_API_KEY"
It answers {"ready": true}. A 401 means the key does not match; a 503 means the saved key is shorter than 32 characters or is missing.
| Field | Type | Required | Rules |
|---|---|---|---|
| external_id | string | Yes | Your unique order ID: 1–120 characters, letters, digits, periods, underscores, colons, or hyphens, starting with a letter or digit. |
| source_text | string | Yes | The original work order text: 20–12,000 characters. The AI drafts the title, invoice, task, and property details from it. |
curl --request POST "https://secure-port-copy-b80082e7.base44.app/functions/submitWorkOrder" \
--header "Content-Type: application/json" \
--header "X-Work-Order-Key: $WORK_ORDER_API_KEY" \
--data '{
"external_id": "WO-2026-001",
"source_text": "Customer: Example customer. Property: 123 Example Street. Remove garage debris and sweep the floor. Approved price: $450. Complete by October 9, 2026."
}'201 — draft created. Body is the receipt below.200 with duplicate: true — this external_id was already submitted with identical text; the original draft is untouched.{
"work_order_id": "returned-record-id",
"external_id": "WO-2026-001",
"status": "draft",
"review_required": true,
"duplicate": false
}{
"work_order_id": "returned-record-id",
"external_id": "WO-2026-001",
"status": "draft",
"review_required": true,
"duplicate": true
}Reuse the same external_id and identical source_text after a timeout or error, and send requests for the same ID one at a time. A reused ID with different text is rejected with 409; it never overwrites a reviewed draft.
20 new orders per minute and 200 per rolling 24 hours. A 429 response includes a Retry-After header; wait before retrying.
| Status | Meaning |
|---|---|
| 400 | Invalid fields or JSON. |
| 401 | Missing or incorrect API key. |
| 405 | Non-POST request. |
| 409 | Reused external_id with different text. |
| 413 | Request body exceeds 64 KB. |
| 415 | Content type is not application/json. |
| 429 | Rate limit reached (Retry-After included). |
| 503 | The saved key is missing or under 32 characters, or processing failed temporarily. Retry with the same external_id and source_text. |
Receives work order events from Cyprexx through Pruvan's webhook Add-On and turns each order into a reviewable draft in Received Work Orders. Existing imported orders are refreshed with new address, due date, or instruction updates instead of being duplicated.
POST https://secure-port-copy-b80082e7.base44.app/functions/cyprexxWebhookAuthorization: Bearer <webhook secret>. The secret is the app's webhook_secret stored in Cyprexx integration settings and must be at least 16 characters. For testing, ?secret= in the URL or a secret body field are also accepted.workorder.create — imports a new order as a draft (AI title, invoice, task, and property fields prepared).workorder.update — refreshes address, due date, and instructions on an already imported order.item.publish — accepted and acknowledged; no import action is taken.| Field | Type | Notes |
|---|---|---|
| event | string | One of the supported events above. |
| workorder.workOrderNumber | string | Cyprexx order number; stored as the internal cyprexx::<number> identifier for de-duplication. |
| workorder.* | object | Address (address1, address2, city, state, zip), dueDate or clientDueDate, instructions, description, services[] with serviceName, and reference. |
| sync | boolean | Optional. true processes the order before responding so failures appear in the response and logs; default processes after the response so Pruvan gets a fast 200. |
{
"event": "workorder.create",
"workorder": {
"workOrderNumber": "CYP-102938",
"address1": "123 Main St",
"city": "Artesia",
"state": "NM",
"zip": "88210",
"dueDate": "2026-10-30",
"instructions": "Initial secure, debris removal",
"description": "Trash out single family home",
"services": [{ "serviceName": "Trash Out" }]
}
}200 on accepted events (invalid credentials are 401, unknown method 405, setup unfinished 503, processing error 500). Pruvan retries its own events, so delivery is at-least-once and duplicates are safe.
{
"ok": true,
"event": "workorder.create",
"imported": true,
"processing": ""
}Completed Cyprexx orders are pushed back through Pruvan's pushkey endpoint with clientStatus: "Completed" by the app's Cyprexx tab (admin-only, invoked from the dashboard). No external caller can trigger this.
SecurePort stores its records in the entities below. Row-level security keeps every tenant, crew member, and administrator scoped to their own data; no API key is ever needed for a signed-in user to see their own records.
| Entity | What it holds | Access |
|---|---|---|
| WorkOrder | Orders from API, webhook, email scan, or manual intake. Includes AI draft invoice and task, assigned crew, and property details. | Admins only, via dashboard. |
| Task | Crew jobs created when a work order is approved. | Admins; staff see jobs assigned to them or unassigned jobs. |
| ProjectPhoto | Timestamped, GPS-stamped camera photos with room, stage, and measurements. | The crew member who captured them and admins. |
| PhotoFolder | Camera folders grouping photos per property or job. | Folder owner and admins. |
| WorkOrderCompletion | Crew sign-off records with notes and client signature. | The submitting employee and admins. |
| BusinessInvoice | Invoices generated from approved work orders. | Admins. |
| TimeEntry / TimeDay | Clock-in and clock-out records for payroll. | The employee and admins. |
| TrainingModule / TrainingProgress | Training courses and each employee's completion progress. | Admins; staff read offered courses and their own progress. |
| Company / CompanyMember | Tenant workspace and its member roster. | The company owner and admins. |
| EmailWorkOrder | Work orders scanned from connected mailboxes, with AI-rewritten details and mileage. | Admins. |
For reading and writing these records directly from your own backend, create a Base44 API key in the app dashboard's API page and follow the generated SDK and REST examples there. Keep keys server-side, like the work order key above.
Page walkthrough
Step 1 of 4: What is documented
This page documents the work order API: how to submit orders programmatically, the data model, and the Cyprexx webhook.