For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Dashboard
DocsAPI Reference
Dashboard
LogoLogo
DocsAPI Reference
  • OCPPLAB Gateway API
        • POSTProxy OCPP message
        • POSTSet charger configuration
        • POSTReset authorization cache
        • POSTSend local authorization list
        • POSTClear local authorization list
        • POSTInject fault
        • POSTClear fault
        • POSTPlug connector
        • POSTUnplug connector
        • POSTUnlock connector
        • POSTStart transaction
        • POSTStop transaction
        • POSTStart session
        • POSTStop session
        • POSTAuthorize ID tag
        • POSTEV requests energy
        • POSTEV stops energy
        • POSTPower update
OCPPLAB Gateway APICharger OperationsCommands

Stop session

||View as Markdown|
POST
https://host.com/ocpp/commands/stop-session
POST
/ocpp/commands/stop-session
1import requests
2
3url = "https://host.com/ocpp/commands/stop-session"
4
5payload = {
6 "target": { "charger_id": "dep-789" },
7 "event": { "connector_id": 2 }
8}
9headers = {
10 "Authorization": "Bearer <token>",
11 "Content-Type": "application/json"
12}
13
14response = requests.post(url, json=payload, headers=headers)
15
16print(response.json())
1{
2 "targeted_count": 1,
3 "queued_count": 1,
4 "failed_count": 0,
5 "results": [
6 {
7 "charger_id": "dep-789",
8 "identity": "CP-CHARGER-789",
9 "command": {
10 "id": "f4e5d6c7b8a9",
11 "event_type": "stop_session",
12 "ocpp_version": "ocpp1.6",
13 "payload": {
14 "connector_id": 2
15 }
16 }
17 }
18 ],
19 "failed": []
20}

Trigger a full auto-stop sequence: stop the active transaction then unplug the connector. Targets a single charger, selected chargers in a location, or all chargers in a location.

Was this page helpful?
Previous

Start session

Next

Authorize ID tag

Built with

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Request

This endpoint expects an object.
targetobjectRequired

Target for a unified command.

Provide exactly one of charger_id or location_id. charger_ids is an optional subset filter — only valid with location_id.

Examples::

{“charger_id”: “dep-123”} {“location_id”: “loc-456”} {“location_id”: “loc-456”, “charger_ids”: [“dep-1”, “dep-2”]}

eventobjectRequired

Command payload for stop-session.

Response

Command accepted and queued for the target charger(s)

targeted_countinteger
queued_countinteger
failed_countinteger
resultslist of objects
failedlist of objects

Errors

401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
422
Unprocessable Entity Error
500
Internal Server Error