Update knowledge base entry Beta

PUT /v1/replicas/{replicaUUID}/training/{trainingID}

Updates a knowledge base entry with training content. This is the second step in the training process after creating an entry. You can provide "rawText" which is the content you want your replica to learn from (such as product information, company policies, or specialized knowledge). The system will automatically process this text and make it available for your replica to use when answering questions. The entry status will change to PROCESSING and then to READY once fully processed.

Headers

  • X-API-Version string

    Default value is 2025-03-25.

Path parameters

  • replicaUUID string(uuid) Required

    The replica unique identifier (UUID)

  • trainingID number | null Required

    The unique identifier of the knowledge base entry

application/json

Body

  • rawText string

    The text content you want your replica to learn

    Minimum length is 1.

  • processedText string

    Pre-processed text that is ready to be added to the knowledge base. This is typically used when you have already optimized the text format.

    Minimum length is 1.

  • vectorEntryId string

    The ID of the vector entry in the database. Its presenceindicates the information has been fully processed and is ready for retrieval.

  • metadata object

    Additional information about the knowledge base entry, such as source, tags, or other contextual data (only used when vectorEntryId is present)

    Additional properties are allowed.

Responses

  • 200 application/json

    Knowledge base entry updated successfully.

    Hide response attribute Show response attribute object
    • success boolean Required

      Indicates the status of the request

  • 400 application/json

    Bad Request

    Hide response attributes Show response attributes object
    • success boolean Required

      Indicates the status of the request

    • error string Required

      A text representation of the error

    • fingerprint string

      A unique identifier of the event, useful for reporting

    • request_id string Required

      A unique identifier of the request, useful for reporting

  • 401 application/json

    Unauthorized

    Hide response attributes Show response attributes object
    • success boolean Required

      Indicates the status of the request

    • error string Required

      A text representation of the error

    • fingerprint string

      A unique identifier of the event, useful for reporting

    • request_id string Required

      A unique identifier of the request, useful for reporting

  • 404 application/json

    Not Found

    Hide response attributes Show response attributes object
    • success boolean Required

      Indicates the status of the request

    • error string Required

      A text representation of the error

    • request_id string Required

      A unique identifier of the request, useful for reporting

  • 415 application/json

    Unsupported Media Type

    Hide response attributes Show response attributes object
    • success boolean Required

      Indicates the status of the request

    • error string Required

      A text representation of the error

    • fingerprint string

      A unique identifier of the event, useful for reporting

    • request_id string Required

      A unique identifier of the request, useful for reporting

  • 500 application/json

    Internal Server Error

    Hide response attributes Show response attributes object
    • success boolean Required

      Indicates the status of the request

    • error string Required

      A text representation of the error

    • fingerprint string

      A unique identifier of the event, useful for reporting

    • request_id string Required

      A unique identifier of the request, useful for reporting

    • inner_exception object

      The inner exception

      Hide inner_exception attributes Show inner_exception attributes object
      • name string Required
      • message string Required
      • cause string
      • stack string
PUT /v1/replicas/{replicaUUID}/training/{trainingID}
curl \
 --request PUT 'https://api.sensay.io/v1/replicas/03db5651-cb61-4bdf-9ef0-89561f7c9c53/training/12345' \
 --header "X-ORGANIZATION-SECRET: $API_KEY" \
 --header "Content-Type: application/json" \
 --header "X-API-Version: 2025-03-25" \
 --data '{"rawText":"Our company was founded in 2020. We specialize in AI-powered customer service solutions.","processedText":"Our company was founded in 2020. We specialize in AI-powered customer service solutions.","vectorEntryId":"1337","metadata":{"page":42,"tags":["company info","history"],"source":"company handbook"}}'
Request examples
# Headers
X-API-Version: 2025-03-25

# Payload
{
  "rawText": "Our company was founded in 2020. We specialize in AI-powered customer service solutions.",
  "processedText": "Our company was founded in 2020. We specialize in AI-powered customer service solutions.",
  "vectorEntryId": "1337",
  "metadata": {
    "page": 42,
    "tags": [
      "company info",
      "history"
    ],
    "source": "company handbook"
  }
}
Response examples (200)
{
  "success": true
}
Response examples (400)
{
  "error": "A text representation of the error",
  "success": false,
  "request_id": "xyz1::reg1:reg1::ab3c4-1234567890123-0123456789ab",
  "fingerprint": "14fceadd84e74ec499afe9b0f7952d6b"
}
Response examples (401)
{
  "error": "A text representation of the error",
  "success": false,
  "request_id": "xyz1::reg1:reg1::ab3c4-1234567890123-0123456789ab",
  "fingerprint": "14fceadd84e74ec499afe9b0f7952d6b"
}
Response examples (404)
{
  "error": "A text representation of the error",
  "success": false,
  "request_id": "xyz1::reg1:reg1::ab3c4-1234567890123-0123456789ab"
}
Response examples (415)
{
  "error": "A text representation of the error",
  "success": false,
  "request_id": "xyz1::reg1:reg1::ab3c4-1234567890123-0123456789ab",
  "fingerprint": "14fceadd84e74ec499afe9b0f7952d6b"
}
Response examples (500)
{
  "error": "A text representation of the error",
  "success": false,
  "request_id": "xyz1::reg1:reg1::ab3c4-1234567890123-0123456789ab",
  "fingerprint": "14fceadd84e74ec499afe9b0f7952d6b",
  "inner_exception": {
    "name": "Server overheated",
    "cause": "Request too complicated",
    "stack": "Error: Server overheated due to an unexpected situation\n    at Object.eval (eval at <anonymous>...",
    "message": "The server overheated due to an unexpected situation"
  }
}