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
| Name | Description |
|---|---|
Authorization | Required. Bearer <access_token> |
Content-Type | Required. application/json |
Body
| Field | Type | Required | Description |
|---|---|---|---|
category_id | string | Yes | Category the provider belongs to (24-character hex id). It is not checked to exist |
type | string | Yes | Source type: TOGG or SHEET |
name | string | Yes | Provider name |
description | string | No | Description |
fiat_currency | string | Yes | ISO 4217 code of the currency the source's rental income is in (e.g. TRY) |
codes | array | No | The series this provider can read |
codes[].code | string | Yes | Code the source knows the series by |
codes[].name | string | Yes | Display name of the series |
codes[].description | string | No | Description of the series |
connection | object | Yes | Where the provider reads from |
connection.url | string | Yes | Base URL of the source, starting with http:// or https:// |
connection.timeout | integer | No | Request timeout in seconds, 0–300. 0 means the default (30) |
connection.cache_ttl_seconds | integer | No | How long a fetched source document is reused within one server process, 0–86400. 0 disables this cache |
connection.auth | object | No | How the source is authenticated. Omitted means NONE |
connection.auth.type | string | No | NONE (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.name | string | Conditional | Header or query parameter name. Required for API_KEY and QUERY_PARAM |
connection.auth.username | string | Conditional | Required for BASIC |
connection.auth.secret | string | Conditional | Bearer token, API key or basic password. Required for every scheme except NONE; discarded for NONE |
connection.headers | array | No | Static headers sent with every request. Stored and returned in clear text, so never put a credential here |
connection.headers[].name | string | Yes | Header name |
connection.headers[].value | string | No | Header 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
| Status | Code | Description |
|---|---|---|
| 400 | 10015 | Validation 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 | -1 | The 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.