Skip to main content
POST
/
api
/
charge_windows
Create a charge window
curl --request POST \
  --url https://clarus-api.com/api/charge_windows \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-Clarus-Subdomain: <api-key>' \
  --data '
{
  "data": {
    "type": "charge_windows",
    "attributes": {
      "frequency": "Day",
      "name": "Weekly Monday",
      "numbers": [
        1
      ]
    }
  }
}
'
{
  "data": {
    "id": "1",
    "type": "charge_windows",
    "attributes": {
      "frequency": "Day",
      "id": 1,
      "name": "Weekly Monday",
      "numbers": [
        1
      ]
    }
  }
}

Request Structure

{
  "data": {
    "type": "charge_windows",
    "attributes": {
      "frequency": "Day",
      "name": "Weekly Monday",
      "numbers": [1]
    }
  }
}

Required Fields

FieldDescription
frequencyFrequency type: Day or Month
numbersArray of day/date numbers for the schedule

Optional Fields

FieldDescription
nameDisplay name for the charge window

Numbers Field Values

  • Day frequency: 0=Sunday, 1=Monday, 2=Tuesday, 3=Wednesday, 4=Thursday, 5=Friday, 6=Saturday
  • Month frequency: 1-31 for day of month

Authorizations

Authorization
string
header
required

OAuth 2.0 authentication. Use the client credentials or authorization code flow to obtain an access token.

X-Clarus-Subdomain
string
header
required

The subdomain/tenant name identifying which tenant's data to access. Required for all API requests.

Body

application/json
data
object
required

Response

Charge Window created successfully

data
object