- Reference
- OCPI 2.1.1 (CPO)
- Start CPO Session Command
OpenAPI reference
Start CPO Session Command
/commands/START_SESSIONOCPI 2.1.1 CPO Commands interface endpoint for POST /commands/START_SESSION. The eMSP requests the CPO to forward a START_SESSION command to the charge point. The immediate response indicates whether
API: OCPI 2.1.1 (CPO) · Module: Commands (CPO)
Base path:/commands· Base URL:https://ocpi-api.gridos.co/ocpi/cpo/2.1.1
Overview
POST /commands/START_SESSIONAbsolute URL: https://ocpi-api.gridos.co/ocpi/cpo/2.1.1/commands/START_SESSION
OCPI 2.1.1 CPO Commands interface endpoint for POST /commands/START_SESSION. The eMSP requests the CPO to forward a START_SESSION command to the charge point. The immediate response indicates whether the CPO accepted the request for delivery. The final command result 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.1.1/commands/START_SESSION' \
-H "Authorization: Token $OCPI_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"response_url":"https://example.com/ocpi/emsp/2.1.1/commands/START_SESSION/1234","token":{"uid":"100012","type":"RFID","auth_id":"FA54320","visual_number":"DF000-2001-8999","issuer":"TheNewMotion","valid":true,"whitelist":"ALWAYS","last_updated":"2015-06-21T22:39:05Z"},"location_id":"LOC1"}'Request
Request body
application/json · Required
Schema: StartSession
| Field | Type | Required | Description |
|---|---|---|---|
response_url | string | Yes | — |
token | CommandToken | Yes | OCPI 2.1.1 Token object as embedded in command requests. |
location_id | string | Yes | — |
evse_uid | string | No | — |
Request examples
Example 1
{
"response_url": "https://example.com/ocpi/emsp/2.1.1/commands/START_SESSION/1234",
"token": {
"uid": "100012",
"type": "RFID",
"auth_id": "FA54320",
"visual_number": "DF000-2001-8999",
"issuer": "TheNewMotion",
"valid": true,
"whitelist": "ALWAYS",
"last_updated": "2015-06-21T22:39:05Z"
},
"location_id": "LOC1"
}Example 2
{
"response_url": "https://example.com/ocpi/emsp/2.1.1/commands/START_SESSION/5678",
"token": {
"uid": "APP-USER-01",
"type": "OTHER",
"auth_id": "EMP-7788",
"issuer": "Example eMSP",
"valid": true,
"whitelist": "ALLOWED",
"last_updated": "2015-06-22T07:30:00Z"
},
"location_id": "LOC2",
"evse_uid": "EVSE-22"
}Responses
| Status | Description | Schema |
|---|---|---|
200 | Successful Response | CommandResponseEnvelope |
400 | Invalid or missing parameters (HTTP 200, OCPI envelope) | — |
401 | Unauthorized | — |
422 | Validation Error | HTTPValidationError |
200 — successful response
application/json
Schema: CommandResponseEnvelope
| Field | Type | Required | Description |
|---|---|---|---|
status_code | integer | No | Default: 1000 |
status_message | string | No | — |
timestamp | string (date-time) | No | — |
data | CommandResponse | No | CommandResponse |
Response example
{
"status_code": 1000,
"status_message": "Success",
"timestamp": "2015-06-29T22:39:09Z",
"data": {
"result": "ACCEPTED"
}
}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": 2000,
"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.1.1/commands/START_SESSION' \
-H "Authorization: Token $OCPI_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"response_url":"https://example.com/ocpi/emsp/2.1.1/commands/START_SESSION/1234","token":{"uid":"100012","type":"RFID","auth_id":"FA54320","visual_number":"DF000-2001-8999","issuer":"TheNewMotion","valid":true,"whitelist":"ALWAYS","last_updated":"2015-06-21T22:39:05Z"},"location_id":"LOC1"}'