Reserve a document and return a presigned upload URL
curl --request POST \
--url https://api.pineyard.ai/documents/upload-init \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"fileSize": 26214400
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', fileSize: 26214400})
};
fetch('https://api.pineyard.ai/documents/upload-init', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pineyard.ai/documents/upload-init"
payload = {
"name": "<string>",
"fileSize": 26214400
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"documentId": "<string>",
"uploadUrl": "<string>",
"uploadUrlExpiresAt": "<string>"
}Agent documents
Reserve a document and return a presigned upload URL
POST
/
documents
/
upload-init
Reserve a document and return a presigned upload URL
curl --request POST \
--url https://api.pineyard.ai/documents/upload-init \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"fileSize": 26214400
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', fileSize: 26214400})
};
fetch('https://api.pineyard.ai/documents/upload-init', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pineyard.ai/documents/upload-init"
payload = {
"name": "<string>",
"fileSize": 26214400
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"documentId": "<string>",
"uploadUrl": "<string>",
"uploadUrlExpiresAt": "<string>"
}Required scope:
knowledge.editAuthorizations
Your API key, e.g. pk_live_xxxxxxxxxxxxxxxxxxxxxxxx.
Body
application/json
Required string length:
1 - 200Required range:
1 <= x <= 52428800Available options:
application/pdf, application/vnd.openxmlformats-officedocument.wordprocessingml.document, text/plain, text/markdown Maximum string length:
500
