Diska
Knowledge

Upload a PDF

Uploads a PDF as multipart/form-data, in the file field (up to 25 MB).
POST https://api.diska.ai/v1/knowledge-bases/{knowledge_base_id}/documents/pdf

Scope: knowledge:write

Parameters

Path

NameTypeRequiredDescription
knowledge_base_idstringYesThe knowledge base's ID.

Request body

multipart/form-data

FieldTypeRequiredDescription
filefileYesThe PDF (up to 25 MB).

Examples

curl -X POST "https://api.diska.ai/v1/knowledge-bases/<knowledge_base_id>/documents/pdf" \
  -H "Authorization: Bearer $DISKA_API_KEY" \
  -F "file=@tabela-de-precos.pdf;type=application/pdf"

Try it

Send the request from this page, with your key. The key stays on this page: it is not stored and is only sent to api.diska.ai. Use a test key with the fewest scopes you need. In Try it, pick a PDF from your computer.

POSThttps://api.diska.ai/v1/knowledge-bases/{knowledge_base_id}/documents/pdf
Starts with dsk_. It stays in this browser tab only.
path
Enter an API key (dsk_…).

Response 201

FieldTypeDescription
idstringID.
organization_idstringOrganization it belongs to.
knowledge_base_idstringBase the document belongs to.
namestringDocument name.
source_typestringmanual (text), pdf or url.
statusstringOverall document state. One of: pending, uploading, processing, ready, failed, indexing_pending. Default: pending.
extraction_statusstringText extraction state. One of: pending, extracted, skipped, failed. Default: pending.
indexing_statusstringIndexing state: indexed when the agent can use it. One of: pending, indexing_pending, indexed, skipped, failed. Default: indexing_pending.
content_textstring | nullThe extracted text.
original_urlstring | nullImported address (url documents).
storage_pathstring | nullInternal file location.
mime_typestring | nullFile type.
size_bytesinteger | nullSize in bytes.
error_messagestring | nullError, when it failed.
metadataobjectTechnical metadata.
created_atstring | nullCreation date (ISO 8601).
updated_atstring | nullLast change date (ISO 8601).
has_filebooleantrue when a file is stored. Default: false.
{
  "id": "5c2e8a14-7d3b-4f9e-a1c6-0b8d2f4e6a93",
  "organization_id": "5c2e8a14-7d3b-4f9e-a1c6-0b8d2f4e6a93",
  "knowledge_base_id": "b2e4c6d8-1a3f-4e5b-9c7d-0f2a4b6c8e10",
  "name": "Horários",
  "source_type": "manual",
  "status": "ready",
  "extraction_status": "extracted",
  "indexing_status": "indexed",
  "content_text": "Abrimos de segunda a sexta, das 8h às 17h.",
  "original_url": null,
  "storage_path": null,
  "mime_type": "text/plain",
  "size_bytes": 48213,
  "error_message": "…",
  "metadata": {},
  "created_at": "2026-10-25T18:40:00Z",
  "updated_at": "2026-10-25T18:40:00Z",
  "has_file": false
}

Errors

CodeWhen
400Content refused — for example Ficheiro vazio. (empty file), PDF demasiado grande (máx. 25 MB). (PDF too large), Apenas ficheiros PDF são aceites. (only PDFs), O ficheiro não parece ser um PDF válido. (not a valid PDF), Tempo esgotado ao obter a página. (page timed out), A página não devolveu texto legível. (no readable text) or a URL blocked for security.
404Base de conhecimento não encontrada. (knowledge base not found).

Errors common to every endpoint (401, 403, 422, 429 and 5xx) are in Errors.

Copyright © 2026