Skip to main content
PUT
/
battery
/
{deviceId}
/
schedule
curl
curl --request PUT \
  --url 'https://api.amps.ai/battery/device_abc123/schedule' \
  --header 'x-api-key: amps_sk_test_xxxxxxxxxxxxxxxxxxxxxxxx' \
  --header 'content-type: application/json' \
  --data '{
    "timezone": "Europe/London",
    "recurrence": {
      "rule": "daily"
    },
    "slots": [
      {
        "time": "00:30",
        "duration": "PT5H",
        "command": "charge",
        "parameters": {
          "target": {
            "value": 100,
            "unit": "percent"
          }
        }
      }
    ]
  }'
{
  "id": "sched_abc123",
  "deviceId": "device_abc123",
  "deviceType": "battery",
  "state": "active",
  "timezone": "Europe/London",
  "recurrence": {
    "rule": "daily"
  },
  "slots": [
    {
      "time": "00:30",
      "duration": "PT5H",
      "command": "charge",
      "parameters": {
        "target": {
          "value": 100,
          "unit": "percent"
        }
      }
    }
  ],
  "updatedAt": "2026-06-01T12:00:00.000Z",
  "nextFireAt": "2026-06-02T00:30:00.000Z"
}

Authorizations

x-api-key
string
header
required

Path Parameters

deviceId
string
required

The unique identifier for the battery device.

Example:

"device_abc123"

Body

application/json

The schedule to set on the device: a non-empty slots array, an optional recurrence, and an optional timezone (required for time-variant slots). No deviceId in the body; the device is the URL.

The body is of type string.

Response

Schedule set on the device.