A site’s installed capacity can change over time if e.g. more wind turbines or solar panels are installed or decommissioned. Furthermore, the available capacity is also changing e.g. when there is some technical issues or during maintenance periods when some of the capacity is not available. It is possible to reflect these capacity changes by uploading the periods when there is a capacity change along with the new capacity values.

import requests
 
api_key = "Your API key" # Set your API key
site_id = "a923653c-26f1-1b29-955d-ffde5d182276" # Set the site ID

payload = {
    "data": [
        {
            "valid_time": "2022-01-01T00:00:00Z",
            "value": 2780.0
        },
        {
            "valid_time": "2023-05-16T16:00:00Z",
            "value": 3100.0
        }
    ]
}
			
url = f'https://api.rebase.energy/platform/v2/sites/{site_id}/capacity'
headers = {"Authorization": api_key, "Content-Type": "application/json"}			

response = requests.post(url, json=payload, headers=headers)
response.raise_for_status()
response = response.json()
Response example
{
    "message": "Capacity uploaded successfully"
}