HomeGuidesAPI ReferenceChangelog
Log In
API Reference

Add or Update Profile

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Create a usage profile, update an existing profile, or upsert a profile using your providerProfileId.

Usage profiles are tied to an account, so include an accountId or providerAccountId when creating a profile. Most other fields are optional. You can create an empty profile and add readings later, or create the profile with readings and other data in the same request.

For the full profile data model, profile workflow, reading formats, solar profile options, and detailed examples, see Profiles API.

lightbulb

Use PUT /rest/v1/profiles to upsert profiles. If you use a unique providerProfileId, the request creates the profile when it does not exist or updates it when it already exists.

Resource URI

PUT /rest/v1/profiles

Common request body fields

FieldTypeDescription
accountIdStringArcadia-generated account ID for the profile owner. Required unless you pass providerAccountId.
providerAccountIdStringYour account identifier for the profile owner. Required unless you pass accountId.
profileIdStringArcadia-generated profile ID. Use when updating an existing profile by Arcadia ID. Optional.
providerProfileIdStringYour unique profile identifier. Use this for upserts when you do not want to track profileId. Optional, but must be unique if supplied.
profileNameStringHuman-readable profile name. Optional.
descriptionStringDescription for the profile. Optional.
serviceTypesStringService type for the profile, such as ELECTRICITY or SOLAR_PV. Defaults to ELECTRICITY. Optional.
sourceIdStringSource of the profile data, such as ReadingEntry, PVWatts, or SolarPvModel. Optional.
isDefaultBooleanWhether this profile is the default profile for the service type. Optional.
propertiesObjectProfile-specific properties, such as systemSize for solar profiles. Optional.
readingDataArrayReading data to create or update on the profile. Optional.
baselineMeasuresArrayModeled solar production values for generic-year profiles. Optional.

Example

This example upserts a profile without readings. The profileName and description fields are optional but shown for context. The providerProfileId field is optional, but it must be unique if supplied.

The profile's serviceTypes value defaults to ELECTRICITY if not passed. You can also set serviceTypes to SOLAR_PV. If this is the account's first ELECTRICITY profile, isDefault is set to true.

{  
     "providerProfileId": "ELECTRICITY_RESIDENTIAL_CA_2012",  
     "profileName": "2012 CA Electricity Residential Profile",  
     "accountId": "4b1dd606-a72a-46b2-8c12-34db20be69fa"  
}

The response contains the new profile's profileId, which you can use to retrieve or update the profile later.

{  
   "status": "success",  
   "count": 1,  
   "type": "UsageProfile",  
   "results": [  
      {  
         "profileId": "b7559f37-8020-4969-8bd1-48d8c3d58976",  
         "providerProfileId": "ELECTRICITY_RESIDENTIAL_CA_2012",  
         "profileName": "2012 CA Electricity Residential Profile",  
         "accountId": "4b1dd606-a72a-46b2-8c12-34db20be69fa",  
         "serviceTypes": "ELECTRICITY",  
         "properties": null  
      }  
   ]  
}

Optional: Update or upsert a profile

Update most fields on an existing profile with this method. The request only updates fields that you pass in. For example, if the profile already has a description and you omit description, the existing description remains unchanged.

If you use a unique providerProfileId, you can also use this method to create a new profile with that ID. This lets you avoid tracking the Arcadia-generated profileId in your system.

Resource URI

PUT /rest/v1/profiles

Optional: Upsert monthly electricity readings

This example creates a new profile if one with this providerProfileId does not exist. It also adds the readings included in the request.


{
  "providerAccountId": "api-eg-008",
  "providerProfileId": "RESIDENTIAL_CA_ELECTRICITY_2012",
  "profileName": "2012 CA Electricity Residential Profile",
  "description": "Residential Electricity Profile",
  "isDefault": true,
  "serviceTypes": "ELECTRICITY",
  "sourceId": "ReadingEntry",
  "readingData": [
    {
      "fromDateTime": "2012-01-01",
      "quantityUnit": "kWh",
      "quantityValue": "700",
      "toDateTime": "2012-02-01"
    },
    {
      "fromDateTime": "2012-12-01",
      "quantityUnit": "kWh",
      "quantityValue": "700",
      "toDateTime": "2013-01-01"
    }
  ]
}

The request returns the following response.

