امتثال
واجهة البرمجة

Knowledge

GET
/v1/knowledge/files

Metadata for every custom KB file (enabled AND disabled). Pass ?include_rules=1 to include each file's full rules array (used by the web export flow, which needs disabled files too).

Authorization

BearerAuth
headerAuthorizationBearer <token>

JWT access token. Obtain via POST /v1/auth/login.

Query Parameters

include_rules?Include Rules
Defaultfalse

Response Body

Successful Response

application/json
  1. response
files*array<>
curl -X GET 'https://api.aisc.sa/v1/knowledge/files'
{  "files": [    {      "enabled": true,      "file_key": "direct-a1b2c3d4e5f60708",      "name": "My custom fire-safety rules",      "rule_count": 12,      "rules": [        null      ],      "updated_at": "2019-08-24T14:15:22Z"    }  ]}
PATCH
/v1/knowledge/files

Authorization

BearerAuth
headerAuthorizationBearer <token>

JWT access token. Obtain via POST /v1/auth/login.

Request Body

application/json
  1. body
enabled*Enabled

Response Body

Successful Response

application/json
  1. response
updated*Updated

Number of rows affected.

curl -X PATCH 'https://api.aisc.sa/v1/knowledge/files' \  -H 'Content-Type: application/json' \  -d '{  "enabled": true}'
{  "updated": 0}
DELETE
/v1/knowledge/files

Authorization

BearerAuth
headerAuthorizationBearer <token>

JWT access token. Obtain via POST /v1/auth/login.

Response Body

Successful Response

curl -X DELETE 'https://api.aisc.sa/v1/knowledge/files'
Empty
PATCH
/v1/knowledge/files/{file_key}

Authorization

BearerAuth
headerAuthorizationBearer <token>

JWT access token. Obtain via POST /v1/auth/login.

Path Parameters

file_key*File Key
Length1 <= length <= 80

Request Body

application/json
  1. body
enabled*Enabled

Response Body

Successful Response

application/json
  1. response
enabled*Enabled
file_key*File Key
name*Name
rule_count*Rule Count
rules?array<unknown>|null
updated_at*Updated At
Formatdate-time
curl -X PATCH 'https://api.aisc.sa/v1/knowledge/files/string' \  -H 'Content-Type: application/json' \  -d '{  "enabled": true}'
{  "enabled": true,  "file_key": "direct-a1b2c3d4e5f60708",  "name": "My custom fire-safety rules",  "rule_count": 12,  "rules": [    null  ],  "updated_at": "2019-08-24T14:15:22Z"}
DELETE
/v1/knowledge/files/{file_key}

Authorization

BearerAuth
headerAuthorizationBearer <token>

JWT access token. Obtain via POST /v1/auth/login.

Path Parameters

file_key*File Key
Length1 <= length <= 80

Response Body

Successful Response

curl -X DELETE 'https://api.aisc.sa/v1/knowledge/files/string'
Empty
PUT
/v1/knowledge/files/{file_key}

Upsert by (user, file_key). rule_count is recomputed server-side; updated_at is bumped explicitly (findings-cache fingerprint input); the prior enabled flag is preserved on replace. Serialized rules over 5 MB → 413.

Authorization

BearerAuth
headerAuthorizationBearer <token>

JWT access token. Obtain via POST /v1/auth/login.

Path Parameters

file_key*File Key
Length1 <= length <= 80

Request Body

application/json
  1. body
name*Name
Length1 <= length <= 200
rules*array<unknown>

Parsed rule array; rule_count is derived from it.

Response Body

Successful Response

application/json
  1. response
enabled*Enabled
file_key*File Key
name*Name
rule_count*Rule Count
rules?array<unknown>|null
updated_at*Updated At
Formatdate-time
curl -X PUT 'https://api.aisc.sa/v1/knowledge/files/string' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "rules": [    null  ]}'
{  "enabled": true,  "file_key": "direct-a1b2c3d4e5f60708",  "name": "My custom fire-safety rules",  "rule_count": 12,  "rules": [    null  ],  "updated_at": "2019-08-24T14:15:22Z"}
GET
/v1/knowledge/packages

Authorization

BearerAuth
headerAuthorizationBearer <token>

JWT access token. Obtain via POST /v1/auth/login.

Response Body

Successful Response

application/json
  1. response
disabled*array<string>
curl -X GET 'https://api.aisc.sa/v1/knowledge/packages'
{  "disabled": [    "sbc-801-fire"  ]}
PUT
/v1/knowledge/packages/{package_id}

enabled=false inserts a disabled-row (idempotent); enabled=true removes it. Returns the full disabled list after the change.

Authorization

BearerAuth
headerAuthorizationBearer <token>

JWT access token. Obtain via POST /v1/auth/login.

Path Parameters

package_id*Package Id
Length1 <= length <= 40

Request Body

application/json
  1. body
enabled*Enabled

Response Body

Successful Response

application/json
  1. response
disabled*array<string>
curl -X PUT 'https://api.aisc.sa/v1/knowledge/packages/string' \  -H 'Content-Type: application/json' \  -d '{  "enabled": true}'
{  "disabled": [    "sbc-801-fire"  ]}
GET
/v1/knowledge/scan-context

Authorization

BearerAuth
headerAuthorizationBearer <token>

JWT access token. Obtain via POST /v1/auth/login.

Response Body

Successful Response

application/json
  1. response
disabled_packages*array<string>
files*array<>

ENABLED custom KB files only.

curl -X GET 'https://api.aisc.sa/v1/knowledge/scan-context'
{  "disabled_packages": [    "string"  ],  "files": [    {      "file_key": "string",      "name": "string",      "rule_count": 0,      "rules": [        null      ],      "updated_at": "2019-08-24T14:15:22Z"    }  ]}