Skip to content

Code Insight REST API Documentation (v1)

The Code Insight REST APIs provide a standardized interface for interacting with the application.

An authorization JWT token must be included in the HTTP Authorization header using the Bearer schema. The token can be obtained from the Code Insight Web UI under the Preferences menu. To set the token, click the Authorize button below on the right, enter the JWT token in the Value field, then click Authorize and close the dialog. Once authorized, the token will be automatically included in the HTTP Authorization header for all API requests made through the Swagger UI.

Note: If accessing the REST APIs through external tools such as curl or Postman, include the token manually in the HTTP header using the following format: Authorization: Bearer JWT_TOKEN. "Bearer" must precede the actual JWT token value.

Download OpenAPI description
Languages
Servers
Mock server
https://codeinsightapi.redocly.app/_mock/swagger
Code Insight REST API Server
https://codeinsightapi.redocly.app/codeinsight/api

Email Templates

Internal API for fetching custom email templates and images from core server

Operations

CodebaseFolder

Operations

Deprecated APIs

Operations

Component

Operations

Files

Operations

Folder

Operations

Project API

Operations

Inventory API

Operations

inventoryWorkflow

Operations

Jobs

Operations

ldap

Operations

license

Operations

sourceCodeManagement

Operations

Reports

Operations

Rules

Operations

Get Rules

Request

Get existing custom rules

Security
bearerAuth
Query
offsetinteger(int64)>= 1

Index of the page to start with

Default 1
limitinteger(int64)>= 1

Number Of Records to fetch

Default 25
curl -i -X GET \
  'https://codeinsightapi.redocly.app/_mock/swagger/rules?offset=1&limit=25' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

Responses

OK

Update Rule

Request

Update existing rule.

Note: Value for detectionCriteria is an array of string Eg. detectionCriteria: ["filepath1 or folderpath1","filepath2 or folderpath2"].

Parameters fileInfo and ruleInfo are mutually exclusive. Only users with Library Manager role can update rules.

Security
bearerAuth
Bodyapplication/jsonrequired

Update existing rule.

idinteger(int64)

id

Example: 1
inventoryNamestring

inventoryName

Example: "Custom Inventory Name"
componentIdinteger(int64)>= 1required

componentId

Example: 1
versionIdinteger(int64)>= 1required

versionId

Example: 1
licenseIdinteger(int64)>= 1required

licenseId

Example: 1
descriptionstring

description

Example: "description"
urlstring[ 0 .. 2400 ] characters(NA|^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=...

url

Example: "https://www.flexera.com/"
noticesTextstring

noticesText

Example: "Sample Notices Text"
auditNotesstring

auditNotes

Example: "Sample Audit Notes"
asFoundLicenseTextstring

asFoundLicenseText

Example: "Sample from file LICENSE.txt in file @file in the materials"
fileInfoArray of objects(FileInfo)

fileInfo

ruleInfoArray of objects(RuleInfo)

ruleInfo

curl -i -X PUT \
  https://codeinsightapi.redocly.app/_mock/swagger/rules \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "id": 1,
    "inventoryName": "Custom Inventory Name",
    "componentId": 1,
    "versionId": 1,
    "licenseId": 1,
    "description": "description",
    "url": "https://www.flexera.com/",
    "noticesText": "Sample Notices Text",
    "auditNotes": "Sample Audit Notes",
    "asFoundLicenseText": "Sample from file LICENSE.txt in file @file in the materials",
    "fileInfo": [
      {
        "name": "fileName",
        "md5": "md5"
      }
    ],
    "ruleInfo": [
      {
        "detectionType": "filePath",
        "detectionCriteria": "[filepath]"
      }
    ]
  }'

Responses

OK

Create Rule

Request

Add new rule with either file info or rule info.

Note: Value for detectionCriteria is an array of string Eg. detectionCriteria: ["filepath1 or folderpath1","filepath2 or folderpath2"].

Parameters fileInfo and ruleInfo are mutually exclusive. Only users with Library Manager role can create rules.

Security
bearerAuth
Bodyapplication/jsonrequired

Add new rule.

inventoryNamestring

inventoryName

Example: "Custom Inventory Name"
componentIdinteger(int64)>= 1required

componentId

Example: 1
versionIdinteger(int64)>= 1required

versionId

Example: 1
licenseIdinteger(int64)>= 1required

licenseId

Example: 1
descriptionstring

description

Example: "description"
urlstring[ 0 .. 2400 ] characters(NA|^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=...

url

Example: "https://www.flexera.com/"
noticesTextstring

noticesText

Example: "Sample Notices Text"
auditNotesstring

auditNotes

Example: "Sample Audit Notes"
asFoundLicenseTextstring

asFoundLicenseText

Example: "Sample from file LICENSE.txt in file @file in the materials"
fileInfoArray of objects(FileInfo)

fileInfo

ruleInfoArray of objects(RuleInfo)

ruleInfo

curl -i -X POST \
  https://codeinsightapi.redocly.app/_mock/swagger/rules \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "inventoryName": "Custom Inventory Name",
    "componentId": 1,
    "versionId": 1,
    "licenseId": 1,
    "description": "description",
    "url": "https://www.flexera.com/",
    "noticesText": "Sample Notices Text",
    "auditNotes": "Sample Audit Notes",
    "asFoundLicenseText": "Sample from file LICENSE.txt in file @file in the materials",
    "fileInfo": [
      {
        "name": "fileName",
        "md5": "md5"
      }
    ],
    "ruleInfo": [
      {
        "detectionType": "filePath",
        "detectionCriteria": "[filepath]"
      }
    ]
  }'

Responses

Created

Get Rule By Id

Request

Get existing rule by ruleId

Security
bearerAuth
Path
ruleIdinteger(int64)required
curl -i -X GET \
  'https://codeinsightapi.redocly.app/_mock/swagger/rules/{ruleId}' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

Responses

OK

Delete Rule

Request

Delete existing rule. Only users with Library Manager role can delete rules.

Security
bearerAuth
Path
ruleIdinteger(int64)required
curl -i -X DELETE \
  'https://codeinsightapi.redocly.app/_mock/swagger/rules/{ruleId}' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

Responses

OK

Disable Rules

Request

Disable multiple rules by their IDs. Disabled rules will not be applied during project scanning. Only users with Library Manager role can disable rules.

Security
bearerAuth
Bodyapplication/jsonrequired

List of rule IDs to disable

Array [
integer(int64)
]
curl -i -X PUT \
  https://codeinsightapi.redocly.app/_mock/swagger/rules/disable \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '[
    0
  ]'

Responses

Rules disabled successfully

Enable Rules

Request

Enable multiple rules. Enabled rules will be applied during project scanning. Only users with Library Manager role can enable rules.

Security
bearerAuth
Bodyapplication/jsonrequired

List of rules ids to enable

Array [
integer(int64)
]
curl -i -X PUT \
  https://codeinsightapi.redocly.app/_mock/swagger/rules/enable \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '[
    0
  ]'

Responses

Rules enabled successfully

Scan profiles

Operations

Task

Operations

Scan API

Operations

User API

Operations

vulnerability

Operations