1Generate AI Metadata
Overview
This API generates AI metadata for a semantic model, in one of two modes as specified by the parameter usecase.
Method: POST
Request URL: {kyvos-url}/rest/v2/semantic-models/{name-or-id}/generate-ai-metadata
Authorization
API Key: sessionid
This method authenticates requests using a session ID which acts like an API key.
BasicAuth: HTTP Authorization Scheme
This method authenticates requests using a username and password sent in the HTTP Authorization header.
Headers
Header | Required | Value | Description |
|---|---|---|---|
Content-Type | Yes |
| Request body must be sent as URL-encoded form fields. |
Accept | No |
| This API always returns |
Path Parameters
Name | Type | Required | Description |
|---|---|---|---|
name-or-id | string | yes | The semantic model's name or id. How this value is interpreted is determined by the |
Query Parameters
Name | Type | Default | Description |
|---|---|---|---|
by | string |
| Whether |
Form Parameters
Name | Type | Default | Required | Description |
|---|---|---|---|---|
folderName | string | — | no | Name of the folder in which the semantic model resides. Only used when resolving by name; ignored when resolving by id. |
folderId | string | — | no | ID of the folder in which the semantic model resides. Only used when resolving by name. |
usecase | string |
| no | Specifies the AI metadata generation mode. Supported values (case-insensitive):
Note: Any other value returns error code |
columns | string |
| no | Specifies which columns are considered for metadata generation when Supported values:
Note: Any other value returns error code |
userPrompt | string |
| no | Free-text prompt to guide the AI generation. |
action | string |
| no | Specifies whether to generate and save the result or generate it for preview without saving. The following values are supported:
Note: Any other value (case-insensitive) returns error code |
Responses
The following responses are applicable when the usecase parameter is set to COLUMNS_METADATA and the action parameter is set to GENERATE_ONLY.
200 Success
{
"columns": {
"MEASURE_787792": {
"name": "salary",
"businessContext": "...",
"type": "MEASURE",
"tags": ["pay"]
},
"DIMENSION_ATTRIBUTE_448466": {
"name": "country",
"businessContext": "...",
"type": "ATTRIBUTE",
"tags": ["nation"]
}
},
"failedColumns": {
"DIMENSION_ATTRIBUTE_44864": {
"name": "...",
"businessContext": "",
"type": "ATTRIBUTE",
"tags": []
}
}
}Status | Condition | Body shape |
|---|---|---|
| Neither the semantic model's name nor id could be resolved |
|
|
|
|
|
|
|
|
|
|
|
|
|
| No eligible column to generate metadata for ( |
|
| No eligible column to save ( |
|
| Semantic model not found |
|
| Unexpected error, or an engine/ |
|
Request Examples
Generate + save per-column metadata for all eligible columns (default action)
curl -X POST '{kyvos-url}/rest/v2/semantic-models/{name-or-id}/generate-ai-metadata?by=id' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Authorization: Basic <token>' \
--data-urlencode 'usecase=COLUMNS_METADATA' \
--data-urlencode 'columns=ALL'Preview per-column metadata for only the columns that don't have any yet, without saving
curl -X POST '{kyvos-url}/rest/v2/semantic-models/{name-or-id}/generate-ai-metadata?by=id' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Authorization: Basic <token>' \
--data-urlencode 'usecase=COLUMNS_METADATA' \
--data-urlencode 'columns=EMPTY_COLUMNS' \
--data-urlencode 'action=GENERATE_ONLY'Generate and save a semantic-model-level business context, guided by a prompt
curl -X POST '{kyvos-url}/rest/v2/semantic-models/{name-or-id}/generate-ai-metadata?by=id' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Authorization: Basic <token>' \
--data-urlencode 'usecase=SM_BUSINESS_CONTEXT' \
--data-urlencode 'userPrompt=Focus on retail sales terminology'Bare defaults (still requires the form-urlencoded Content-Type header even with an empty body)
curl -X POST '{kyvos-url}/rest/v2/semantic-models/{name-or-id}/generate-ai-metadata?by=id' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Authorization: Basic <token>'