> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.umnai.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.umnai.com/_mcp/server.

# Schema

A data schema tells Umnai how to read the columns in your source data.

Create a schema before ingestion. Ingestion applies the schema to validate and prepare the source data. Onboarding then uses the same schema context when creating a dataset for training.

## Define schema fields

A schema is made up of fields. Each field represents one source column and defines how that column should be used.

At minimum, each field needs:

| Field         | Purpose                                                                         |
| ------------- | ------------------------------------------------------------------------------- |
| `name`        | The source column name. It must match the column in your data.                  |
| `data_type`   | The physical type of the value, such as string, number, boolean, array, or any. |
| `designation` | How Umnai should use the column: `FEATURE`, `TARGET`, or `IGNORED`.             |

Most schemas also define:

| Field           | Purpose                                                                                              |
| --------------- | ---------------------------------------------------------------------------------------------------- |
| `semantic_type` | The modelling meaning of the column, such as `CATEGORICAL`, `CONTINUOUS`, or `SEQUENTIAL`.           |
| `encoding_type` | Optional field-level encoding behaviour for categorical, sequential, or other non-continuous values. |
| `vector`        | Whether the field contains vector data.                                                              |

If `semantic_type`, `encoding_type`, or `vector` is omitted, Umnai may infer it during processing. Define these values explicitly when you need predictable behaviour.

### Features, targets, and ignored columns

Use `designation` to decide how each column participates in modelling.

| Designation | Use for                                              |
| ----------- | ---------------------------------------------------- |
| `FEATURE`   | Input columns the model can use to make predictions. |
| `TARGET`    | The value the model should learn to predict.         |
| `IGNORED`   | Columns that should not be used for model training.  |

A dataset used for training should have at least one feature and one target.

Use `IGNORED` for row identifiers, record IDs, transaction IDs, UUIDs, or other columns that identify a row but do not help the model generalise.

### Data types and formats

Use `data_type` to describe the value stored in each source column.

| Data type | Supported formats                                       |
| --------- | ------------------------------------------------------- |
| `ANY`     | None                                                    |
| `STRING`  | `CATEGORY`, `DATETIME`, `JSON`                          |
| `NUMBER`  | `INT8`, `INT16`, `INT32`, `INT64`, `FLOAT32`, `FLOAT64` |
| `BOOLEAN` | None                                                    |
| `ARRAY`   | None                                                    |

Although `ARRAY` and `STRING: JSON` are exposed in the schema, complex nested values are not currently supported for processing. Avoid arrays and JSON objects as model features unless you have confirmed the workflow supports them.

Free-form natural language text is not currently supported for processing. Transform text before ingestion, or mark text columns as ignored if they must remain in the source data.

### Encoding

Encoding controls how non-continuous values are represented during onboarding.

For most datasets, you only need to set the field's `semantic_type` and let Umnai determine the encoding during processing. Define `encoding_type` explicitly when you need to control how a field is encoded.

Common mappings include:

| Source field                | Typical schema options                                                                           |
| --------------------------- | ------------------------------------------------------------------------------------------------ |
| Categorical string feature  | `data_type: STRING`, `semantic_type: CATEGORICAL`, `encoding_type: ONE_HOT` or `TARGET`          |
| Date or time string feature | `data_type: STRING`, `format: DATETIME`, `semantic_type: SEQUENTIAL`, `encoding_type: TIMESTAMP` |
| Numeric continuous feature  | `data_type: NUMBER`, `semantic_type: CONTINUOUS`                                                 |
| Numeric target              | `data_type: NUMBER`, `designation: TARGET`                                                       |

For the full set of encoding options and when to use them, see [Encoding](/guides/data/data-schema/encoding).

## Infer a schema from storage

After creating a storage connector, you can retrieve an inferred schema from a path inside the connected bucket.

Use this as a starting point, then review and adjust the generated fields before creating the schema.

### Request

