Skip to main content
POST
/
v1
/
knowledge-files
Create Knowledge File
curl --request POST \
  --url https://api.bey.dev/v1/knowledge-files \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "name": "<string>",
  "format": "<string>",
  "content": "<string>"
}
'
import requests

url = "https://api.bey.dev/v1/knowledge-files"

payload = {
"name": "<string>",
"format": "<string>",
"content": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', format: '<string>', content: '<string>'})
};

fetch('https://api.bey.dev/v1/knowledge-files', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
{
  "id": "<string>",
  "name": "<string>",
  "status": "to-upload"
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}

Authorizations

x-api-key
string
header
required

Your Beyond Presence API Key.

Body

application/json

Request model for creating a text knowledge file.

name
string
required
Required string length: 1 - 100
Example:

"Hitchhiker's Guide to the Galaxy"

format
string
required
Allowed value: "text"
content
string
required
Required string length: 1 - 100000

Response

Created Knowledge File

Response model for a knowledge file that is to be uploaded.

id
string
required

Unique identifier of the object in the database.

Example:

"01234567-89ab-cdef-0123-456789abcdef"

name
string
required
Required string length: 1 - 100
Example:

"Hitchhiker's Guide to the Galaxy"

format
enum<string>
required

Format of the knowledge file.

Available options:
text,
pdf
status
string
default:to-upload
Allowed value: "to-upload"