# Send Document > 🚧 Using the Sandbox Key > > When you use a [sandbox API key](https://developers.pandadoc.com/reference/sandbox-key) during the free trial period, the sender and recipient email addresses must be from the same organisation (email domain). ## Document State - You can only send a document in the `document.draft` status. - After creating a new document, it usually retains a `document.uploaded` status for 3-5 seconds while the document syncs across PandaDoc servers. When the document is available for further API calls, it moves to the `document.draft` state. Use [Document Status](/reference/document-status) or [Webhooks](/reference/on-document-status-change) to check document status. - Moving a document to the `document.sent` status finalizes the document structure, before recipients can complete it. - If a template used for the document creation has an approval workflow turned on, the sent document moves to the `document.waiting_approval` status. Once the document is approved, you need to make the call again to move the document to `document.sent` status. ## Send and Silence Notifications - By default, PandaDoc sends a notification email to the recipient, as well as notifications the sender has configured. You may disable all notifications for recipients by passing `silent: true`. This is useful when you are using alternative delivery methods such as linking to the document or embedding the document. - The `silent: true` parameter disables sent, viewed, comment and completed document email notifications. "Document Approval" notification won't be affected by this parameter. - If you pass `silent: false`, the document is going to be delivered by email and/or SMS. ![Example email. Branding can be changed in workspace settings](https://files.readme.io/cc5a03e-email2.png) ## Select Approver from Group If you have previously set up an approval workflow with selectable groups on the UI, you can select a particular approver from this group. Learn more about [selectable groups](https://support.pandadoc.com/en/articles/9714799-approval-workflow#h_01H4GNY5GSGG38BPYY46XV7GB4). To set an approver, we recommend to follow these steps: 1. Run the [Document Details](https://developers.pandadoc.com/reference/document-details) request. 2. Copy the `steps` part from the `approval_execution` section of the response into the `selected_approvers` field of the Send Document payload. 3. Modify your payload according to business needs: set `is_selected` to true for one approver. > 📘 **Note**: You can change the selected approver only if you revert your document back to the `document.draft` status. # 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}/send": { "post": { "tags": [ "Documents" ], "summary": "Send Document", "operationId": "sendDocument", "description": "> 🚧 Using the Sandbox Key\n> \n> When you use a [sandbox API key](https://developers.pandadoc.com/reference/sandbox-key) during the free trial period, the sender and recipient email addresses must be from the same organisation (email domain).\n\n## Document State\n\n- You can only send a document in the `document.draft` status.\n- After creating a new document, it usually retains a `document.uploaded` status for 3-5 seconds while the document syncs across PandaDoc servers. When the document is available for further API calls, it moves to the `document.draft` state. Use [Document Status](/reference/document-status) or [Webhooks](/reference/on-document-status-change) to check document status.\n- Moving a document to the `document.sent` status finalizes the document structure, before recipients can complete it.\n- If a template used for the document creation has an approval workflow turned on, the sent document moves to the `document.waiting_approval` status. Once the document is approved, you need to make the call again to move the document to `document.sent` status.\n\n## Send and Silence Notifications\n\n- By default, PandaDoc sends a notification email to the recipient, as well as notifications the sender has configured. You may disable all notifications for recipients by passing `silent: true`. This is useful when you are using alternative delivery methods such as linking to the document or embedding the document.\n- The `silent: true` parameter disables sent, viewed, comment and completed document email notifications. \"Document Approval\" notification won't be affected by this parameter.\n- If you pass `silent: false`, the document is going to be delivered by email and/or SMS. \n\n![Example email. Branding can be changed in workspace settings](https://files.readme.io/cc5a03e-email2.png)\n\n## Select Approver from Group\n\nIf you have previously set up an approval workflow with selectable groups on the UI, you can select a particular approver from this group. Learn more about [selectable groups](https://support.pandadoc.com/en/articles/9714799-approval-workflow#h_01H4GNY5GSGG38BPYY46XV7GB4). \nTo set an approver, we recommend to follow these steps:\n\n1. Run the [Document Details](https://developers.pandadoc.com/reference/document-details) request.\n2. Copy the `steps` part from the `approval_execution` section of the response into the `selected_approvers` field of the Send Document payload.\n3. Modify your payload according to business needs: set `is_selected` to true for one approver.\n\n> 📘 **Note**: You can change the selected approver only if you revert your document back to the `document.draft` status.\n", "parameters": [ { "name": "id", "description": "Document ID", "in": "path", "schema": { "type": "string" }, "required": true, "example": "ZPeAfcpzr9aiVs5vqUf6jg" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DocumentSendRequest" } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DocumentSendResponse" } } } }, "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": { "RecipientDeliveryMethods": { "type": "object", "nullable": true, "properties": { "email": { "type": "boolean" }, "sms": { "type": "boolean" } } }, "DocumentSendRequest": { "type": "object", "properties": { "message": { "type": "string", "description": "A message that will be sent by email with a link to a document to sign.", "example": "Hello! This document was sent from the PandaDoc API" }, "subject": { "type": "string", "description": "Value that will be used as the email subject.", "example": "Please check this test API document from PandaDoc" }, "silent": { "type": "boolean", "description": "If set to `true`, disables email notifications for document recipients and the document sender. Also disables scheduled reminders (manual reminders still possible). Doesn't affect \"Approve document\" email notification sent to the Approver." }, "sender": { "type": "object", "description": "You can set a sender of a document as an `email` or `membership_id`", "properties": { "membership_id": { "type": "string", "description": "Membership ID.", "example": "QMDSzwabfFzTgjW6KijHyu" }, "email": { "type": "string", "description": "Email.", "example": "john.doe@example.com" } } }, "forwarding_settings": { "type": "object", "description": "Set settings for Document and Signature forwarding.", "properties": { "forwarding_allowed": { "type": "boolean", "description": "Your recipient will be able/not able to forward the document to another email address.", "example": true }, "forwarding_with_reassigning_allowed": { "type": "boolean", "description": "Your recipient will be able/not able to forward the right to fill out all fields (including signature) assigned to them to another email address.", "example": true } } }, "reply_to": { "type": "string", "format": "email", "description": "Email address that will be used as a reply-to address for the document. To use this parameter, please contact the support team to have it enabled for your account.\n", "example": "john.doe@example.com" }, "selected_approvers": { "type": "object", "description": "Configuration for selected approvers.", "properties": { "steps": { "type": "array", "description": "Approval steps.", "items": { "type": "object", "required": [ "id", "group" ], "properties": { "id": { "type": "string", "description": "Step ID.", "example": "LzWmancTxrgfTMpsJP9Eqd" }, "group": { "type": "object", "description": "Group information.", "required": [ "id", "type", "assignees" ], "properties": { "id": { "type": "string", "description": "Group ID.", "example": "op9MA75HygJHiV4aeVHXCH" }, "type": { "type": "string", "description": "Group type.", "example": "selectable" }, "assignees": { "type": "array", "description": "Assignees for the group.", "required": [ "user", "is_selected" ], "items": { "type": "object", "properties": { "user": { "type": "string", "description": "User ID.", "example": "tpBLrk3vJoLggypMSRt92i" }, "is_selected": { "type": "boolean", "description": "Whether the user is selected.", "example": true } } } } } } } } } } } } }, "DocumentSendResponse": { "type": "object", "properties": { "id": { "type": "string", "example": "msFYActMfJHqNTKH8YSvF1" }, "name": { "type": "string", "example": "API Sample Document from PandaDoc Template" }, "status": { "type": "string", "example": "document.sent" }, "date_created": { "type": "string", "example": "2018-02-06T08:42:13.836022Z" }, "date_modified": { "type": "string", "example": "2018-02-06T08:42:13.836022Z" }, "date_completed": { "type": "string", "description": "Document completion date.", "example": "2021-10-23T21:07:04.147345Z", "nullable": true }, "expiration_date": { "type": "string", "example": "2018-02-06T08:42:13.836022Z" }, "version": { "type": "string", "example": "2" }, "uuid": { "type": "string", "example": "msFYActMfJHqNTKH8YSvF1" }, "recipients": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "example": "7kqXgjFejB2toXxjcC5jfZ" }, "first_name": { "type": "string", "example": "Jhon" }, "last_name": { "type": "string", "example": "Dow" }, "recipient_type": { "type": "string", "example": "CC" }, "email": { "type": "string", "nullable": true, "example": "test@test.com" }, "phone": { "type": "string", "nullable": true, "example": "+14842634627" }, "delivery_methods": { "$ref": "#/components/schemas/RecipientDeliveryMethods" }, "signing_order": { "type": "integer", "example": 1, "nullable": true }, "shared_link": { "type": "string", "example": "https://app.pandadoc.com/document/b7f11ea3c09d1c11208cc122457d4f3a2829d364" }, "type": { "type": "string", "example": "recipient", "nullable": true } } } } } } }, "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." } } } } } } } } } ```