Skip to main content
curl -X POST https://api.chargeapi.co/v1/policies/pol_dMBjATAAVcbAKtSNnjlfbmnwviSXr8yP \
  -H "Authorization: Bearer ch_sk_test_..." \
  --json '{
  "name": "Example Policy v2"
}'
{
    "id": "pol_dMBjATAAVcbAKtSNnjlfbmnwviSXr8yP",
    "object": "policy",
    "created": "2026-04-01T00:09:07.493Z",
    "description": null,
    "metadata": {},
    "mode": "enforcement",
    "name": "Example Policy v2",
    "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"
}
Updates a policy. Parameters you omit keep their current values.
curl -X POST https://api.chargeapi.co/v1/policies/pol_dMBjATAAVcbAKtSNnjlfbmnwviSXr8yP \
  -H "Authorization: Bearer ch_sk_test_..." \
  --json '{
  "name": "Example Policy v2"
}'
{
    "id": "pol_dMBjATAAVcbAKtSNnjlfbmnwviSXr8yP",
    "object": "policy",
    "created": "2026-04-01T00:09:07.493Z",
    "description": null,
    "metadata": {},
    "mode": "enforcement",
    "name": "Example Policy v2",
    "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
Updated operational mode of the policy.Available options: enforcement, suggestion
name
string
Updated display name of the policy.
rules
object
Rules that define how the policy behaves.
status
string
Updated status of the policy.Available options: active, inactive

More parameters

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

Returns

Returns the updated policy.