# Pascal developer interfaces Choose the interface for the task: - Building scenes, architectural editing, room scans, furniture, and hosted site or media services: start with the [Pascal Editor documentation](https://editor.pascal.app/docs), [agent entry document](https://editor.pascal.app/llms.txt), and [API catalog](https://editor.pascal.app/.well-known/api-catalog). The [MCP connection guide](https://editor.pascal.app/docs/developers/mcp) describes local editing and hosted account access. - Home maintenance, work requests, contractor organizations, and memberships: use the Home Services API below. Each product owns its authentication and resource permissions. Use the selected product's documented connection flow and endpoints. ## Home Services API > Base URL: https://pascal.app ## Authentication The Home Services API requests described below require an API key. Include it in your request headers: ``` x-api-key: pascal_your_api_key_here ``` Or as a Bearer token: ``` Authorization: Bearer pascal_your_api_key_here ``` API keys are organization-scoped and can be created from the Account page in the Pascal web app. ## Endpoints The API uses tRPC. All endpoints are at `/api/trpc/{procedure}`. ### Work Requests #### Create Work Request ``` POST /api/trpc/workRequest.apiCreate Content-Type: application/json { "json": { "projectName": "Repair HVAC Unit", "description": "AC unit in Building A not cooling properly", "priority": "high", "propertyId": "property_xxx" } } ``` **Parameters:** - `projectName` (required): Name of the work request - `description` (required): Detailed description - `priority` (optional): "low" | "normal" | "high" | "urgent" (default: "normal") - `status` (optional): "pending" | "accepted" | "in_progress" | "completed" | "cancelled" (default: "pending") - `propertyId` (optional): Property ID. If omitted, uses organization's first property. - `budget` (optional): Budget amount as string - `deadline` (optional): ISO 8601 date string - `notes` (optional): Additional notes - `attachmentUrls` (optional): Array of attachment URLs **Response:** ```json { "result": { "data": { "json": { "id": "work_request_abc123", "projectName": "Repair HVAC Unit", "description": "AC unit in Building A not cooling properly", "propertyId": "property_xxx", "status": "pending", "priority": "high", "createdAt": "2026-02-04T12:00:00.000Z", "updatedAt": "2026-02-04T12:00:00.000Z" } } } } ``` #### List Work Requests ``` GET /api/trpc/workRequest.apiList?input={"json":{}} ``` **Query Parameters (in input JSON):** - `propertyId` (optional): Filter by property - `status` (optional): Filter by status - `limit` (optional): Max results (1-100, default: 50) - `offset` (optional): Pagination offset (default: 0) **Example with filters:** ``` GET /api/trpc/workRequest.apiList?input={"json":{"status":"pending","limit":10}} ``` **Response:** ```json { "result": { "data": { "json": [ { "id": "work_request_abc123", "projectName": "Repair HVAC Unit", "propertyId": "property_xxx", "status": "pending", "property": { "id": "property_xxx", "name": "Building A" }, "contractor": null } ] } } } ``` #### Get Work Request ``` GET /api/trpc/workRequest.apiGet?input={"json":{"id":"work_request_abc123"}} ``` **Response:** ```json { "result": { "data": { "json": { "id": "work_request_abc123", "projectName": "Repair HVAC Unit", "description": "AC unit in Building A not cooling properly", "propertyId": "property_xxx", "status": "pending", "priority": "high", "property": { "id": "property_xxx", "name": "Building A" }, "contractor": null, "createdAt": "2026-02-04T12:00:00.000Z", "updatedAt": "2026-02-04T12:00:00.000Z" } } } } ``` #### Update Work Request ``` POST /api/trpc/workRequest.apiUpdate Content-Type: application/json { "json": { "id": "work_request_abc123", "data": { "status": "in_progress", "notes": "Technician dispatched" } } } ``` **Parameters:** - `id` (required): Work request ID - `data` (required): Object with fields to update (same as create, all optional) ## Error Handling Errors return this structure: ```json { "error": { "json": { "message": "Organization has no properties. Create a property first.", "code": -32600, "data": { "code": "BAD_REQUEST", "httpStatus": 400 } } } } ``` **Common Error Codes:** - `UNAUTHORIZED` (401): Invalid or missing API key - `FORBIDDEN` (403): Key doesn't have access to resource - `NOT_FOUND` (404): Resource not found - `BAD_REQUEST` (400): Invalid input - `RATE_LIMITED` (429): Too many requests ## Rate Limits - 100 requests per minute per API key - Rate limit resets every minute - Exceeding limit returns `UNAUTHORIZED` until reset ## Organization Scope API keys are scoped to a single organization. You can only: - Access work requests for properties in your organization - Create work requests for properties in your organization Attempting to access resources outside your organization returns `FORBIDDEN`. ## Example: Create and Track Work Request ```bash # Create a work request curl -X POST "https://pascal.app/api/trpc/workRequest.apiCreate" \ -H "x-api-key: pascal_your_key" \ -H "Content-Type: application/json" \ -d '{ "json": { "projectName": "Replace Light Fixtures", "description": "Replace fluorescent lights with LED in cafeteria", "priority": "normal" } }' # Check status curl -X GET "https://pascal.app/api/trpc/workRequest.apiGet?input={\"json\":{\"id\":\"work_request_xxx\"}}" \ -H "x-api-key: pascal_your_key" # Update status curl -X POST "https://pascal.app/api/trpc/workRequest.apiUpdate" \ -H "x-api-key: pascal_your_key" \ -H "Content-Type: application/json" \ -d '{ "json": { "id": "work_request_xxx", "data": { "status": "completed" } } }' ``` ## Support For API issues, contact support@pascal.app or visit https://pascal.app/support