Skip to main content
POST
/
actions
/
{actionId}
/
cancel
curl
curl --request POST \
  --url 'https://api.amps.ai/actions/act_abc123/cancel' \
  --header 'x-api-key: amps_sk_test_xxxxxxxxxxxxxxxxxxxxxxxx'
{
  "id": "act_2026050709a1b2c3",
  "deviceId": "device_abc123",
  "type": "battery:set_operation_mode",
  "state": "cancelled",
  "parameters": {
    "mode": "charge",
    "target": {
      "value": 100,
      "unit": "percent"
    }
  },
  "result": null,
  "errorCode": null,
  "errorMessage": null,
  "createdAt": "2026-05-07T08:00:00.000Z",
  "updatedAt": "2026-05-07T11:32:00.000Z",
  "acknowledgedAt": null,
  "completedAt": null,
  "start": "2026-06-01T02:00:00.000Z",
  "end": null
}

Documentation Index

Fetch the complete documentation index at: https://docs.amps.ai/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

x-api-key
string
header
required

Path Parameters

actionId
string
required

The unique identifier for the action to cancel.

Example:

"act_abc123"

Response

Action cancelled successfully.

Persistent state of a device action across its lifecycle. The type field discriminates the device family and the parameters shape. Lifecycle states, timestamps, and the result envelope are universal.

type
string
required

Battery operation mode change (charge, discharge, idle, auto.*).

Allowed value: "battery:set_operation_mode"
parameters
object
required

Canonical mode plus any optional target/power/reserve constraints the caller supplied. Auto modes carry only mode.

id
string
required

Unique action identifier.

deviceId
string
required

Device the action targets.

state
enum<string>
required

Current state of the action. scheduled indicates a deferred action awaiting its fire time. The terminal states are completed, failed, and cancelled.

Available options:
acknowledged,
completed,
failed,
scheduled,
cancelled
result
object
required

Connector response captured when the action reaches a terminal state. Null while pending or scheduled. The OEM may add fields beyond success/message/error.

errorCode
string | null
required

Machine-readable error code when state is failed. Null otherwise.

errorMessage
string | null
required

Human-readable error message when state is failed. Null otherwise.

createdAt
string<date-time>
required

ISO 8601 timestamp when the action was created.

updatedAt
string<date-time>
required

ISO 8601 timestamp of the most recent state transition.

acknowledgedAt
string<date-time> | null
required

ISO 8601 timestamp when the connector accepted the action. Null until acknowledged.

completedAt
string<date-time> | null
required

ISO 8601 timestamp when the action reached a terminal state. Null until terminal.

start
string<date-time> | null
required

Absolute firing instant for deferred actions, as an ISO 8601 timestamp. Null for immediate actions. Battery is currently the only family that supports deferred push.

end
string<date-time> | null
required

Absolute end instant for windowed actions (e.g. charge/discharge with both start and end), as an ISO 8601 timestamp. Null for immediate or open-ended actions.