GET [https://api.hi.umnai.com/storage-connectors/\{storageConnectorId}/schema](https://api.hi.umnai.com/storage-connectors/\{storageConnectorId}/schema)

```curl
curl https://api.hi.umnai.com/storage-connectors/{storageConnectorId}/schema \
     -H "Authorization: Bearer <token>"
```

```python
import requests

url = "https://api.hi.umnai.com/storage-connectors/:storageConnectorId/schema"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.hi.umnai.com/storage-connectors/:storageConnectorId/schema';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.hi.umnai.com/storage-connectors/:storageConnectorId/schema"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.hi.umnai.com/storage-connectors/:storageConnectorId/schema")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.hi.umnai.com/storage-connectors/:storageConnectorId/schema")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.hi.umnai.com/storage-connectors/:storageConnectorId/schema', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.hi.umnai.com/storage-connectors/:storageConnectorId/schema");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.hi.umnai.com/storage-connectors/:storageConnectorId/schema")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Response (200)

```json
{
  "data": [
    {
      "id": "ea8b745ead39ec442fc3b4fba359bf98",
      "name": "Sample Organisation",
      "status": "ACTIVE",
      "created_at": "2026-03-11T16:04:19.749000Z",
      "updated_at": null
    }
  ],
  "pagination": {
    "total_items": 1,
    "items_per_page": 10,
    "current_page": 1,
    "total_pages": 1
  }
}
```

## Create a schema

Create a schema once you have reviewed the source columns and decided how each one should be used.

### Request

POST [https://api.hi.umnai.com/data-schemas](https://api.hi.umnai.com/data-schemas)

```curl
curl -X POST https://api.hi.umnai.com/data-schemas \
     -H "Authorization: Bearer <token>" \
     -H "Content-Type: application/json" \
     -d '{
  "name": "Sample Schema",
  "fields": [
    {
      "name": "age",
      "data_type": {
        "data_type": "NUMBER",
        "format": "INT64"
      },
      "designation": "FEATURE",
      "semantic_type": "CONTINUOUS"
    },
    {
      "name": "occupation",
      "data_type": {
        "data_type": "STRING"
      },
      "designation": "FEATURE",
      "semantic_type": "CATEGORICAL"
    },
    {
      "name": "income",
      "data_type": {
        "data_type": "NUMBER",
        "format": "INT64"
      },
      "designation": "TARGET",
      "semantic_type": "CATEGORICAL"
    }
  ]
}'
```

```python
import requests

url = "https://api.hi.umnai.com/data-schemas"

