# Pipe Solar API v1 > Read and change your company's solar and home improvement leads and projects. Base address: https://staging-api.pipe.solar. The full description is `/openapi.json`. ## Authentication Send a company key, made by an owner or admin in Pipe under Settings > API Keys, as `Authorization: Bearer psk_<40 hex characters>`. Call from a server. A key reaches its own company's records only. ## Ids `{id}` takes Pipe's id, the 10-character UID of the customer or the project, or the long record id Pipe gave your system before (such as `1650753380033x501766420143276000`). It never takes the `externalId` you sent. A project also answers to its lead's id. ## Endpoints ### GET /v1/me: Check a key Answers the key's name and its company. Answers: - 200: The key works. - 401: The key is missing, wrong or revoked. Example answer: ```json { "key": { "name": "Make scenario", "prefix": "psk_3f9a1c2b" }, "company": { "name": "Inty Power" } } ``` ### GET /v1/users: List your company's people The people of your company, a page at a time: their id, name, sign-in email, role and whether they are active. Name a lead's rep or setter by this `id` (`salesRepId`, `setterId`); a lead's and a project's people carry the same `id`, as an activity's `authorId` does. Keep the `id`, not the email: a person's email can change. Only an active owner, admin, manager, rep or setter can be a lead's rep or setter. A dealer's key lists the dealer's people, an installer's key its own. Read only: people are invited and removed in Pipe. Query: - limit (integer): Rows in a page, 1 to 100. 50 when absent. - cursor (string): The `next` value of the previous page, URL-encoded. Send the same other fields with it. Absent for the first page. - role (string): owner, admin, manager, rep, setter, inspector, serviceProvider or subContractor. Every role when absent. - active (boolean): `true` for active people only, `false` for people switched off. Both when absent. A person removed from the company is not listed. Answers: - 200: `data` holds the page's people; `next` is the cursor for the next page, or null at the end. - 400: The request is not valid; the message says what to change. - 401: The key is missing, wrong or revoked. Example answer: ```json { "data": [{ "id": "1695312000000x123456789012345678", "firstName": "Jordan", "lastName": "Lee", "email": "jordan@example.com", "role": "rep", "active": true, "company": { "name": "Inty Power" } }], "next": null } ``` ### POST /v1/service-requests: Send a work order to an installer For a requester company's key, which Pipe issues: sends one service work order to an installer your company may send work to. The installer accepts or declines it (`acceptance`). The homeowner joins the installer's customers: the one at the same street address, or a new one with your company as the lead source. Send your own work-order number as `externalId`: sending it again answers the newest work order with that number, with 200, and makes nothing new. When every work order with that number was declined, it answers the one sent to this installer, or makes a new one, with 201, for an installer not yet sent it, up to 10 installers; after that, send it under a new number. The homeowner is matched on the whole address, line 2 included, so send the urbanization or unit there. Times in the answer are UTC; each visit names the site's own `timeZone`. Body (JSON): - externalId (string, required): Your work-order number, up to 64 characters. - installerId (string, required): The installer's Pipe id, as Pipe gives it when your company is set up. - serviceType (string, required): solar, monitoring, batteryStorage, roofing, hvac, electrical, generalMaintenance or other. - issueType (string): One of the service type's issues, such as inverterFailure or deviceOffline. - priority (string): high, medium or low. - description (string, required): What is wrong, up to 5,000 characters. - reference (string): Any reference of your own, up to 120 characters. - homeowner (object, required): The homeowner: first and last name, phone, email, and the site's address. A Puerto Rico address takes state `PR`, with country `US`, `PR` or `Puerto Rico`. - monitoringSites (object): The site's monitoring ids: `enphase`, `generac`, `solarEdge`, each a string. - equipment (array): Up to 50 units you know are bad: `kind` (microinverter, inverter, battery, gateway, panel, meter, other), `serial`, and optional `maker` and `model`. - files (array): Up to 10 files, each `{ url, name? }`. Pipe copies each into its own store: the address must be public https and open the file without signing in, and the file a document, picture, audio or video of 100 MB or less; an address that is not public https is refused before anything is made. A file that cannot be copied answers 400 naming its position; the work order and the files before it are kept, and sending the same call again adds the files it now can, never one twice. The answer's `files` lists the files you sent. Answers: - 201: The work order was made. - 200: This `externalId` made a work order before; the newest is answered as it stands. - 400: The request is not valid; the message says what to change. - 403: A key that is not a requester company's. - 401: The key is missing, wrong or revoked. Example request body: ```json { "externalId": "WO-1001", "installerId": "k57a…", "serviceType": "solar", "issueType": "inverterFailure", "description": "Two microinverters do not report.", "homeowner": { "firstName": "Sam", "lastName": "Rivera", "phone": "+1 555 0100", "address": { "line1": "1 Main St", "city": "San Juan", "state": "PR", "postalCode": "00901" } }, "monitoringSites": { "enphase": "1000001" }, "equipment": [{ "kind": "microinverter", "serial": "SN-0001" }], "files": [{ "url": "https://files.example.com/commissioning.pdf" }] } ``` Example answer: ```json { "id": "r81c…", "externalId": "WO-1001", "reference": null, "number": "S-04211", "installer": { "id": "k57a…", "name": "Example Solar" }, "status": "new", "acceptance": "pending", "declineReason": null, "serviceType": "solar", "issueType": "inverterFailure", "priority": null, "description": "Two microinverters do not report.", "monitoringSites": { "enphase": "1000001", "generac": null, "solarEdge": null }, "files": [{ "id": "f42b…", "name": "commissioning.pdf" }], "equipment": [{ "kind": "microinverter", "role": "reported", "serial": "SN-0001", "maker": null, "model": null }], "visits": [], "createdAt": "2026-10-15T14:00:00.000Z", "updatedAt": "2026-10-15T14:00:00.000Z" } ``` ### GET /v1/service-requests: List your work orders For a requester company's key: the work orders your company sent, newest first, a page at a time, or the ones one `externalId` names. Query: - limit (integer): 1 to 100; 50 when absent. - cursor (string): The `next` of the page before. - externalId (string): Only the work orders with this number of yours. Answers: - 200: `data` holds the page's work orders; `next` is the cursor for the next page, or null at the end. - 400: The request is not valid; the message says what to change. - 403: A key that is not a requester company's. - 401: The key is missing, wrong or revoked. Example answer: ```json { "data": [{ "id": "r81c…", "externalId": "WO-1001", "status": "new", "acceptance": "pending", "…": "…" }], "next": null } ``` ### PATCH /v1/service-requests/{id}: Change or cancel a work order For a requester company's key: changes your reference, the description, the priority or the monitoring ids of a work order you sent, adds files, or cancels it while it is open. An absent field is kept; null clears the reference or a monitoring id. The installer moves the work order otherwise. Answers the work order as it now stands. Body (JSON): - reference (string or null): Your own reference, up to 120 characters, or null. - description (string): What is wrong, up to 5,000 characters. - priority (string): high, medium or low. - monitoringSites (object): Any of `enphase`, `generac`, `solarEdge`: a string sets it, null clears it, absent keeps it. - files (array): Up to 10 files to add, each `{ url, name? }`, as on the create. A file that cannot be copied answers 400; the changes, a cancel and the files before it are kept, and the same call again finishes the rest. - status (string): Only `cancelled`, while the work order is open; on a work order already Cancelled it changes nothing. Answers: - 200: The work order as it now stands. - 400: The request is not valid; the message says what to change. - 404: No record with this id is yours. - 403: A key that is not a requester company's. - 401: The key is missing, wrong or revoked. Example request body: ```json { "priority": "high", "monitoringSites": { "generac": "2000002" } } ``` Example answer: ```json { "id": "r81c…", "externalId": "WO-1001", "reference": null, "number": "S-04211", "installer": { "id": "k57a…", "name": "Example Solar" }, "status": "new", "acceptance": "pending", "declineReason": null, "serviceType": "solar", "issueType": "inverterFailure", "priority": null, "description": "Two microinverters do not report.", "monitoringSites": { "enphase": "1000001", "generac": null, "solarEdge": null }, "files": [{ "id": "f42b…", "name": "commissioning.pdf" }], "equipment": [{ "kind": "microinverter", "role": "reported", "serial": "SN-0001", "maker": null, "model": null }], "visits": [], "createdAt": "2026-10-15T14:00:00.000Z", "updatedAt": "2026-10-15T14:00:00.000Z" } ``` ### GET /v1/service-requests/{id}: Read a work order One work order your company sent, by the `id` Pipe answered: whether the installer accepted it, its status, its equipment and its visits. Answers: - 200: The work order. - 404: No record with this id is yours. - 403: A key that is not a requester company's. - 401: The key is missing, wrong or revoked. Example answer: ```json { "id": "r81c…", "externalId": "WO-1001", "reference": null, "number": "S-04211", "installer": { "id": "k57a…", "name": "Example Solar" }, "status": "new", "acceptance": "pending", "declineReason": null, "serviceType": "solar", "issueType": "inverterFailure", "priority": null, "description": "Two microinverters do not report.", "monitoringSites": { "enphase": "1000001", "generac": null, "solarEdge": null }, "files": [{ "id": "f42b…", "name": "commissioning.pdf" }], "equipment": [{ "kind": "microinverter", "role": "reported", "serial": "SN-0001", "maker": null, "model": null }], "visits": [], "createdAt": "2026-10-15T14:00:00.000Z", "updatedAt": "2026-10-15T14:00:00.000Z" } ``` ### GET /v1/projects: List projects Your company's projects, solar and HI, newest change first, a page at a time. Keep the newest `updatedAt` you read and send it as `updatedSince` next time to read only what changed. An installer's key lists every project it builds, its dealers' included. `externalId` is the id the system that sent the customer knows it by (your CRM's id from `POST /v1/leads`, or RepCard's), null when none. Query: - limit (integer): Rows in a page, 1 to 100. 50 when absent. - cursor (string): The `next` value of the previous page, URL-encoded. Send the same other fields with it. Absent for the first page. - updatedSince (string): Only rows changed after this time, ISO 8601 (2026-10-01T00:00:00Z). - productLine (string): `solar` or `hi`. Both when absent. Answers: - 200: `data` holds the page's projects, the core of each; `next` is the cursor for the next page, or null at the end. - 400: The request is not valid; the message says what to change. - 401: The key is missing, wrong or revoked. Example answer: ```json { "data": [{ "id": "k97f…", "reference": "D4YR1VSK7K", "productLine": "solar", "stage": { "id": "s92d…", "name": "Permitting", "enteredAt": "…" }, "updatedAt": "…", "externalId": "crm-1042" }], "next": "eyJ…" } ``` ### GET /v1/projects/{id}: Read a project One project in full: the customer, the people, the contract, the financing, the milestones and the files. A solar project carries `system` and an HI project `products`; `productLine` says which, and the other is null. `externalId` is the id the system that sent the customer knows it by, the same as on the lead, null when none. Answers: - 200: The project. - 404: No record with this id is yours. - 401: The key is missing, wrong or revoked. Example answer: ```json { "id": "k97f…", "reference": "D4YR1VSK7K", "leadId": "j57a…", "productLine": "solar", "stage": { "id": "s92d…", "name": "Permitting", "enteredAt": "2026-10-02T14:05:00.000Z" }, "soldAt": "2026-09-20T18:31:00.000Z", "updatedAt": "2026-10-02T14:05:00.000Z", "ntpGranted": true, "customer": { "firstName": "Ana", "lastName": "Rivera", "email": "ana@example.com", "phone": "6025550100" }, "coBorrower": null, "address": { "line1": "812 Main St", "line2": null, "city": "Plano", "state": "TX", "postalCode": "75023", "country": "US" }, "meterNumber": "4471209", "notes": { "customer": null, "project": "Gate code 1234" }, "source": { "name": "Door knock", "subSource": null }, "externalId": "crm-1042", "partnerLeadId": null, "utility": { "name": "Oncor" }, "design": { "name": "Ana Rivera Design", "scaniflyProjectId": "64f1…", "scaniflyDesignId": "651a…", "soldScaniflyDesignId": "651a…" }, "company": { "name": "Inty Power" }, "salesRep": { "id": "1695312000000x123456789012345678", "name": "Jordan Lee", "email": "jordan@example.com", "phone": null }, "setter": null, "projectManager": null, "siteSurveyor": null, "subcontractor": null, "contract": { "signedAt": "2026-09-20T18:31:00.000Z", "price": 28450.5, "salesTax": 0, "priceBeforeTax": 28450.5, "files": ["https://…"] }, "financing": { "type": "loan", "lender": "GoodLeap", "amount": 28450.5, "aprPercent": 3.99, "termMonths": 300, "monthlyPayment": 142.18, "dealerFeePercent": 18, "escalatorPercent": null }, "system": { "roofType": "Shingle", "sizeKw": 8.2, "annualProductionKwh": 11480, "panels": { "count": 20, "manufacturer": "REC", "model": "Alpha Pure 410" }, "inverters": { "count": 20, "manufacturer": "Enphase", "model": "IQ8M", "name": null, "microinverter": true }, "batteries": null, "pricePerWatt": { "base": 3.1, "final": 3.47 }, "adders": [{ "name": "Critter guard", "quantity": 1, "total": 450 }] }, "products": null, "milestones": { "installScheduled": "2026-10-14", "ntpApproved": "2026-09-28" }, "customFields": { "Roof type": "Metal", "Crew": "Crew B" }, "files": { "siteSurvey": ["https://…"], "planset": [] }, "links": { "project": "https://pipe.solar/dashboard/projects/j57a…", "proposal": null } } ``` ### GET /v1/stages: List stages The stages a project can move to, in ladder order: solar first, then HI. Store the `id`, not the name: a renamed stage keeps its id. A company with no ladder of its own for a product line uses Pipe's standard one, so the same id can appear under both lines. Only the installer's key reads the ladders. Query: - productLine (string): `solar` or `hi`. Both when absent. Answers: - 200: `data` holds the stages, in ladder order; `position` counts from 1 within each product line. - 400: The request is not valid; the message says what to change. - 403: A dealer's key: only the installer's key reads its ladders. - 401: The key is missing, wrong or revoked. Example answer: ```json { "data": [ { "id": "s81c…", "name": "Contract Signed", "productLine": "solar", "position": 1, "kind": "normal" }, { "id": "s92d…", "name": "Submit Permitting & Interconnection", "productLine": "solar", "position": 2, "kind": "normal" }, { "id": "s05e…", "name": "Cancelled", "productLine": "solar", "position": 9, "kind": "cancelled" } ] } ``` ### POST /v1/projects/{id}/stage: Move a project's stage Moves the project to a stage on its ladder. The stage's checklists, alerts and messages follow. Send `stageId` (from GET /v1/stages, or a project's `stage.id`) or the stage's name as `stage`, not both. Moving to the current stage changes nothing. Only the installer's key moves a project. Body (JSON): - stageId (string): The stage's id, as GET /v1/stages lists it. Preferred: a rename keeps it. - stage (string): The stage's name, as the ladder shows it, when you send no `stageId`. Case does not matter. Answers: - 200: `changed` says whether it moved; `stage` is the stage's name and `stageId` its id. - 400: No such stage on this project's ladder, or both or neither of `stageId` and `stage`; a wrong name lists the ladder's stages. - 403: A dealer's key: only the installer's key changes a project. - 404: No record with this id is yours. - 401: The key is missing, wrong or revoked. Example request body: ```json { "stageId": "s92d…" } ``` Example answer: ```json { "changed": true, "stage": "Submit Permitting & Interconnection", "stageId": "s92d…" } ``` ### PATCH /v1/projects/{id}: Set the install date, NTP and the adder amount Sets the install date (the project's "Install Scheduled" milestone, which also places it on the Calendar), whether NTP is granted, and the adder amount, which asks your company's admins in Pipe to approve or reject it (an adder decision webhook, when your company has one, gets the answer). A changed amount asks again, even one answered before; the same amount changes nothing. An absent field is kept. Only the installer's key changes a project. Body (JSON): - installDate (string or null): The day, YYYY-MM-DD, or null to clear it. - ntpGranted (boolean): Whether notice to proceed is granted. - adderAmount (number or null): The adder amount in dollars, such as 1250.5 (cents are kept), or null to clear it. Answers: - 200: `changed` says whether anything changed. - 400: The request is not valid; the message says what to change. - 403: A dealer's key: only the installer's key changes a project. - 404: No record with this id is yours. - 401: The key is missing, wrong or revoked. Example request body: ```json { "installDate": "2026-10-14", "ntpGranted": true, "adderAmount": 1250.5 } ``` Example answer: ```json { "changed": true } ``` ### POST /v1/projects/{id}/files: Add files to a project Copies each file from its address into the project's folder, where the record shows it. Send 1 to 10 at a time. Each address must be public https (no IP address, no private name, no password in it), open the file without signing in, and hold a document, picture, audio or video of 100 MB or less; Pipe keeps its own copy. Sending the same address to the same folder again adds nothing. Only the installer's key adds files. Body (JSON): - folder (string, required): contract, utilityBill, identification, material, siteSurvey, planset, permit, interconnection, other, homeInsurance, installationPhoto or internal. - files (array, required): 1 to 10 of { url, name }: a public https address, and the name to show (the address's own when absent). Answers: - 201: `files` lists each file with its id; `added` is false for an address this folder already holds, so a retry adds nothing twice. - 200: Every address was already in this folder; nothing was added. - 400: The request is not valid; the message says what to change. - 403: A dealer's key: only the installer's key changes a project. - 404: No record with this id is yours. - 401: The key is missing, wrong or revoked. Example request body: ```json { "folder": "permit", "files": [{ "url": "https://files.example.com/permit-812-main.pdf", "name": "Permit.pdf" }] } ``` Example answer: ```json { "files": [{ "id": "m17c…", "name": "Permit.pdf", "folder": "permit", "added": true }] } ``` ### GET /v1/leads: List leads Your company's leads, solar and HI, newest change first, a page at a time, with `updatedSince` to read only what changed. An installer's key lists every lead sold through it, its dealers' included. Query: - limit (integer): Rows in a page, 1 to 100. 50 when absent. - cursor (string): The `next` value of the previous page, URL-encoded. Send the same other fields with it. Absent for the first page. - updatedSince (string): Only rows changed after this time, ISO 8601 (2026-10-01T00:00:00Z). - productLine (string): `solar` or `hi`. Both when absent. Answers: - 200: `data` holds the page's leads; `next` is the cursor for the next page, or null at the end. - 400: The request is not valid; the message says what to change. - 401: The key is missing, wrong or revoked. Example answer: ```json { "data": [{ "id": "j57a…", "status": "proposal", "updatedAt": "…" }], "next": null } ``` ### GET /v1/leads/{id}: Read a lead One lead: the customer, the address, the status, the source, the people and its files by folder. `proposal` is the lead's main option: the one the customer chose (`status` `accepted`) or signed (`signed`), else the newest still offered, with its system, price, financing and adders. `project` names the project once the customer buys. Answers: - 200: The lead. - 404: No record with this id is yours. - 401: The key is missing, wrong or revoked. Example answer: ```json { "id": "j57a…", "reference": "D4YR1VSK7K", "productLine": "solar", "status": "proposal", "archived": false, "createdAt": "2026-09-12T15:00:00.000Z", "updatedAt": "2026-09-19T10:12:00.000Z", "customer": { "firstName": "Ana", "lastName": "Rivera", "email": "ana@example.com", "phone": "6025550100" }, "coBorrower": null, "address": { "line1": "812 Main St", "line2": null, "city": "Plano", "state": "TX", "postalCode": "75023", "country": "US" }, "utility": { "name": "Oncor", "monthlyBill": 182, "meterNumber": null }, "source": { "name": "Door knock", "subSource": null }, "externalId": "crm-1042", "partnerLeadId": null, "notes": null, "salesRep": { "id": "1695312000000x123456789012345678", "name": "Jordan Lee", "email": "jordan@example.com", "phone": null }, "setter": null, "project": null, "design": { "name": "Ana Rivera Design", "scaniflyProjectId": "64f1…", "scaniflyDesignId": "651a…", "soldScaniflyDesignId": null }, "proposal": { "id": "k17b…", "reference": "PS-14832", "label": "25-year loan", "status": "presented", "system": { "sizeKw": 8.2, "annualProductionKwh": 11480, "arrays": 2, "panels": { "count": 20, "manufacturer": "REC", "model": "Alpha Pure 410" }, "inverters": { "count": 20, "manufacturer": "Enphase", "model": "IQ8M", "name": null, "microinverter": true }, "batteries": null, "pricePerWatt": { "base": 3.1, "final": 3.47 } }, "price": { "total": 28450.5, "salesTax": 0, "beforeTax": 28450.5, "adders": 450, "discounts": 0, "incentives": 0, "net": 28450.5 }, "financing": { "type": "loan", "lender": "GoodLeap", "amount": 28450.5, "aprPercent": 3.99, "termMonths": 300, "monthlyPayment": 142.18, "dealerFeePercent": 18, "escalatorPercent": null }, "adders": [{ "name": "Critter guard", "quantity": 1, "total": 450 }], "links": { "proposal": "https://pipe.solar/p/7Hq2…" } }, "links": { "record": "https://pipe.solar/dashboard/proposals/j57a…", "proposal": "https://pipe.solar/p/7Hq2…" }, "contractFiles": [], "files": { "siteSurvey": ["https://…"], "utilityBill": ["https://…"] } } ``` ### GET /v1/leads/{id}/activities: Read a lead's activity The lead's activity, newest first, a page at a time: notes, status and stage changes, files and more. `createdAt` is when the row was written. `reference` is the long record id Pipe gave your system before for this row, and null for a row written since. Older rows can come out of order, so sort by `createdAt` when order matters. `internal` marks a note only the company's admins see. `author` is the writer's name and `authorId` their id, the same id the activity webhook sends. Both are null for a row Pipe wrote, and `authorId` is null for the homeowner. Query: - limit (integer): Rows in a page, 1 to 100. 50 when absent. - cursor (string): The `next` value of the previous page, URL-encoded. Send the same other fields with it. Absent for the first page. Answers: - 200: `data` holds the page's activities; `next` is the cursor for the next page, or null at the end. - 400: The request is not valid; the message says what to change. - 404: No record with this id is yours. - 401: The key is missing, wrong or revoked. Example answer: ```json { "data": [{ "id": "n2b…", "reference": null, "type": "note", "body": "Customer asked about batteries", "internal": false, "customerFacing": false, "replyTo": null, "author": "Jordan Lee", "authorId": "1695312000000x123456789012345678", "createdAt": "2026-09-19T10:12:00.000Z" }], "next": null } ``` ### PATCH /v1/leads/{id}: Change a lead's details Changes the customer's details, the sales rep and the setter. Send only the fields you change: an absent field is kept, and null clears an optional one. A field not in the list below (such as `id`, `status` or `salesRep` from a read) is refused with `invalid`. The answer is the changed lead. A new rep or setter must be an active member of the lead's company, or nothing changes. A rep taken off a lead stops seeing it, unless the lead is shared with them. Body (JSON): - firstName (string): The customer's first name. - lastName (string): The customer's last name. - email (string or null): The customer's email; null clears it. - phone (string or null): The customer's phone; null clears it. A whole North American number is answered as 10 digits (6025550100); any other text as sent. - notes (string or null): The lead's notes; also posted to its activity. - address (object): line1, city, state and postalCode together; line2 and country are optional. state is a US state or Canadian province (TX, ON, or the name); country is US or CA, read from the state when absent. - coBorrower (object or null): firstName, lastName, email, phone; an empty text clears that field, and null clears the co-borrower. - salesRepEmail (string or null): The sales rep, by their sign-in email: an active owner, admin, manager, rep or setter of the lead's company. Any other email, a field person's included, is refused with `invalid`, naming it. An empty text or null takes the rep off the lead. - setterEmail (string or null): The same rule as salesRepEmail, for the setter. - salesRepId (string or null): The sales rep by their `id` from GET /v1/users, instead of `salesRepEmail`; send one of the two. The same rule; an empty text or null takes the rep off. - setterId (string or null): The setter by their `id`, instead of `setterEmail`; send one of the two. Answers: - 200: The lead, changed. - 400: The request is not valid; the message says what to change. - 404: No record with this id is yours. - 401: The key is missing, wrong or revoked. Example request body: ```json { "phone": "602-555-0199", "coBorrower": { "firstName": "Luis", "lastName": "Rivera" }, "salesRepEmail": "jordan@example.com" } ``` Example answer: ```json { "id": "j57a…", "reference": "D4YR1VSK7K", "productLine": "solar", "status": "proposal", "archived": false, "createdAt": "2026-09-12T15:00:00.000Z", "updatedAt": "2026-09-19T10:12:00.000Z", "customer": { "firstName": "Ana", "lastName": "Rivera", "email": "ana@example.com", "phone": "6025550100" }, "coBorrower": null, "address": { "line1": "812 Main St", "line2": null, "city": "Plano", "state": "TX", "postalCode": "75023", "country": "US" }, "utility": { "name": "Oncor", "monthlyBill": 182, "meterNumber": null }, "source": { "name": "Door knock", "subSource": null }, "externalId": "crm-1042", "partnerLeadId": null, "notes": null, "salesRep": { "id": "1695312000000x123456789012345678", "name": "Jordan Lee", "email": "jordan@example.com", "phone": null }, "setter": null, "project": null, "design": { "name": "Ana Rivera Design", "scaniflyProjectId": "64f1…", "scaniflyDesignId": "651a…", "soldScaniflyDesignId": null }, "proposal": { "id": "k17b…", "reference": "PS-14832", "label": "25-year loan", "status": "presented", "system": { "sizeKw": 8.2, "annualProductionKwh": 11480, "arrays": 2, "panels": { "count": 20, "manufacturer": "REC", "model": "Alpha Pure 410" }, "inverters": { "count": 20, "manufacturer": "Enphase", "model": "IQ8M", "name": null, "microinverter": true }, "batteries": null, "pricePerWatt": { "base": 3.1, "final": 3.47 } }, "price": { "total": 28450.5, "salesTax": 0, "beforeTax": 28450.5, "adders": 450, "discounts": 0, "incentives": 0, "net": 28450.5 }, "financing": { "type": "loan", "lender": "GoodLeap", "amount": 28450.5, "aprPercent": 3.99, "termMonths": 300, "monthlyPayment": 142.18, "dealerFeePercent": 18, "escalatorPercent": null }, "adders": [{ "name": "Critter guard", "quantity": 1, "total": 450 }], "links": { "proposal": "https://pipe.solar/p/7Hq2…" } }, "links": { "record": "https://pipe.solar/dashboard/proposals/j57a…", "proposal": "https://pipe.solar/p/7Hq2…" }, "contractFiles": [], "files": { "siteSurvey": ["https://…"], "utilityBill": ["https://…"] } } ``` ### GET /v1/adders: List adders and products The installer's active adders and HI products, in its own order. For a `perWatt` adder, `unitPrice` is dollars per watt. An adder priced by solar size lists its steps in `sizePrices`, smallest size first; a system takes the last step that starts at or below its size, and `unitPrice` is then the first step's price. Answers: - 200: `data` holds the adders. - 403: A dealer's key: only the installer's key reads its catalogue. - 401: The key is missing, wrong or revoked. Example answer: ```json { "data": [{ "id": "q3d…", "name": "Critter guard", "description": null, "productLine": "solar", "productKind": null, "unit": "fixed", "unitPrice": 450, "sizePrices": [], "tiered": false, "repSponsored": false, "showOnProposal": true, "brand": null, "model": null, "warrantyYears": null }] } ``` ### GET /v1/equipment: List panels, inverters and batteries The installer's active equipment. `kind` picks one of the three. Query: - kind (string): `panel`, `inverter` or `battery`. All three when absent. Answers: - 200: `data` holds the equipment, each with its `kind`. - 400: The request is not valid; the message says what to change. - 403: A dealer's key: only the installer's key reads its catalogue. - 401: The key is missing, wrong or revoked. Example answer: ```json { "data": [{ "id": "r8e…", "kind": "panel", "manufacturer": "REC", "model": "Alpha Pure 410", "watts": 410, "default": true }] } ``` ### POST /v1/leads: Create a lead Sends one homeowner to Pipe as a lead in the key's company. Send the same externalId again and the answer is the lead it already made, so a retried call makes no duplicate. Body (JSON): - firstName (string, required): The homeowner's first name. - lastName (string, required): The homeowner's last name. - address (object, required): line1, city, state and postalCode; line2 and country are optional. state is a US state or Canadian province (TX, ON, or the name); country is US or CA, read from the state when absent. - email (string): The homeowner's email. - phone (string): The homeowner's phone. A whole North American number is answered as 10 digits. - salesRepEmail (string): An active owner, admin, manager, rep or setter of the company. Any other email, a field person's included, leaves the rep empty and is listed under unassigned. - setterEmail (string): The same rule as salesRepEmail, for the setter. - salesRepId (string): The sales rep by their `id` from GET /v1/users, instead of `salesRepEmail`; send one of the two. The same rule: anyone else leaves the rep empty and is listed under unassigned. - setterId (string): The setter by their `id`, instead of `setterEmail`; send one of the two. - notes (string): Saved on the lead and posted to its activity. - externalId (string): Your system's id, at most 128 characters. Answers: - 201: The lead was made. - 200: The externalId was sent before; the answer is that lead. - 400: The body is not valid; the error says why. - 401: The key is missing, wrong or revoked. Example request body: ```json { "firstName": "Ana", "lastName": "Rivera", "address": { "line1": "812 Main St", "city": "Plano", "state": "TX", "postalCode": "75023" }, "externalId": "crm-1042" } ``` Example answer: ```json { "leadId": "k57a…", "created": true, "unassigned": [] } ``` ## Errors Every error answers `{ "error": { "code", "message", "docs" } }`. - unauthorized (401): No key, or a key that is wrong, revoked, or whose company is not active. Check the key; do not retry. - forbidden (403): The key is right but the call is not for its company, such as a dealer reading the installer's catalogue or changing its project. Do not retry. - not_open (403): The API is closed on this address: nothing is read or written, and no key is checked. Call api.pipe.solar, or staging-api.pipe.solar with a staging key for tests. - not_found (404): No such address, or no record with this id is yours. Another company's record answers the same as a missing one. - invalid (400): The request is not valid; the message says what to change. Retrying the same request fails the same way. - rate_limited (429): The key made more than 100 calls in a minute, or another call was changing the same record at that moment. Wait the seconds `Retry-After` names, then retry. - unavailable (503): The API is not set up on the address you called. Check the address; Pipe's is https://api.pipe.solar. - internal (500): Pipe's side failed. Retry after a short wait; if it repeats, send Pipe the answer's X-Request-Id. ## Safe to retry - Every GET is safe to retry. - Moving a stage to the stage the project is already in changes nothing, and answers `changed: false`. - Setting the install date or NTP to the value it already holds changes nothing. - Adding a file whose address this folder already holds adds nothing, and answers `added: false`. - Creating a lead with an `externalId` you sent before answers that lead, with 200, instead of making a second one. ## Limits - A key makes at most 100 calls a minute, every endpoint counted together; past that the answer is 429 with `Retry-After`. - A list page holds at most 100 rows. - A call adds at most 10 files, each 100 MB or less. - Every answer carries `X-Request-Id`. Send it to Pipe when you report a problem.