Skip to main content

Create Oracle Metric

Registers a metric provider. Every provider carries its own connection: the provider type does not imply an endpoint.

The connection is checked for completeness before it is saved (an http:// or https:// URL, and the name, username or secret its auth scheme needs). No request is sent to the source here; probe it first with Test Oracle Metric Connection.

connection.auth.secret is write-only: it is stored, never returned, and the response reports only secret_set.

Required permission: oracle:create

Request​

POST /v2/admin/oracle-metrics

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
fiat_currencystringYesISO 4217 code of the currency the source's rental income is in (e.g. TRY)
codesarrayNoThe series this provider can read
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_secondsintegerNoHow long a fetched source document is reused within one server process, 0–86400. 0 disables this cache
connection.authobjectNoHow the source is authenticated. Omitted means NONE
connection.auth.typestringNoNONE (public source), BEARER (Authorization: Bearer <secret>), API_KEY (secret in the header named name), BASIC (username + secret) or QUERY_PARAM (secret in the query parameter named name)
connection.auth.namestringConditionalHeader or query parameter name. Required for API_KEY and QUERY_PARAM
connection.auth.usernamestringConditionalRequired for BASIC
connection.auth.secretstringConditionalBearer token, API key or basic password. Required for every scheme except NONE; discarded for NONE
connection.headersarrayNoStatic headers sent with every request. Stored and returned in clear text, so never put a credential here
connection.headers[].namestringYesHeader name
connection.headers[].valuestringNoHeader value

Example​

curl --request POST \
--url '{{baseUrl}}/v2/admin/oracle-metrics' \
--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", "description": "İstanbul Ataşehir hızlı şarj istasyonu" }
],
"connection": {
"url": "https://docs.google.com/spreadsheets/d/1Q9xWmT4kLp7RzV2sN8bYc3HdF6gJ0aEu5iO/export?format=csv&gid=0",
"timeout": 30,
"cache_ttl_seconds": 300,
"auth": { "type": "NONE" },
"headers": []
}
}'

Response​

201 Created with the new provider, in the shape described on Get Oracle Metric.

{
"id": "6911b6f1e4b0f51d2c8a7e63",
"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", "description": "İstanbul Ataşehir hızlı şarj istasyonu" }
],
"fiat_currency": "TRY",
"connection": {
"url": "https://docs.google.com/spreadsheets/d/1Q9xWmT4kLp7RzV2sN8bYc3HdF6gJ0aEu5iO/export?format=csv&gid=0",
"timeout": 30,
"cache_ttl_seconds": 300,
"auth": {
"type": "NONE",
"name": "",
"username": "",
"secret_set": false
},
"headers": []
}
},
"created_at": "2026-11-09T10:40:12.226Z",
"updated_at": "2026-11-09T10:40:12.226Z"
}

Errors​

StatusCodeDescription
40010015Validation failed (a required field missing, type not TOGG or SHEET, connection.url not a URL, a number out of range, an unknown auth.type) — see details
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. message names which

See Errors for the error format and common codes.