Adds file references as knowledge sources to an agent version.
POST/api/v2/AgentVersion/:agentCode/:agentVersion/knowledge/file/reference
Adds file references as knowledge sources to an agent version. Subtitle files (.srt and .vtt) are accepted and read as plain text.
Request
Path Parameters
The code of the agent.
The version number of the agent.
Query Parameters
Use this param to override the culture of the response. Options: - en (default) - es
- application/json
- text/json
- application/*+json
Body
The file references to add as knowledge sources.
Array [
]
fileReferences
object[]
required
List of file references to add as knowledge sources
The ID of the file to reference as a knowledge source
metadata
object
Possible values: <= 500 characters
Description of the knowledge source
Possible values: <= 500 characters
Comma-separated tags for the knowledge source
Body
The file references to add as knowledge sources.
Array [
]
fileReferences
object[]
required
List of file references to add as knowledge sources
The ID of the file to reference as a knowledge source
metadata
object
Possible values: <= 500 characters
Description of the knowledge source
Possible values: <= 500 characters
Comma-separated tags for the knowledge source
Body
The file references to add as knowledge sources.
Array [
]
fileReferences
object[]
required
List of file references to add as knowledge sources
The ID of the file to reference as a knowledge source
metadata
object
Possible values: <= 500 characters
Description of the knowledge source
Possible values: <= 500 characters
Comma-separated tags for the knowledge source
Responses
- 200
- 400
- 401
- 403
- 404
- 500
Knowledge sources added successfully.
If the request is invalid or the version is not in DRAFT status. A version that links a dataset it can't link (another agent's default dataset, a draft, a dataset being deleted or one from another subtenant) is rejected with knowledge_dataset_not_linkable, with a message naming each dataset and why.
- application/json
- Schema
- Example (from schema)
Schema
- MOD1
- MOD2
Array [
]
Stable, machine-readable error code. Branch on this value, not on message.
Human-readable, localised summary of the error.
Link to the documentation section for this error code.
errors
object
nullable
Map of keys (an invalid request field or the rule that failed) to messages. Only present when the error has specific detail to report. Values are strings, except on input_validation_error, where each value is an array of messages for that field.
property name*
object
nullable
oneOf
string
string
{
"code": "string",
"message": "string",
"documentationUrl": "string",
"errors": {}
}
The user is unauthorized or the session expired
- application/json
- Schema
- Example (from schema)
Schema
Stable, machine-readable error code. Branch on this value, not on message.
Human-readable, localised summary of the error.
Link to the documentation section for this error code.
{
"code": "string",
"message": "string",
"documentationUrl": "string"
}
The user does not have permission
- application/json
- Schema
- Example (from schema)
Schema
Stable, machine-readable error code. Branch on this value, not on message.
Human-readable, localised summary of the error.
Link to the documentation section for this error code.
{
"code": "string",
"message": "string",
"documentationUrl": "string"
}
If the agent or version is not found.
- application/json
- Schema
- Example (from schema)
Schema
- MOD1
- MOD2
Array [
]
Stable, machine-readable error code. Branch on this value, not on message.
Human-readable, localised summary of the error.
Link to the documentation section for this error code.
errors
object
nullable
Map of keys (an invalid request field or the rule that failed) to messages. Only present when the error has specific detail to report. Values are strings, except on input_validation_error, where each value is an array of messages for that field.
property name*
object
nullable
oneOf
string
string
{
"code": "string",
"message": "string",
"documentationUrl": "string",
"errors": {}
}
There was an unexpected error
- application/json
- Schema
- Example (from schema)
Schema
Stable, machine-readable error code. Branch on this value, not on message.
Human-readable, localised summary of the error.
Link to the documentation section for this error code.
{
"code": "string",
"message": "string",
"documentationUrl": "string"
}