This page covers configuration and management of View graph repository objects.
Object Overview
Graph repositories define the properties by which relationship data and metadat are stored within View.
Endpoint, URL, and Supported Methods
Objects are managed via the configuration server API at [http|https]://[hostname]:[port]/v1.0/tenants/[tenant-guid]/graphrepositories
Supported methods include: GET
HEAD
PUT
DELETE
Structure
Objects have the following structure:
{
"GUID": "example-graph-repository",
"TenantGUID": "default",
"Name": "My LiteGraph instance",
"RepositoryType": "LiteGraph",
"EndpointUrl": "http://litegraph:8701/",
"ApiKey": "default",
"Port": 0,
"Ssl": false,
"GraphIdentifier": "11111111-1111-1111-1111-111111111111",
"CreatedUtc": "2024-07-10T05:09:32.000000Z"
}
Properties:
GUID
GUID
globally unique identifier for the objectTenantGUID
GUID
globally unique identifier for the tenantName
string
name of the objectRepositoryType
string
the type of vector repository (currently onlyLiteGraph
EndpointUrl
string
the URL on which the graph database is accessedApiKey
string
API key to the graph repositoryPort
int
unused, the port on which the graph database is accessedSsl
boolean
is having SSL or notGraphIdentifier
string
the identifier, typically a GUID, on which the graph is accessedCreatedUtc
datetime
timestamp from creation, in UTC time
Create
To create, call PUT /v1.0/tenants/[tenant-guid]/graphrepositories
with the following properties using the configuration server: Name
RepositoryType
EndpointUrl
GraphIdentifier
curl --location --request PUT 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/graphrepositories' \
--header 'content-type: application/json' \
--header 'Authorization: ••••••' \
--data '{
"Name": "My LiteGraph instance",
"RepositoryType": "LiteGraph",
"EndpointUrl": "http://localhost:8701/",
"ApiKey": "default",
"GraphIdentifier": "00000000-0000-0000-0000-000000000000"
}'
import { ViewConfigurationSdk } from "view-sdk";
const api = new ViewConfigurationSdk(
"default", //tenant Id
"default", //access token
"http://localhost:8000/" //endpoint
);
const createGraphRepository = async () => {
try {
const response = await api.createGraphRepository({
Name: "My LiteGraph instance",
RepositoryType: "LiteGraph",
EndpointUrl: "http://localhost:8701/",
ApiKey: "default",
GraclearphIdentifier: "00000000-0000-0000-0000-000000000000",
});
console.log(response, "Graph repository created successfully");
} catch (err) {
console.log("Error creating Graph repository:", err);
}
};
createGraphRepository();
Enumerate
Refer to the Enumeration page in REST API for details about the use of enumeration APIs.
Enumerate objects by using GET /v2.0/tenants/[tenant-guid]/graphrepositories
. The resultant object will appear as:
{
"Success": true,
"Timestamp": {
"Start": "2024-10-21T02:36:37.677751Z",
"TotalMs": 23.58,
"Messages": {}
},
"MaxResults": 10,
"IterationsRequired": 1,
"EndOfResults": true,
"RecordsRemaining": 16,
"Objects": [
{
"GUID": "example-graphrepository",
... graphrepository details ...
},
{ ... }
],
"ContinuationToken": "[continuation-token]"
}
curl --location 'http://view.homedns.org:8000/v2.0/tenants/00000000-0000-0000-0000-000000000000/graphrepositories/' \
--header 'Authorization: ••••••'
import { ViewConfigurationSdk } from "view-sdk";
const api = new ViewConfigurationSdk(
"default", //tenant Id
"default", //access token
"http://localhost:8000/" //endpoint
);
const enumerateGraphRepositories = async () => {
try {
const response = await api.enumerateGraphRepositories();
console.log(response, "Graph repositories fetched successfully");
} catch (err) {
console.log("Error fetching Graph repositories:", err);
}
};
enumerateGraphRepositories();
Read
To read an object by GUID, call GET /v1.0/tenants/[tenant-guid]/embeddingsrule/[embeddingsrule-guid]
. If the object exists, it will be returned as a JSON object in the response body. If it does not exist, a 404 will be returned with a NotFound
error response.
{
"GUID": "example-graph-repository",
"TenantGUID": "default",
"Name": "My LiteGraph instance",
"RepositoryType": "LiteGraph",
"EndpointUrl": "http://litegraph:8701/",
"Port": 0,
"GraphIdentifier": "11111111-1111-1111-1111-111111111111",
"CreatedUtc": "2024-07-10T05:09:32.000000Z"
}
curl --location 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/graphrepositories/00000000-0000-0000-0000-000000000000' \
--header 'Authorization: ••••••'
import { ViewConfigurationSdk } from "view-sdk";
const api = new ViewConfigurationSdk(
"default", //tenant Id
"default", //access token
"http://localhost:8000/" //endpoint
);
const readGraphRepository = async () => {
try {
const response = await api.retrieveGraphRepository(
"00000000-0000-0000-0000-000000000000"
);
console.log(response, "Graph repository fetched successfully");
} catch (err) {
console.log("Error fetching Graph repository:", err);
}
};
readGraphRepository();
Note: the HEAD
method can be used as an alternative to get to simply check the existence of the object. HEAD
requests return either a 200/OK
in the event the object exists, or a 404/Not Found
if not. No response body is returned with a HEAD
request.
Read all
To read all objects, call GET /v1.0/tenants/[tenant-guid]/graphrepositories/
. If the object exists, it will be returned as an array of JSON object in the response body
curl --location 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/graphrepositories/' \
--header 'Authorization: ••••••'
import { ViewConfigurationSdk } from "view-sdk";
const api = new ViewConfigurationSdk(
"default", //tenant Id
"default", //access token
"http://localhost:8000/" //endpoint
);
const readAllGraphRepositories = async () => {
try {
const response = await api.retrieveGraphRepositories();
console.log(response, "All graph repositories fetched successfully");
} catch (err) {
console.log("Error fetching Graph repositories:", err);
}
};
readAllGraphRepositories();
Update
To update an object by GUID, call PUT /v1.0/tenants/[tenant-guid]/graphrepositories/[graphrepository-guid]
with a fully populated object in the request body. The updated object will be returned to you.
Note: certain fields cannot be modified and will be preserved across updates.
Request body:
{
"Name": "My updated LiteGraph instance",
"RepositoryType": "LiteGraph",
"EndpointUrl": "http://localhost:8701/",
"ApiKey": "default",
"GraphIdentifier": "00000000-0000-0000-0000-000000000000"
}
curl --location --request PUT 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/graphrepositories/00000000-0000-0000-0000-000000000000' \
--header 'content-type: application/json' \
--header 'Authorization: ••••••' \
--data '{
"Name": "My updated LiteGraph instance",
"RepositoryType": "LiteGraph",
"EndpointUrl": "http://localhost:8701/",
"ApiKey": "default",
"GraphIdentifier": "00000000-0000-0000-0000-000000000000"
}'
import { ViewConfigurationSdk } from "view-sdk";
const api = new ViewConfigurationSdk(
"default", //tenant Id
"default", //access token
"http://localhost:8000/" //endpoint
);
const updateGraphRepository = async () => {
try {
const response = await api.updateGraphRepository({
GUID: "31ff2943-f15a-4493-9cfc-21b56f821e89",
TenantGUID: "00000000-0000-0000-0000-000000000000",
Name: "My LiteGraph instance updated",
RepositoryType: "LiteGraph",
EndpointUrl: "http://localhost:8701/",
ApiKey: "***ault",
Ssl: false,
GraphIdentifier: undefined,
CreatedUtc: "2025-03-26T11:49:18.804037Z",
Port: 0,
});
console.log(response, "Graph repository updated successfully");
} catch (err) {
console.log("Error updating Graph repository:", err);
}
};
updateGraphRepository();
Response body:
{
GUID: '31ff2943-f15a-4493-9cfc-21b56f821e89',
TenantGUID: '00000000-0000-0000-0000-000000000000',
Name: 'My LiteGraph instance updated',
RepositoryType: 'LiteGraph',
EndpointUrl: 'http://localhost:8701/',
ApiKey: '***ault',
Ssl: false,
GraphIdentifier: undefined,
CreatedUtc: '2025-03-26T11:49:18.804037Z',
Port: 0
}
Delete
To delete an object by GUID, call DELETE /v1.0/tenants/[tenant-guid]/graphrepositories/[graphrepository-guid]
.
curl --location --request DELETE 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/graphrepositories/00000000-0000-0000-0000-000000000000' \
--header 'Authorization: ••••••' \
import { ViewConfigurationSdk } from "view-sdk";
const api = new ViewConfigurationSdk(
"default", //tenant Id
"default", //access token
"http://localhost:8000/" //endpoint
);
const deleteGraphRepository = async () => {
try {
const response = await api.deleteGraphRepository(
"31ff2943-f15a-4493-9cfc-21b56f821e89"
);
console.log(response, "Graph repository deleted successfully");
} catch (err) {
console.log("Error deleting Graph repository:", err);
}
};
deleteGraphRepository();
Check Existance
curl --location --head 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/graphrepositories/00000000-0000-0000-0000-000000000000' \
--header 'Authorization: ••••••'
import { ViewConfigurationSdk } from "view-sdk";
const api = new ViewConfigurationSdk(
"default", //tenant Id
"default", //access token
"http://localhost:8000/" //endpoint
);
const graphRepositoryExists = async () => {
try {
const response = await api.existsGraphRepository(
"180ee580-9c0b-4ef6-b0b1-cddabfa2067a"
);
console.log(response, "Graph repository exists");
} catch (err) {
console.log("Error checking Graph repository:", err);
}
};
graphRepositoryExists();