Skip to main content
POST
/
knowledge
/
v1alpha
/
{parent}
/
knowledge
Create knowledge
curl --request POST \
  --url https://api.inworld.ai/knowledge/v1alpha/{parent}/knowledge \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "faq",
  "language": "EN_US",
  "records": [
    {
      "text": "Refunds are available within 14 days of purchase."
    },
    {
      "text": "Support is available via email and chat."
    }
  ]
}
'
{
  "name": "<string>",
  "metadata": {},
  "done": true,
  "error": {
    "code": 123,
    "message": "<string>",
    "details": [
      {
        "@type": "<string>"
      }
    ]
  },
  "response": {
    "name": "<string>",
    "records": [
      {
        "text": "<string>"
      }
    ],
    "language": "LANGUAGE_CODE_UNSPECIFIED"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.inworld.ai/llms.txt

Use this file to discover all available pages before exploring further.

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

parent
string
required

The workspace that owns the knowledge collection. Format: workspaces/{workspace}.

Pattern: workspaces/[^/]+

Body

application/json

The details of the knowledge collection to be created.

Represents a knowledge collection, which contains multiple knowledge records.

name
string

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

records
object[]

List of knowledge records in the collection.

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 create knowledge

name
string

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

metadata
object

Metadata for LRO associated with CreateKnowledge.

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.