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 @- <<EOF
{
"name": "Hitchhiker's Guide to the Galaxy",
"format": "text",
"content": "<string>"
}
EOFimport requests
url = "https://api.bey.dev/v1/knowledge-files"
payload = {
"name": "Hitchhiker's Guide to the Galaxy",
"format": "text",
"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: 'Hitchhiker\'s Guide to the Galaxy', format: 'text', 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": "01234567-89ab-cdef-0123-456789abcdef",
"name": "Hitchhiker's Guide to the Galaxy",
"format": "text",
"status": "to-upload"
}Agent Knowledge Files
Create Knowledge File
Create a knowledge file and start its upload.
Text files are stored immediately and begin indexing, so they come back
as processing and are ready to attach to an agent once they read
available. PDF files begin a chunked upload: use the returned ID to
upload each chunk via PUT /{id}/upload, then finalize with
POST /{id}/submit.
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 @- <<EOF
{
"name": "Hitchhiker's Guide to the Galaxy",
"format": "text",
"content": "<string>"
}
EOFimport requests
url = "https://api.bey.dev/v1/knowledge-files"
payload = {
"name": "Hitchhiker's Guide to the Galaxy",
"format": "text",
"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: 'Hitchhiker\'s Guide to the Galaxy', format: 'text', 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": "01234567-89ab-cdef-0123-456789abcdef",
"name": "Hitchhiker's Guide to the Galaxy",
"format": "text",
"status": "to-upload"
}Authorizations
Your Beyond Presence API Key.
Body
application/json
Response
Created Knowledge File
- ToUploadKnowledgeFileResponse
- ProcessingKnowledgeFileResponse
- AvailableKnowledgeFileResponse
- FailedKnowledgeFileResponse
Response model for a knowledge file that is to be uploaded.
Unique identifier of the object in the database.
Example:
"01234567-89ab-cdef-0123-456789abcdef"
Required string length:
1 - 100Example:
"Hitchhiker's Guide to the Galaxy"
Format of the knowledge file.
Available options:
text, pdf Allowed value:
"to-upload"Was this page helpful?