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
| Parameter | Type | Description |
|---|---|---|
doc_id | integer | The unique identifier for the document. |
Query parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
include | string | — | Comma-separated extras: versions, folders |
Response
200 OKDocument object
| Field | Type | Description |
|---|---|---|
id | integer | Unique document identifier. |
description | string | Document title. Doubles as the default filename when downloading. |
doc_number | string | Auto-generated document number. |
doc_type | string | Document type (e.g. "Invoice", "Report"). |
doc_status | string | Current status (e.g. "Draft", "Final"). |
reference_number | string | Reference identifier — external or internally generated. |
date | datetime | Business date of the document (ISO 8601). |
from_entity | string | Sending organisation name. |
to_entity | string | Receiving organisation name. |
entry_person | string | Username of the creator. |
entry_date | datetime | When the document was created. |
rev_number | string | Revision identifier (e.g. "A", "01"). |
main_doc_number | string | Doc number of the parent this is attached to. |
privileged | boolean | Metadata flag. Purely informational. |
islocked | boolean | true if locked. Cannot be modified. |
account_number | string | Account or project number. |
Linked files (linked_files)
Files attached to the document, newest first.
| Field | Type | Description |
|---|---|---|
ownid | integer | File version ID. Use as linked_file_id in Download. |
image_name | string | Canonical storage filename. |
image_type | string | MIME type (e.g. "application/pdf"). |
image_size | integer | File size in bytes. |
page_count | integer | Page count (PDFs only). |
origname | string | Original uploaded filename. |
filehash | string | SHA-256 hash for integrity verification. |
lastmodified | datetime | Last modification timestamp. |
Version history (version_history)
Only with ?include=versions.
| Field | Type | Description |
|---|---|---|
own_id | integer | Archive record ID. |
image_name | string | Archived filename. |
orig_name | string | Original filename. |
type | string | Archive reason (e.g. "replaced in portal"). |
entry_date | datetime | When archived. |
file_hash | string | SHA-256 hash. |
Folders (folders)
Only with ?include=folders.
| Field | Type | Description |
|---|---|---|
folder_id | integer | Folder ID. |
name | string | Folder display name. |
full_path | string | Full path (e.g. "Finance->Invoices"). |
parent_id | integer | Parent folder ID. 0 = root. |
Errors
| Status | Reason |
|---|---|
| 401 | Invalid or expired token |
| 403 | No permission to access this document |
| 404 | Document 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
}
]
}