payload = {
    "name": "Sample Schema",
    "fields": [
        {
            "name": "age",
            "data_type": {
                "data_type": "NUMBER",
                "format": "INT64"
            },
            "designation": "FEATURE",
            "semantic_type": "CONTINUOUS"
        },
        {
            "name": "occupation",
            "data_type": { "data_type": "STRING" },
            "designation": "FEATURE",
            "semantic_type": "CATEGORICAL"
        },
        {
            "name": "income",
            "data_type": {
                "data_type": "NUMBER",
                "format": "INT64"
            },
            "designation": "TARGET",
            "semantic_type": "CATEGORICAL"
        }
    ]
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.hi.umnai.com/data-schemas';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"name":"Sample Schema","fields":[{"name":"age","data_type":{"data_type":"NUMBER","format":"INT64"},"designation":"FEATURE","semantic_type":"CONTINUOUS"},{"name":"occupation","data_type":{"data_type":"STRING"},"designation":"FEATURE","semantic_type":"CATEGORICAL"},{"name":"income","data_type":{"data_type":"NUMBER","format":"INT64"},"designation":"TARGET","semantic_type":"CATEGORICAL"}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.hi.umnai.com/data-schemas"

	payload := strings.NewReader("{\n  \"name\": \"Sample Schema\",\n  \"fields\": [\n    {\n      \"name\": \"age\",\n      \"data_type\": {\n        \"data_type\": \"NUMBER\",\n        \"format\": \"INT64\"\n      },\n      \"designation\": \"FEATURE\",\n      \"semantic_type\": \"CONTINUOUS\"\n    },\n    {\n      \"name\": \"occupation\",\n      \"data_type\": {\n        \"data_type\": \"STRING\"\n      },\n      \"designation\": \"FEATURE\",\n      \"semantic_type\": \"CATEGORICAL\"\n    },\n    {\n      \"name\": \"income\",\n      \"data_type\": {\n        \"data_type\": \"NUMBER\",\n        \"format\": \"INT64\"\n      },\n      \"designation\": \"TARGET\",\n      \"semantic_type\": \"CATEGORICAL\"\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.hi.umnai.com/data-schemas")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"Sample Schema\",\n  \"fields\": [\n    {\n      \"name\": \"age\",\n      \"data_type\": {\n        \"data_type\": \"NUMBER\",\n        \"format\": \"INT64\"\n      },\n      \"designation\": \"FEATURE\",\n      \"semantic_type\": \"CONTINUOUS\"\n    },\n    {\n      \"name\": \"occupation\",\n      \"data_type\": {\n        \"data_type\": \"STRING\"\n      },\n      \"designation\": \"FEATURE\",\n      \"semantic_type\": \"CATEGORICAL\"\n    },\n    {\n      \"name\": \"income\",\n      \"data_type\": {\n        \"data_type\": \"NUMBER\",\n        \"format\": \"INT64\"\n      },\n      \"designation\": \"TARGET\",\n      \"semantic_type\": \"CATEGORICAL\"\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.hi.umnai.com/data-schemas")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Sample Schema\",\n  \"fields\": [\n    {\n      \"name\": \"age\",\n      \"data_type\": {\n        \"data_type\": \"NUMBER\",\n        \"format\": \"INT64\"\n      },\n      \"designation\": \"FEATURE\",\n      \"semantic_type\": \"CONTINUOUS\"\n    },\n    {\n      \"name\": \"occupation\",\n      \"data_type\": {\n        \"data_type\": \"STRING\"\n      },\n      \"designation\": \"FEATURE\",\n      \"semantic_type\": \"CATEGORICAL\"\n    },\n    {\n      \"name\": \"income\",\n      \"data_type\": {\n        \"data_type\": \"NUMBER\",\n        \"format\": \"INT64\"\n      },\n      \"designation\": \"TARGET\",\n      \"semantic_type\": \"CATEGORICAL\"\n    }\n  ]\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.hi.umnai.com/data-schemas', [
  'body' => '{
  "name": "Sample Schema",
  "fields": [
    {
      "name": "age",
      "data_type": {
        "data_type": "NUMBER",
        "format": "INT64"
      },
      "designation": "FEATURE",
      "semantic_type": "CONTINUOUS"
    },
    {
      "name": "occupation",
      "data_type": {
        "data_type": "STRING"
      },
      "designation": "FEATURE",
      "semantic_type": "CATEGORICAL"
    },
    {
      "name": "income",
      "data_type": {
        "data_type": "NUMBER",
        "format": "INT64"
      },
      "designation": "TARGET",
      "semantic_type": "CATEGORICAL"
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.hi.umnai.com/data-schemas");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"Sample Schema\",\n  \"fields\": [\n    {\n      \"name\": \"age\",\n      \"data_type\": {\n        \"data_type\": \"NUMBER\",\n        \"format\": \"INT64\"\n      },\n      \"designation\": \"FEATURE\",\n      \"semantic_type\": \"CONTINUOUS\"\n    },\n    {\n      \"name\": \"occupation\",\n      \"data_type\": {\n        \"data_type\": \"STRING\"\n      },\n      \"designation\": \"FEATURE\",\n      \"semantic_type\": \"CATEGORICAL\"\n    },\n    {\n      \"name\": \"income\",\n      \"data_type\": {\n        \"data_type\": \"NUMBER\",\n        \"format\": \"INT64\"\n      },\n      \"designation\": \"TARGET\",\n      \"semantic_type\": \"CATEGORICAL\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "Sample Schema",
  "fields": [
    [
      "name": "age",
      "data_type": [
        "data_type": "NUMBER",
        "format": "INT64"
      ],
      "designation": "FEATURE",
      "semantic_type": "CONTINUOUS"
    ],
    [
      "name": "occupation",
      "data_type": ["data_type": "STRING"],
      "designation": "FEATURE",
      "semantic_type": "CATEGORICAL"
    ],
    [
      "name": "income",
      "data_type": [
        "data_type": "NUMBER",
        "format": "INT64"
      ],
      "designation": "TARGET",
      "semantic_type": "CATEGORICAL"
    ]
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.hi.umnai.com/data-schemas")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Response (201)

```json
{
  "id": "22f2c353201d472fbfc7c856eaecaccd",
  "account": {
    "id": "cf5b093e7f65480e98107feb78649222",
    "name": "Sample Account"
  },
  "name": "Sample Schema",
  "fields": [
    {
      "created_at": "2026-04-02T08:36:14.974937Z",
      "data_type": {
        "data_type": "NUMBER",
        "format": "INT64"
      },
      "designation": "FEATURE",
      "id": "37fd2c48429440ae981cb9831c66464b",
      "name": "age",
      "created_by": {
        "id": "eca422469dc3270625bf646df3472a45",
        "name": "Sample User"
      },
      "dimension": null,
      "encoding_type": null,
      "semantic_type": "CONTINUOUS",
      "unit": null,
      "updated_at": null,
      "vector": false
    },
    {
      "created_at": "2026-04-02T08:36:14.982037Z",
      "data_type": {
        "data_type": "STRING",
        "format": null
      },
      "designation": "FEATURE",
      "id": "95dc4f2aab9242e491b1f109778b0d10",
      "name": "occuptation",
      "created_by": {
        "id": "eca422469dc3270625bf646df3472a45",
        "name": "Sample User"
      },
      "dimension": null,
      "encoding_type": null,
      "semantic_type": "CATEGORICAL",
      "unit": null,
      "updated_at": null,
      "vector": false
    },
    {
      "created_at": "2026-04-02T08:36:15.063293Z",
      "data_type": {
        "data_type": "NUMBER",
        "format": "INT64"
      },
      "designation": "TARGET",
      "id": "058383ab0f6c4ce9a078b5f842ace676",
      "name": "income",
      "created_by": {
        "id": "eca422469dc3270625bf646df3472a45",
        "name": "Sample User"
      },
      "dimension": null,
      "encoding_type": null,
      "semantic_type": "CATEGORICAL",
      "unit": null,
      "updated_at": null,
      "vector": false
    }
  ],
  "friendly_names": [],
  "category_friendly_names": [],
  "data_anchors": [],
  "data_protections": [],
  "created_at": "2026-04-02T08:36:14.968725Z",
  "created_by": {
    "id": "eca422469dc3270625bf646df3472a45",
    "name": "Sample User"
  },
  "updated_at": null
}
```

Save the returned schema `id`. You will use it when creating an ingestion configuration.

## Retrieve schemas

Retrieve schemas when you need to reuse an existing schema or inspect its fields.

### Request

GET [https://api.hi.umnai.com/data-schemas](https://api.hi.umnai.com/data-schemas)

```curl
curl https://api.hi.umnai.com/data-schemas \
     -H "Authorization: Bearer <token>"
```

```python
import requests

url = "https://api.hi.umnai.com/data-schemas"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.hi.umnai.com/data-schemas';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.hi.umnai.com/data-schemas"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.hi.umnai.com/data-schemas")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.hi.umnai.com/data-schemas")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.hi.umnai.com/data-schemas', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.hi.umnai.com/data-schemas");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.hi.umnai.com/data-schemas")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Response (200)

```json
{
  "data": [
    {
      "id": "ea8b745ead39ec442fc3b4fba359bf98",
      "name": "Sample Organisation",
      "created_at": "2026-03-11T16:04:19.749000Z",
      "updated_at": null,
      "status": "ACTIVE"
    }
  ],
  "pagination": {
    "total_items": 1,
    "items_per_page": 10,
    "current_page": 1,
    "total_pages": 1
  }
}
```

To inspect a specific schema, retrieve it by `id`.

### Request

GET [https://api.hi.umnai.com/data-schemas/\{dataSchemaId}](https://api.hi.umnai.com/data-schemas/\{dataSchemaId})

```curl
curl https://api.hi.umnai.com/data-schemas/{dataSchemaId} \
     -H "Authorization: Bearer <token>"
```

```python
import requests

url = "https://api.hi.umnai.com/data-schemas/:dataSchemaId"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.hi.umnai.com/data-schemas/:dataSchemaId';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.hi.umnai.com/data-schemas/:dataSchemaId"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.hi.umnai.com/data-schemas/:dataSchemaId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.hi.umnai.com/data-schemas/:dataSchemaId")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.hi.umnai.com/data-schemas/:dataSchemaId', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.hi.umnai.com/data-schemas/:dataSchemaId");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.hi.umnai.com/data-schemas/:dataSchemaId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Response (200)

```json
{
  "data": [
    {
      "id": "ea8b745ead39ec442fc3b4fba359bf98",
      "name": "Sample Organisation",
      "status": "ACTIVE",
      "created_at": "2026-03-11T16:04:19.749000Z",
      "updated_at": null
    }
  ],
  "pagination": {
    "total_items": 1,
    "items_per_page": 10,
    "current_page": 1,
    "total_pages": 1
  }
}
```

## Update a schema

You can update an existing schema, including schema fields.

Be careful when changing a schema that has already been used for ingestion. Existing datasources keep the schema that was applied when they were ingested. Schema changes apply to future ingestion runs.

## Delete a schema

Delete a schema when it should no longer be used.

### Request

DELETE [https://api.hi.umnai.com/data-schemas/\{dataSchemaId}](https://api.hi.umnai.com/data-schemas/\{dataSchemaId})

```curl
curl -X DELETE https://api.hi.umnai.com/data-schemas/dataSchemaId \
     -H "Authorization: Bearer <token>"
```

```python
import requests

url = "https://api.hi.umnai.com/data-schemas/dataSchemaId"

headers = {"Authorization": "Bearer <token>"}

response = requests.delete(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.hi.umnai.com/data-schemas/dataSchemaId';
const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.hi.umnai.com/data-schemas/dataSchemaId"

	req, _ := http.NewRequest("DELETE", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.hi.umnai.com/data-schemas/dataSchemaId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.delete("https://api.hi.umnai.com/data-schemas/dataSchemaId")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://api.hi.umnai.com/data-schemas/dataSchemaId', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.hi.umnai.com/data-schemas/dataSchemaId");
var request = new RestRequest(Method.DELETE);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.hi.umnai.com/data-schemas/dataSchemaId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

## Advanced schema metadata

The API also exposes optional schema metadata.

| Metadata                | What it stores                                                                               |
| ----------------------- | -------------------------------------------------------------------------------------------- |
| Dimensions and units    | Measurement context for fields, such as time, currency, or other units.                      |
| Friendly names          | Human-readable labels for fields.                                                            |
| Category friendly names | Human-readable labels for category values.                                                   |
| Stakeholders            | Audience or stakeholder context for friendly names.                                          |
| Data anchors            | Fields, interactions, or values intended to act as stable reference points.                  |
| Data protections        | Fields, interactions, or values intended to identify sensitive or protected characteristics. |

Advanced schema metadata can be defined through the API, but it is not yet fully used by downstream platform workflows. Do not rely on dimensions, units, friendly names, category friendly names, stakeholders, data anchors, or data protections to affect ingestion, onboarding, training, or explanations until the functionality is complete.