Get Metadata
Purpose
This API allows you to retrieve metadata and structural properties of a PDF document.
Quick Reference
| Property | Value |
|---|---|
| Method | POST |
| Request URL (Download) | https://{zohoapis_domain}/pdfeditor/api/v1/pdf/metadata/get |
| Request URL (Callback) | https://{zohoapis_domain}/pdfeditor/api/v1/pdf/metadata/get/callback |
Body Parameters
| Parameter | Value | Mandatory/Optional | Description |
|---|---|---|---|
| file | File or String | Mandatory | Upload the PDF file from your local drive or desktop. If the PDF file is available via a publicly accessible web URL, you can provide the URL using the same parameter. |
| input_options | { "properties": ["page_count", "title", "author", "pdf_version"] } | Optional | Specify the property keys to retrieve. If omitted, all supported properties are returned. |
| password | String | Optional | If the input PDF is password protected, specify the password to unlock it. |
| callback | { "invoke_url": "<callback_url>", "timeout": 60, "retry_interval": 60, "headers": { "header_name": "header_value" }, "http_method_type": "post" } | Mandatory for callback variant | Specify the callback delivery configuration for the /callback variant. |
input_options Parameters
| Parameter | Data Type | Possible Values | Default Value |
|---|---|---|---|
| properties | JSON Array | List of supported property keys. See Supported Property Keys. | All supported properties |
Supported Property Keys
| Parameter | Data Type | Possible Values | Default Value |
|---|---|---|---|
| page_count | Integer | Total number of pages in the PDF | – |
| title | String | Document title | Empty string if not set |
| author | String | Document author | Empty string if not set |
| subject | String | Document subject | Empty string if not set |
| keywords | String | Document keywords | Empty string if not set |
| creator | String | Application that created the document | – |
| producer | String | PDF producer or generator | – |
| creation_date | String | Document creation timestamp | – |
| modification_date | String | Last modification timestamp | – |
| trapped | String | True, False, Unknown | Empty string if not set |
| is_encrypted | Boolean | true, false | – |
| pdf_version | Float | PDF specification version such as 1.7 | – |
| file_size | Integer | Size of the input PDF in bytes | – |
| linearized | Boolean | true, false | – |
| tagged | Boolean | true, false | – |
| form_type | String | none, acroform, xfa, hybrid | – |
| permissions | JSON Object | Permission flags for encrypted PDFs | – |
| pages | Array | Per-page dimensions and rotation details | – |
| attachment_count | Integer | Number of embedded attachments | – |
| attachment_names | Array | Filenames of embedded attachments | – |
callback Parameters
| Parameter | Data Type | Possible Values | Default Value |
|---|---|---|---|
| invoke_url | String | URL. Maximum length: 300 characters. | – |
| timeout | Integer | 10 to 120 seconds | 60 seconds |
| retry_interval | Integer | 60 to 28800 seconds | 60 seconds |
| headers | JSON Object | Maximum 10 keys. Allowed characters for keys: alphabets, numbers, hyphen, underscore, dot. Maximum key length: 100. Maximum value length: 2500. | – |
| http_method_type | String | put, post | post |
Notes and Limits
- The maximum file size allowed for the input PDF is 50 MB.
- If properties is omitted, all supported properties are returned.
- Unsupported keys in properties result in an error.
- To use this API, an OAuth token should be generated with the following scopes: ZohoWriter.pdfEditor.ALL
Possible Errors
Refer to the following pages for the list of possible errors for this API:
Download Variant Sample Request
Copiedcurl --location --request POST "https://{zohoapis_domain}/pdfeditor/api/v1/pdf/metadata/get" \
--header "Authorization: Zoho-oauthtoken xxx.yyy.zzz" \
--form 'file=@/Users/username/Documents/Original.pdf' \
--form 'password="pdf_password"' \
--form 'input_options={"properties": ["page_count", "title", "author", "pdf_version", "pages", "is_encrypted", "attachment_count", "trapped", "file_size", "linearized", "tagged", "form_type", "permissions"]}'Callback Variant Sample Request
Copiedcurl --location --request POST "https://{zohoapis_domain}/pdfeditor/api/v1/pdf/metadata/get/callback" \
--header "Authorization: Zoho-oauthtoken xxx.yyy.zzz" \
--form 'file=@/Users/username/Documents/Original.pdf' \
--form 'password="pdf_password"' \
--form 'input_options={"properties": ["page_count", "title", "author", "pdf_version", "pages", "is_encrypted", "attachment_count", "trapped", "file_size", "linearized", "tagged", "form_type", "permissions"]}' \
--form 'callback={"invoke_url": "https://www.example.com/v1/api/callback/savecallback", "timeout": 120, "retry_interval": 60, "http_method_type": "post"}'Download Variant Sample Response
Copied{
"status": "inprogress",
"status_check_url": "https://pdf.zoho.com/pdfeditor/api/v1/pdf/metadata/get/job/e9051e30fd7f0093cba4247d1f831e03e945a127bde429ed6e9ef3a703b15a6060b830256c650cb88a3f687773c33076"
}Download Variant Success Response
Copied{
"status": "success",
"download_url": "https://pdf.zoho.com/pdfeditor/api/v1/pdf/metadata/get/download/properties_a7d4c9f2e1b6a3d8f5c2e7b0a9d4c1f6.json",
"response_generated_time": 1780912499331
}Callback Variant Sample Response
Copied{
"status": "inprogress",
"status_check_url": "https://pdf.zoho.com/pdfeditor/api/v1/pdf/metadata/get/job/1d358192770dc68d173ca34b8f7c9dcb121ad0bf3d6307b7387be79e76dacf586f9d62cd253c26020f8c3dcf79d51b6b"
}Callback Variant Success Response
Copied{
"status": "success",
"callback_response": {
"invoked_time": 1780912655806,
"http_status_code": 200,
"message": {
"download_url": "https://pdf.zoho.com/pdfeditor/api/v1/pdf/metadata/get/download/properties_a7d4c9f2e1b6a3d8f5c2e7b0a9d4c1f6.json",
"response_generated_time": 1780912656237
}
}
}