Skip to main content
All Docs
API ReferencemyProp (AgentOS People Portal)Updated April 4, 2026

Contractor Portal API

Contractor Portal API

The Contractor Portal API provides tRPC endpoints and a service layer for contractor-specific operations within myProp. It enables contractors to view their account details, manage assigned maintenance jobs, track financial statements, and submit invoices — all connected in real time to the AgentOS (letmc.com) API.

Authentication

All contractor endpoints are protected and require an authenticated session. Unauthenticated requests are rejected before reaching the handler.

Endpoints

All endpoints are available under the contractor tRPC namespace (e.g. contractor.account, contractor.maintenanceJobs).


contractor.status

Returns a simple alive signal for the contractor router. Useful for connectivity checks.


contractor.insights

Returns aggregated dashboard KPIs for the contractor.

Response fields:

FieldTypeDescription
totalAssignedJobsnumberTotal jobs ever assigned to this contractor
activeJobsnumberJobs currently in progress
completedJobsnumberJobs marked as completed
pendingPaymentAmountnumberTotal value of unpaid statement entries
totalEarnedAmountnumberCumulative earned amount from statements

Data is aggregated across multiple AgentOS API calls using Promise.allSettled so partial failures do not block the dashboard.


contractor.account

Fetches the contractor's profile from AgentOS.

Input:

  • shortName — Agency short name (AgentOS identifier)
  • contractorId — Contractor's AgentOS ID

Response fields:

FieldTypeDescription
contractorIdstringAgentOS contractor ID
companyNamestringRegistered company name
displayNamestringDisplay name
emailstring | nullPrimary email address
phonestring | nullPhone number
mobilestring | nullMobile number
addressstring | nullFull address (combined)
addressLine1–3string | nullIndividual address lines
postcodestring | nullPostcode
vatNumberstring | nullVAT registration number
companyRegNumberstring | nullCompanies House number
isActivebooleanWhether the contractor account is active
branchIdstring | nullAssociated agency branch
tradesstring[]List of trade types
metadataRecord<string, unknown>Raw AgentOS fields

Returns null if the contractor is not found (404 from AgentOS).


contractor.contacts

Lists contact persons associated with the contractor account.

Response: Array of ContractorContact objects.

FieldTypeDescription
contactIdstringContact ID
namestringFull name
emailstring | nullEmail address
phonestring | nullPhone number
mobilestring | nullMobile number
rolestring | nullJob title or role
isPrimarybooleanWhether this is the primary contact
metadataRecord<string, unknown>Raw AgentOS fields

Errors from this endpoint are swallowed; an empty array is returned on failure.


contractor.maintenanceJobs

Returns a paginated list of maintenance jobs assigned to the contractor.

Input:

  • shortName — Agency short name
  • contractorId — Contractor ID
  • offset (optional) — Pagination offset (default: 0)
  • count (optional) — Page size (default: agency-level default)

Response: Array of ContractorMaintenanceJob objects.

FieldTypeDescription
jobIdstringJob ID
propertyIdstringAssociated property ID
propertyAddressstring | nullHuman-readable property address
titlestringJob title/summary
descriptionstring | nullDetailed job description
statusstringCurrent status (e.g. Open, Completed)
prioritystring | nullPriority level
reportedDatestring | nullISO date when reported
completedDatestring | nullISO date when completed
estimatedCostnumber | nullEstimated job cost
actualCostnumber | nullFinal cost on completion
categorystring | nullJob category (e.g. Plumbing, Electrical)
tenantNamestring | nullTenant at the property
landlordNamestring | nullLandlord name
accessDetailsstring | nullAccess/entry instructions
metadataRecord<string, unknown>Raw AgentOS fields

contractor.maintenanceJobDetails

Fetches full details for a single maintenance job.

Input:

  • shortName, contractorId, jobId

Response: Single ContractorMaintenanceJob object, or null if not found.


contractor.maintenanceJobNotes

Returns notes attached to a specific maintenance job.

Input:

  • shortName, contractorId, jobId

Response: Array of ContractorJobNote objects.

FieldTypeDescription
noteIdstringNote ID
jobIdstringParent job ID
textstringNote content
createdAtstring | nullISO timestamp
createdBystring | nullAuthor name
typestring | nullNote type/category
metadataRecord<string, unknown>Raw AgentOS fields

Errors are swallowed; returns an empty array on failure.


contractor.toggleJobCompletion

Toggles the completion status of a maintenance job (PATCH).

Input:

  • shortName, contractorId, jobId
  • completedbooleantrue to mark complete, false to reopen

contractor.addJobNote

Adds a note to a maintenance job (POST).

Input:

  • shortName, contractorId, jobId
  • textstring — Note content

contractor.statements

Returns historical financial statements for the contractor.

Input:

  • shortName, contractorId
  • dateFrom (optional) — Start of date range (ISO string)
  • dateTo (optional) — End of date range (ISO string)

Response: ContractorStatement object.

FieldTypeDescription
entriesContractorStatementEntry[]Line items
openingBalancenumber | nullPeriod opening balance
closingBalancenumber | nullPeriod closing balance
totalDebitsnumber | nullSum of debits
totalCreditsnumber | nullSum of credits
periodStartstring | nullISO start date
periodEndstring | nullISO end date

Each ContractorStatementEntry includes: entryId, date, description, debit, credit, balance, jobId, propertyAddress, category, invoiceNumber, metadata.


contractor.pendingStatements

Returns unpaid/pending statement entries.

Response: Array of PendingStatementEntry objects.

FieldTypeDescription
entryIdstringEntry ID
datestring | nullTransaction date
descriptionstringDescription/narrative
amountnumberPending amount
jobIdstring | nullRelated job ID
propertyAddressstring | nullRelated property
invoiceNumberstring | nullInvoice reference
statusstring | nullPayment status
metadataRecord<string, unknown>Raw AgentOS fields

contractor.submitInvoice

Submits an invoice for a completed maintenance job (POST).

Input:

  • shortName, contractorId, jobId
  • Invoice details (amount, reference, etc.) — validated by Zod schema

Response: InvoiceSubmissionResult

FieldTypeDescription
invoiceIdstring | nullID assigned by AgentOS
successbooleanWhether the submission was accepted
messagestring | nullConfirmation or error message from AgentOS
metadataRecord<string, unknown>Raw AgentOS response fields

Error Handling

ScenarioBehaviour
404 from AgentOSReturns null or [] — does not throw
Non-configured AgentOS APIThrows LetmcNotConfiguredError
Server-side AgentOS errorThrows; captured via captureError
Non-critical endpoints (contacts, notes)Errors swallowed, returns empty array

Field Mapping

All AgentOS PascalCase response fields are mapped to camelCase typed interfaces. The service layer handles both primary and alternative field names returned by different AgentOS API versions (e.g. CompanyName / Company, EmailAddress / Email, Phone / PhoneNumber).

Architecture

Follows the same patterns as the Landlord and Tenant portal service layers:

  • letmcClient handles HTTP with retry and timeout
  • 404 errors return null/[] for graceful UI degradation
  • Dashboard insights use Promise.allSettled so partial API failures don't block the page
  • All endpoints are authenticated via protectedProcedure