Create Metadata Index
curl --request POST \
--url https://ledger.sandbox.lerian.net/v1/settings/metadata-indexes/entities/{entity_name} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"metadataKey": "tier",
"sparse": true,
"unique": false
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://ledger.sandbox.lerian.net/v1/settings/metadata-indexes/entities/{entity_name}"
payload := strings.NewReader("{\n \"metadataKey\": \"tier\",\n \"sparse\": true,\n \"unique\": false\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(string(body))
}const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({metadataKey: 'tier', sparse: true, unique: false})
};
fetch('https://ledger.sandbox.lerian.net/v1/settings/metadata-indexes/entities/{entity_name}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://ledger.sandbox.lerian.net/v1/settings/metadata-indexes/entities/{entity_name}"
payload = {
"metadataKey": "tier",
"sparse": True,
"unique": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"entityName": "transaction",
"indexName": "metadata.tier_1",
"metadataKey": "tier",
"sparse": true,
"unique": false,
"stats": {
"accesses": 1523,
"statsSince": "2024-12-01T10:30:00Z"
}
}{
"code": "0065",
"message": "<string>",
"title": "Invalid Path Parameter",
"entityType": "Account",
"fields": {}
}{
"code": "0065",
"message": "<string>",
"title": "Invalid Path Parameter",
"entityType": "Account",
"fields": {}
}{
"code": "0065",
"message": "<string>",
"title": "Invalid Path Parameter",
"entityType": "Account",
"fields": {}
}Create Metadata Index
deprecated
POST
/
v1
/
settings
/
metadata-indexes
/
entities
/
{entity_name}
Create Metadata Index
curl --request POST \
--url https://ledger.sandbox.lerian.net/v1/settings/metadata-indexes/entities/{entity_name} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"metadataKey": "tier",
"sparse": true,
"unique": false
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://ledger.sandbox.lerian.net/v1/settings/metadata-indexes/entities/{entity_name}"
payload := strings.NewReader("{\n \"metadataKey\": \"tier\",\n \"sparse\": true,\n \"unique\": false\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(string(body))
}const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({metadataKey: 'tier', sparse: true, unique: false})
};
fetch('https://ledger.sandbox.lerian.net/v1/settings/metadata-indexes/entities/{entity_name}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://ledger.sandbox.lerian.net/v1/settings/metadata-indexes/entities/{entity_name}"
payload = {
"metadataKey": "tier",
"sparse": True,
"unique": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"entityName": "transaction",
"indexName": "metadata.tier_1",
"metadataKey": "tier",
"sparse": true,
"unique": false,
"stats": {
"accesses": 1523,
"statsSince": "2024-12-01T10:30:00Z"
}
}{
"code": "0065",
"message": "<string>",
"title": "Invalid Path Parameter",
"entityType": "Account",
"fields": {}
}{
"code": "0065",
"message": "<string>",
"title": "Invalid Path Parameter",
"entityType": "Account",
"fields": {}
}{
"code": "0065",
"message": "<string>",
"title": "Invalid Path Parameter",
"entityType": "Account",
"fields": {}
}Authorizations
JWT bearer token issued by the identity provider.
Path Parameters
Entity name (organization, ledger, segment, account, portfolio, asset, account_type, transaction, operation, operation_route, transaction_route)
Body
application/json
Was this page helpful?

