{
"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/idempotency-key-in-use",
"title": "Idempotency key in use",
"status": 409,
"code": "idempotency_key_in_use",
"detail": "Retry once the original request has completed."
}
{
"type": "https://api.kapa.energy/problems/energy-out-of-range",
"title": "Energy out of range",
"status": 422,
"code": "energy_out_of_range",
"detail": "max_wh (15000) exceeds the usable capacity of this battery (13000 Wh).",
"invalid_params": [
{
"name": "max_wh",
"reason": "exceeds usable_capacity_wh"
}
]
}
Batches
Send a batch of commands
Sends up to 1,000 commands, to one or many batteries, in a single request. Each
operation takes the same parameters as the matching single-battery endpoint,
plus id (the battery) and action. In a batch, start and end are required
for every operation. A battery can appear in several operations if their
windows do not overlap.
Kapa validates every operation immediately and returns 202 Accepted with one
result per operation. Each accepted operation becomes a command carrying the
batch’s batch_id, delivered to the manufacturer asynchronously. Follow it like
any other command.
Whole-batch errors (400): invalid JSON, schema violations, more than 1,000
operations, or two operations targeting the same battery over overlapping
windows.
Per-operation errors: unknown battery, command not applicable to that
battery, invalid time window. Only that operation is rejected; the others
proceed.
Batches are not atomic: there is no rollback if some commands fail later.
{
"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/idempotency-key-in-use",
"title": "Idempotency key in use",
"status": 409,
"code": "idempotency_key_in_use",
"detail": "Retry once the original request has completed."
}
{
"type": "https://api.kapa.energy/problems/energy-out-of-range",
"title": "Energy out of range",
"status": 422,
"code": "energy_out_of_range",
"detail": "max_wh (15000) exceeds the usable capacity of this battery (13000 Wh).",
"invalid_params": [
{
"name": "max_wh",
"reason": "exceeds usable_capacity_wh"
}
]
}
Unique value identifying this request (a UUID is recommended). Reuse the same
key and the same body when retrying. See Idempotency in the API description.
{"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/batches/send-a-batch-of-commands","slug":"/api-reference/batches/send-a-batch-of-commands","pageMetadata":{"title":"Send a batch of commands","description":"Sends up to 1,000 commands, to one or many batteries, in a single request. Each\noperation takes the same parameters as the matching single-battery endpoint,\nplus `id` (the battery) and `action`. In a batch, `start` and `end` are required\nfor every operation. A battery can appear in several operations if their\nwindows do not overlap.\n\nKapa validates every operation immediately and returns `202 Accepted` with one\nresult per operation. Each accepted operation becomes a command carrying the\nbatch's `batch_id`, delivered to the manufacturer asynchronously. Follow it like\nany other command.\n\n- **Whole-batch errors (400):** invalid JSON, schema violations, more than 1,000\n operations, or two operations targeting the same battery over overlapping\n windows.\n- **Per-operation errors:** unknown battery, command not applicable to that\n battery, invalid time window. Only that operation is rejected; the others\n proceed.\n\nBatches are not atomic: there is no rollback if some commands fail later.\n","deprecated":null,"version":null,"openapi":"/openapi.yaml post /bat/v1/batches","href":"/api-reference/batches/send-a-batch-of-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 li: \"li\",\n p: \"p\",\n strong: \"strong\",\n ul: \"ul\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_Fragment, {\n children: [_jsxs(_components.p, {\n children: [\"Sends up to 1,000 commands, to one or many batteries, in a single request. Each\\noperation takes the same parameters as the matching single-battery endpoint,\\nplus \", _jsx(_components.code, {\n children: \"id\"\n }), \" (the battery) and \", _jsx(_components.code, {\n children: \"action\"\n }), \". In a batch, \", _jsx(_components.code, {\n children: \"start\"\n }), \" and \", _jsx(_components.code, {\n children: \"end\"\n }), \" are required\\nfor every operation. A battery can appear in several operations if their\\nwindows do not overlap.\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Kapa validates every operation immediately and returns \", _jsx(_components.code, {\n children: \"202 Accepted\"\n }), \" with one\\nresult per operation. Each accepted operation becomes a command carrying the\\nbatch’s \", _jsx(_components.code, {\n children: \"batch_id\"\n }), \", delivered to the manufacturer asynchronously. Follow it like\\nany other command.\"]\n }), \"\\n\", _jsxs(_components.ul, {\n children: [\"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.strong, {\n children: \"Whole-batch errors (400):\"\n }), \" invalid JSON, schema violations, more than 1,000\\noperations, or two operations targeting the same battery over overlapping\\nwindows.\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.strong, {\n children: \"Per-operation errors:\"\n }), \" unknown battery, command not applicable to that\\nbattery, invalid time window. Only that operation is rejected; the others\\nproceed.\"]\n }), \"\\n\"]\n }), \"\\n\", _jsx(_components.p, {\n children: \"Batches are not atomic: there is no rollback if some commands fail later.\"\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":"Send a batch of commands","description":"Sends up to 1,000 commands, to one or many batteries, in a single request. Each\noperation takes the same parameters as the matching single-battery endpoint,\nplus `id` (the battery) and `action`. In a batch, `start` and `end` are required\nfor every operation. A battery can appear in several operations if their\nwindows do not overlap.\n\nKapa validates every operation immediately and returns `202 Accepted` with one\nresult per operation. Each accepted operation becomes a command carrying the\nbatch's `batch_id`, delivered to the manufacturer asynchronously. Follow it like\nany other command.\n\n- **Whole-batch errors (400):** invalid JSON, schema violations, more than 1,000\n operations, or two operations targeting the same battery over overlapping\n windows.\n- **Per-operation errors:** unknown battery, command not applicable to that\n battery, invalid time window. Only that operation is rejected; the others\n proceed.\n\nBatches are not atomic: there is no rollback if some commands fail later.\n","deprecated":null,"version":null,"openapi":"/openapi.yaml post /bat/v1/batches","href":"/api-reference/batches/send-a-batch-of-commands","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"tags":["Batches"],"operationId":"createBatch","summary":"Send a batch of commands","description":"Sends up to 1,000 commands, to one or many batteries, in a single request. Each\noperation takes the same parameters as the matching single-battery endpoint,\nplus `id` (the battery) and `action`. In a batch, `start` and `end` are required\nfor every operation. A battery can appear in several operations if their\nwindows do not overlap.\n\nKapa validates every operation immediately and returns `202 Accepted` with one\nresult per operation. Each accepted operation becomes a command carrying the\nbatch's `batch_id`, delivered to the manufacturer asynchronously. Follow it like\nany other command.\n\n- **Whole-batch errors (400):** invalid JSON, schema violations, more than 1,000\n operations, or two operations targeting the same battery over overlapping\n windows.\n- **Per-operation errors:** unknown battery, command not applicable to that\n battery, invalid time window. Only that operation is rejected; the others\n proceed.\n\nBatches are not atomic: there is no rollback if some commands fail later.\n","parameters":["37de3f92-5489-41ca-988c-2d36fc672c32"],"requestBody":"722c475c-6abc-4438-b070-e0fd83abb017","responses":{"202":"6f3a2566-10f4-4ba6-a614-1ee550201ce3","400":"aef0958d-dc95-4580-bc80-7b3dfddec828","401":"82d28510-6e85-43f5-b853-b2d2c9657937","409":"ce61d103-0f45-4a7c-92da-659602eda5ec","422":"a46977f2-05f2-4666-b4a5-12ed26071a50"},"method":"post","type":"path","servers":["2b930e37-df3c-4ce7-8c09-1e5db810139c"],"security":["c2e4e0f7-3540-4425-897d-7de72a89b5df"],"path":"/bat/v1/batches","baseUrlOptions":["https://api.kapa.energy"],"title":"Send a batch of commands","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{"37de3f92-5489-41ca-988c-2d36fc672c32":{"name":"Idempotency-Key","in":"header","required":false,"description":"Unique value identifying this request (a UUID is recommended). Reuse the same\nkey and the same body when retrying. See Idempotency in the API description.\n","schema":{"type":"string","maxLength":255,"isRequired":false,"description":"Unique value identifying this request (a UUID is recommended). Reuse the same\nkey and the same body when retrying. See Idempotency in the API description.\n","uniqueKey":"","typeLabel":"string"},"example":"7c1e4a90-5b2d-4f8e-9a31-0d6c2e8b1f47"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["operations"],"properties":{"operations":{"type":"array","minItems":1,"maxItems":1000,"items":{"oneOf":[{"type":"object","required":["id","action","start","end"],"properties":{"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":"Start of the command (inclusive).","examples":["2026-11-12T18:00:00Z"],"isRequired":true,"uniqueKey":"operations.items.[INDEX].oneOf.0.start","typeLabel":"string\u003cdate-time>"},"end":{"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 of the command (exclusive). Must be after `start` and in the future.","examples":["2026-11-12T18:00:00Z"],"isRequired":true,"uniqueKey":"operations.items.[INDEX].oneOf.0.end","typeLabel":"string\u003cdate-time>"},"id":{"type":"string","description":"Battery identifier.","isRequired":true,"uniqueKey":"operations.items.[INDEX].oneOf.0.id","typeLabel":"string"},"action":{"type":"string","const":"charge","isRequired":true,"uniqueKey":"operations.items.[INDEX].oneOf.0.action","typeLabel":"string"},"allow_import":{"type":"boolean","default":true,"description":"If true, the battery may charge from the grid. If false, it only charges from\non-site production (PV surplus).\n","uniqueKey":"operations.items.[INDEX].oneOf.0.allow_import","typeLabel":"boolean"},"max_wh":{"oneOf":[{"type":"integer","minimum":0,"description":"Stored energy level, in Wh, at which charging stops. Must not exceed\n`usable_capacity_wh`. Omitted or null means up to the full usable capacity.\n","uniqueKey":"operations.items.[INDEX].oneOf.0.max_wh.oneOf.0","typeLabel":"integer"},{"type":"null","minimum":0,"description":"Stored energy level, in Wh, at which charging stops. Must not exceed\n`usable_capacity_wh`. Omitted or null means up to the full usable capacity.\n","uniqueKey":"operations.items.[INDEX].oneOf.0.max_wh.oneOf.1","typeLabel":"null"}],"uniqueKey":"operations.items.[INDEX].oneOf.0.max_wh","typeLabel":"integer | null"}},"uniqueKey":"operations.items.[INDEX].oneOf.0","typeLabel":"object"},{"type":"object","required":["id","action","start","end"],"properties":{"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":"Start of the command (inclusive).","examples":["2026-11-12T18:00:00Z"],"isRequired":true,"uniqueKey":"operations.items.[INDEX].oneOf.1.start","typeLabel":"string\u003cdate-time>"},"end":{"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 of the command (exclusive). Must be after `start` and in the future.","examples":["2026-11-12T18:00:00Z"],"isRequired":true,"uniqueKey":"operations.items.[INDEX].oneOf.1.end","typeLabel":"string\u003cdate-time>"},"id":{"type":"string","description":"Battery identifier.","isRequired":true,"uniqueKey":"operations.items.[INDEX].oneOf.1.id","typeLabel":"string"},"action":{"type":"string","const":"discharge","isRequired":true,"uniqueKey":"operations.items.[INDEX].oneOf.1.action","typeLabel":"string"},"min_wh":{"oneOf":[{"type":"integer","minimum":0,"description":"Stored energy level, in Wh, at which discharging stops. Omitted or null means\ndown to the lowest level the manufacturer allows.\n","uniqueKey":"operations.items.[INDEX].oneOf.1.min_wh.oneOf.0","typeLabel":"integer"},{"type":"null","minimum":0,"description":"Stored energy level, in Wh, at which discharging stops. Omitted or null means\ndown to the lowest level the manufacturer allows.\n","uniqueKey":"operations.items.[INDEX].oneOf.1.min_wh.oneOf.1","typeLabel":"null"}],"uniqueKey":"operations.items.[INDEX].oneOf.1.min_wh","typeLabel":"integer | null"},"max_wh":{"oneOf":[{"type":"integer","minimum":0,"description":"**To be confirmed.** The meaning of this parameter for a discharge is not defined yet.","uniqueKey":"operations.items.[INDEX].oneOf.1.max_wh.oneOf.0","typeLabel":"integer"},{"type":"null","minimum":0,"description":"**To be confirmed.** The meaning of this parameter for a discharge is not defined yet.","uniqueKey":"operations.items.[INDEX].oneOf.1.max_wh.oneOf.1","typeLabel":"null"}],"uniqueKey":"operations.items.[INDEX].oneOf.1.max_wh","typeLabel":"integer | null"}},"uniqueKey":"operations.items.[INDEX].oneOf.1","typeLabel":"object"},{"type":"object","required":["id","action","start","end"],"properties":{"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":"Start of the command (inclusive).","examples":["2026-11-12T18:00:00Z"],"isRequired":true,"uniqueKey":"operations.items.[INDEX].oneOf.2.start","typeLabel":"string\u003cdate-time>"},"end":{"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 of the command (exclusive). Must be after `start` and in the future.","examples":["2026-11-12T18:00:00Z"],"isRequired":true,"uniqueKey":"operations.items.[INDEX].oneOf.2.end","typeLabel":"string\u003cdate-time>"},"id":{"type":"string","description":"Battery identifier.","isRequired":true,"uniqueKey":"operations.items.[INDEX].oneOf.2.id","typeLabel":"string"},"action":{"type":"string","const":"autoconsume","isRequired":true,"uniqueKey":"operations.items.[INDEX].oneOf.2.action","typeLabel":"string"},"min_wh":{"oneOf":[{"type":"integer","minimum":0,"description":"Lowest stored energy level, in Wh. Below it, the battery stops discharging to\ncover site consumption. Omitted or null means the lowest level the\nmanufacturer allows.\n","uniqueKey":"operations.items.[INDEX].oneOf.2.min_wh.oneOf.0","typeLabel":"integer"},{"type":"null","minimum":0,"description":"Lowest stored energy level, in Wh. Below it, the battery stops discharging to\ncover site consumption. Omitted or null means the lowest level the\nmanufacturer allows.\n","uniqueKey":"operations.items.[INDEX].oneOf.2.min_wh.oneOf.1","typeLabel":"null"}],"uniqueKey":"operations.items.[INDEX].oneOf.2.min_wh","typeLabel":"integer | null"},"max_wh":{"oneOf":[{"type":"integer","minimum":0,"description":"Highest stored energy level, in Wh. Above it, the battery stops charging from\non-site production. Must be greater than or equal to `min_wh` and must not\nexceed `usable_capacity_wh`. Omitted or null means the full usable capacity.\n","uniqueKey":"operations.items.[INDEX].oneOf.2.max_wh.oneOf.0","typeLabel":"integer"},{"type":"null","minimum":0,"description":"Highest stored energy level, in Wh. Above it, the battery stops charging from\non-site production. Must be greater than or equal to `min_wh` and must not\nexceed `usable_capacity_wh`. Omitted or null means the full usable capacity.\n","uniqueKey":"operations.items.[INDEX].oneOf.2.max_wh.oneOf.1","typeLabel":"null"}],"uniqueKey":"operations.items.[INDEX].oneOf.2.max_wh","typeLabel":"integer | null"}},"uniqueKey":"operations.items.[INDEX].oneOf.2","typeLabel":"object"},{"type":"object","required":["id","action","start","end"],"properties":{"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":"Start of the command (inclusive).","examples":["2026-11-12T18:00:00Z"],"isRequired":true,"uniqueKey":"operations.items.[INDEX].oneOf.3.start","typeLabel":"string\u003cdate-time>"},"end":{"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 of the command (exclusive). Must be after `start` and in the future.","examples":["2026-11-12T18:00:00Z"],"isRequired":true,"uniqueKey":"operations.items.[INDEX].oneOf.3.end","typeLabel":"string\u003cdate-time>"},"id":{"type":"string","description":"Battery identifier.","isRequired":true,"uniqueKey":"operations.items.[INDEX].oneOf.3.id","typeLabel":"string"},"action":{"type":"string","const":"idle","isRequired":true,"uniqueKey":"operations.items.[INDEX].oneOf.3.action","typeLabel":"string"}},"uniqueKey":"operations.items.[INDEX].oneOf.3","typeLabel":"object"}],"uniqueKey":"operations.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"operations","typeLabel":"object[]"}},"additionalProperties":false,"uniqueKey":"","typeLabel":"object"},"example":{"operations":[{"id":"bat_1","action":"charge","start":"2026-11-12T13:00:00Z","end":"2026-11-12T15:00:00Z","allow_import":true,"max_wh":12000},{"id":"bat_2","action":"discharge","start":"2026-11-12T18:00:00Z","end":"2026-11-12T19:00:00Z","min_wh":1500},{"id":"bat_3","action":"idle","start":"2026-11-12T18:00:00Z","end":"2026-11-12T20:00:00Z"}]},"examples":{"Example":{"title":"Example","value":{"operations":[{"id":"bat_1","action":"charge","start":"2026-11-12T13:00:00Z","end":"2026-11-12T15:00:00Z","allow_import":true,"max_wh":12000},{"id":"bat_2","action":"discharge","start":"2026-11-12T18:00:00Z","end":"2026-11-12T19:00:00Z","min_wh":1500},{"id":"bat_3","action":"idle","start":"2026-11-12T18:00:00Z","end":"2026-11-12T20:00:00Z"}]}}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"6f3a2566-10f4-4ba6-a614-1ee550201ce3":{"description":"Batch validated. One result per operation, in request order.","content":{"application/json":{"schema":{"type":"object","required":["batch_id","summary","results"],"properties":{"batch_id":{"type":"string","description":"Batch identifier, also set on every command the batch created.","isRequired":true,"uniqueKey":"batch_id","typeLabel":"string"},"summary":{"type":"object","required":["total","accepted","rejected"],"properties":{"total":{"type":"integer","minimum":0,"isRequired":true,"uniqueKey":"summary.total","typeLabel":"integer"},"accepted":{"type":"integer","minimum":0,"isRequired":true,"uniqueKey":"summary.accepted","typeLabel":"integer"},"rejected":{"type":"integer","minimum":0,"isRequired":true,"uniqueKey":"summary.rejected","typeLabel":"integer"}},"isRequired":true,"uniqueKey":"summary","typeLabel":"object"},"results":{"type":"array","description":"One result per operation, in request order.","items":{"type":"object","required":["index","id","status","command_id","error"],"properties":{"index":{"type":"integer","minimum":0,"description":"Position of the operation in the request.","isRequired":true,"uniqueKey":"results.items.[INDEX].index","typeLabel":"integer"},"id":{"type":"string","description":"Battery identifier.","isRequired":true,"uniqueKey":"results.items.[INDEX].id","typeLabel":"string"},"status":{"type":"string","enum":["accepted","rejected"],"description":"`accepted` means the operation passed validation and became a command; it\ndoes not mean the command was applied yet.\n","isRequired":true,"uniqueKey":"results.items.[INDEX].status","typeLabel":"enum\u003cstring>"},"command_id":{"oneOf":[{"type":"string","description":"Identifier of the created command. Null if rejected.","isRequired":true,"uniqueKey":"results.items.[INDEX].command_id.oneOf.0","typeLabel":"string"},{"type":"null","description":"Identifier of the created command. Null if rejected.","isRequired":true,"uniqueKey":"results.items.[INDEX].command_id.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"results.items.[INDEX].command_id","typeLabel":"string | null"},"error":{"oneOf":[{"type":"object","description":"Reason for rejection. Null if accepted.","required":["type","title","status","code"],"properties":{"type":{"type":"string","format":"uri-reference","description":"URI identifying the problem type.","isRequired":true,"uniqueKey":"results.items.[INDEX].error.oneOf.0.type","typeLabel":"string\u003curi-reference>"},"title":{"type":"string","description":"Short, human-readable summary of the problem type.","isRequired":true,"uniqueKey":"results.items.[INDEX].error.oneOf.0.title","typeLabel":"string"},"status":{"type":"integer","description":"HTTP status code.","isRequired":true,"uniqueKey":"results.items.[INDEX].error.oneOf.0.status","typeLabel":"integer"},"code":{"type":"string","description":"Stable, machine-readable error code. See Errors in the API description.","isRequired":true,"uniqueKey":"results.items.[INDEX].error.oneOf.0.code","typeLabel":"string"},"detail":{"type":"string","description":"Human-readable explanation specific to this occurrence.","uniqueKey":"results.items.[INDEX].error.oneOf.0.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":"results.items.[INDEX].error.oneOf.0.invalid_params.items.[INDEX].name","typeLabel":"string"},"reason":{"type":"string","isRequired":true,"uniqueKey":"results.items.[INDEX].error.oneOf.0.invalid_params.items.[INDEX].reason","typeLabel":"string"}},"uniqueKey":"results.items.[INDEX].error.oneOf.0.invalid_params.items.[INDEX]","typeLabel":"object"},"uniqueKey":"results.items.[INDEX].error.oneOf.0.invalid_params","typeLabel":"object[]"}},"isRequired":true,"uniqueKey":"results.items.[INDEX].error.oneOf.0","typeLabel":"object"},{"type":"null","description":"Reason for rejection. Null if accepted.","isRequired":true,"uniqueKey":"results.items.[INDEX].error.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"results.items.[INDEX].error","typeLabel":"object | null"}},"uniqueKey":"results.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"results","typeLabel":"object[]"}},"uniqueKey":"","typeLabel":"object"},"example":{"batch_id":"bch_81","summary":{"total":3,"accepted":2,"rejected":1},"results":[{"index":0,"id":"bat_1","status":"accepted","command_id":"cmd_701","error":null},{"index":1,"id":"bat_2","status":"accepted","command_id":"cmd_702","error":null},{"index":2,"id":"bat_3","status":"rejected","command_id":null,"error":{"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_3 is accessible to this client."}}]},"examples":{"Example":{"title":"Example","value":{"batch_id":"bch_81","summary":{"total":3,"accepted":2,"rejected":1},"results":[{"index":0,"id":"bat_1","status":"accepted","command_id":"cmd_701","error":null},{"index":1,"id":"bat_2","status":"accepted","command_id":"cmd_702","error":null},{"index":2,"id":"bat_3","status":"rejected","command_id":null,"error":{"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_3 is accessible to this client."}}]}}},"exampleType":"examples"}},"exampleType":"examples"},"aef0958d-dc95-4580-bc80-7b3dfddec828":{"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"},"82d28510-6e85-43f5-b853-b2d2c9657937":{"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"},"ce61d103-0f45-4a7c-92da-659602eda5ec":{"description":"A request with the same Idempotency-Key is still being processed.","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/idempotency-key-in-use","title":"Idempotency key in use","status":409,"code":"idempotency_key_in_use","detail":"Retry once the original request has completed."},"examples":{"Example":{"title":"Example","value":{"type":"https://api.kapa.energy/problems/idempotency-key-in-use","title":"Idempotency key in use","status":409,"code":"idempotency_key_in_use","detail":"Retry once the original request has completed."}}},"exampleType":"examples"}},"exampleType":"examples"},"a46977f2-05f2-4666-b4a5-12ed26071a50":{"description":"The request is valid but cannot be applied to this battery\n(`action_not_supported`, `energy_out_of_range`), or the Idempotency-Key was\nalready used with a different body (`idempotency_key_reused`).\n","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/energy-out-of-range","title":"Energy out of range","status":422,"code":"energy_out_of_range","detail":"max_wh (15000) exceeds the usable capacity of this battery (13000 Wh).","invalid_params":[{"name":"max_wh","reason":"exceeds usable_capacity_wh"}]},"examples":{"Example":{"title":"Example","value":{"type":"https://api.kapa.energy/problems/energy-out-of-range","title":"Energy out of range","status":422,"code":"energy_out_of_range","detail":"max_wh (15000) exceeds the usable capacity of this battery (13000 Wh).","invalid_params":[{"name":"max_wh","reason":"exceeds usable_capacity_wh"}]}}},"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":"Send a batch of commands - Kapa Energy Battery API","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-12T17:40:42.753Z","originalFileLocation":"api-reference/batches/send-a-batch-of-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=\"Sends up to 1,000 commands, to one or many batteries, in a single request. Each operation takes the same parameters as the matching single-battery endpoint, plus id (the battery) and action. In a batch, start and end are required for every operation. A battery can appear in several operations if their windows do not overlap. Kapa validates every operation immediately and returns 202 Accepted with one result per operation. Each accepted operation becomes a command carrying the batch\u0026#x27;s batch_id, delivered to the manufacturer asynchronously. Follow it like any other command. - Whole-batch errors (400): invalid JSON, schema violations, more than 1,000 operations, or two operations targeting the same battery over overlapping windows. - Per-operation errors: unknown battery, command not applicable to that battery, invalid time window. Only that operation is rejected; the others proceed. Batches are not atomic: there is no rollback if some commands fail later.\">\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=\"Send a batch of commands - Kapa Energy Battery API\">\u003cmeta data-mint-head property=\"og:description\" content=\"Sends up to 1,000 commands, to one or many batteries, in a single request. Each operation takes the same parameters as the matching single-battery endpoint, plus id (the battery) and action. In a batch, start and end are required for every operation. A battery can appear in several operations if their windows do not overlap. Kapa validates every operation immediately and returns 202 Accepted with one result per operation. Each accepted operation becomes a command carrying the batch\u0026#x27;s batch_id, delivered to the manufacturer asynchronously. Follow it like any other command. - Whole-batch errors (400): invalid JSON, schema violations, more than 1,000 operations, or two operations targeting the same battery over overlapping windows. - Per-operation errors: unknown battery, command not applicable to that battery, invalid time window. Only that operation is rejected; the others proceed. Batches are not atomic: there is no rollback if some commands fail later.\">\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/batches/send-a-batch-of-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=Batches\u0026amp;title=Send+a+batch+of+commands\u0026amp;description=Sends+up+to+1%2C000+commands%2C+to+one+or+many+batteries%2C+in+a+single+request.+Each%0Aoperation+takes+the+same+parameters+as+the+matching+single-battery+endpoint%2C%0Aplu\u0026amp;theme=be394bdd824f66fd2549706a\u0026amp;signature=94abd5d1253c307f48f2b23cbf62b9ff3d119fc0f3c8aaf817ea637aee69eaca\">\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=\"Send a batch of commands - Kapa Energy Battery API\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Sends up to 1,000 commands, to one or many batteries, in a single request. Each operation takes the same parameters as the matching single-battery endpoint, plus id (the battery) and action. In a batch, start and end are required for every operation. A battery can appear in several operations if their windows do not overlap. Kapa validates every operation immediately and returns 202 Accepted with one result per operation. Each accepted operation becomes a command carrying the batch\u0026#x27;s batch_id, delivered to the manufacturer asynchronously. Follow it like any other command. - Whole-batch errors (400): invalid JSON, schema violations, more than 1,000 operations, or two operations targeting the same battery over overlapping windows. - Per-operation errors: unknown battery, command not applicable to that battery, invalid time window. Only that operation is rejected; the others proceed. Batches are not atomic: there is no rollback if some commands fail later.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://kapa-energy.mintlify.site/_mintlify/api/og/v2?division=Batches\u0026amp;title=Send+a+batch+of+commands\u0026amp;description=Sends+up+to+1%2C000+commands%2C+to+one+or+many+batteries%2C+in+a+single+request.+Each%0Aoperation+takes+the+same+parameters+as+the+matching+single-battery+endpoint%2C%0Aplu\u0026amp;theme=be394bdd824f66fd2549706a\u0026amp;signature=94abd5d1253c307f48f2b23cbf62b9ff3d119fc0f3c8aaf817ea637aee69eaca\">\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/batches/send-a-batch-of-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/batches/send-a-batch-of-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/batches/send-a-batch-of-commands#webpage\",\"url\":\"https://kapa-energy.mintlify.app/api-reference/batches/send-a-batch-of-commands\",\"name\":\"Send a batch of commands\",\"description\":\"Sends up to 1,000 commands, to one or many batteries, in a single request. Each operation takes the same parameters as the matching single-battery endpoint, plus id (the battery) and action. In a batch, start and end are required for every operation. A battery can appear in several operations if their windows do not overlap. Kapa validates every operation immediately and returns 202 Accepted with one result per operation. Each accepted operation becomes a command carrying the batch's batch_id, delivered to the manufacturer asynchronously. Follow it like any other command. - Whole-batch errors (400): invalid JSON, schema violations, more than 1,000 operations, or two operations targeting the same battery over overlapping windows. - Per-operation errors: unknown battery, command not applicable to that battery, invalid time window. Only that operation is rejected; the others proceed. Batches are not atomic: there is no rollback if some commands fail later.\",\"dateModified\":\"2026-11-12T17:40:42.753Z\",\"isPartOf\":{\"@id\":\"https://kapa-energy.mintlify.app#website\"},\"breadcrumb\":{\"@id\":\"https://kapa-energy.mintlify.app/api-reference/batches/send-a-batch-of-commands#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://kapa-energy.mintlify.app/api-reference/batches/send-a-batch-of-commands#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Kapa Energy Battery API\",\"item\":\"https://kapa-energy.mintlify.app\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Send a batch of commands\",\"item\":\"https://kapa-energy.mintlify.app/api-reference/batches/send-a-batch-of-commands\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://kapa-energy.mintlify.app/api-reference/batches/send-a-batch-of-commands#apireference\",\"headline\":\"Send a batch of commands\",\"name\":\"Send a batch of commands\",\"description\":\"Sends up to 1,000 commands, to one or many batteries, in a single request. Each operation takes the same parameters as the matching single-battery endpoint, plus id (the battery) and action. In a batch, start and end are required for every operation. A battery can appear in several operations if their windows do not overlap. Kapa validates every operation immediately and returns 202 Accepted with one result per operation. Each accepted operation becomes a command carrying the batch's batch_id, delivered to the manufacturer asynchronously. Follow it like any other command. - Whole-batch errors (400): invalid JSON, schema violations, more than 1,000 operations, or two operations targeting the same battery over overlapping windows. - Per-operation errors: unknown battery, command not applicable to that battery, invalid time window. Only that operation is rejected; the others proceed. Batches are not atomic: there is no rollback if some commands fail later.\",\"url\":\"https://kapa-energy.mintlify.app/api-reference/batches/send-a-batch-of-commands\",\"mainEntityOfPage\":{\"@id\":\"https://kapa-energy.mintlify.app/api-reference/batches/send-a-batch-of-commands#webpage\"},\"dateModified\":\"2026-11-12T17:40:42.753Z\",\"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/batches/send-a-batch-of-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","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","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","description":"Sent when Kapa retrieves new measurements from manufacturers' clouds. One\ndelivery can carry points for several batteries. A missed delivery can be\nrecovered with `GET /bat/v1/{id}/telemetry`.\n","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":"Send a batch of 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"]}