Knowledge
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).
BearerAuthAuthorizationBearer <token>JWT access token. Obtain via POST /v1/auth/login.
include_rules?Include RulesfalseSuccessful Response
application/json- 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" } ]}BearerAuthAuthorizationBearer <token>JWT access token. Obtain via POST /v1/auth/login.
application/json- body
enabled*EnabledSuccessful Response
application/json- response
updated*UpdatedNumber of rows affected.
curl -X PATCH 'https://api.aisc.sa/v1/knowledge/files' \ -H 'Content-Type: application/json' \ -d '{ "enabled": true}'{ "updated": 0}BearerAuthAuthorizationBearer <token>JWT access token. Obtain via POST /v1/auth/login.
Successful Response
curl -X DELETE 'https://api.aisc.sa/v1/knowledge/files'BearerAuthAuthorizationBearer <token>JWT access token. Obtain via POST /v1/auth/login.
file_key*File Key1 <= length <= 80application/json- body
enabled*EnabledSuccessful Response
application/json- response
enabled*Enabledfile_key*File Keyname*Namerule_count*Rule Countrules?array<unknown>|nullupdated_at*Updated Atdate-timecurl -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"}BearerAuthAuthorizationBearer <token>JWT access token. Obtain via POST /v1/auth/login.
file_key*File Key1 <= length <= 80Successful Response
curl -X DELETE 'https://api.aisc.sa/v1/knowledge/files/string'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.
BearerAuthAuthorizationBearer <token>JWT access token. Obtain via POST /v1/auth/login.
file_key*File Key1 <= length <= 80application/json- body
name*Name1 <= length <= 200rules*array<unknown>Parsed rule array; rule_count is derived from it.
Successful Response
application/json- response
enabled*Enabledfile_key*File Keyname*Namerule_count*Rule Countrules?array<unknown>|nullupdated_at*Updated Atdate-timecurl -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"}BearerAuthAuthorizationBearer <token>JWT access token. Obtain via POST /v1/auth/login.
Successful Response
application/json- response
disabled*array<string>curl -X GET 'https://api.aisc.sa/v1/knowledge/packages'{ "disabled": [ "sbc-801-fire" ]}enabled=false inserts a disabled-row (idempotent); enabled=true removes it. Returns the full disabled list after the change.
BearerAuthAuthorizationBearer <token>JWT access token. Obtain via POST /v1/auth/login.
package_id*Package Id1 <= length <= 40application/json- body
enabled*EnabledSuccessful Response
application/json- 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" ]}BearerAuthAuthorizationBearer <token>JWT access token. Obtain via POST /v1/auth/login.
Successful Response
application/json- 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" } ]}