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
        • GETList CPOs
        • POSTCreate CPO (durable)
        • GETGet CPO provisioning status
        • GETGet CPO
        • DELDelete CPO
        • GETGet CPO report
OCPPLAB Gateway APIOCPIOcpi Cpos

Create CPO (durable)

||View as Markdown|
POST
https://host.com/ocpi/cpos
POST
/ocpi/cpos
1import requests
2
3url = "https://host.com/ocpi/cpos"
4
5payload = {
6 "template": "small-urban-ac",
7 "country_code": "FR",
8 "party_id": "ABC",
9 "name_prefix": "alice",
10 "role": "cpo",
11 "ocpi_version": "2.2.1",
12 "seed": 42,
13 "ttl_seconds": 7200,
14 "overrides": {
15 "chargers_per_location": 3,
16 "locations": 2
17 }
18}
19headers = {
20 "Authorization": "Bearer <token>",
21 "Content-Type": "application/json"
22}
23
24response = requests.post(url, json=payload, headers=headers)
25
26print(response.json())
1{
2 "cpo_id": "101",
3 "party": {
4 "country_code": "FR",
5 "party_id": "ABC",
6 "role": "CPO"
7 },
8 "name_prefix": "demo",
9 "template": "small-urban-ac",
10 "template_version": 1,
11 "token_a": "a_TOKdemo123",
12 "ocpi_peer_url": "https://api.ocpplab.test/ocpi/2.2.1/versions",
13 "status_url": "/ocpi/cpos/101/status",
14 "destroy_url": "/ocpi/cpos/101",
15 "roam_helper": {
16 "credentials_payload": {
17 "token": "a_TOKdemo123",
18 "url": "https://api.ocpplab.test/ocpi/2.2.1/versions"
19 },
20 "curl_snippet": "curl -X POST https://peer.example/ocpi/2.2.1/credentials -H 'Authorization: Token a_TOKdemo123' -d ..."
21 },
22 "workflow_run_id": "wfr_01HK3TPDX...",
23 "status": "PENDING",
24 "expires_at": "2026-04-21T21:00:00Z"
25}
Kick off a full OCPI CPO in one call: network + locations + chargers + topology routing. Returns **202 Accepted** in under a second with the freshly minted Token A (so the eMSP peer can handshake immediately) and a `status_url`. The slow per-location / per-charger / ECS work runs as a durable Upstash Workflow with step-level retries. Poll `GET {status_url}` every 1-2s until `status == READY` (or `FAILED`).
Was this page helpful?
Previous

List CPOs

Next

Get CPO provisioning status

Built with

Kick off a full OCPI CPO in one call: network + locations + chargers + topology routing. Returns 202 Accepted in under a second with the freshly minted Token A (so the eMSP peer can handshake immediately) and a status_url. The slow per-location / per-charger / ECS work runs as a durable Upstash Workflow with step-level retries. Poll GET {status_url} every 1-2s until status == READY (or FAILED).

Authentication

AuthorizationBearer

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

Request

This endpoint expects an object.
templatestringRequired

Template slug. Use GET /ocpi/cpos/templates for the gallery.

country_codestringRequired=2 characters

ISO 3166-1 alpha-2 country code.

party_idstringRequired=3 characters

3-char OCPI party identifier. May be auto-mangled on collision if another CPO already holds this (country, party) under your org.

name_prefixstringRequired1-32 characters
Human label prepended to every identity created under this CPO.
roleenumOptional
Role this CPO takes in OCPI roaming.
Allowed values:
ocpi_versionstringOptionalDefaults to 2.2.1
OCPI protocol version.
seedinteger or nullOptional

Optional deterministic seed. Same seed + same template = byte-identical output. Leave null for random (different each call).

ttl_secondsinteger or nullOptional60-604800Defaults to 3600

Auto-destroy after N seconds (min 60s, max 7 days). Defaults to 3600 (1 hour) so exploratory CPOs don’t pile up. Pass an explicit null to opt out of auto-destroy.

overridesmap from strings to integers or nullOptional

Template-specific overrides. Supported keys: locations, chargers_per_location. Values are bounded by each template’s caps.

Response

CPO provisioning accepted; poll status_url for progress

cpo_idstring
partyobject
The OCPI party identity the new CPO occupies.
name_prefixstring
templatestring
template_versioninteger
token_astring

Freshly minted Token A. Returned here only; not echoed on GET.

ocpi_peer_urlstring
status_urlstring
GET here to poll provisioning state.
destroy_urlstring
roam_helperobject or null

Pre-built eMSP helper payload so the peer can handshake in one paste.

workflow_run_idstring or null

Internal provisioning run id. Opaque to clients; include it in bug reports when something goes wrong.

statusenum
Durable provisioning states the status endpoint can report.
Allowed values:
expires_atdatetime or null

Errors

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