List Documents

Lists documents and folders created

Endpoint URLSDK Method
https://api.inkit.com/v1/document (GET)Document.list()

Request properties

PropertyTypeRequiredDescription
pageIntegerNoThe page of the list you want to pull. The default is 1.
page_sizeIntegerNoThe number of records to pull per page. The default is 25.
sortStringNoThe sort key. If the key is preceded with a -, the request will sort the records in descending order. Otherwise it will sort in ascending order.
searchStringNoThe search key. The request will only return records with this key.
data_idStringNoA comma-delimited list of Render IDs to return.
destination_nameStringNoThe request will only return records with this destination name.
destination_statusStringNoThe request will only return records with this destination status.

Response properties

PropertyTypeDescription
itemsObject[]An array of documents and folders generated.
metadataObjectMetadata relating to the list.

items

PropertyTypeDescription
created_atStringThe date and time the document or folder was created.
created_byObjectThe user or API name that created the document or folder.
descriptionStringThe description of the document or folder.
idStringThe ID of the document or folder created.
modified_atStringThe date and time the document or folder was modified.
nameStringThe name of the document or folder.

created_by

PropertyTypeDescription
first_nameStringThe first name of the user who created the document or folder.
last_nameStringThe last name of the user who created the document or folder.
nameStringThe name of the API key that created the document or folder.

Example request and response

# Import the Inkit Python package
import inkit
from inkit.exceptions import InkitResponseException
# Import json package
import json

# Replace the string below with your API key
inkit.api_token = "ENTER YOUR API KEY"

try:
   # List all documents and folders created
   resp = inkit.Document.list()
   # Print the JSON repsonse of the API call
   print(json.dumps(dict(resp.data), indent = 3))
except InkitResponseException as err:
   # Print any error
   print(err.response.data)
// Import the Inkit Node.js package
const Inkit = require("inkit");

// Replace the string below with your API key
Inkit.apiToken = "ENTER YOUR API KEY";

// Call document list
getDocumentList();

// List documents and folders created
async function getDocumentList() {
    try {
        const result = await Inkit.Document.list();
        // Print the JSON response of the API call
        console.log(JSON.stringify(result.data, null, 3));
    } catch (error) {
        // Print any error
        console.error(error.response.status, error.response.statusText);
    }
}
curl --request GET \
     --url https://api.inkit.com/v1/document \
     --header 'X-Inkit-API-Token: ENTER YOUR API KEY' \
     --header 'accept: application/json'
{
  "items": [
    {
      "created_at": "2023-07-13T15:20:29.270479Z",
      "created_by": {
        "first_name": "John",
        "last_name": "Doe",
        "name": "Default"
      },
      "description": null,
      "id": "fold_6UpetHRzr73eyl4jCbfYBl",
      "modified_at": "2023-07-13T15:20:29.270491Z",
      "name": "Render"
    },
    {
      "created_at": "2023-07-31T15:53:32.890830Z",
      "created_by": {
        "first_name": null,
        "last_name": null,
        "name": "John Doe"
      },
      "description": null,
      "expire_after_n_views": null,
      "expire_at": null,
      "folder_id": null,
      "id": "doc_3vlYXJc6sLKHYc57yGhWZS",
      "name": "Mail Merge Ruby",
      "render_id": "rend_2xR06TmBDXtJe6yvukJXS6",
      "status": "Completed"
    },
  ],
  "metadata": {
    "pagination": {
      "current_page": 1,
      "next_page": 2,
      "page_count": 3,
      "page_size": 25,
      "prev_page": 3,
      "total_count": 64
    },
    "sort": {
      "key": "modified_at",
      "order": 1
    }
  }
}