Skip to main content
curl -X POST https://api.chargeapi.co/v1/policies \
  -H "Authorization: Bearer ch_sk_test_..." \
  --json '{
  "mode": "enforcement",
  "name": "Business Hours Policy",
  "rules": {
    "max_price_per_kwh": 25
  }
}'
{
    "id": "pol_NCq1tX7rpNAqDwGkXA6ygtiHMbPTHtkY",
    "object": "policy",
    "created": "2026-04-01T00:08:18.314Z",
    "description": null,
    "metadata": {},
    "mode": "enforcement",
    "name": "Example Policy",
    "rules": {
        "allowed_operators": ["example_operator"],
        "denied_operators": [],
        "geofences": [
            {
                "center": {
                    "latitude": 48.8698,
                    "longitude": 2.3319
                },
                "name": "Example Zone",
                "radius_meters": 1500
            }
        ],
        "max_price_per_kwh": 25,
        "time_windows": [
            {
                "days_of_week": ["monday", "tuesday", "wednesday", "thursday", "friday"],
                "end_time": "18:00",
                "start_time": "09:00"
            }
        ]
    },
    "status": "active"
}
Creates a policy for enforcement or suggestion workflows.
curl -X POST https://api.chargeapi.co/v1/policies \
  -H "Authorization: Bearer ch_sk_test_..." \
  --json '{
  "mode": "enforcement",
  "name": "Business Hours Policy",
  "rules": {
    "max_price_per_kwh": 25
  }
}'
{
    "id": "pol_NCq1tX7rpNAqDwGkXA6ygtiHMbPTHtkY",
    "object": "policy",
    "created": "2026-04-01T00:08:18.314Z",
    "description": null,
    "metadata": {},
    "mode": "enforcement",
    "name": "Example Policy",
    "rules": {
        "allowed_operators": ["example_operator"],
        "denied_operators": [],
        "geofences": [
            {
                "center": {
                    "latitude": 48.8698,
                    "longitude": 2.3319
                },
                "name": "Example Zone",
                "radius_meters": 1500
            }
        ],
        "max_price_per_kwh": 25,
        "time_windows": [
            {
                "days_of_week": ["monday", "tuesday", "wednesday", "thursday", "friday"],
                "end_time": "18:00",
                "start_time": "09:00"
            }
        ]
    },
    "status": "active"
}

Parameters

mode
string
required
The operational mode of the policy.Available options: enforcement, suggestion
name
string
required
A human-readable name for the policy.
rules
object
required
Rules that define how the policy behaves.
status
string
The status of the policy.Available options: active, inactive

More parameters

description
string
An optional description of the policy’s purpose.
metadata
object
Set of key-value pairs that you can attach to an object.

Returns

Returns the created policy.