- Reference
- OCPI 2.2.1 (CPO)
- Start Session Command
OpenAPI reference
Start Session Command
/commands/START_SESSIONOCPI 2.2.1 Receiver interface endpoint for POST /commands/START_SESSION. The Sender requests the CPO to forward a START_SESSION command to a charge point. The immediate response only confirms whether
API: OCPI 2.2.1 (CPO) · Module: Commands (CPO)
Base path:/commands· Base URL:https://ocpi-api.gridos.co/ocpi/cpo/2.2.1
Overview
POST /commands/START_SESSIONAbsolute URL: https://ocpi-api.gridos.co/ocpi/cpo/2.2.1/commands/START_SESSION
OCPI 2.2.1 Receiver interface endpoint for POST /commands/START_SESSION. The Sender requests the CPO to forward a START_SESSION command to a charge point. The immediate response only confirms whether the CPO accepted the request for delivery. The final charge point outcome is returned asynchronously to the supplied response_url.
Requires authentication. Use Authorization: Token <token>. See OCPI credentials.
How to call
Quick Shell sample (set OCPI_TOKEN when auth is required). Full Python and TypeScript under Examples.
curl -sS -X POST 'https://ocpi-api.gridos.co/ocpi/cpo/2.2.1/commands/START_SESSION' \
-H "Authorization: Token $OCPI_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"response_url":"https://example.com/ocpi/emsp/2.2.1/commands/START_SESSION/cmd-start-rfid-001","token":{"country_code":"NL","party_id":"TNM","uid":"012345678905880","type":"RFID","contract_id":"NL-TNM-012345678905880-S","issuer":"MobilityPlus","valid":true,"whitelist":"ALWAYS","last_updated":"2024-01-15T10:00:00Z"},"location_id":"LOC-NL-TNM-001","evse_uid":"LOC-NL-TNM-001*E1","connector_id":"1","authorization_reference":"AUTH-REF-START-001"}'Request
Request body
application/json · Required
Schema: StartSession
| Field | Type | Required | Description |
|---|---|---|---|
response_url | string | Yes | — |
token | Token | Yes | Token |
location_id | string | Yes | — |
evse_uid | string | No | — |
connector_id | string | No | — |
authorization_reference | string | No | — |
Request example
{
"response_url": "https://example.com/ocpi/emsp/2.2.1/commands/START_SESSION/cmd-start-rfid-001",
"token": {
"country_code": "NL",
"party_id": "TNM",
"uid": "012345678905880",
"type": "RFID",
"contract_id": "NL-TNM-012345678905880-S",
"issuer": "MobilityPlus",
"valid": true,
"whitelist": "ALWAYS",
"last_updated": "2024-01-15T10:00:00Z"
},
"location_id": "LOC-NL-TNM-001",
"evse_uid": "LOC-NL-TNM-001*E1",
"connector_id": "1",
"authorization_reference": "AUTH-REF-START-001"
}Responses
| Status | Description | Schema |
|---|---|---|
200 | Successful Response | CommandResponse |
400 | Invalid or missing parameters (HTTP 200, OCPI envelope) | — |
401 | Unauthorized | — |
422 | Validation Error | HTTPValidationError |
200 — successful response
application/json
Schema: CommandResponse
| Field | Type | Required | Description |
|---|---|---|---|
status_code | integer | No | Default: 1000 |
status_message | string | No | — |
timestamp | string (date-time) | No | — |
data | CommandOut | No | CommandOut |
Response example
{
"status_code": 1000,
"status_message": "Success",
"timestamp": "2024-01-15T10:00:00Z",
"data": {
"message": [
{
"language": "en",
"text": "Command accepted"
}
],
"result": "ACCEPTED",
"timeout": 30
}
}400 — invalid or missing parameters (HTTP 200, OCPI envelope)
application/json
Response example
{
"status_code": 2001,
"status_message": "Invalid or missing parameters",
"timestamp": "2025-01-01T00:00:00Z",
"doc_url": "https://github.com/ocpplab/ocpi-gateway/blob/main/docs/errors.md#2001-invalid-parameters",
"errors": [
{
"field": "country_code",
"message": "expected 'NL' to match Token A identity",
"type": "value_error.identity_mismatch"
}
]
}401 — unauthorized
application/json
Response example
{
"status_code": 2001,
"status_message": "Unauthorized",
"timestamp": "2025-01-01T00:00:00Z"
}422 — validation error
application/json
Schema: HTTPValidationError
| Field | Type | Required | Description |
|---|---|---|---|
detail | ValidationError[] | No | Detail |
Response example
{
"detail": [
{
"loc": [],
"msg": "string",
"type": "string",
"input": {
"_type": "Input"
},
"ctx": {
"_type": "Context"
}
}
]
}Examples
Shell, Python, and TypeScript (set OCPI_TOKEN when auth is required).
curl -sS -X POST 'https://ocpi-api.gridos.co/ocpi/cpo/2.2.1/commands/START_SESSION' \
-H "Authorization: Token $OCPI_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"response_url":"https://example.com/ocpi/emsp/2.2.1/commands/START_SESSION/cmd-start-rfid-001","token":{"country_code":"NL","party_id":"TNM","uid":"012345678905880","type":"RFID","contract_id":"NL-TNM-012345678905880-S","issuer":"MobilityPlus","valid":true,"whitelist":"ALWAYS","last_updated":"2024-01-15T10:00:00Z"},"location_id":"LOC-NL-TNM-001","evse_uid":"LOC-NL-TNM-001*E1","connector_id":"1","authorization_reference":"AUTH-REF-START-001"}'