{  
   "status": "success",  
   "count": 1,  
   "type": "UsageProfile",  
   "results": [  
      {  
         "profileId": "a860df08-31cb-4dd8-961d-523429bf5420",  
         "providerProfileId": "RESIDENTIAL_CA_ELECTRICITY_2012",  
         "profileName": "2012 CA Electricity Residential Profile",  
         "accountId": "4b1dd606-a72a-46b2-8c12-34db20be69fa",  
         "description": "Residential Electricity Profile",  
         "serviceTypes": "ELECTRICITY",  
         "source": {  
            "sourceId": "ReadingEntry",  
            "name": "Readings"  
         },  
         "isDefault": true,  
         "properties": null  
      }  
   ]  
}

Optional: Generate a solar production profile using integrated PVWatts

Use the integrated PVWatts model to upload a solar profile directly. To use it, set source.sourceId to PVWatts. Switch supports PVWatts versions 5 and 6. To choose between them, set source.sourceVersion to 5 or 6.

The following parameters are available for PVWatts requests:


NameTypeDescription
systemSizeDecimalThe desired system size in kW. Must be between 0.05 and 500,000 kW.
moduleTypeIntegerThe type of module to use. 0 = Standard, 1 = Premium, 2 = Thin Film.
azimuthIntegerThe azimuth of the array. 0 = Due north, 180 = Due south. Must be between 0 and 359.
tiltIntegerThe tilt of the array. 0 = Flat, 90 = Vertical. Must be between 0 and 90.
lossesDecimalLosses in the system other than from the inverter. Must be between -5 and 99. 0 = no power lost, 99 = 1% of power remaining.
inverterEfficiencyDecimalThe efficiency of your inverter. Must be between 90 and 99.5. 90 = 10% of power lost, 99.5 = 0.5% of power lost. Default: 96.
trackModeIntegerThe array type and tracking mode. 0 = Fixed - Roof Mounted, 1 = Single Axis Backtracking, 2 = Double Axis, 3 = Fixed - Open Rack, 4 = Single Axis.
DCACRatioDecimalThe ratio of the array's DC rated size to the inverter's AC rated size. Must be positive. PVWatts v6 and v8 default: 1.2.
gcrDecimalGround coverage ratio applies only to arrays with single-axis tracking, and is the ratio of module surface area to the ground or roof occupied by the array. Must be between 0 and 3. Default: 0.4.
climateDatasetStringThe climate data set that you want to use. Valid options are nsrdb, tmy2, tmy3, and intl. PVWatts v6 and v8 default: nsrdb.
climateDataCorrectionZoneStringFor Hawaii Sun Zones, the zone applicable to this analysis. Available values are 200-250, 251-300, and so on up to 601-650. Note that the correction factor will only be used if it applies to the location of the account and the climate dataset that you specify. For example, a value of 601-650 would be applicable and used for Honolulu but would not be used for a system in Los Angeles.
climateDataFileIdStringReference to a specific climate data file to use. Must be a valid ID returned by the PVWatts Solar Dataset Query API.
climateDataSearchRadiusIntegerThe search radius to use when searching for the closest climate data station (miles). Pass in radius = 0 to use the closest station regardless of the distance. Default: 100.
bifacialityDecimalThe ratio of rear-side efficiency to front-side efficiency. Typically a value between 0.65 and 0.9 provided on the bifacial module datasheet. This accounts for the fact that photovoltaic cells on the rear of the module are usually less efficient than the cells on the front of the module. The bifaciality does not affect the solar irradiance on the rear of the module. Must be between 0 and 1.
albedoComma-separated StringGround reflectance. A value of 0 means the ground is completely non-reflective, and a value of 1 means it is completely reflective. Specify a comma-separated string with one or twelve values. Must be greater than 0 and less than 1.
useWeatherFileAlbedoIntegerUse hourly or sub-hourly albedo data from the weather file instead of the monthly albedo values, if available. 0 means do not use weather file albedo values, and 1 means use weather file albedo values.
soilingComma-separated StringReduction in incident solar irradiance caused by dust or other seasonal soiling of the module surface. Soiling losses cause a uniform reduction in the total irradiance incident on each subarray. Specify a comma-separated string of 12 monthly values. Must be between 0 and 100.

This example creates a new profile if one with this providerProfileId does not exist and loads it with data from the integrated NREL PVWatts solar production model. The request passes model parameters such as azimuth, tilt, losses, and inverter efficiency.

The account must have a valid address because Switch uses latitude and longitude to look up the location's solar irradiance.

