{"command":{"effect":"write","timeoutSeconds":30,"inputSchema":{"type":"object","description":"Updates the content of an unsent draft. Omitted fields are left unchanged. Send at least one of `to`, `cc`, `bcc`, `subject`, `text`, `html` or `attachments`. Sending `attachments` replaces every attachment on the draft. A request that sets `text` or `html` replaces the whole body. The body part you omit from that request becomes `null`. The merged draft must still contain at least one non-empty field, and its combined recipients cannot exceed 50. A draft that was already sent, or that changed during the request, returns a 409. The response holds only the Draft ID. Retrieve the draft to read its content.","properties":{"path":{"type":"object","properties":{"inbox_id":{"type":"string","examples":["b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1"],"description":"The Inbox ID or the inbox email address, such as `support@acme.com`. A value that contains `@` must be a valid email address, and any other value must be a UUID, or the request returns a 422. The address match is case-insensitive and never falls back to the inbox `name`. An address that matches no inbox returns a 404."},"draft_id":{"type":"string","format":"uuid","description":"The Draft ID."}},"required":["inbox_id","draft_id"],"additionalProperties":false},"body":{"$ref":"#/definitions/UpdateInboxDraftOptions"}},"required":["path","body"],"additionalProperties":false,"definitions":{"UpdateInboxDraftOptions":{"type":"object","description":"Send at least one of `to`, `cc`, `bcc`, `subject`, `text`, `html` or `attachments`. Omitted fields are left unchanged. Setting `text` or `html` replaces the whole body, so the body part you omit becomes `null`. The merged draft must contain at least one non-empty field, and its combined recipients cannot exceed 50.","anyOf":[{"required":["to"]},{"required":["cc"]},{"required":["bcc"]},{"required":["subject"]},{"required":["text"]},{"required":["html"]},{"required":["attachments"]}],"properties":{"to":{"description":"The recipients. For multiple addresses, send an array of strings. Each value can include a friendly name. Pass `null` to clear. Each address is `email@example.com` or `Name <email@example.com>`. An address that is not valid returns a 422.","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"},"maxItems":50},{"type":"null"}],"examples":[["ada@example.org"]]},"cc":{"description":"The CC recipients. Pass `null` or `[]` to clear. Each address is `email@example.com` or `Name <email@example.com>`. An address that is not valid returns a 422.","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"},"maxItems":50},{"type":"null"}]},"bcc":{"description":"The BCC recipients. Pass `null` or `[]` to clear. Each address is `email@example.com` or `Name <email@example.com>`. An address that is not valid returns a 422.","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"},"maxItems":50},{"type":"null"}]},"subject":{"type":["string","null"],"minLength":1,"maxLength":2000,"description":"The subject. Max 2000 characters. Cannot be only whitespace or contain a line break. Pass `null` to clear.","examples":["Refund issued for order 1041"]},"html":{"type":["string","null"],"description":"The HTML body. Pass `null` to clear."},"text":{"type":["string","null"],"description":"The plain text body. Pass `null` to clear."},"attachments":{"type":["array","null"],"description":"Files to store on the draft. Each one needs a `filename` and either `content` or a `path` URL. A `path` file is downloaded when the request is made and stored on the draft. When both are sent, `path` is ignored. A `content_id` returns a 422. The files on a draft, downloaded ones included, can total at most 25 MB. A `path` that does not start with `http` or `https`, or that cannot be downloaded, returns a 422, and so does a request whose downloads take more than 20 seconds together. An empty file or a blocked file type returns a 422. Sending the field replaces every attachment on the draft. Send `[]` to remove them all. `null` also removes them all.","items":{"$ref":"#/definitions/InboxDraftAttachmentInput"}}}},"InboxDraftAttachmentInput":{"type":"object","description":"A file to store on a draft. Send either `content` or a `path` URL. Unlike `POST /emails` attachments, a `path` file is downloaded when the request is made, not when the draft is sent, and a draft attachment cannot use `content_id`. When both `content` and `path` are sent, `path` is ignored.","required":["filename"],"properties":{"content":{"type":"string","description":"The content of the file, encoded in base64. It cannot be empty. Required without `path`.","examples":["aGVsbG8gZTJl"]},"path":{"type":"string","description":"A URL to download the file from, starting with `http` or `https`. Required without `content`. A file that cannot be downloaded returns a 422, and so does a request whose downloads take more than 20 seconds together.","examples":["https://example.com/invoice.pdf"]},"filename":{"type":"string","minLength":1,"description":"The filename of the attachment. A blocked file type returns a 422.","examples":["receipt.pdf"]},"content_type":{"type":"string","minLength":1,"description":"The MIME type of the attachment. It must be a valid MIME type, such as `application/pdf`, or the request returns a 422. Required with `content`. With `path`, it defaults to the content type of the downloaded file.","examples":["application/pdf"]}}}}},"name":"Update an existing draft","id":"resend.inboxes.update-draft","example":{"path":{"inbox_id":"b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1","draft_id":"00000000-0000-4000-8000-000000000000"},"body":{"to":["ada@example.org"]}},"maxRequests":1,"summary":false}}