# Create an Oracle

To set up an oracle:

1. Go to the network details page by clicking on the network name from the network tab.
2. On the left menu, select the '**Oracles**' option.
3. Click on **Create Oracle** to begin the process of creating a workflow in three simple steps.

#### <mark style="color:blue;">Step 1: Oracle Definition</mark>

1. Add the name of the Oracle.
2. Select the channel where the Oracle should be deployed.
3. Select the organisation that will own the Oracle.

<figure><img src="/files/DoCqFJn1iTVnQtXRTLWI" alt=""><figcaption></figcaption></figure>

#### <mark style="color:blue;">Step 2: Oracle Configuration</mark>

1. Select the type of URL and enter the source URL.
2. Select the type of param between Query, Path, Body, and None.
3. Select authentication type for the source URL between basic, custom or none
   * If authentication type is basic, enter the username and password
   * If authentication type is custom, enter custom key value pair(s)
   * If authentication type is none, no authentication is required to use the source URL
4. Enter custom header (optional). Click on "Add New" to add key-value pairs as custom headers.

<figure><img src="/files/x0tDX2oGGveTduSYvGc2" alt=""><figcaption></figcaption></figure>

#### <mark style="color:blue;">Step 3: Oracle Scheduler</mark>

Adding a scheduler is an optional step. You can add a scheduler at a later stage. An oracle can have multiple schedulers.

1. Enter the cron expression
   1. minutes- \
      Allowed value: <mark style="color:blue;">`0-59`</mark> \
      Allowed special characters: <mark style="color:blue;">`, - * /`</mark> \
      **Example**: \ <mark style="color:blue;">10</mark> for 10th minute of an hour, \
      Ranges: <mark style="color:blue;">1-10</mark> for first 10 minutes of an hour, \
      List: <mark style="color:blue;">1-10, 30</mark> for first 10 minutes and 30th minute of an hour, \
      Steps values: <mark style="color:blue;">0-59/2</mark> for every 30 minutes \
      Unrestricted: <mark style="color:blue;">\*</mark> for all possible values
   2. hours-\
      Allowed value: <mark style="color:blue;">`0-23`</mark> \
      Allowed special characters: <mark style="color:blue;">`, - / *`</mark>&#x20;
   3. days (month)-\
      Allowed value: <mark style="color:blue;">`0-31`</mark> \
      Allowed special characters: <mark style="color:blue;">`, - / *`</mark>&#x20;
   4. months-\
      Allowed value: <mark style="color:blue;">`0-11`</mark> \
      Allowed special characters: <mark style="color:blue;">`, - / *`</mark>&#x20;
   5. day(week)-\
      Allowed value: <mark style="color:blue;">`0-7`</mark> \
      Allowed special characters: <mark style="color:blue;">`, - / *`</mark>&#x20;
2. Enter the oracle scheduler name
3. Based on the param type of the oracle, user should define the arguments
   * if the param type is 'path' : provide one key-value
   * if the param type is query: provide multiple key-values
   * if the param type is body: use an input box to enter JSON, XML, etc.
   * if the param type is none: no arguments needed
4. Select from the list of deployed apps of the channel where the oracle is defined. The selected app will consume the data. If the selected app is a custom chaincode, define the callback function name.

<figure><img src="/files/OCNm7DactI8E8CJiyf4u" alt=""><figcaption></figcaption></figure>

#### <mark style="color:blue;">Step 4: Review</mark>

Review entered details and deploy the oracle.

<figure><img src="/files/AC7A9vGVqzWgwbyxkqLG" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.spydra.app/how-to/private-network/oracles/create-an-oracle.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