{  
  "providerAccountId" : "api-eg-08",  
  "providerProfileId" : "PVWATTS_RESIDENTIAL_FL_2018",  
  "serviceTypes" : "SOLAR_PV",  
  "sourceId" : "PVWatts",  
  "properties" : {  
    "systemSize" : {  
      "keyName" : "systemSize",  
      "dataValue" : "8.25"  
    },  
    "azimuth" : {  
      "keyName" : "azimuth",  
      "dataValue" : "170"  
    },  
    "tilt" : {  
      "keyName" : "tilt",  
      "dataValue" : "17"  
    },  
    "losses" : {  
      "keyName" : "losses",  
      "dataValue" : "14"  
    },  
    "inverterEfficiency" : {  
      "keyName" : "inverterEfficiency",  
      "dataValue" : "96"  
    }  
  }  
}

The request runs PVWatts and saves the results in a baseline profile.

Optional: Upload a solar profile with BaselineMeasure data

lightbulb

Use baseline measures for modeled solar production. If you are uploading actual production data, use readings instead.

Estimated solar production data does not usually correspond to the days of a specific year. Instead, the estimate for "January 1, 2012" represents expected production for the first day of any year. To model this, upload a profile with a series of BaselineMeasure objects instead of ReadingData.

Each BaselineMeasure object corresponds to one hour of a generic year, so a full year of solar data has 8,760 data points.

This example also passes the systemSize property in kW. Including this information on the solar profile allows charges based on solar system size to be calculated automatically when the solar profile is referenced in a Savings Analysis.

To upload a solar profile with baseline measures, you can use the same URL that you do when uploading a normal profile:

PUT /rest/v1/profiles

The request body, however, will be a little bit different:

{  
  "providerAccountId" : "api-eg-01",  
  "providerProfileId" : "eg-BaselineMeasures",  
  "serviceTypes" : "SOLAR_PV",  
  "sourceId": "SolarPvModel",  
   "properties" : {  
   "systemSize" : {  
     "keyName" : "systemSize",  
     "dataValue" : "5"  
   }},  
  "baselineMeasures": [  
      {  
          "i":1,  
          "v":10  
      },  
      {  
          "i":2,  
          "v":20  
      },
      // Edited for length.

  {
      "i":8759,
      "v":20
  },
  {
      "i":8760,
      "v":10
  }]
}

This profile differs from a readings-based profile in two ways. First, sourceId is set to SolarPvModel, which tells the API that the profile uses baselineMeasures instead of readingData. Second, the baselineMeasures property contains the measurements. Each measure has i, which denotes where the measurement appears in the sequence, and v, which denotes the measurement value.

After the profile is uploaded, you can use it like a normal solar profile when calculating customer savings.

To retrieve baseline measurements, add the populateBaseline parameter to your Get Usage Profile request and set it to true:

GET /rest/v1/profiles/pid/eg-BaselineMeasures?populateBaseline=true

Optional: Add or update readings

When adding a new set of readings, send a POST request. To update existing readings, send a PUT request. Both methods accept the same request body structure and return the same response body.

Resource URI

POST /rest/v1/profiles/{profileId}/readings
PUT /rest/v1/profiles/{profileId}/readings

POST /rest/v1/profiles/pid/{providerProfileId}/readings
PUT /rest/v1/profiles/pid/{providerProfileId}/readings

Request payload

The request requires authentication. The request body contains the usageProfileId to add readings to and an array of one or more readings. Readings use the ReadingData object. The following fields are required or common for each reading:

NameTypeDescription
fromDateTimeDateTimeStart date and time of this reading. Optional but typical.
toDateTimeDateTimeEnd date and time of this reading. Required.
quantityUnitStringUnit of the reading, such as kWh. Required.
quantityValueDecimalActual quantity of the reading. Required.

Make sure the Content-Type of the body is application/json.

Example POST request

POST /rest/v1/profiles/e494b54e-430e-4b1b-833b-8783e21eae56/readings

This POST body adds individual reading data items to a usage profile with ID e494b54e-430e-4b1b-833b-8783e21eae56.

{  
  "usageProfileId": "e494b54e-430e-4b1b-833b-8783e21eae56",  
  "readings" : [ {  
    "fromDateTime" : "2011-08-01T22:30:00.000-0700",  
    "toDateTime" : "2011-08-01T22:45:00.000-0700",  
    "quantityUnit" : "kWh",  
    "quantityValue" : 220  
  } ]  
}
Body Params
RAW_BODY
object
Responses

Language
Credentials
Basic
base64
:
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json