Skip to main content

Get File Information

GET/apiv2/pub/documents/{doc_id}documents_read

Retrieves the full metadata for a document, including all linked files. Optionally includes version archive history and folder assignments.

Request

Path parameters

ParameterTypeDescription
doc_idintegerThe unique identifier for the document.

Query parameters

ParameterTypeDefaultDescription
includestringComma-separated extras: versions, folders

Response

200 OK

Document object

FieldTypeDescription
idintegerUnique document identifier.
descriptionstringDocument title. Doubles as the default filename when downloading.
doc_numberstringAuto-generated document number.
doc_typestringDocument type (e.g. "Invoice", "Report").
doc_statusstringCurrent status (e.g. "Draft", "Final").
reference_numberstringReference identifier — external or internally generated.
datedatetimeBusiness date of the document (ISO 8601).
from_entitystringSending organisation name.
to_entitystringReceiving organisation name.
entry_personstringUsername of the creator.
entry_datedatetimeWhen the document was created.
rev_numberstringRevision identifier (e.g. "A", "01").
main_doc_numberstringDoc number of the parent this is attached to.
privilegedbooleanMetadata flag. Purely informational.
islockedbooleantrue if locked. Cannot be modified.
account_numberstringAccount or project number.

Linked files (linked_files)

Files attached to the document, newest first.

FieldTypeDescription
ownidintegerFile version ID. Use as linked_file_id in Download.
image_namestringCanonical storage filename.
image_typestringMIME type (e.g. "application/pdf").
image_sizeintegerFile size in bytes.
page_countintegerPage count (PDFs only).
orignamestringOriginal uploaded filename.
filehashstringSHA-256 hash for integrity verification.
lastmodifieddatetimeLast modification timestamp.

Version history (version_history)

Only with ?include=versions.

FieldTypeDescription
own_idintegerArchive record ID.
image_namestringArchived filename.
orig_namestringOriginal filename.
typestringArchive reason (e.g. "replaced in portal").
entry_datedatetimeWhen archived.
file_hashstringSHA-256 hash.

Folders (folders)

Only with ?include=folders.

FieldTypeDescription
folder_idintegerFolder ID.
namestringFolder display name.
full_pathstringFull path (e.g. "Finance->Invoices").
parent_idintegerParent folder ID. 0 = root.

Errors

StatusReason
401Invalid or expired token
403No permission to access this document
404Document not found

cURL

curl -i -X GET "https://portal.docwize.com/apiv2/pub/documents/1542" \
-H "Authorization: Bearer <ACCESS_TOKEN>"

{
"id": 1542,
"description": "January Invoice",
"doc_number": "INV-00042",
"doc_type": "Invoice",
"doc_status": "Final",
"reference_number": "INV-2025-001",
"date": "2025-01-15T00:00:00",
"from_entity": "Acme Corp",
"to_entity": "Widget Inc",
"entry_person": "jdoe",
"entry_date": "2025-01-15T10:30:00",
"rev_number": "A",
"privileged": false,
"islocked": false,
"account_number": "PROJ-2025",
"linked_files": [
{
"ownid": 3801,
"id": 1542,
"image_name": "1542_a7f2c.pdf",
"image_type": "application/pdf",
"image_size": 245760,
"page_count": 12,
"origname": "invoice-january.pdf",
"filehash": "e3b0c44298fc1c14...",
"lastmodified": "2025-01-15T10:30:00",
"lastmodifieduser": 3,
"pdf_image_name": null
}
],
"version_history": [
{
"own_id": 201,
"image_name": "1542_old_abc.pdf",
"orig_name": "invoice-draft.pdf",
"description": "Replaced in Portal",
"type": "replaced in portal",
"entry_date": "2025-01-14T09:00:00",
"entry_person": 3,
"image_size": 230400,
"file_hash": "a1b2c3d4e5f6..."
}
],
"folders": [
{
"folder_id": 42,
"code": "f-abc-123",
"name": "Invoices",
"full_path": "Finance->Invoices",
"parent_id": 10
}
]
}
{"detail": "Invalid or expired token"}
{"detail": "Document not found or access denied"}