Skip to main content

Create Oracle

Registers a price oracle. Every oracle 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 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/oracles

Headers​

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

Body​

FieldTypeRequiredDescription
category_idstringYesCategory the oracle belongs to (24-character hex id). It is not checked to exist
typestringYesSource type: TEFAS, TOGG or SHEET
namestringYesOracle name
descriptionstringNoDescription
fiat_currencystringYesISO 4217 code of the currency the source prices in (e.g. TRY). The summary expresses its prices in the active currency token of this currency
codesarrayNoThe series this oracle can price
codes[].codestringYesCode the source knows the series by
codes[].namestringYesDisplay name of the series
codes[].descriptionstringNoDescription of the series
connectionobjectYesWhere the oracle reads from
connection.urlstringYesBase URL of the source, starting with http:// or https://. The provider appends only its own resource path
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
summary_cache_ttl_secondsintegerNoHow long a computed summary is cached, 0–2592000 seconds. 0 means the platform default (12 hours)

Example​

curl --request POST \
--url '{{baseUrl}}/v2/admin/oracles' \
--header 'Authorization: Bearer <access_token>' \
--header 'Content-Type: application/json' \
--data '{
"category_id": "677ed6e3cc111aea14a3dfb4",
"type": "TEFAS",
"name": "Gümüş Fonu",
"description": "TEFAS Gümüş Fonu",
"fiat_currency": "TRY",
"codes": [
{ "code": "IOG", "name": "Gümüş Fonu" }
],
"connection": {
"url": "https://tefas-api.p.rapidapi.com",
"timeout": 30,
"cache_ttl_seconds": 0,
"auth": { "type": "API_KEY", "name": "x-rapidapi-key", "secret": "<rapidapi_key>" },
"headers": [
{ "name": "x-rapidapi-host", "value": "tefas-api.p.rapidapi.com" }
]
},
"summary_cache_ttl_seconds": 0
}'

Response​

201 Created with the new oracle. The secret is not echoed back.

{
"id": "6911b0d4e4b0f51d2c8a7e52",
"category_id": "677ed6e3cc111aea14a3dfb4",
"type": "TEFAS",
"name": "Gümüş Fonu",
"description": "TEFAS Gümüş Fonu",
"integration": {
"codes": [
{ "code": "IOG", "name": "Gümüş Fonu" }
],
"fiat_currency": "TRY",
"connection": {
"url": "https://tefas-api.p.rapidapi.com",
"timeout": 30,
"cache_ttl_seconds": 0,
"auth": {
"type": "API_KEY",
"name": "x-rapidapi-key",
"username": "",
"secret_set": true
},
"headers": [
{ "name": "x-rapidapi-host", "value": "tefas-api.p.rapidapi.com" }
]
},
"summary_cache_ttl_seconds": 0,
"default_summary_cache_ttl_seconds": 43200
},
"created_at": "2026-11-09T10:22:05.411Z",
"updated_at": "2026-11-09T10:22:05.411Z"
}

Response Fields​

The oracle, in the shape described on Get Oracle.

Errors​

StatusCodeDescription
40010015Validation failed (a required field missing, type not one of the three, 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.