# Document Status Change with Upload PandaDoc has eight document statuses, but you can manually set your document status to only four: ### Document statuses - Completed - `document.completed` - API code `2` - Expired - `document.voided` - code `11` - Paid - `document.paid` - code `10`. **Important**: You can only set it if you have a payment app connected. - Declined - `document.declined` - code `12` > 🚧 Pass a numeric code for the corresponding document status, for example, `2` for `document.completed`. Find more details in [\[Editor 2.0\] Manually change document status](https://support.pandadoc.com/en/articles/9714842-manually-change-document-status) topic. | Current Status | To Completed: | To Expired: | To Paid: | To Declined: | |----------------|---------------|-------------|----------|--------------| | Draft | YES | NO | YES | YES | | Approved | NO | NO | NO | NO | | Sent | YES | YES | NO | YES | | Viewed | YES | YES | NO | YES | | Completed (Auto) | NO | NO | NO | YES | | Waithing for payment | NO | NO | YES | YES | | Paid | NO | NO | NO | NO | | Expired | YES | NO | YES | YES | | Declined | YES | NO | YES | NO | > ✅ - from `document.voided` to `document.paid` > > ❌ - from `document.paid` to `document.voided` # 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/{id}/status?upload": { "patch": { "tags": [ "Documents" ], "summary": "Document Status Change with Upload", "operationId": "changeDocumentStatusWithUpload", "description": "PandaDoc has eight document statuses, but you can manually set your document status to only four:\n\n### Document statuses\n\n- Completed - `document.completed` - API code `2`\n- Expired - `document.voided` - code `11`\n- Paid - `document.paid` - code `10`. **Important**: You can only set it if you have a payment app connected.\n- Declined - `document.declined` - code `12`\n\n> 🚧 Pass a numeric code for the corresponding document status, for example, `2` for `document.completed`.\n\nFind more details in [\\[Editor 2.0\\] Manually change document status](https://support.pandadoc.com/en/articles/9714842-manually-change-document-status) topic.\n\n| Current Status | To Completed: | To Expired: | To Paid: | To Declined: |\n|----------------|---------------|-------------|----------|--------------|\n| Draft | YES | NO | YES | YES |\n| Approved | NO | NO | NO | NO |\n| Sent | YES | YES | NO | YES |\n| Viewed | YES | YES | NO | YES |\n| Completed (Auto) | NO | NO | NO | YES |\n| Waithing for payment | NO | NO | YES | YES |\n| Paid | NO | NO | NO | NO |\n| Expired | YES | NO | YES | YES |\n| Declined | YES | NO | YES | NO |\n\n> ✅ - from `document.voided` to `document.paid`\n>\n> ❌ - from `document.paid` to `document.voided`\n", "parameters": [ { "examples": { "Mark as Decline": { "value": "iGsFiaV2hEEvQdhr2WAkMk" }, "Mark as Completed": { "value": "iGsFiaV2hEEvQdhr2WAkMk" }, "Mark as Expired": { "value": "iGsFiaV2hEEvQdhr2WAkMk" }, "Mark as Paid": { "value": "iGsFiaV2hEEvQdhr2WAkMk" } }, "name": "id", "in": "path", "schema": { "type": "string" }, "required": true, "description": "Specify document ID." } ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "type": "object", "properties": { "file": { "type": "string", "format": "binary", "description": "Binary attachment file" }, "data": { "allOf": [ { "$ref": "#/components/schemas/DocumentStatusChangeRequest" }, { "description": "JSON as a multipart/form-data string." } ] } } } } } }, "responses": { "204": { "description": "No content" }, "401": { "$ref": "#/components/responses/401" }, "403": { "$ref": "#/components/responses/403" }, "404": { "$ref": "#/components/responses/404" }, "409": { "$ref": "#/components/responses/409" }, "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": { "DocumentStatusChangeRequestStatusEnum": { "type": "integer", "enum": [ 2, 10, 11, 12 ], "example": 12, "description": "Number code for the target document status. See notes for the codes corresponding to each status." }, "DocumentStatusChangeRequest": { "type": "object", "properties": { "status": { "$ref": "#/components/schemas/DocumentStatusChangeRequestStatusEnum" }, "note": { "type": "string", "description": "Provide “private notes” regarding the manual status change.", "example": "A private note" }, "notify_recipients": { "type": "boolean", "description": "Send a notification email about the status change to all recipients." } }, "required": [ "status" ] } }, "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" } } } } } } } } }, "404": { "description": "Not found", "content": { "application/json": { "schema": { "properties": { "type": { "type": "string", "example": "request_error" }, "detail": { "type": "string", "example": "Not found" } } } } } }, "409": { "description": "Conflict", "content": { "application/json": { "schema": { "properties": { "id": { "type": "string", "example": "mXpGsEBHdSFW97zKXq75hm" }, "status": { "type": "string", "example": "document.uploaded" }, "info_message": { "type": "string", "example": "Warning - Document status document.uploaded doesn’t mean that the document already exists - processing happens asynchronously. Please follow the documentation section https://developers.pandadoc.com/reference/new-document" } } } } } }, "429": { "description": "Too Many Requests", "content": { "application/json": { "schema": { "properties": { "type": { "type": "string", "example": "throttled" }, "detail": { "type": "string", "example": "Request was throttled." } } } } } } } } } ```