Skip to main content
Version: 3.2

REST API (OpenAPI / Swagger)

Cortex 3.2 includes a runtime-generated OpenAPI 3.0 specification covering the full REST API, served alongside an interactive Swagger UI for exploring and testing endpoints.


Accessing the Swagger UI​

The Swagger UI is available at:

http://YOUR_CORTEX_URL/swagger

From here, you can browse available endpoints, view request and response schemas, and test API calls directly in your browser.

The raw OpenAPI specification is available at:

http://YOUR_CORTEX_URL/swagger/v1/swagger.json

API Endpoints​

The REST API includes the following primary endpoints:

EndpointDescription
GET /api/data-sourcesList all available data sources
GET /api/data-sources/{dsId}/tablesList tables in a data source
GET /api/data-sources/{dsId}/tables/{tableId}Get table details and schema
GET /api/data-sources/{dsId}/tables/{tableId}/recordsSearch records in a table
GET /api/data-sources/{dsId}/tables/{tableId}/records/{recordId}Get a single record
GET /api/data-sources/{dsId}/tables/{tableId}/records/{recordId}/relationships/{relationshipId}Get related records
GET /api/servicenow/datasource/{id}/choicesGet ServiceNow choice options for a data source

Authentication​

The REST API uses API key authentication. To authenticate:

  1. Create an API key from Admin → API → API Keys.
  2. Include the key in the Authorization header of your requests:
Authorization: Bearer YOUR_API_KEY

Content Type​

The API returns JSON responses. Set the Accept header to application/json when making requests.


API Versioning​

The API version is derived from the Cortex build version and is included in the OpenAPI specification. The current version is reflected in the Swagger UI title.


Use Cases​

The REST API is useful for:

  • Integration with external tools — connect Cortex data to reporting, dashboard, or automation tools
  • Custom scripts — write scripts that query or manage archive data programmatically
  • Testing and development — use the Swagger UI to explore the API and test endpoints before building integrations

Swagger UI Features​

The Swagger UI provides:

  • Endpoint listing — all available endpoints grouped by category
  • Request parameters — clear documentation of required and optional parameters
  • Response schemas — JSON schema for each endpoint's response
  • Try it out — execute requests directly from the browser with your API key
  • Authentication — built-in support for passing the Bearer token