- Reference
- OCPI 2.2.1 REST API
OpenAPI reference
OCPI 2.2.1 REST API
OCPI 2.2.1 module endpoints as exposed by a GridOS CPO or eMSP role. Generated reference for credentials, locations, sessions, CDRs, tariffs, tokens, and commands.
OCPI 2.2.1 module endpoints as exposed by a GridOS CPO or eMSP role. Generated reference for credentials, locations, sessions, CDRs, tariffs, tokens, and commands.
All modules and endpoints on this single page. Left rail jumps to # anchors.
Spec version: 2.2.1
Base URL: https://api.gridos.example/ocpi/2.2.1
Modules (left rail mirrors this list)
- Versions — base
/versions· 2 endpoints - Credentials — base
/credentials· 4 endpoints - Locations — base
/locations· 4 endpoints - Sessions —
GET /sessions - Cdrs —
GET /cdrs - Tariffs —
GET /tariffs - Tokens —
GET /tokens - Commands —
POST /commands/{command}
Versions
Version discovery
Base path: /versions
GET · list supported OCPI versions
GET /versionsAbsolute URL: https://api.gridos.example/ocpi/2.2.1/versions
Returns the list of OCPI versions this party supports.
How to call this endpoint
curl -sS -X GET 'https://api.gridos.example/ocpi/2.2.1/versions'Responses
| Status | Description | Schema |
|---|---|---|
200 | Version list with URLs | — |
200 — version list with URLs
No response body.
GET · version details
GET /versions/{version}Absolute URL: https://api.gridos.example/ocpi/2.2.1/versions/{version}
Returns module endpoints for a specific OCPI version.
How to call this endpoint
curl -sS -X GET 'https://api.gridos.example/ocpi/2.2.1/versions/2.2.1'Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
version | string | Yes | OCPI version identifier, e.g. 2.2.1 Example: 2.2.1 |
Responses
| Status | Description | Schema |
|---|---|---|
200 | Module endpoint map | — |
404 | Version not supported | — |
200 — module endpoint map
No response body.
404 — version not supported
No response body.
Credentials
Credentials handshake
Base path: /credentials
GET · credentials
GET /credentialsAbsolute URL: https://api.gridos.example/ocpi/2.2.1/credentials
Receiver returns the current credentials object for the caller.
How to call this endpoint
curl -sS -X GET 'https://api.gridos.example/ocpi/2.2.1/credentials'Header parameters
| Name | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes | Token A or Token C as Token <token> |
Responses
| Status | Description | Schema |
|---|---|---|
200 | Credentials object | — |
401 | Unauthorized | — |
200 — credentials object
No response body.
401 — unauthorized
No response body.
POST · register credentials
POST /credentialsAbsolute URL: https://api.gridos.example/ocpi/2.2.1/credentials
Sender posts credentials to complete the OCPI credentials handshake.
How to call this endpoint
curl -sS -X POST 'https://api.gridos.example/ocpi/2.2.1/credentials'Responses
| Status | Description | Schema |
|---|---|---|
200 | Registered credentials | — |
405 | Method not allowed if already registered | — |
200 — registered credentials
No response body.
405 — method not allowed if already registered
No response body.
PUT · update credentials
PUT /credentialsAbsolute URL: https://api.gridos.example/ocpi/2.2.1/credentials
Update tokens or business details for an existing credentials link.
How to call this endpoint
curl -sS -X PUT 'https://api.gridos.example/ocpi/2.2.1/credentials'Responses
| Status | Description | Schema |
|---|---|---|
200 | Updated credentials | — |
200 — updated credentials
No response body.
DELETE · credentials
DELETE /credentialsAbsolute URL: https://api.gridos.example/ocpi/2.2.1/credentials
Unregisters the credentials relationship between parties.
How to call this endpoint
curl -sS -X DELETE 'https://api.gridos.example/ocpi/2.2.1/credentials'Responses
| Status | Description | Schema |
|---|---|---|
200 | Credentials deleted | — |
200 — credentials deleted
No response body.
Locations
Locations module
Base path: /locations
GET · list locations
GET /locationsAbsolute URL: https://api.gridos.example/ocpi/2.2.1/locations
Sender interface: pull locations from the CPO (paginated).
How to call this endpoint
curl -sS -X GET 'https://api.gridos.example/ocpi/2.2.1/locations?date_from=2025-01-01T00%3A00%3A00Z&date_to=2025-01-01T00%3A00%3A00Z&offset=0&limit=50'Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
date_from | string | No | Only objects last updated after this timestamp (ISO 8601) |
date_to | string | No | Only objects last updated before this timestamp |
offset | integer | No | Pagination offset |
limit | integer | No | Page size |
Responses
| Status | Description | Schema |
|---|---|---|
200 | Array of Location objects | — |
200 — array of location objects
No response body.
GET · location
GET /locations/{country_code}/{party_id}/{location_id}Absolute URL: https://api.gridos.example/ocpi/2.2.1/locations/{country_code}/{party_id}/{location_id}
Retrieve a single Location by country code, party id, and location id.
How to call this endpoint
curl -sS -X GET 'https://api.gridos.example/ocpi/2.2.1/locations/NL/STK/LOC1'Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
country_code | string | Yes | Example: NL |
party_id | string | Yes | Example: STK |
location_id | string | Yes | — |
Responses
| Status | Description | Schema |
|---|---|---|
200 | Location object | — |
404 | Unknown location | — |
200 — location object
No response body.
404 — unknown location
No response body.
PUT · location (push)
PUT /locations/{country_code}/{party_id}/{location_id}Absolute URL: https://api.gridos.example/ocpi/2.2.1/locations/{country_code}/{party_id}/{location_id}
Receiver interface: CPO pushes a full Location object to the eMSP.
How to call this endpoint
curl -sS -X PUT 'https://api.gridos.example/ocpi/2.2.1/locations/NL/ABC/LOC1'Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
country_code | string | Yes | — |
party_id | string | Yes | — |
location_id | string | Yes | — |
Responses
| Status | Description | Schema |
|---|---|---|
200 | Location accepted | — |
200 — location accepted
No response body.
PATCH · location (push)
PATCH /locations/{country_code}/{party_id}/{location_id}Absolute URL: https://api.gridos.example/ocpi/2.2.1/locations/{country_code}/{party_id}/{location_id}
Receiver interface: partial update of a Location, EVSE, or Connector.
How to call this endpoint
curl -sS -X PATCH 'https://api.gridos.example/ocpi/2.2.1/locations/NL/ABC/LOC1'Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
country_code | string | Yes | — |
party_id | string | Yes | — |
location_id | string | Yes | — |
Responses
| Status | Description | Schema |
|---|---|---|
200 | Patch applied | — |
200 — patch applied
No response body.
Sessions
Sessions module
Base path: /sessions
GET · list sessions
GET /sessionsAbsolute URL: https://api.gridos.example/ocpi/2.2.1/sessions
Pull charging sessions (paginated).
How to call this endpoint
curl -sS -X GET 'https://api.gridos.example/ocpi/2.2.1/sessions?date_from=2025-01-01T00%3A00%3A00Z&limit=50'Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
date_from | string | No | — |
limit | integer | No | — |
Responses
| Status | Description | Schema |
|---|---|---|
200 | Array of Session objects | — |
200 — array of session objects
No response body.
Cdrs
CDRs module
Base path: /cdrs
GET · list CDRs
GET /cdrsAbsolute URL: https://api.gridos.example/ocpi/2.2.1/cdrs
Pull charge detail records.
How to call this endpoint
curl -sS -X GET 'https://api.gridos.example/ocpi/2.2.1/cdrs'Responses
| Status | Description | Schema |
|---|---|---|
200 | Array of CDR objects | — |
200 — array of CDR objects
No response body.
Tariffs
Tariffs module
Base path: /tariffs
GET · list tariffs
GET /tariffsAbsolute URL: https://api.gridos.example/ocpi/2.2.1/tariffs
Pull tariffs available to the caller.
How to call this endpoint
curl -sS -X GET 'https://api.gridos.example/ocpi/2.2.1/tariffs'Responses
| Status | Description | Schema |
|---|---|---|
200 | Array of Tariff objects | — |
200 — array of tariff objects
No response body.
Tokens
Tokens module
Base path: /tokens
GET · list tokens
GET /tokensAbsolute URL: https://api.gridos.example/ocpi/2.2.1/tokens
Pull tokens (eMSP sender / CPO receiver roles).
How to call this endpoint
curl -sS -X GET 'https://api.gridos.example/ocpi/2.2.1/tokens'Responses
| Status | Description | Schema |
|---|---|---|
200 | Array of Token objects | — |
200 — array of token objects
No response body.
Commands
Commands module
Base path: /commands
POST · send command
POST /commands/{command}Absolute URL: https://api.gridos.example/ocpi/2.2.1/commands/{command}
Send a remote command (START_SESSION, STOP_SESSION, RESERVE_NOW, UNLOCK_CONNECTOR, etc.).
How to call this endpoint
curl -sS -X POST 'https://api.gridos.example/ocpi/2.2.1/commands/START_SESSION'Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
command | string | Yes | Command type Example: START_SESSION |
Responses
| Status | Description | Schema |
|---|---|---|
200 | Command response with result | — |
200 — command response with result
No response body.