Skip to documentation
On this page

Portfolio API

The calls behind the building portfolio import, with curl examples. They are the calls our own app makes.

Who can open it
Signed in with an Enterprise account
Last checked against the code
2026-11-07
Status
Preview, can changeExamples not run against a live API yet

Preview, can change These pages describe calls that can change. They are not a separate public product.

What this is#

Note. These are the calls our own app makes. They are not a separate public product, there is no REC Verify API key, and they can change. Every call needs a signed in Enterprise user.

Note. The curl examples on this page have not been run against a live API yet. The request shapes are read from the backend code.

Read Authentication first. Responses and errors use the same envelope as the REC Verify API: { "data": ... } on success and { "error": "<code>" } on failure.

Before you call#

Unknown. How an outside reader learns the real API host. The app reads it from its own server settings. Examples here use the placeholder https://<api-host> and never a real address.

shell
Set the host and the token once
export SOLSAT_API="https://<api-host>"
export TOKEN="<token>"

Endpoints#

All calls need the token and an Enterprise account.

Portfolio calls
MethodPathWhat it doesSuccessNeeds a token
GET/secure/portfolio/importsList the imports of your organisation.200Yes
POST/secure/portfolio/importsCreate an import from CSV text or from pasted addresses.200Yes
GET/secure/portfolio/imports/{id}Read an import with its buildings, estimate and blockers.200Yes
PATCH/secure/portfolio/imports/{id}/buildings/{buildingId}Choose a building, fix an address, or leave a building out.200Yes
POST/secure/portfolio/imports/{id}/confirmConfirm the import. Starts the roof analysis.200Yes
GET/secure/portfolio/imports/{id}/quoteRead the quote for the import.200Yes
GET/secure/portfolio/imports/{id}/rankingRanking of the buildings. Used by the results screens. Documentation in progress.200Yes
GET/secure/portfolio/imports/{id}/exportCSV export of the results. Documentation in progress.200Yes
POST/secure/portfolio/imports/{id}/shareCreate a share link. Documentation in progress.200Yes
POST/secure/portfolio/imports/{id}/share/revokeRevoke share links. Documentation in progress.200Yes
POST/secure/portfolio/imports/{id}/feasibilityRequest feasibility for chosen buildings. Documentation in progress.200Yes

Scroll sideways to see all columns

Create an import#

The body is JSON, not a file upload. Give the CSV text in csv, or addresses in pasted.

Body of the create call
FieldTypeMeaning
fileNamestringOptional. The name shown for the import.
csvstringThe text of the CSV file. When both csv and pasted are sent, csv is used.
pastedstringAddresses, one per line.
mappingobjectOptional, for csv. Column positions counted from 0: name and address are required, buildingType and monthlyBill are optional.

Scroll sideways to see all columns

The examples that send a file use jq to put the file text into the JSON body. Install jq, or build the body another way.

shell
Create an import from a CSV file
jq -n --arg fileName eec-portfolio-mock-30-factories.csv \
  --rawfile csv eec-portfolio-mock-30-factories.csv \
  '{fileName: $fileName, csv: $csv}' |
curl -sS -X POST "$SOLSAT_API/secure/portfolio/imports" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  --data @-
shell
Create an import from pasted addresses
curl -sS -X POST "$SOLSAT_API/secure/portfolio/imports" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"pasted":"First address\nSecond address"}'
shell
Create an import with a column mapping, after a header_mismatch answer
jq -n --arg fileName my-buildings.csv --rawfile csv my-buildings.csv \
  '{fileName: $fileName, csv: $csv, mapping: {name: 0, address: 2, buildingType: 1}}' |
curl -sS -X POST "$SOLSAT_API/secure/portfolio/imports" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  --data @-
json
The answer when the header does not match, with status 422. The values are illustrative.
{
  "error": "header_mismatch",
  "headers": ["Branch", "Type", "Where"],
  "preview": ["Bang Na", "Warehouse", "1 Example Road"]
}
Errors of the create call
CodeStatusMeaning
header_mismatch422No name column or no address column found. The answer has headers and preview.
invalid_input400The body is not valid.
invalid_file400The CSV text is not valid CSV.
empty_file400There are no rows to import.
file_too_large413The text is over 5 MiB.
too_many_rows413More than 500 rows.

Scroll sideways to see all columns

Follow the import#

The create call returns at once and the address checks run in the background. Read the import until estimate.pending is 0.

shell
Read an import
curl -sS "$SOLSAT_API/secure/portfolio/imports/$IMPORT_ID" \
  -H "Authorization: Bearer $TOKEN"
Fields of an import answer
FieldMeaning
importimportId, status (draft or confirmed), fileName, duplicatesRemoved, verifiedCount, confirmedAt, createdAt.
buildingsOne entry per row: buildingId, rowNumber, branchName, address, buildingType, monthlyBillThb, verification, candidates, latitude, longitude and, after the analysis, result.
estimateCounts: rows, verified, needsChoice, notFound, excluded, pending; the minimum (20) and whether it is met (minimumMet); and the price fields shown in the estimate and on the quote.
blockersWhat blocks the confirm step: verification_pending, choice_required, minimum_not_met.
governmentWhether the import is marked as government work.

Scroll sideways to see all columns

shell
Leave one building out
curl -sS -X PATCH "$SOLSAT_API/secure/portfolio/imports/$IMPORT_ID/buildings/$BUILDING_ID" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"exclude":true}'
shell
Read the quote
curl -sS "$SOLSAT_API/secure/portfolio/imports/$IMPORT_ID/quote" \
  -H "Authorization: Bearer $TOKEN"

Confirm#

Warning. Confirming an import starts the roof analysis for the verified buildings and tells the SOLSAT sales team, who then send an invoice at the price shown on the quote. No card is charged. Do not confirm a sample file on a live organisation.

shell
Confirm an import
curl -sS -X POST "$SOLSAT_API/secure/portfolio/imports/$IMPORT_ID/confirm" \
  -H "Authorization: Bearer $TOKEN"
Errors after the create call
CodeStatusMeaning
confirm_blocked409The answer has blockers. Fix them and confirm again.
import_confirmed409A building edit after the import was confirmed.
duplicate_address409An address change that matches another row of the import.
invalid_input400An edit with none or more than one of address, chooseCandidateId, exclude.

Scroll sideways to see all columns

What we have not checked#

Unknown. The response shapes of ranking, export, share and feasibility, and what each address check costs SOLSAT. This guide does not state them.