{
"type": "https://api.kapa.energy/problems/invalid-time-window",
"title": "Invalid time window",
"status": 400,
"code": "invalid_time_window",
"detail": "end must be after start.",
"invalid_params": [
{
"name": "end",
"reason": "must be after start"
}
]
}
{
"type": "https://api.kapa.energy/problems/unauthorized",
"title": "Unauthorized",
"status": 401,
"code": "unauthorized",
"detail": "The access token has expired."
}
{
"type": "https://api.kapa.energy/problems/battery-not-found",
"title": "Battery not found",
"status": 404,
"code": "battery_not_found",
"detail": "No battery with id bat_9 is accessible to this client."
}
Commands
Cancel commands
Cancels every unfinished command on this battery (pending, scheduled or
active) whose window overlaps [start, end). With an empty body, all current
and upcoming commands are cancelled.
Active commands stop as soon as the manufacturer applies the cancellation. The
battery then returns to its default behaviour, unless another command applies.
{
"type": "https://api.kapa.energy/problems/invalid-time-window",
"title": "Invalid time window",
"status": 400,
"code": "invalid_time_window",
"detail": "end must be after start.",
"invalid_params": [
{
"name": "end",
"reason": "must be after start"
}
]
}
{
"type": "https://api.kapa.energy/problems/unauthorized",
"title": "Unauthorized",
"status": 401,
"code": "unauthorized",
"detail": "The access token has expired."
}
{
"type": "https://api.kapa.energy/problems/battery-not-found",
"title": "Battery not found",
"status": 404,
"code": "battery_not_found",
"detail": "No battery with id bat_9 is accessible to this client."
}
Commands that were cancelled. Empty if none matched.
Show child attributes
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Kapa Energy Battery API","colors":{"primary":"#16A34A","light":"#07C983","dark":"#15803D"},"favicon":"https://mintcdn.com/kapa-energy/2AleCt6EQQe9cMHB/favicon.svg?fit=max\u0026auto=format\u0026n=2AleCt6EQQe9cMHB\u0026q=85\u0026s=43feb583befd8bc21940444f24fab7d8","contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"kapa-energy","hasAudioNarration":false,"actualSubdomain":"kapa-energy","customDomains":[],"gitSource":{"type":"github","owner":"br-g","repo":"kapa-api","deployBranch":"main","contentDirectory":"docs","isPrivate":false,"mountPath":"","label":"","_id":"6af5f6ad6d281f8985c138db"},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6af5fa176d281f8985c176ac","clientVersion":"0.0.4111","searchFilterCounts":[{"language":"default","tag":"Getting Started","count":2}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"api-reference/commands/cancel-commands","slug":"/api-reference/commands/cancel-commands","pageMetadata":{"title":"Cancel commands","description":"Cancels every unfinished command on this battery (`pending`, `scheduled` or\n`active`) whose window overlaps `[start, end)`. With an empty body, all current\nand upcoming commands are cancelled.\n\nActive commands stop as soon as the manufacturer applies the cancellation. The\nbattery then returns to its default behaviour, unless another command applies.\n","deprecated":null,"version":null,"openapi":"/openapi.yaml post /bat/v1/{id}/cancel_command","href":"/api-reference/commands/cancel-commands","autogeneratedByOpenApi":true},"description":{"compiledSource":"\"use strict\";\nconst {Fragment: _Fragment, jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n code: \"code\",\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_Fragment, {\n children: [_jsxs(_components.p, {\n children: [\"Cancels every unfinished command on this battery (\", _jsx(_components.code, {\n children: \"pending\"\n }), \", \", _jsx(_components.code, {\n children: \"scheduled\"\n }), \" or\\n\", _jsx(_components.code, {\n children: \"active\"\n }), \") whose window overlaps \", _jsx(_components.code, {\n children: \"[start, end)\"\n }), \". With an empty body, all current\\nand upcoming commands are cancelled.\"]\n }), \"\\n\", _jsx(_components.p, {\n children: \"Active commands stop as soon as the manufacturer applies the cancellation. The\\nbattery then returns to its default behaviour, unless another command applies.\"\n })]\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Cancel commands","description":"Cancels every unfinished command on this battery (`pending`, `scheduled` or\n`active`) whose window overlaps `[start, end)`. With an empty body, all current\nand upcoming commands are cancelled.\n\nActive commands stop as soon as the manufacturer applies the cancellation. The\nbattery then returns to its default behaviour, unless another command applies.\n","deprecated":null,"version":null,"openapi":"/openapi.yaml post /bat/v1/{id}/cancel_command","href":"/api-reference/commands/cancel-commands","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"tags":["Commands"],"operationId":"cancelCommands","summary":"Cancel commands","description":"Cancels every unfinished command on this battery (`pending`, `scheduled` or\n`active`) whose window overlaps `[start, end)`. With an empty body, all current\nand upcoming commands are cancelled.\n\nActive commands stop as soon as the manufacturer applies the cancellation. The\nbattery then returns to its default behaviour, unless another command applies.\n","requestBody":"198539a8-bb7e-48d9-864f-99f128708a72","responses":{"202":"30fd9ec5-b0b6-41e2-9182-2c623c0a6259","400":"573b92bb-0ee3-4cdc-8ed2-fcddb60071d6","401":"499ed624-7f2a-439b-8b22-07a37b42f9e4","404":"2475f736-dac5-4adc-8f41-cf8c9ca10b4c"},"method":"post","type":"path","servers":["2b930e37-df3c-4ce7-8c09-1e5db810139c"],"security":["c2e4e0f7-3540-4425-897d-7de72a89b5df"],"path":"/bat/v1/{id}/cancel_command","baseUrlOptions":["https://api.kapa.energy"],"title":"Cancel commands","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{"fbcfe309-d155-4912-bade-3ef14e684f5f":{"name":"id","in":"path","required":true,"description":"Battery identifier.","schema":{"type":"string","isRequired":true,"description":"Battery identifier.","uniqueKey":"","typeLabel":"string"},"example":"bat_1"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"start":{"oneOf":[{"type":"string","format":"date-time","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{1,9})?Z$","description":"Lower bound of the window (inclusive). Omitted or null means no lower bound.","uniqueKey":"start.oneOf.0","typeLabel":"string\u003cdate-time>"},{"type":"null","format":"date-time","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{1,9})?Z$","description":"Lower bound of the window (inclusive). Omitted or null means no lower bound.","uniqueKey":"start.oneOf.1","typeLabel":"null"}],"uniqueKey":"start","typeLabel":"string\u003cdate-time> | null"},"end":{"oneOf":[{"type":"string","format":"date-time","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{1,9})?Z$","description":"Upper bound of the window (exclusive). Omitted or null means no upper bound.","uniqueKey":"end.oneOf.0","typeLabel":"string\u003cdate-time>"},{"type":"null","format":"date-time","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{1,9})?Z$","description":"Upper bound of the window (exclusive). Omitted or null means no upper bound.","uniqueKey":"end.oneOf.1","typeLabel":"null"}],"uniqueKey":"end","typeLabel":"string\u003cdate-time> | null"}},"additionalProperties":false,"uniqueKey":"","typeLabel":"object"},"example":{"start":"2026-11-12T18:00:00Z","end":"2026-11-12T20:00:00Z"},"examples":{"Example":{"title":"Example","value":{"start":"2026-11-12T18:00:00Z","end":"2026-11-12T20:00:00Z"}}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"30fd9ec5-b0b6-41e2-9182-2c623c0a6259":{"description":"Cancellation accepted. Lists the commands that were cancelled; empty if none matched.","content":{"application/json":{"schema":{"type":"object","required":["cancelled"],"properties":{"cancelled":{"type":"array","description":"Commands that were cancelled. Empty if none matched.","items":{"type":"object","required":["command_id","battery_id","action","parameters","start","end","status","status_reason","batch_id","created_at","updated_at"],"properties":{"command_id":{"type":"string","description":"Command identifier.","isRequired":true,"uniqueKey":"cancelled.items.[INDEX].command_id","typeLabel":"string"},"battery_id":{"type":"string","description":"Battery identifier.","isRequired":true,"uniqueKey":"cancelled.items.[INDEX].battery_id","typeLabel":"string"},"action":{"type":"string","enum":["charge","discharge","autoconsume","idle"],"description":"- `charge`: charge the battery.\n- `discharge`: discharge the battery.\n- `autoconsume`: self-consumption.\n- `idle`: neither charge nor discharge.\n","isRequired":true,"uniqueKey":"cancelled.items.[INDEX].action","typeLabel":"enum\u003cstring>"},"parameters":{"type":"object","description":"Action-specific parameters, as accepted. `charge` uses `allow_import` and\n`max_wh`; `discharge` and `autoconsume` use `min_wh` and `max_wh`; `idle` has none.\n","properties":{"allow_import":{"type":"boolean","uniqueKey":"cancelled.items.[INDEX].parameters.allow_import","typeLabel":"boolean"},"min_wh":{"oneOf":[{"type":"integer","minimum":0,"uniqueKey":"cancelled.items.[INDEX].parameters.min_wh.oneOf.0","typeLabel":"integer"},{"type":"null","minimum":0,"uniqueKey":"cancelled.items.[INDEX].parameters.min_wh.oneOf.1","typeLabel":"null"}],"uniqueKey":"cancelled.items.[INDEX].parameters.min_wh","typeLabel":"integer | null"},"max_wh":{"oneOf":[{"type":"integer","minimum":0,"uniqueKey":"cancelled.items.[INDEX].parameters.max_wh.oneOf.0","typeLabel":"integer"},{"type":"null","minimum":0,"uniqueKey":"cancelled.items.[INDEX].parameters.max_wh.oneOf.1","typeLabel":"null"}],"uniqueKey":"cancelled.items.[INDEX].parameters.max_wh","typeLabel":"integer | null"}},"additionalProperties":false,"isRequired":true,"uniqueKey":"cancelled.items.[INDEX].parameters","typeLabel":"object"},"start":{"type":"string","format":"date-time","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{1,9})?Z$","description":"Effective start (inclusive). If the request omitted `start`, or gave a time\nin the past, this is the time Kapa accepted the command.\n","examples":["2026-11-12T18:00:00Z"],"isRequired":true,"uniqueKey":"cancelled.items.[INDEX].start","typeLabel":"string\u003cdate-time>"},"end":{"oneOf":[{"type":"string","format":"date-time","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{1,9})?Z$","description":"End (exclusive). Null means open-ended, until cancelled or superseded.","isRequired":true,"uniqueKey":"cancelled.items.[INDEX].end.oneOf.0","typeLabel":"string\u003cdate-time>"},{"type":"null","format":"date-time","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{1,9})?Z$","description":"End (exclusive). Null means open-ended, until cancelled or superseded.","isRequired":true,"uniqueKey":"cancelled.items.[INDEX].end.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"cancelled.items.[INDEX].end","typeLabel":"string\u003cdate-time> | null"},"status":{"type":"string","enum":["pending","scheduled","active","completed","cancelled","superseded","failed"],"description":"- `pending`: accepted by Kapa, not yet acknowledged by the manufacturer's cloud.\n- `scheduled`: acknowledged by the manufacturer; `start` is in the future.\n- `active`: in effect on the battery.\n- `completed`: the window ended normally.\n- `cancelled`: cancelled with `cancel_command`.\n- `superseded`: the whole window is covered by more recent commands.\n- `failed`: the command could not be applied; see `status_reason`.\n","isRequired":true,"uniqueKey":"cancelled.items.[INDEX].status","typeLabel":"enum\u003cstring>"},"status_reason":{"oneOf":[{"type":"string","description":"Machine-readable reason when `status` is `failed`, e.g. `oem_rejected`,\n`oem_unreachable`, `battery_offline`. Null otherwise.\n","isRequired":true,"uniqueKey":"cancelled.items.[INDEX].status_reason.oneOf.0","typeLabel":"string"},{"type":"null","description":"Machine-readable reason when `status` is `failed`, e.g. `oem_rejected`,\n`oem_unreachable`, `battery_offline`. Null otherwise.\n","isRequired":true,"uniqueKey":"cancelled.items.[INDEX].status_reason.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"cancelled.items.[INDEX].status_reason","typeLabel":"string | null"},"batch_id":{"oneOf":[{"type":"string","description":"Identifier of the batch that created the command. Null for single commands.","isRequired":true,"uniqueKey":"cancelled.items.[INDEX].batch_id.oneOf.0","typeLabel":"string"},{"type":"null","description":"Identifier of the batch that created the command. Null for single commands.","isRequired":true,"uniqueKey":"cancelled.items.[INDEX].batch_id.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"cancelled.items.[INDEX].batch_id","typeLabel":"string | null"},"created_at":{"type":"string","format":"date-time","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{1,9})?Z$","description":"When Kapa accepted the command.","examples":["2026-11-12T18:00:00Z"],"isRequired":true,"uniqueKey":"cancelled.items.[INDEX].created_at","typeLabel":"string\u003cdate-time>"},"updated_at":{"type":"string","format":"date-time","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{1,9})?Z$","description":"Last status change.","examples":["2026-11-12T18:00:00Z"],"isRequired":true,"uniqueKey":"cancelled.items.[INDEX].updated_at","typeLabel":"string\u003cdate-time>"}},"uniqueKey":"cancelled.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"cancelled","typeLabel":"object[]"}},"uniqueKey":"","typeLabel":"object"},"example":{"cancelled":[{"command_id":"cmd_610","battery_id":"bat_1","action":"discharge","parameters":{"min_wh":1500,"max_wh":null},"start":"2026-11-12T18:00:00Z","end":"2026-11-12T19:00:00Z","status":"cancelled","status_reason":null,"batch_id":null,"created_at":"2026-11-12T16:02:51Z","updated_at":"2026-11-12T16:30:18Z"}]},"examples":{"Example":{"title":"Example","value":{"cancelled":[{"command_id":"cmd_610","battery_id":"bat_1","action":"discharge","parameters":{"min_wh":1500,"max_wh":null},"start":"2026-11-12T18:00:00Z","end":"2026-11-12T19:00:00Z","status":"cancelled","status_reason":null,"batch_id":null,"created_at":"2026-11-12T16:02:51Z","updated_at":"2026-11-12T16:30:18Z"}]}}},"exampleType":"examples"}},"exampleType":"examples"},"573b92bb-0ee3-4cdc-8ed2-fcddb60071d6":{"description":"The request is malformed or its parameters are invalid.","content":{"application/problem+json":{"schema":{"type":"object","description":"Error details, following RFC 9457 (Problem Details for HTTP APIs).","required":["type","title","status","code"],"properties":{"type":{"type":"string","format":"uri-reference","description":"URI identifying the problem type.","isRequired":true,"uniqueKey":"type","typeLabel":"string\u003curi-reference>"},"title":{"type":"string","description":"Short, human-readable summary of the problem type.","isRequired":true,"uniqueKey":"title","typeLabel":"string"},"status":{"type":"integer","description":"HTTP status code.","isRequired":true,"uniqueKey":"status","typeLabel":"integer"},"code":{"type":"string","description":"Stable, machine-readable error code. See Errors in the API description.","isRequired":true,"uniqueKey":"code","typeLabel":"string"},"detail":{"type":"string","description":"Human-readable explanation specific to this occurrence.","uniqueKey":"detail","typeLabel":"string"},"invalid_params":{"type":"array","description":"Parameters that caused the error, if any.","items":{"type":"object","required":["name","reason"],"properties":{"name":{"type":"string","isRequired":true,"uniqueKey":"invalid_params.items.[INDEX].name","typeLabel":"string"},"reason":{"type":"string","isRequired":true,"uniqueKey":"invalid_params.items.[INDEX].reason","typeLabel":"string"}},"uniqueKey":"invalid_params.items.[INDEX]","typeLabel":"object"},"uniqueKey":"invalid_params","typeLabel":"object[]"}},"uniqueKey":"","typeLabel":"object"},"example":{"type":"https://api.kapa.energy/problems/invalid-time-window","title":"Invalid time window","status":400,"code":"invalid_time_window","detail":"end must be after start.","invalid_params":[{"name":"end","reason":"must be after start"}]},"examples":{"Example":{"title":"Example","value":{"type":"https://api.kapa.energy/problems/invalid-time-window","title":"Invalid time window","status":400,"code":"invalid_time_window","detail":"end must be after start.","invalid_params":[{"name":"end","reason":"must be after start"}]}}},"exampleType":"examples"}},"exampleType":"examples"},"499ed624-7f2a-439b-8b22-07a37b42f9e4":{"description":"The access token is missing, invalid or expired.","content":{"application/problem+json":{"schema":{"type":"object","description":"Error details, following RFC 9457 (Problem Details for HTTP APIs).","required":["type","title","status","code"],"properties":{"type":{"type":"string","format":"uri-reference","description":"URI identifying the problem type.","isRequired":true,"uniqueKey":"type","typeLabel":"string\u003curi-reference>"},"title":{"type":"string","description":"Short, human-readable summary of the problem type.","isRequired":true,"uniqueKey":"title","typeLabel":"string"},"status":{"type":"integer","description":"HTTP status code.","isRequired":true,"uniqueKey":"status","typeLabel":"integer"},"code":{"type":"string","description":"Stable, machine-readable error code. See Errors in the API description.","isRequired":true,"uniqueKey":"code","typeLabel":"string"},"detail":{"type":"string","description":"Human-readable explanation specific to this occurrence.","uniqueKey":"detail","typeLabel":"string"},"invalid_params":{"type":"array","description":"Parameters that caused the error, if any.","items":{"type":"object","required":["name","reason"],"properties":{"name":{"type":"string","isRequired":true,"uniqueKey":"invalid_params.items.[INDEX].name","typeLabel":"string"},"reason":{"type":"string","isRequired":true,"uniqueKey":"invalid_params.items.[INDEX].reason","typeLabel":"string"}},"uniqueKey":"invalid_params.items.[INDEX]","typeLabel":"object"},"uniqueKey":"invalid_params","typeLabel":"object[]"}},"uniqueKey":"","typeLabel":"object"},"example":{"type":"https://api.kapa.energy/problems/unauthorized","title":"Unauthorized","status":401,"code":"unauthorized","detail":"The access token has expired."},"examples":{"Example":{"title":"Example","value":{"type":"https://api.kapa.energy/problems/unauthorized","title":"Unauthorized","status":401,"code":"unauthorized","detail":"The access token has expired."}}},"exampleType":"examples"}},"exampleType":"examples"},"2475f736-dac5-4adc-8f41-cf8c9ca10b4c":{"description":"No battery with this id is accessible to the client.","content":{"application/problem+json":{"schema":{"type":"object","description":"Error details, following RFC 9457 (Problem Details for HTTP APIs).","required":["type","title","status","code"],"properties":{"type":{"type":"string","format":"uri-reference","description":"URI identifying the problem type.","isRequired":true,"uniqueKey":"type","typeLabel":"string\u003curi-reference>"},"title":{"type":"string","description":"Short, human-readable summary of the problem type.","isRequired":true,"uniqueKey":"title","typeLabel":"string"},"status":{"type":"integer","description":"HTTP status code.","isRequired":true,"uniqueKey":"status","typeLabel":"integer"},"code":{"type":"string","description":"Stable, machine-readable error code. See Errors in the API description.","isRequired":true,"uniqueKey":"code","typeLabel":"string"},"detail":{"type":"string","description":"Human-readable explanation specific to this occurrence.","uniqueKey":"detail","typeLabel":"string"},"invalid_params":{"type":"array","description":"Parameters that caused the error, if any.","items":{"type":"object","required":["name","reason"],"properties":{"name":{"type":"string","isRequired":true,"uniqueKey":"invalid_params.items.[INDEX].name","typeLabel":"string"},"reason":{"type":"string","isRequired":true,"uniqueKey":"invalid_params.items.[INDEX].reason","typeLabel":"string"}},"uniqueKey":"invalid_params.items.[INDEX]","typeLabel":"object"},"uniqueKey":"invalid_params","typeLabel":"object[]"}},"uniqueKey":"","typeLabel":"object"},"example":{"type":"https://api.kapa.energy/problems/battery-not-found","title":"Battery not found","status":404,"code":"battery_not_found","detail":"No battery with id bat_9 is accessible to this client."},"examples":{"Example":{"title":"Example","value":{"type":"https://api.kapa.energy/problems/battery-not-found","title":"Battery not found","status":404,"code":"battery_not_found","detail":"No battery with id bat_9 is accessible to this client."}}},"exampleType":"examples"}},"exampleType":"examples"}},"security":{"c2e4e0f7-3540-4425-897d-7de72a89b5df":{"oauth2":{"type":"oauth2","description":"OAuth 2.0 client credentials. Obtain a token from `POST /token`.","flows":{"clientCredentials":{"tokenUrl":"https://api.kapa.energy/token","scopes":{}}},"scopes":[],"schemeName":"oauth2"}}},"servers":{"2b930e37-df3c-4ce7-8c09-1e5db810139c":{"url":"https://api.kapa.energy","description":"Production"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"oauth2","description":"OAuth 2.0 client credentials. Obtain a token from `POST /token`.","flows":{"clientCredentials":{"tokenUrl":"https://api.kapa.energy/token","scopes":{}}},"scopes":[],"schemeName":"oauth2"},"schema":{"title":"OAuth2 Auth","type":"string","isRequired":true,"description":"OAuth 2.0 client credentials. Obtain a token from `POST /token`.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"oauth2","name":"Authorization"}],"title":"oauth2"}]},"originalFileLocation":"openapi.yaml"},"subdomain":"kapa-energy","siteName":"Kapa Energy Battery API","title":"Cancel commands - Kapa Energy Battery API","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-12T17:40:42.712Z","originalFileLocation":"api-reference/commands/cancel-commands.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Cancels every unfinished command on this battery (pending, scheduled or active) whose window overlaps [start, end). With an empty body, all current and upcoming commands are cancelled. Active commands stop as soon as the manufacturer applies the cancellation. The battery then returns to its default behaviour, unless another command applies.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Kapa Energy Battery API\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/kapa-energy/pztUxocyRE_md0x_/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/kapa-energy/pztUxocyRE_md0x_/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/kapa-energy/pztUxocyRE_md0x_/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/kapa-energy/pztUxocyRE_md0x_/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/kapa-energy/pztUxocyRE_md0x_/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/kapa-energy/pztUxocyRE_md0x_/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/kapa-energy/pztUxocyRE_md0x_/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/kapa-energy/pztUxocyRE_md0x_/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/kapa-energy/pztUxocyRE_md0x_/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Cancel commands - Kapa Energy Battery API\">\u003cmeta data-mint-head property=\"og:description\" content=\"Cancels every unfinished command on this battery (pending, scheduled or active) whose window overlaps [start, end). With an empty body, all current and upcoming commands are cancelled. Active commands stop as soon as the manufacturer applies the cancellation. The battery then returns to its default behaviour, unless another command applies.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Kapa Energy Battery API\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://kapa-energy.mintlify.app/api-reference/commands/cancel-commands\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://kapa-energy.mintlify.site/_mintlify/api/og/v2?division=Commands\u0026amp;title=Cancel+commands\u0026amp;description=Cancels+every+unfinished+command+on+this+battery+%28%60pending%60%2C+%60scheduled%60+or%0A%60active%60%29+whose+window+overlaps+%60%5Bstart%2C+end%29%60.+With+an+empty+body%2C+all+current%0Aand+\u0026amp;theme=be394bdd824f66fd2549706a\u0026amp;signature=4f6697271bca10e3d0050a645899334a8fbe2a71b796024a6561f432452c6a62\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Cancel commands - Kapa Energy Battery API\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Cancels every unfinished command on this battery (pending, scheduled or active) whose window overlaps [start, end). With an empty body, all current and upcoming commands are cancelled. Active commands stop as soon as the manufacturer applies the cancellation. The battery then returns to its default behaviour, unless another command applies.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://kapa-energy.mintlify.site/_mintlify/api/og/v2?division=Commands\u0026amp;title=Cancel+commands\u0026amp;description=Cancels+every+unfinished+command+on+this+battery+%28%60pending%60%2C+%60scheduled%60+or%0A%60active%60%29+whose+window+overlaps+%60%5Bstart%2C+end%29%60.+With+an+empty+body%2C+all+current%0Aand+\u0026amp;theme=be394bdd824f66fd2549706a\u0026amp;signature=4f6697271bca10e3d0050a645899334a8fbe2a71b796024a6561f432452c6a62\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/kapa-energy/pztUxocyRE_md0x_/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Kapa Energy Battery API\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#16A34A\">\u003clink data-mint-head rel=\"canonical\" href=\"https://kapa-energy.mintlify.app/api-reference/commands/cancel-commands\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/commands/cancel-commands.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://kapa-energy.mintlify.app/#organization\",\"name\":\"Kapa Energy Battery API\",\"url\":\"https://kapa-energy.mintlify.app\"},{\"@type\":\"WebSite\",\"@id\":\"https://kapa-energy.mintlify.app#website\",\"name\":\"Kapa Energy Battery API\",\"url\":\"https://kapa-energy.mintlify.app\",\"publisher\":{\"@id\":\"https://kapa-energy.mintlify.app/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://kapa-energy.mintlify.app/api-reference/commands/cancel-commands#webpage\",\"url\":\"https://kapa-energy.mintlify.app/api-reference/commands/cancel-commands\",\"name\":\"Cancel commands\",\"description\":\"Cancels every unfinished command on this battery (pending, scheduled or active) whose window overlaps [start, end). With an empty body, all current and upcoming commands are cancelled. Active commands stop as soon as the manufacturer applies the cancellation. The battery then returns to its default behaviour, unless another command applies.\",\"dateModified\":\"2026-11-12T17:40:42.712Z\",\"isPartOf\":{\"@id\":\"https://kapa-energy.mintlify.app#website\"},\"breadcrumb\":{\"@id\":\"https://kapa-energy.mintlify.app/api-reference/commands/cancel-commands#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://kapa-energy.mintlify.app/api-reference/commands/cancel-commands#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Commands\",\"item\":\"https://kapa-energy.mintlify.app/api-reference/commands/charge-the-battery\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Cancel commands\",\"item\":\"https://kapa-energy.mintlify.app/api-reference/commands/cancel-commands\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://kapa-energy.mintlify.app/api-reference/commands/cancel-commands#apireference\",\"headline\":\"Cancel commands\",\"name\":\"Cancel commands\",\"description\":\"Cancels every unfinished command on this battery (pending, scheduled or active) whose window overlaps [start, end). With an empty body, all current and upcoming commands are cancelled. Active commands stop as soon as the manufacturer applies the cancellation. The battery then returns to its default behaviour, unless another command applies.\",\"url\":\"https://kapa-energy.mintlify.app/api-reference/commands/cancel-commands\",\"mainEntityOfPage\":{\"@id\":\"https://kapa-energy.mintlify.app/api-reference/commands/cancel-commands#webpage\"},\"dateModified\":\"2026-11-12T17:40:42.712Z\",\"publisher\":{\"@id\":\"https://kapa-energy.mintlify.app/#organization\"},\"isPartOf\":{\"@id\":\"https://kapa-energy.mintlify.app#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Kapa Energy Battery API\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Kapa Energy Battery API\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/commands/cancel-commands.md","siteName":"Kapa Energy Battery API","nav":{"global":null,"tabs":[{"tab":"Guides","pages":[{"title":"Guides","href":""}]},{"tab":"API reference","groups":[{"group":"Authentication","pages":[{"title":"Get an access token","deprecated":null,"version":null,"openapi":"/openapi.yaml post /token","href":"/api-reference/authentication/get-an-access-token"}]},{"group":"Batteries","pages":[{"title":"Get battery information","deprecated":null,"version":null,"openapi":"/openapi.yaml get /bat/v1/{id}/info","href":"/api-reference/batteries/get-battery-information"}]},{"group":"Commands","pages":[{"title":"Charge the battery","deprecated":null,"version":null,"openapi":"/openapi.yaml post /bat/v1/{id}/charge","href":"/api-reference/commands/charge-the-battery"},{"title":"Discharge the battery","deprecated":null,"version":null,"openapi":"/openapi.yaml post /bat/v1/{id}/discharge","href":"/api-reference/commands/discharge-the-battery"},{"title":"Switch to self-consumption","deprecated":null,"version":null,"openapi":"/openapi.yaml post /bat/v1/{id}/autoconsume","href":"/api-reference/commands/switch-to-self-consumption"},{"title":"Put the battery on idle","deprecated":null,"version":null,"openapi":"/openapi.yaml post /bat/v1/{id}/idle","href":"/api-reference/commands/put-the-battery-on-idle"},{"title":"List commands","description":"Commands on this battery whose window overlaps `[start, end)`, with their\ncurrent status, most recently created first.\n","deprecated":null,"version":null,"openapi":"/openapi.yaml get /bat/v1/{id}/commands","href":"/api-reference/commands/list-commands"},{"title":"Cancel commands","deprecated":null,"version":null,"openapi":"/openapi.yaml post /bat/v1/{id}/cancel_command","href":"/api-reference/commands/cancel-commands"},{"title":"Command status changed","description":"Sent each time the status of a command changes. Carries the full command.","version":null,"deprecated":null,"openapi":"/openapi.yaml webhook command.status_changed","href":"/api-reference/commands/command-status-changed"}]},{"group":"Telemetry","pages":[{"title":"Get telemetry history","deprecated":null,"version":null,"openapi":"/openapi.yaml get /bat/v1/{id}/telemetry","href":"/api-reference/telemetry/get-telemetry-history"},{"title":"Get latest telemetry","deprecated":null,"version":null,"openapi":"/openapi.yaml get /bat/v1/{id}/telemetry/latest","href":"/api-reference/telemetry/get-latest-telemetry"},{"title":"New telemetry points","version":null,"deprecated":null,"openapi":"/openapi.yaml webhook telemetry","href":"/api-reference/telemetry/new-telemetry-points"}]},{"group":"Batches","pages":[{"title":"Send a batch of commands","deprecated":null,"version":null,"openapi":"/openapi.yaml post /bat/v1/batches","href":"/api-reference/batches/send-a-batch-of-commands"}]}]},{"tab":"Webhooks","pages":[{"title":"Webhooks","href":"/webhooks/telemetry"}]}]},"basePath":"","title":"Cancel commands - Kapa Energy Battery API","buildId":"dpl_DqYu5MPb49gWBBbUGgpHQUmCHY3P","deploymentId":"dpl_DqYu5MPb49gWBBbUGgpHQUmCHY3P","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-CybtLBIt.js","utils-BMLj2fvV.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-B6In562Y.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-Dr8Mfhp9.js","snippetPresets-2rmQvMVl.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","ApiExamples-WMqJYdZj.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-CJ-MlPHu.js","shallow-dY3TMRCk.js","getApiPlaygroundDisplay-v-1B2bKm.js","CodeSnippet-BDhiTB7U.js","CodeSnippets-D9hnzQcS.js","Page-C4GwDT3_.js","getPastedJson-Th2V45jI.js","icon-BQXch1W9.js","MethodPill-BCqUneP3.js","DuplicateIcon-Q_-bhurZ.js","createIcon-DUjLHRqp.js","DynamicMarkdown-B-f2cqXQ.js","SectionHeading-Da5NsV4v.js","axios-vUo_bRtp.js","Markdown-D13FWkIM.js","clsx-D3Isdib3.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-C-XZBk9h.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink--qIqmmVG.js"]}