Skip to main content
POST
/
ev-charger
/
{deviceId}
curl
curl --request POST \
  --url 'https://api.amps.ai/ev-charger/device_abc123' \
  --header 'x-api-key: amps_sk_test_xxxxxxxxxxxxxxxxxxxxxxxx' \
  --header 'content-type: application/json' \
  --data '{
    "action": {
      "command": "charge"
    }
  }'
{
  "success": true,
  "data": {
    "id": "act_2026050712000ev02",
    "deviceId": "dev_ev7a3b1f",
    "deviceType": "ev_charger",
    "command": "charge",
    "parameters": null,
    "state": "acknowledged",
    "createdAt": "2026-05-07T12:00:00.000Z",
    "start": null,
    "links": {
      "self": "/actions/act_2026050712000ev02"
    }
  },
  "meta": {
    "requestId": "req_8a2Bf3kP",
    "environment": "sandbox",
    "timestamp": "2026-06-02T12:00:00.000Z",
    "latencyMs": 12
  }
}

Authorizations

x-api-key
string
header
required

Path Parameters

deviceId
string
required

The unique identifier for the EV Charger device

Example:

"device_abc123"

Body

application/json

A single EV-charger action plus optional onConflict strategy and sandbox controls.

Action variants describe what the API accepts. Per-device support varies; the commands map on GET /ev-charger/{deviceId} shows which actions a specific device handles.

action
EV Charger Action · object
required

A canonical EV-charger command. charge begins charging; idle pauses, holding the session. Neither takes command parameters.

Examples:
{ "command": "charge" }
{ "command": "idle" }
onConflict
enum<string>

cancel_and_replace cancels the active action before running this one; queue_after defers this one until the active action completes. Omit to receive 409 on conflict.

Available options:
cancel_and_replace,
queue_after
sandbox
Ev Charger Sandbox Config · object

Sandbox controls for testing error paths. Ignored in live environments.

Response

Action acknowledged and queued for processing

success
boolean
required

Always true for success responses.

data
Ev Charger Push Response · object
required

Result of a push. Mirrors the dispatch (command + parameters + deviceType) and carries links.self to track the action. For immediate actions, state reflects the dispatch outcome. For deferred actions, state is scheduled, start carries the fire time, and end the window close when a window was requested.

meta
Response Meta · object
required

Metadata attached to every response: the request identifier, the serving environment, the build timestamp, and the server-side latency.