curl -X POST "https://api.nedzo.ai/v1/knowledge/uploads" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "fileName": "price-list.pdf", "contentType": "application/pdf" }'
# Then upload the file to the uploadUrl from the answer
curl -X PUT "UPLOAD_URL" \
-H "Content-Type: application/pdf" \
--data-binary @price-list.pdf
{
"uploadUrl": "https://...",
"method": "PUT",
"fileUrl": "https://...",
"fileName": "price-list.pdf",
"contentType": "application/pdf",
"maxBytes": 5242880,
"expiresAt": "2026-10-11T12:00:00Z"
}
Knowledge
Get a file upload link
Get a link to upload a file for the knowledge library through the Nedzo REST API, so you don’t have to host the file yourself.
POST
/
knowledge
/
uploads
curl -X POST "https://api.nedzo.ai/v1/knowledge/uploads" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "fileName": "price-list.pdf", "contentType": "application/pdf" }'
# Then upload the file to the uploadUrl from the answer
curl -X PUT "UPLOAD_URL" \
-H "Content-Type: application/pdf" \
--data-binary @price-list.pdf
{
"uploadUrl": "https://...",
"method": "PUT",
"fileUrl": "https://...",
"fileName": "price-list.pdf",
"contentType": "application/pdf",
"maxBytes": 5242880,
"expiresAt": "2026-10-11T12:00:00Z"
}
This endpoint is for the VIP plan only. Other plans get a
403. See Plan access.PUTthe file bytes touploadUrl, with theContent-Typeheader set tocontentType.- Add the file with Add knowledge, using the
fileUrlandfileNamefrom this answer.
contentType from this answer. When you add the file, fileName must have the same extension as the upload.
Anyone with the fileUrl can open the file.
| Extension | contentType |
|---|---|
pdf | application/pdf |
docx | application/vnd.openxmlformats-officedocument.wordprocessingml.document |
txt | text/plain |
md | text/markdown |
csv | text/csv |
workspaceId is required for account-scoped API keys and taken from the key for workspace-scoped keys. See Workspace ID and Request Scope.Body Parameters
string
The workspace. Required for an account-scoped key.
string
required
The file name, with its extension.
string
required
The file type from the table above. It must match the extension.
Errors
| Status | When |
|---|---|
400 | The file type is not supported, or contentType does not match the extension. |
402 | The account has no plan, or its subscription is not active. |
404 | The workspace is not in your API key’s scope. |
403 | The workspace is locked. The answer has workspaceLocked: true. |
502 | We could not check the workspace or create a link. Try again. |
curl -X POST "https://api.nedzo.ai/v1/knowledge/uploads" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "fileName": "price-list.pdf", "contentType": "application/pdf" }'
# Then upload the file to the uploadUrl from the answer
curl -X PUT "UPLOAD_URL" \
-H "Content-Type: application/pdf" \
--data-binary @price-list.pdf
{
"uploadUrl": "https://...",
"method": "PUT",
"fileUrl": "https://...",
"fileName": "price-list.pdf",
"contentType": "application/pdf",
"maxBytes": 5242880,
"expiresAt": "2026-10-11T12:00:00Z"
}
Was this page helpful?
