Getting Started


Overview

The CAST Imaging API provides RESTful access to analysis results and is automatically installed with CAST Imaging. This API allows you to programmatically retrieve and interact with your analysis data.

Getting started

Base URL

The API is accessible via the following endpoints, depending on your CAST Imaging configuration:

HTTP (default):

http://<imaging-public-url>:8090/rest/

HTTPS (if configured):

https://<imaging-public-url>/rest/

Replace <imaging-public-url> with your actual CAST Imaging server address. All API requests in this documentation assume the appropriate base URL is prepended.

Authentication

API access requires authentication using a user-specific API key:

Generating an API Key

  1. Log into the CAST Imaging UI
  2. Navigate to your Profile settings
  3. Generate your API key

Using the API Key

Include your API key in the X-API-KEY header for every request:

curl -H "X-API-KEY: <your-api-key>" http://<imaging-public-url>:8090/rest/<endpoint>

Configuration

Default setup

No additional configuration is required for a standard installation. The API runs out-of-the-box with default settings.

Custom configuration

To customize API behavior, modify the app.config JSON file located at:

Windows:

%PROGRAMDATA%/CAST/Imaging/CAST-Imaging-Viewer/setup-config/imagingapis/

Linux (Docker):

/opt/cast/installation/imaging-viewer/imaging-apis/config/

Configuration options

Below is the default app.config file with available settings. Restart the CAST Imaging API service/container for changes to take effect.

{
  "PORT": "8070",
  "NEO4J_BOLT_ENDPOINT": "neo4j:7687",
  "NEO4J_USERNAME": "neo4j",
  "NEO4J_PASSWORD": "imaging",
  "API_KEY": "",
  "LOG_PATH": "/opt/imaging/imaging-api/logs/",
  "LOG_LEVEL": "info",
  "SOURCE_CODE_SERVICE_TOKEN": "",
  "SOURCE_CODE_SERVICE_ENDPOINT": "",
  "TRUSTED_PROXIES": "",
  "ACCESS_CONTROL_ALLOW_ORIGIN": "",
  "ACCESS_CONTROL_ALLOW_METHODS": "",
  "ACCESS_CONTROL_ALLOW_HEADERS": "",
  "EUREKA_HOST": "host",
  "EUREKA_PORT": "port",
  "SERVICE_HOST": "localhost",
  "SERVICE_NAME": "ImagingAPIs"
}

Important: Do not use the "API_KEY" field in the configuration file. API keys should always be passed in the X-API-KEY header for every request.

Log levels

Configure logging verbosity by updating the LOG_LEVEL setting in app.config:

{
  "LOG_LEVEL": "info"
}

Available log levels (in order of verbosity):

  • error: Shows only error messages (least verbose)
  • warning: Includes warnings and errors
  • info: Shows informational messages (default and recommended)
  • debug: Enables verbose output for troubleshooting (most verbose). Use only when troubleshooting issues, as it generates significantly more log data.