Skip to main content
PATCH
/
knowledge
/
v1alpha
/
{knowledge.name}
Update knowledge
curl --request PATCH \
  --url https://api.inworld.ai/knowledge/v1alpha/{knowledge.name} \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "records": [
    {
      "text": "<string>"
    }
  ],
  "language": "LANGUAGE_CODE_UNSPECIFIED"
}
'
{
  "name": "<string>",
  "metadata": {},
  "done": true,
  "error": {
    "code": 123,
    "message": "<string>",
    "details": [
      {
        "@type": "<string>"
      }
    ]
  },
  "response": {
    "name": "<string>",
    "records": [
      {
        "text": "<string>"
      }
    ],
    "language": "LANGUAGE_CODE_UNSPECIFIED"
  }
}

Authorizations

Authorization
string
header
required

Should follow the format Basic {credentials}. The {credentials} consists of the Base64-encoded string of the API key and the secret in the format key:secret

Path Parameters

knowledge.name
string
required

Resource name that is provided by user and can contain only lowercase letters, digits, underscores, or hyphens and has length up to 61 symbols

Body

application/json

The updated knowledge collection details.

records
object[]

List of knowledge records in the collection. The provided records will override the existing knowledge records

language
enum<string>
default:LANGUAGE_CODE_UNSPECIFIED

Language codes following the format of Language_Locale. Language is defined per ISO 639-1. Locale is defined per ISO 3166-1. Current protobuf value: 3. Please update with each revision.

  • LANGUAGE_CODE_UNSPECIFIED: Unspecified.
  • EN_US: English - US.
  • ZH_CN: Chinese - China.
  • KO_KR: Korean - Korea.
  • JA_JP: Japanese - Japan.
  • RU_RU: Russian - Russia.
  • AUTO: Auto-detect language.
Available options:
LANGUAGE_CODE_UNSPECIFIED,
EN_US,
ZH_CN,
KO_KR,
JA_JP,
RU_RU,
AUTO

Response

A successful response.

Long running operation that handle update knowledge

name
string

The server-assigned name, which is only unique within the Public Knowledge Retrieval APIservice.

metadata
object

Metadata for LRO associated with UpdateKnowledge.

done
boolean

If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available.

error
object

The Status type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by gRPC. Each Status message contains three pieces of data: error code, error message, and error details.

You can find out more about this error model and how to work with it in the API Design Guide.

response
object

Represents a knowledge collection, which contains multiple knowledge records.