This page covers the basic of interacting with and consuming the LiteGraph REST API.
HTTP Methods
LiteGraph primarily uses the following HTTP methods:
GET: Retrieve resourcesPUT: Create or update resourcesPOST: Perform logic operationsDELETE: Remove resourcesHEAD: Verify existence of a resource
Note: While these are the general usage patterns, there may be occasional deviations for specific endpoints.
URL Structure
The general URL structure for the LiteGraph APIs is: [http||https]://[hostname]:[port]/[apiversion]/tenants/[tenant-guid]/[resource-type]/[resource-guid]
hostname: Defined by the user based on their deploymentport: Specific to each microservice (see Microservices section). Most ports are accessible port8000apiversion: In the formatvx.y(e.g.,v1.0,v2.0)tenant-guid: Identifies the tenant within the multi-tenant systemresource-type: Specifies the type of resource being accessedresource-guid: Identifies the individual resource
While this is the typical URL structure, deviations do exist, and will be documented accordingly.
Authentication
LiteGraph uses three distinct mechanisms for authentication:
- Bearer tokens - used for administrator authentication or for user authentication
- Security tokens - generated via API by passing in credentials and a tenant GUID, security tokens are ephemeral and can be used on subsequent API calls by including them as the value to the
x-tokenheader
Response Format
Most LiteGraph APIs return responses in JSON format.
Error Codes
LiteGraph uses standard HTTP status codes, including:
200: OK201: Created204: No Content400: Bad Request401: Unauthorized403: Forbidden404: Not Found409: Conflict429: Too Many Requests500: Internal Server Error501: Not Implemented503: Service Unavailable
Healthcheck
LiteGraph will always return a 200 to a request made using HEAD /. Using GET / will also return a 200, along with a simple HTML page. These endpoints are commonly used as healthcheck endpoints to validate connectivity to LiteGraph.