--- title: "Endpoints for Documents" slug: "endpoints-for-documents" updated: 2026-10-24T11:28:39Z published: 2026-10-24T11:28:39Z canonical: "documentation.decisions.com/endpoints-for-documents" --- > ## Documentation Index > Fetch the complete documentation index at: https://documentation.decisions.com/llms.txt > Use this file to discover all available pages before exploring further. # Endpoints for Documents Interact with IDP documents through APIs from ProcessMaker scripts. ## Base URL for Document Endpoints Access the server via `https://{processmaker-server}/api/1.0/connector-idp`. ## View Metadata of a Document `GET` `https://``{processmaker-server}``/api/1.0/connector-idp/get-file/``{id}` See `200` status code response for cURL example and response example. ### Path Parameters | Name | Type | Description | | --- | --- | --- | | id* | String | Unique ID for the document to find in the information document section of the IDP server. | **200: OK** Following is an example of getting a document metadata using the file id. **cURL request:** ```plaintext curl --location --request GET "https://processmaker.com/api/1.0/connector-idp/get-file/d72c9a40-8ef1-4c16-94c8-038cd9b80089" ``` **Example response:** The request was okay and the response body contains the representation requested. ```json {  "data": {    "type": "file",    "attributes": {      "createdAt": "2019-11-29T09:46:29.006+0000",      "createdBy": "User",      "documentType": "NONE",      "modifiedAt": "2019-12-03T07:41:33.445+0000",      "name": "Welcome to IDP.docx",      "modifiedBy": null,      "checkedOutBy": null,      "id": "d72c9a40-8ef1-4c16-94c8-038cd9b80089",      "content": 117350    },    "relations": {}  },  "status": "success",  "message": null } ``` **Script Example** 1. [Create a Script](/processmaker/docs/scripts#create-a-new-script) to get the metadata of the IDP file using a file id. 2. [Add the Script Task to your process model](/processmaker/docs/script-task#add-a-script-task-to-the-process-model). 3. [Reference the created script](/processmaker/docs/script-task#properties-panel-settings). ```php users()->getUserById(1)['email'] *  API Documentation https://github.com/ProcessMaker/docker-executor-php/tree/master/docs/sdk */ $start = microtime(true); $guzzleClient = new \$GuzzleHttp\Client(['base_uri'=> getenv('API_HOST'),'verify' => false]); $guzzleOptions['headers']['Accept'] = 'application/json'; $guzzleOptions['headers']['Authorization'] = 'Bearer'.getenv('API_TOKEN'); $guzzleApi = '/api/1.0/connector-idp/get-file/be74e981-f82c-data-b906-669724f0c37f'; $result = json_decode($guzzleClient->request('GET', $guzzleApi, $guzzleOptions)->getBody(),true)['data']; return $result; ``` ## Update Documents `PUT` `https://``{processmaker-server}``/api/1.0/connector-idp/update-file/``{id}` See `200` status code response for cURL example and response example. ### Path Parameters | Name | Type | Description | | --- | --- | --- | | id* | String | Unique ID for the document to find in the information document section of the IDP server. | ### Request Body | Name | Type | Description | | --- | --- | --- | | data | JSON String | Attributes specified as key-value pairs. Check the example response to see the JSON structure to send | **200: OK** Here is an example of updating a file using the file id., where the file attributes are being updated. **cURL request:** ```plaintext curl --location --request PUT "https://processmaker.com/api/1.0/connector-idp/update-file/d72c9a40-8ef1-4c16-94c8-038cd9b80089" ``` **Example response:** The request was okay and the response body contains the representation requested. The response contains all attributes of the updated document. ```plaintext {  "data": {    "type": "file",    "attributes": {      "createdAt": "2023-12-03T12:47:06.960+0000",      "createdBy": "User",      "documentType": "NONE",      "modifiedAt": "2023-12-05T12:47:06.960+0000",      "name": "Welcome back to IDP.docx",      "modifiedBy": "User2",      "checkedOutBy": "User",      "id": "d72c9a40-8ef1-4c16-94c8-038cd9b80089",      "content": 125398,      "parentId": null    }  },  "status": "success",  "message": null } ``` **Script Example** - [Create a Script](/processmaker/docs/scripts#create-a-new-script) to update the metadata (`fulltext`, `name`, `documentType`) of the IDP file using a file id. - [Add the Script Task to your process model](/processmaker/docs/script-task#add-a-script-task-to-the-process-model). - [Reference the created script](/processmaker/docs/script-task#properties-panel-settings). ```php users()->getUserById(1)['email'] *  API Documentation https://github.com/ProcessMaker/docker-executor-php/tree/master/docs/sdk */ $start = microtime(true); $guzzleClient = new \$GuzzleHttp\Client(['base_uri'=> getenv('API_HOST'),'verify' => false]); $guzzleOptions['headers']['Accept'] = 'application/json'; $guzzleOptions['headers']['Authorization'] = 'Bearer'.getenv('API_TOKEN'); $guzzleOptions['json'] = [    "attributes" => [        "fulltext" => "Hello World",        "name" => "Finance Invoice",        "documentType" => "Invoice"    ] ]; $guzzleApi = '/api/1.0/connector-idp/get-file/be74e981-f82c-data-b906-669724f0c37f'; $result = json_decode($guzzleClient->request('GET', $guzzleApi, $guzzleOptions)->getBody(),true)['data']; return $result; ```