Skip to main content

Update Oracle Metric

Replaces the editable fields of a metric provider; its id and created_at are kept. Send the whole record, as on Create Oracle Metric.

The auth secret is never returned, so a client that round-trips a record has none to send. That is why connection.auth.secret behaves differently from the other fields:

  • omitted or null keeps the stored secret;
  • a string replaces it;
  • auth.type: "NONE" drops it.

A stored secret is only sent to the origin (scheme, host and port) it was saved for. An update that points connection.url at another origin while keeping the stored secret is refused with 10015 naming connection.auth.secret: send the secret again.

Required permission: oracle:update

Request​

PUT /v2/admin/oracle-metrics/{oracle_metric_id}

Parameters​

NameTypeInDescription
oracle_metric_idstringpathRequired. Metric provider id (24-character hex)

Headers​

NameDescription
AuthorizationRequired. Bearer <access_token>
Content-TypeRequired. application/json

Body​

FieldTypeRequiredDescription
category_idstringYesCategory the provider belongs to (24-character hex id). It is not checked to exist
typestringYesSource type: TOGG or SHEET
namestringYesProvider name
descriptionstringNoDescription. Omitted clears it
fiat_currencystringYesISO 4217 code of the currency the source's rental income is in
codesarrayNoThe full list of series; replaces the stored one. Omitted clears it
codes[].codestringYesCode the source knows the series by
codes[].namestringYesDisplay name of the series
codes[].descriptionstringNoDescription of the series
connectionobjectYesWhere the provider reads from
connection.urlstringYesBase URL of the source, starting with http:// or https://
connection.timeoutintegerNoRequest timeout in seconds, 0–300. 0 means the default (30)
connection.cache_ttl_secondsintegerNoSource document cache window within one server process, 0–86400. 0 disables it
connection.auth.typestringNoNONE, BEARER, API_KEY, BASIC or QUERY_PARAM. Omitted means NONE
connection.auth.namestringConditionalHeader or query parameter name. Required for API_KEY and QUERY_PARAM
connection.auth.usernamestringConditionalRequired for BASIC
connection.auth.secretstring | nullNoOmitted or null keeps the stored secret; a string replaces it
connection.headersarrayNoStatic headers, stored and returned in clear text
connection.headers[].namestringYesHeader name
connection.headers[].valuestringNoHeader value

Example​

curl --request PUT \
--url '{{baseUrl}}/v2/admin/oracle-metrics/6a5d0206379ebd02e53bf1a1' \
--header 'Authorization: Bearer <access_token>' \
--header 'Content-Type: application/json' \
--data '{
"category_id": "6a5d0206379ebd02e53bf0df",
"type": "SHEET",
"name": "Togg Şarj İstasyonu Metric Sheet",
"description": "Google Sheets üzerinden yönetilen Togg şarj istasyonu token metrikleri",
"fiat_currency": "TRY",
"codes": [
{ "code": "TOGG1", "name": "Togg Şarj İstasyonu 1" },
{ "code": "TOGG2", "name": "Togg Şarj İstasyonu 2" }
],
"connection": {
"url": "https://docs.google.com/spreadsheets/d/1Q9xWmT4kLp7RzV2sN8bYc3HdF6gJ0aEu5iO/export?format=csv&gid=0",
"timeout": 30,
"cache_ttl_seconds": 60,
"auth": { "type": "NONE" },
"headers": []
}
}'

Response​

200 OK with the updated provider, in the shape described on Get Oracle Metric.

{
"id": "6a5d0206379ebd02e53bf1a1",
"category_id": "6a5d0206379ebd02e53bf0df",
"type": "SHEET",
"name": "Togg Şarj İstasyonu Metric Sheet",
"description": "Google Sheets üzerinden yönetilen Togg şarj istasyonu token metrikleri",
"integration": {
"codes": [
{ "code": "TOGG1", "name": "Togg Şarj İstasyonu 1" },
{ "code": "TOGG2", "name": "Togg Şarj İstasyonu 2" }
],
"fiat_currency": "TRY",
"connection": {
"url": "https://docs.google.com/spreadsheets/d/1Q9xWmT4kLp7RzV2sN8bYc3HdF6gJ0aEu5iO/export?format=csv&gid=0",
"timeout": 30,
"cache_ttl_seconds": 60,
"auth": {
"type": "NONE",
"name": "",
"username": "",
"secret_set": false
},
"headers": []
}
},
"created_at": "2026-07-19T16:57:42.876Z",
"updated_at": "2026-11-09T10:44:03.517Z"
}

Errors​

StatusCodeDescription
40010015Validation failed — see details. Also returned, naming connection.auth.secret, when the URL moves to another origin while the stored secret would be kept
40010000oracle_metric_id is not a valid 24-character hex id
40010001Metric provider not found or deleted (domain 53)
400-1The connection is incomplete: the URL does not start with http:// or https://, or the auth scheme is missing its name, username or secret

See Errors for the error format and common codes.