BKN 知识网络 · 风险类 API (0.1.0)

Download OpenAPI specification:

Risk Type management. A risk type is a lightweight concept with only a name, tags, comment, and display metadata (icon and color). It is not bound to action types or thresholds. All APIs are exposed under /api/bkn-backend/v1, require OAuth2 authentication, and default the branch query parameter to main. Risk types use risk_type:{kn_id}/{risk_type_id}. Reads and lists require view_detail; updates and deletes use modify and delete. See ../knowledge-network-authorization.md. Resource IDs use lowercase letters, digits, underscores, and hyphens, start with a letter or digit, and contain at most 128 characters. Resource names contain at most 128 Unicode characters.

RiskType

Create risk types in batch or search by criteria

This endpoint uses the x-http-method-override header to select an operation:

  • An omitted header or POST creates or imports risk types in batch using entries.
  • GET searches risk types by criteria or semantics using a ConceptsQuery body.
  • Other values return 400.

Requires an application/json content type.

Authorizations:
OAuth2
path Parameters
kn_id
required
string

Business knowledge network ID

query Parameters
branch
string
Default: "main"

Branch name. Defaults to main.

import_mode
string
Default: "normal"
Enum: "normal" "ignore" "overwrite"

Applies only to creation. normal reports existing items; ignore skips them; overwrite replaces them by ID.

header Parameters
x-http-method-override
string
Enum: "POST" "GET"

Method override. Empty or POST creates in batch; GET searches.

Request Body schema: application/json
required
One of
required
Array of objects (RiskTypeInput) non-empty

Responses

Request samples

Content type
application/json
Example
{
  • "entries": [
    ]
}

Response samples

Content type
application/json
{
  • "entries": [
    ],
  • "total_count": 0,
  • "next_cursor": "string",
  • "overall_ms": 0
}

List risk types

Lists risk types in a knowledge network with pagination and optional name or tag filtering.

Authorizations:
OAuth2
path Parameters
kn_id
required
string

Business knowledge network ID

query Parameters
branch
string
Default: "main"

Branch name. Defaults to main.

name_pattern
string

Fuzzy match by name or ID. Defaults to empty.

tag
string

Fuzzy match by tag. Defaults to empty.

offset
integer <int64>
Default: 0

Offset, greater than or equal to 0. Defaults to 0.

limit
integer <int64>
Default: 10

Page size in the range [1, 1000]. A value of -1 returns all items without pagination.

sort
string
Default: "update_time"
Enum: "name" "update_time"

Sort field

direction
string
Default: "desc"
Enum: "asc" "desc"

Sort direction

Responses

Response samples

Content type
application/json
{
  • "entries": [
    ],
  • "total_count": 0
}

Update a risk type

Fully updates one risk type. Requires application/json content type.

Authorizations:
OAuth2
path Parameters
kn_id
required
string

Business knowledge network ID

rt_id
required
string

Risk type ID

query Parameters
branch
string
Default: "main"

Branch name. Defaults to main.

Request Body schema: application/json
required
id
string <= 128 characters ^$|^[a-z0-9][a-z0-9_-]{0,127}$

Optional. Generated automatically when empty during creation.

name
required
string <= 128 characters
tags
Array of strings
comment
string
icon
string
color
string

Responses

Request samples

Content type
application/json
{
  • "id": "string",
  • "name": "string",
  • "tags": [
    ],
  • "comment": "string",
  • "icon": "string",
  • "color": "string"
}

Response samples

Content type
application/json
{
  • "error_code": "string",
  • "description": "string",
  • "error_details": null,
  • "metadata": { }
}

Batch get risk types by ID

Gets the specified risk types by ID in batch. If any ID is missing, the entire request returns 404.

Authorizations:
OAuth2
path Parameters
kn_id
required
string

Business knowledge network ID

rt_ids
required
string

Comma-separated risk type ID list

query Parameters
branch
string
Default: "main"

Branch name. Defaults to main.

Responses

Response samples

Content type
application/json
{
  • "entries": [
    ]
}

Delete risk types in batch

Deletes one or more risk types by ID list.

Authorizations:
OAuth2
path Parameters
kn_id
required
string

Business knowledge network ID

rt_ids
required
string

Comma-separated risk type ID list

query Parameters
branch
string
Default: "main"

Branch name. Defaults to main.

Responses

Response samples

Content type
application/json
{
  • "error_code": "string",
  • "description": "string",
  • "error_details": null,
  • "metadata": { }
}