# List Documents This endpoint will let you list and search for the documents. ### [Here](https://developers.pandadoc.com/docs/list-search-documents-api) you can find how to filter, search and order documents. # OpenAPI definition ```json { "openapi": "3.0.3", "info": { "title": "PandaDoc Public API", "description": "PandaDoc API spans a broad range of functionality to help you build incredible documents automation experiences inside your product.\n\nPandaDoc API is organized around REST. Our API has predictable resource-oriented URLs and uses standard HTTP response codes, authentication, and verbs.\n\n## Getting started\n\nYou can start testing PandaDoc API with a sandbox key on our [Enterprise](https://www.pandadoc.com/pricing/) plan, either active or in trial.\n\nGenerate your [sandbox key](https://developers.pandadoc.com/reference/sandbox-key) on the Developer Dashboard with predefined [rate limits](https://developers.pandadoc.com/reference/limits). Or contact our solutions expert if you work with high-transaction volumes.\n\n## Guides\n\nIf you’re just getting started with PandaDoc, you may want to jump straight into one of our [getting started guides](https://developers.pandadoc.com/docs/getting-started) for the feature you’re most interested in, whether that’s:\n\n- [Create from template](https://developers.pandadoc.com/docs/create-send-document),\n- [Upload and send a local PDF](https://developers.pandadoc.com/docs/upload-and-send-a-local-pdf),\n- or [Listening for changes in document status](https://developers.pandadoc.com/docs/listen-document-status-changes).\n\nWe also recommend you to discover our dynamic content generation on a fly: [Create from a template with content placeholder](https://developers.pandadoc.com/docs/create-with-content-placeholders-from-template).\n", "termsOfService": "https://www.pandadoc.com/master-services-agreement/", "contact": { "name": "PandaDoc API Support", "url": "https://developers.pandadoc.com/", "email": "api-track@pandadoc.com" }, "license": { "name": "MIT", "url": "https://github.com/PandaDoc/pandadoc-openapi-specification/blob/main/LICENSE" }, "version": "7.18.2" }, "servers": [ { "url": "https://api.pandadoc.com", "description": "Public API" } ], "security": [ { "apiKey": [] }, { "oauth2": [] } ], "tags": [ { "name": "Documents", "description": "Operations for managing documents, including appending content library items and creating document sessions for embedded signing." } ], "paths": { "/public/v1/documents": { "get": { "tags": [ "Documents" ], "summary": "List Documents", "description": "This endpoint will let you list and search for the documents.\n### [Here](https://developers.pandadoc.com/docs/list-search-documents-api) you can find how to filter, search and order documents.\n", "operationId": "listDocuments", "parameters": [ { "name": "template_id", "in": "query", "schema": { "type": "string" }, "description": "Filters by parent template. This Parameter can't be used with form_id.", "example": "BhVzRcxH9Z2LgfPPGXFUBa" }, { "name": "form_id", "in": "query", "schema": { "type": "string" }, "description": "Filters by parent form. This parameter can't be used with template_id.", "example": "BhVzRcxH9Z2LgfPPGXFUBa" }, { "name": "folder_uuid", "in": "query", "schema": { "type": "string" }, "description": "Filters by the folder where the documents are stored.", "x-ignore-no-type": true, "example": "BhVzRcxH9Z2LgfPPGXFUBa" }, { "name": "contact_id", "in": "query", "schema": { "type": "string" }, "description": "Filters by recipient or approver with this 'contact_id'.", "example": "9FeAY2NB3C9qDdtQRb4tTL" }, { "name": "count", "in": "query", "schema": { "type": "integer" }, "description": "Limits the size of the response. Default is 50 documents, maximum is 100 documents.", "example": 50 }, { "name": "page", "in": "query", "schema": { "type": "integer", "minimum": 1 }, "description": "Paginates the search result. Increase value to get the next page of results.", "example": 1 }, { "name": "order_by", "in": "query", "schema": { "$ref": "#/components/schemas/DocumentOrderingFieldsEnum" }, "description": "Defines the sorting of the result. Use `date_created` for ASC and `-date_created` for DESC sorting.", "examples": { "Default order by date_status_changed": { "value": "date_status_changed" } } }, { "name": "created_from", "in": "query", "schema": { "type": "string", "format": "datetime" }, "description": "Limits results to the documents with the `date_created` greater than or equal to this value.", "example": "2024-10-27T15:22:23.132757Z" }, { "name": "created_to", "in": "query", "schema": { "type": "string", "format": "datetime" }, "description": "Limits results to the documents with the `date_created` less than this value.", "example": "2024-10-27T15:22:23.132757Z" }, { "name": "deleted", "in": "query", "schema": { "type": "boolean" }, "description": "Returns only the deleted documents.", "example": false }, { "name": "id", "in": "query", "schema": { "type": "string", "description": "Searches for document by it's id." }, "example": "BhVzRcxH9Z2LgfPPGXFUBa" }, { "name": "completed_from", "in": "query", "schema": { "type": "string", "format": "datetime" }, "example": "2024-10-27T15:22:23.132757Z", "description": "Limits results to the documents with the `date_completed` greater than or equal to this value." }, { "name": "completed_to", "in": "query", "schema": { "type": "string", "format": "datetime" }, "description": "Limits results to the documents with the `date_completed` less than this value.", "example": "2024-10-27T15:22:23.132757Z" }, { "name": "membership_id", "in": "query", "schema": { "type": "string" }, "description": "Filter documents by the owner's 'membership_id'.", "example": "BhVzRcxH9Z2LgfPPGXFUBa" }, { "name": "metadata", "in": "query", "style": "form", "explode": true, "schema": { "type": "array", "items": { "type": "string" } }, "description": "Filters documents by metadata. Pass metadata in the format of `metadata_{metadata-key}={metadata-value}` such as `metadata_opportunity_id=2181432`. The `metadata_` prefix is always required.", "example": [ "metadata_opportunity_id=2181432", "metadata_custom_key=custom_value" ] }, { "name": "modified_from", "in": "query", "schema": { "type": "string", "format": "datetime" }, "description": "Limits results to the documents with the `date_modified` greater than or equal to this value.", "example": "2024-10-27T15:22:23.132757Z" }, { "name": "modified_to", "in": "query", "schema": { "type": "string", "format": "datetime" }, "description": "Limits results to the documents with the `date_modified` less than this value.", "example": "2024-10-27T15:22:23.132757Z" }, { "name": "q", "in": "query", "schema": { "type": "string" }, "description": "Filters documents by name or reference number (stored on the template level).", "example": "Sample Document" }, { "name": "status", "in": "query", "schema": { "$ref": "#/components/schemas/DocumentStatusRequestEnum" }, "description": "Filters documents by the status.\n * 0: document.draft\n * 1: document.sent\n * 2: document.completed\n * 3: document.uploaded\n * 4: document.error\n * 5: document.viewed\n * 6: document.waiting_approval\n * 7: document.approved\n * 8: document.rejected\n * 9: document.waiting_pay\n * 10: document.paid\n * 11: document.voided\n * 12: document.declined\n * 13: document.external_review\n", "example": 5 }, { "name": "status__ne", "x-ignore-snake-case": true, "in": "query", "schema": { "$ref": "#/components/schemas/DocumentStatusRequestEnum" }, "description": "Exludes documents with this status.\n * 0: document.draft\n * 1: document.sent\n * 2: document.completed\n * 3: document.uploaded\n * 4: document.error\n * 5: document.viewed\n * 6: document.waiting_approval\n * 7: document.approved\n * 8: document.rejected\n * 9: document.waiting_pay\n * 10: document.paid\n * 11: document.voided\n * 12: document.declined\n * 13: document.external_review\n", "example": 5 }, { "name": "tag", "in": "query", "schema": { "type": "string" }, "description": "Filters documents by tag.", "example": "tag_1" } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DocumentListResponse" }, "examples": { "Default order by date_status_changed": { "value": { "results": [ { "id": "XjV64iXRJMerjSpk428QSF", "name": "Sample Document", "status": "document.draft", "date_created": "2024-07-02T16:21:35.770196Z", "date_modified": "2024-07-02T16:21:37.696724Z", "expiration_date": null, "version": "2" }, { "id": "6NbHUUu6uuYN2tqJvgtf9h", "name": "Services Invoice", "status": "document.completed", "date_created": "2024-01-25T15:35:27.186107Z", "date_modified": "2024-06-21T15:07:34.192101Z", "expiration_date": "2024-08-20T15:07:32.869161Z", "version": "2" } ] } } } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "properties": { "type": { "type": "string" }, "detail": { "type": "object" } } }, "examples": { "Non field error": { "value": { "type": "request_error", "detail": { "non_field_errors": [ "Either template_id or form_id should be added to query." ] } } } } } } }, "401": { "$ref": "#/components/responses/401" }, "403": { "$ref": "#/components/responses/403" }, "429": { "$ref": "#/components/responses/429" } } } } }, "components": { "securitySchemes": { "apiKey": { "type": "apiKey", "name": "Authorization", "in": "header", "description": "The `Authorization` header must contain the API key. The value should be prefixed with `API-Key` followed by a space and the actual API key.\n", "x-default": "API-Key 3039ba033eb1410caa0a2227158d63c9d6502cd8" }, "oauth2": { "type": "oauth2", "flows": { "authorizationCode": { "authorizationUrl": "https://app.pandadoc.com/oauth2/authorize", "tokenUrl": "https://api.pandadoc.com/oauth2/access_token", "refreshUrl": "https://api.pandadoc.com/oauth2/access_token", "scopes": { "read+write": "Use `read+write` to create, send, delete, and download documents, and `read` to view templates and document details." } } }, "description": "Send the authenticating user to the PandaDoc OAuth2 request URL. We recommend a button or a link titled\n\"Connect to PandaDoc\" if you are connecting users from a custom application. Users will see the \"Authorize Application\" screen.\nWhen the user clicks \"Authorize\", PandaDoc redirects the user back to your site with an authorization code inside the URL.\n\nhttps://app.pandadoc.com/oauth2/authorize?client_id={client_id}&redirect_uri={redirect_uri}&scope=read+write&response_type=code\n\n`client_id` and `redirect_uri` values should match your application settings.\n" } }, "schemas": { "DocumentOrderingFieldsEnum": { "type": "string", "enum": [ "name", "date_created", "date_status_changed", "date_of_last_action", "date_modified", "date_sent", "date_completed", "date_expiration", "date_declined", "status", "-name", "-date_created", "-date_status_changed", "-date_of_last_action", "-date_modified", "-date_sent", "-date_completed", "-date_expiration", "-date_declined", "-status" ], "default": "date_status_changed" }, "DocumentStatusRequestEnum": { "type": "integer", "enum": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 ], "example": 12 }, "DocumentListResponse": { "type": "object", "properties": { "results": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "example": "ZsiBHUyksDoKActQNGz542" }, "name": { "type": "string", "example": "Sample Document" }, "status": { "type": "string", "example": "document.draft" }, "date_created": { "type": "string", "example": "2021-10-08T11:06:32.337395Z" }, "date_modified": { "type": "string", "example": "2021-10-08T11:06:32.337395Z" }, "date_completed": { "type": "string", "nullable": true, "example": "2021-10-08T11:06:32.337395Z" }, "expiration_date": { "type": "string", "nullable": true, "example": "2021-10-08T11:06:32.337395Z" }, "version": { "type": "string", "example": "2" } } } } } } }, "responses": { "401": { "description": "Authentication error", "content": { "application/json": { "schema": { "properties": { "type": { "type": "string", "example": "authentication_error" }, "detail": { "type": "string", "example": "Authentication credentials were not provided." } } } } } }, "403": { "description": "Permission error", "content": { "application/json": { "schema": { "properties": { "type": { "type": "string", "example": "permission_error" }, "detail": { "type": "string", "example": "You do not have permission to perform this action." }, "info_message": { "type": "string", "description": "Human-readable explanation of the permission error.", "example": "You are not allowed to send documents outside of your organization" }, "links": { "type": "array", "description": "Optional links related to the error (e.g. a status endpoint).", "items": { "type": "object", "properties": { "rel": { "type": "string", "example": "status" }, "href": { "type": "string", "example": "https://api.pandadoc.com/public/v1/documents/RsXrKarV524iCpjci9CMGa" }, "type": { "type": "string", "example": "POST" } } } } } } } } }, "429": { "description": "Too Many Requests", "content": { "application/json": { "schema": { "properties": { "type": { "type": "string", "example": "throttled" }, "detail": { "type": "string", "example": "Request was throttled." } } } } } } } } } ```