- Reference
- OCPI 2.1.1 (CPO)
- Rotate credentials for an already-registered partner
OpenAPI reference
Rotate credentials for an already-registered partner
PUT
/credentialsPUT /credentials
API: OCPI 2.1.1 (CPO) · Module: Credentials
Base path:/credentials· Base URL:https://ocpi-api.gridos.co/ocpi/cpo/2.1.1
Overview
PUT /credentialsAbsolute URL: https://ocpi-api.gridos.co/ocpi/cpo/2.1.1/credentials
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 PUT 'https://ocpi-api.gridos.co/ocpi/cpo/2.1.1/credentials' \
-H "Authorization: Token $OCPI_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"token":"example-updated-token","url":"https://partner.example.com/ocpi/versions","business_details":{"name":"Example eMSP","website":"https://partner.example.com"},"party_id":"EMP","country_code":"NL"}'Request
Request body
application/json · Required
Schema: Credentials
| Field | Type | Required | Description |
|---|---|---|---|
token | string | Yes | Token the other party uses to authenticate in your system. |
url | string | Yes | URL to your versions endpoint. |
business_details | BusinessDetails | Yes | BusinessDetails |
party_id | string | Yes | CPO/eMSP party identifier (exactly 3 chars). |
country_code | string | Yes | ISO 3166-1 alpha-2 country code. |
Request examples
Example 1
{
"token": "example-updated-token",
"url": "https://partner.example.com/ocpi/versions",
"business_details": {
"name": "Example eMSP",
"website": "https://partner.example.com"
},
"party_id": "EMP",
"country_code": "NL"
}Example 2
{
"token": "rotated-token-2026",
"url": "https://partner.example.com/ocpi/v2/versions",
"business_details": {
"name": "Example eMSP Updated"
},
"party_id": "EMP",
"country_code": "NL"
}Responses
| Status | Description | Schema |
|---|---|---|
200 | Successful Response | CredentialsResponse |
400 | Invalid or missing parameters (HTTP 200, OCPI envelope) | — |
401 | Unauthorized | — |
422 | Validation Error | HTTPValidationError |
200 — successful response
application/json
Schema: CredentialsResponse
| Field | Type | Required | Description |
|---|---|---|---|
status_code | integer | No | Default: 1000 |
status_message | string | No | — |
timestamp | string (date-time) | No | — |
data | Credentials | No | Credentials |
Response example
{
"data": {
"business_details": {
"name": "TheNewMotion",
"website": "https://www.thenewmotion.com"
},
"country_code": "NL",
"party_id": "TNM",
"token": "ebf3b399-779f-4497-9b9d-ac6ad3cc44",
"url": "https://example.com/ocpi/2.1.1"
},
"status_code": 1000,
"status_message": "Success",
"timestamp": "2015-06-29T22:39:09Z"
}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 PUT 'https://ocpi-api.gridos.co/ocpi/cpo/2.1.1/credentials' \
-H "Authorization: Token $OCPI_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"token":"example-updated-token","url":"https://partner.example.com/ocpi/versions","business_details":{"name":"Example eMSP","website":"https://partner.example.com"},"party_id":"EMP","country_code":"NL"}'