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

Start session

||View as Markdown|
POST
https://host.com/ocpp/commands/start-session
POST
/ocpp/commands/start-session
1import requests
2
3url = "https://host.com/ocpp/commands/start-session"
4
5payload = {
6 "target": { "charger_id": "dep-789" },
7 "event": {
8 "id_tag": "EV-USER-1234",
9 "connector_id": 2,
10 "duration_seconds": 900,
11 "target_energy_kwh": 15.5
12 }
13}
14headers = {
15 "Authorization": "Bearer <token>",
16 "Content-Type": "application/json"
17}
18
19response = requests.post(url, json=payload, headers=headers)
20
21print(response.json())
1{
2 "targeted_count": 1,
3 "queued_count": 1,
4 "failed_count": 0,
5 "results": [
6 {
7 "charger_id": "dep-123",
8 "identity": "CP-TEST-001",
9 "command": {
10 "id": "a1b2c3d4e5f6",
11 "event_type": "start_session",
12 "ocpp_version": "ocpp1.6",
13 "payload": {
14 "id_tag": "TAG-RFID-001",
15 "connector_id": 1
16 }
17 }
18 }
19 ],
20 "failed": []
21}

Trigger a full auto-start sequence: plug in, authorize with id_tag, and begin a transaction. duration_seconds sets a time limit after which the session stops automatically. target_energy_kwh sets an energy limit that triggers an auto-stop when reached. Targets a single charger, selected chargers in a location, or all chargers in a location.

Was this page helpful?
Previous

Stop transaction

Next

Stop session

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 start-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