Docspring.Api.Client (docspring v4.4.0)
API calls for all endpoints tagged Client.
Summary
Functions
Add fields to a template
Adds fields to a template's draft and returns all of its fields. Publish a version for submissions of published versions to have them. A field with the name of one of the template's fields shares its settings (type, required, default, ...), so a field that sets one to another value is refused: PUT /templates/{template_id}/fields changes them for every field with the name.
Copy a template Copies a template (its draft, or a published version) into a new template.
Create an account email action
Adds an email action to your account. It sends for every template, or only for the templates in template_ids and the templates in the folders in folder_ids (and the folders inside them). Each template can turn it off or change its settings for that template only (PUT /templates/{template_id}/email_actions/{email_action_id}/customization). Without a paid plan (Starter or higher), email actions only email your team: test submissions' emails go to your account's users, and live submissions' emails aren't sent.
Combine PDFs
Merges PDFs into one: submissions, other combined PDFs, templates, custom files (POST /custom_files) and PDFs from URLs, in the order of source_pdfs. The PDF is generated in the background: on sync.api hosts the request waits for it (unless you pass wait=false), otherwise poll GET /combined_pdfs/{combined_pdf_id} until state isn't pending. A template source merges the template's processed PDF by default: the PDF submissions are filled in on, decrypted and with its form fields removed. Pass processed: false to merge the PDF as it was uploaded.
Create a custom file from an upload
Creates a custom file from a PDF you uploaded, so you can merge it with other PDFs. Upload the file with the presigned upload (GET /uploads/presign) first, then pass its fields.key as cache_id.
Create an email action
Adds an email action to a template's draft. From then on, each processed submission emails its PDF to the recipients in to, cc and bcc: addresses, and tags for the address in one of the submission's fields ({{ data.tenant_email }}) or in its metadata ({{ metadata.agent_email }}). With send_when, only the submissions whose values meet its conditions send one. Without a paid plan (Starter or higher), email actions only email your team: test submissions' emails go to your account's users, and live submissions' emails aren't sent.
Add an email domain Adds a domain for email actions to send from, and returns the DNS records to add to it. DocSpring checks for them every few minutes, and the domain is verified once its DKIM and DMARC records are found. Needs a paid monthly plan.
Create a folder
Creates a folder for organizing templates. Pass parent_folder_id to create it inside another folder. Folder names are unique within their parent folder.
Record a signature request event
Records something that happened outside DocSpring in the signature request's audit trail: you sent the request to the person (send_request). The audit trail shows it as reported by your account. A finished (completed, declined or expired) signature request's audit trail takes no more events, and a test API token can't record one for a live signature request.
Create a signature request token
Creates a token that opens the signature request without signing in, in a form embedded in your app or from a link you send. The response is the only time the token's secret is returned. The link works for 24 hours, or 7 days for an email token, and a signing page that opened in time keeps working for 7 more days. A test API token can't create a token for a live signature request.
Generate a PDF
Creates a submission: fills in a template with your data and generates a PDF. The PDF is generated in the background: on sync.api hosts the request waits for it (unless you pass wait=false), otherwise poll GET /submissions/{submission_id} until state isn't pending. Data that doesn't match the template's fields returns a 422 with an invalid_data error. The submission is still saved, with its errors, so you can find it in DocSpring: the error's submission_id is its ID. With signature_requests, the PDF is generated once everyone has signed. DocSpring emails each signer a link to sign, unless send_email is false, and can send reminders and the completed document.
Generate PDFs in a batch
Creates up to 50 submissions in one request, from one template or several. The PDFs are only generated when every submission is valid. On sync.api hosts the request waits until every PDF has been generated (unless you pass wait=false), otherwise poll GET /submissions/batches/{submission_batch_id} until processed_at is set. When any submission is invalid, nothing is generated and the request returns a 422. Submissions whose data doesn't match their template's fields are still saved with their errors (an invalid_data error, with each one's submission_id in its details), so you can find them in DocSpring. The other submissions aren't saved.
Create a template
Creates an HTML template, or a PDF or Word template from a file you uploaded with the presigned upload (GET /uploads/presign): pass its fields.key as cache_id. You can send a link to the file (document_url) or the file in base64 (document_base64) instead, or send the file with the request with POST /templates/upload. A Word template is made from a Word document (.docx) or an OpenDocument text file (.odt), which DocSpring converts to a Word document. It needs its output_format: what each submission makes, a Word document (docx), an OpenDocument file (odt) or a PDF. A page design (page_designer) takes its layout in the Page Designer layout format, or starts with an empty page without one. A PDF template is ready to generate PDFs once DocSpring has processed its PDF, a template created from a document_url once its document has been downloaded, and one created from an .odt once it has been converted (ready is true). On sync.api hosts the request waits for that unless you pass wait=false.
Preview a template with data
Makes PNG images of a template's pages filled in with the data you send (not a PDF), so you can check how an HTML, PDF or Word template or a page design prints with your data before you publish a version or send live data. A Word template's pages are its PDF's, whatever its output_format. It renders the template's draft, or the published version you ask for. A preview makes no submission and uses no credits, and its pages are watermarked like a test submission's PDF. It's pending while it renders: get it with GET /templates/{template_id}/previews/{preview_id} until it's processed, with an image of each page, or error.
Create a webhook Creates a webhook that sends a POST request to your endpoint whenever a subscribed event happens. Scope it to API tokens, templates or folders to receive only their events.
Delete an account email action Deletes one of your account's email actions, with every template's customization of it. Emails it has already queued for submissions aren't sent. Submissions keep the record of the emails it sent.
Delete a custom file Deletes a custom file and returns it. Use a live API token: test tokens can't delete custom files.
Delete an email action Deletes an email action. Emails it has already queued for submissions aren't sent. Submissions keep the record of the emails it sent.
Reset an account email action's customization Removes the template's changes to one of your account's email actions: it sends for this template as it is, and again if the template had turned it off.
Remove an email domain
Removes an email domain. Email actions that send from an address at it fail until you add and verify it again, or change their from_address. You can then remove its DNS records.
Delete a folder Deletes an empty folder and returns it. A folder that still has templates or folders in it can't be deleted.
Delete a template
Deletes a template's draft and all of its published versions, or one published version (version). Returns the template as it was before it was deleted.
Delete a webhook Deletes a webhook so it stops receiving events, and returns it.
Expire a combined PDF Deletes a combined PDF's PDF and returns the expired combined PDF.
Expire a submission Deletes a submission's data and PDF now, and returns the expired submission.
Generate more files
Adds formats to a processed submission's files, in the background, without using credits again: pdf, the PDF of a Word template's submission that made only its Word document (converted from that document), docx, the Word document of a Word template's submission that made only its PDF (made again from its data and the template version it used), odt, a Word template's submission's OpenDocument file (converted from its Word document, or from one made again when it didn't keep one), and png, a PNG image of each page of the PDF (up to 100 pages), which makes the PDF first when the submission doesn't have one. To make them with the submission, add them to output_formats when you create it. Each new file is listed in files while it's made: on sync.api hosts the request waits for them (unless you pass wait=false), otherwise poll GET /submissions/{submission_id} until none of their state is pending. A file that couldn't be made has the state error and an error_message, and the submission stays processed. Asking for a format the submission already has (or is making) changes nothing.
Generate a preview PDF
Generates a preview of a submission's PDF in the background, such as for a submission still waiting for its signature requests. It's in files.preview once preview_generated_at changes.
Get an account email action Returns one of your account's email actions, with its settings and whether its emails are failing.
Get a combined PDF Returns a combined PDF, with a temporary link to download it once it has been generated.
Get a custom file Returns a custom file, with a temporary URL to download it.
Get an email action Returns one of a template's email actions, with its settings and whether its emails are failing.
Get an email domain Returns an email domain, whether it's verified, and the DNS records to add to it.
Get a folder Returns a folder.
Get a presigned URL to upload a file
Returns a presigned S3 form for uploading a file directly to DocSpring, for files too large to send in a request body. POST the fields and the file (as file) to url as multipart/form-data, then pass fields.key as the cache_id when you create a custom file.
Get a signature request Returns a signature request, with the values the person has entered so far.
Get a submission Returns a submission, with its data and links to download its PDF.
Get a batch
Returns a batch with its submissions. The batch has finished once processed_at is set: its state is processed when every PDF was generated, or error when any submission failed.
Get a template Returns a template: its draft, or one of its published versions.
Compare a version of a template with the one before it Returns what changed in the template's draft since its latest published version (or in a published version since the one before it): fields added, removed, changed and moved, the settings that changed, and whether the document was replaced. Check it before you publish a version.
Generate typed code for a template's submission data
Generates types for a template's submission data in TypeScript, JavaScript, Ruby, Python, PHP, Java, C#, Elixir, Go or Rust, so your app catches mistakes before it calls the API. root_type_name is the type of the whole data object, and just_types=true leaves out the code that converts JSON to and from the types. Java returns every class in code, each under a // ClassName.java comment. A template with no named fields returns 422.
Get images of a template's pages Returns a JPEG image of each page of a PDF template's PDF, with temporary links to download them: the draft's PDF, or a published version's. Use them to see the pages that fields are placed on.
Get a template preview
Returns a preview made with POST /templates/{template_id}/previews. Once it's processed, pages has a PNG image of each page with a temporary link to download it: a preview has no PDF. Previews are deleted an hour after they're created.
Get the JSON Schema of a template's submission data
Returns the JSON Schema that a submission's data must match. Use it to check data before you create submissions, or to build a form for the template's fields.
Get a webhook Returns a webhook.
List account email actions
Returns your account's email actions, newest first, one page at a time. Each one emails the files of every template's processed submissions, or of the templates and folders it lists. A template's own email actions are listed with the template (GET /templates/{template_id}/email_actions).
List combined PDFs Returns the combined PDFs in your account, newest first, one page at a time.
List custom files Returns the custom files in your account, newest first, one page at a time.
List email actions
Returns the email actions of a template's draft, and your account's email actions that send for it, newest first, one page at a time. Each one emails every processed submission's files to the people it lists. An account email action (template_id null) shows the settings it sends for this template, with the template's changes in customization.
List email domains Returns the domains in your account that email actions can send from once they're verified, newest first, one page at a time.
List folders
Returns the folders in your account, newest first, one page at a time. Pass parent_folder_id to list the folders in one folder.
List submissions
Returns the submissions in your account, newest first, one page at a time. Each one is a summary: its data is null unless you pass include_data=true, and its files are empty unless you pass include_files=true. Get a submission by its ID for its signature requests, uploads and page images.
List a template's fields Returns a template's fields with all of their settings, page by page: the draft's fields, or a published version's. A PDF template's fields are placed on its pages: GET /templates/{template_id}/page_images has images of the pages.
List a template's submissions Returns a template's submissions (from every version of the template), newest first.
List templates Returns the templates in your account (their drafts), newest first, one page at a time. Each one is a summary: get a template by its ID for its settings, its PDF in full, its HTML, defaults and published versions.
List webhooks Returns the webhooks in your account, newest first, one page at a time. Filter them by event type, mode, or the API token, template or folder they're scoped to.
Move a folder
Moves a folder into another folder, or to the root with parent_folder_id: null. Its templates and folders move with it. A folder can't move into itself or one of its own folders.
Move a template to a folder
Moves a template and all of its published versions to a folder, or to the root (null).
Publish a template version
Publishes the template's draft as a new version. Its content (the PDF or HTML, fields, name and description) never changes, while settings such as webhook_url and public_submissions keep following the draft. version_type says which part of the latest version number goes up. While the template's PDF is downloading or being processed, or DocSpring is setting up its fields, it returns a 409 that says so.
Remove fields from a template Removes fields from a template's draft and returns the fields that are left. Conditional logic that used only the removed fields is removed too.
Rename a folder Renames a folder. The name must be unique within its parent folder.
Reorder a template's fields Changes the order of the fields in a template's draft and returns them in their new order. Send every field's ID: each field stays on its page, and a page's fields are printed in this order, so a later field prints over an earlier one where they overlap. Their values are in this order in the template's data schema and forms.
Restore a template version
Replaces the template's draft with a copy of one of its published versions. The draft keeps its settings that apply to every version, such as webhook_url.
Send a test email for an account email action Sends the account email action's email to the API token's user only, as it would go for one template it sends for, with each field shown as its name in brackets, so you can check how it looks. When the email action attaches its files and that template is a PDF template, the test attaches the template's blank PDF. It isn't recorded on any submission.
Send a test email Sends the email action's email to the API token's user only, with each field and metadata value shown as its name in brackets, so you can check how it looks. When the email action attaches its files and the template is a PDF template, the test attaches the template's blank PDF. It isn't recorded on any submission. Without a paid plan, the user needs a confirmed email address.
Test authentication Checks whether your API token is valid by making an authenticated request. This endpoint is useful for verifying credentials during setup or troubleshooting issues.
Update an account email action
Changes one of your account's email actions. Properties left out keep their values. Its templates' customizations keep their own changes, and follow the rest. Set enabled to false to stop its emails for every template.
Update an email action
Changes an email action's settings. Properties left out keep their values. Set enabled to false to stop its emails, or to true to turn it back on after DocSpring turned it off.
Customize an account email action for a template
Changes one of your account's email actions for this template only, replacing any changes the template had. Each setting you send is changed for this template, and the ones you leave out follow the account email action, including later changes to it. Set enabled to false to stop it sending for this template.
Update a signature request Changes a pending signature request's metadata, or how your app authenticated the person (for the audit trail). Once the person has opened it, only its metadata can be changed, and a completed or declined signature request can't be changed.
Update a template
Changes a template's draft. Properties left out keep their values. defaults, html_engine_options and a page design's layout replace the whole object, and field_groups changes only the groups it lists. A new layout adds a field for each new value it reads. Settings such as webhook_url, public_submissions and expire_after apply to every published version too, and setting parent_folder_id moves the template and all of its published versions.
Replace a template's document
Replaces a PDF template's PDF, or a Word template's Word document (from a .docx or an .odt), with one you uploaded with the presigned upload (GET /uploads/presign) (cache_id), a link to download it from (document_url), or the file in base64 (document_base64). A PDF template's fields stay where they are, unless reimport_fields replaces them with the new PDF's fillable fields, and a Word template gets a field for each new tag. To send the file as multipart/form-data instead, use PUT /templates/{template_id}/document/upload.
Update a template's fields
Changes fields of a template's draft and returns all of its fields. Settings left out keep their values. A shared setting (type, required, default, ...) changes for every field with the same name.
Update a webhook Updates a webhook. Only the properties you send change.
Create a template from an uploaded PDF or Word document
Creates a PDF template from a PDF, or a Word template from a Word document (.docx) or an OpenDocument text file (.odt), sent with the request (multipart/form-data). A Word template needs its output_format. For large files, upload the file with the presigned upload (GET /uploads/presign) and create the template with POST /templates.
Replace a template's document with an uploaded file
Replaces a PDF template's PDF, or a Word template's Word document, with one sent with the request (multipart/form-data). A PDF template's fields stay where they are, unless reimport_fields replaces them with the new PDF's fillable fields, and a Word template gets a field for each new tag.
Check a submission without creating it Checks a submission as creating it would (its data against the template's fields, its settings and signature requests) without saving it, generating anything or using credits. It doesn't check your account's credits. The response says whether the submission is valid, and if not, has the error that creating it would return.
Verify an email domain Checks the email domain's DNS records now, instead of waiting for the next check. If DocSpring has stopped looking for its DKIM records (3 days after they were created), it starts again with new ones: replace the CNAME records with them.
Functions
@spec add_template_fields( Tesla.Env.client(), String.t(), Docspring.Model.AddTemplateFieldsRequest.t(), keyword() ) :: {:ok, Docspring.Model.TemplateFields.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Add fields to a template
Adds fields to a template's draft and returns all of its fields. Publish a version for submissions of published versions to have them. A field with the name of one of the template's fields shares its settings (type, required, default, ...), so a field that sets one to another value is refused: PUT /templates/{template_id}/fields changes them for every field with the name.
Parameters
connection(Docspring.Connection): Connection to servertemplate_id(String.t): The template's ID.body(AddTemplateFieldsRequest): The fields to add to the template's draft.opts(keyword): Optional parameters:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.TemplateFields.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec copy_template(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Docspring.Model.Template.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Copy a template Copies a template (its draft, or a published version) into a new template.
Parameters
connection(Docspring.Connection): Connection to servertemplate_id(String.t): The template's ID.opts(keyword): Optional parameters:body(CopyTemplateRequest): Settings for the copy.:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.Template.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec create_account_email_action( Tesla.Env.client(), Docspring.Model.CreateAccountEmailActionRequest.t(), keyword() ) :: {:ok, Docspring.Model.EmailAction.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Create an account email action
Adds an email action to your account. It sends for every template, or only for the templates in template_ids and the templates in the folders in folder_ids (and the folders inside them). Each template can turn it off or change its settings for that template only (PUT /templates/{template_id}/email_actions/{email_action_id}/customization). Without a paid plan (Starter or higher), email actions only email your team: test submissions' emails go to your account's users, and live submissions' emails aren't sent.
Parameters
connection(Docspring.Connection): Connection to serverbody(CreateAccountEmailActionRequest): The account email action to create. Properties left out get their defaults, and it sends for every template unless it liststemplate_idsorfolder_ids.opts(keyword): Optional parameters:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.EmailAction.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec create_combined_pdf( Tesla.Env.client(), Docspring.Model.CreateCombinedPdfRequest.t(), keyword() ) :: {:ok, Docspring.Model.CombinedPdf.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Combine PDFs
Merges PDFs into one: submissions, other combined PDFs, templates, custom files (POST /custom_files) and PDFs from URLs, in the order of source_pdfs. The PDF is generated in the background: on sync.api hosts the request waits for it (unless you pass wait=false), otherwise poll GET /combined_pdfs/{combined_pdf_id} until state isn't pending. A template source merges the template's processed PDF by default: the PDF submissions are filled in on, decrypted and with its form fields removed. Pass processed: false to merge the PDF as it was uploaded.
Parameters
connection(Docspring.Connection): Connection to serverbody(CreateCombinedPdfRequest): The PDFs to merge, and the combined PDF's settings.opts(keyword): Optional parameters:wait(boolean()): Wait until the PDF has been generated before responding. Default true on sync.api hosts.:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.CombinedPdf.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec create_custom_file_from_upload( Tesla.Env.client(), Docspring.Model.CreateCustomFileFromUploadRequest.t(), keyword() ) :: {:ok, Docspring.Model.CustomFile.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Create a custom file from an upload
Creates a custom file from a PDF you uploaded, so you can merge it with other PDFs. Upload the file with the presigned upload (GET /uploads/presign) first, then pass its fields.key as cache_id.
Parameters
connection(Docspring.Connection): Connection to serverbody(CreateCustomFileFromUploadRequest): The uploaded file to create the custom file from.opts(keyword): Optional parameters:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.CustomFile.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec create_email_action( Tesla.Env.client(), String.t(), Docspring.Model.CreateEmailActionRequest.t(), keyword() ) :: {:ok, Docspring.Model.EmailAction.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Create an email action
Adds an email action to a template's draft. From then on, each processed submission emails its PDF to the recipients in to, cc and bcc: addresses, and tags for the address in one of the submission's fields ({{ data.tenant_email }}) or in its metadata ({{ metadata.agent_email }}). With send_when, only the submissions whose values meet its conditions send one. Without a paid plan (Starter or higher), email actions only email your team: test submissions' emails go to your account's users, and live submissions' emails aren't sent.
Parameters
connection(Docspring.Connection): Connection to servertemplate_id(String.t): The template's ID.body(CreateEmailActionRequest): The email action to create. Properties left out get their defaults.opts(keyword): Optional parameters:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.EmailAction.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec create_email_domain( Tesla.Env.client(), Docspring.Model.CreateEmailDomainRequest.t(), keyword() ) :: {:ok, Docspring.Model.EmailDomain.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Add an email domain Adds a domain for email actions to send from, and returns the DNS records to add to it. DocSpring checks for them every few minutes, and the domain is verified once its DKIM and DMARC records are found. Needs a paid monthly plan.
Parameters
connection(Docspring.Connection): Connection to serverbody(CreateEmailDomainRequest): The domain to add.opts(keyword): Optional parameters:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.EmailDomain.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec create_folder( Tesla.Env.client(), Docspring.Model.CreateFolderRequest.t(), keyword() ) :: {:ok, Docspring.Model.Folder.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Create a folder
Creates a folder for organizing templates. Pass parent_folder_id to create it inside another folder. Folder names are unique within their parent folder.
Parameters
connection(Docspring.Connection): Connection to serverbody(CreateFolderRequest): The folder to create.opts(keyword): Optional parameters:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.Folder.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec create_signature_request_event( Tesla.Env.client(), String.t(), Docspring.Model.CreateSignatureRequestEventRequest.t(), keyword() ) :: {:ok, Docspring.Model.SignatureRequestEvent.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Record a signature request event
Records something that happened outside DocSpring in the signature request's audit trail: you sent the request to the person (send_request). The audit trail shows it as reported by your account. A finished (completed, declined or expired) signature request's audit trail takes no more events, and a test API token can't record one for a live signature request.
Parameters
connection(Docspring.Connection): Connection to serversignature_request_id(String.t): The signature request's ID.body(CreateSignatureRequestEventRequest): The event to record.opts(keyword): Optional parameters:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.SignatureRequestEvent.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec create_signature_request_token(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Docspring.Model.SignatureRequestToken.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Create a signature request token
Creates a token that opens the signature request without signing in, in a form embedded in your app or from a link you send. The response is the only time the token's secret is returned. The link works for 24 hours, or 7 days for an email token, and a signing page that opened in time keeps working for 7 more days. A test API token can't create a token for a live signature request.
Parameters
connection(Docspring.Connection): Connection to serversignature_request_id(String.t): The signature request's ID.opts(keyword): Optional parameters:body(CreateSignatureRequestTokenRequest): The kind of link to make. Send no body for anapitoken.:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.SignatureRequestToken.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec create_submission( Tesla.Env.client(), String.t(), Docspring.Model.CreateSubmissionRequest.t(), keyword() ) :: {:ok, Docspring.Model.Submission.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Generate a PDF
Creates a submission: fills in a template with your data and generates a PDF. The PDF is generated in the background: on sync.api hosts the request waits for it (unless you pass wait=false), otherwise poll GET /submissions/{submission_id} until state isn't pending. Data that doesn't match the template's fields returns a 422 with an invalid_data error. The submission is still saved, with its errors, so you can find it in DocSpring: the error's submission_id is its ID. With signature_requests, the PDF is generated once everyone has signed. DocSpring emails each signer a link to sign, unless send_email is false, and can send reminders and the completed document.
Parameters
connection(Docspring.Connection): Connection to servertemplate_id(String.t): The template's ID.body(CreateSubmissionRequest): The submission's data and settings.opts(keyword): Optional parameters:version(String.t): The template version to use: a published version (1.2.0, or1for the latest 1.x.x),latest(the newest published version, or the draft when none has been published) ordraft. Defaultlatest.:wait(boolean()): Wait until the files have been generated before responding. Default true on sync.api hosts.:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.Submission.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec create_submission_batch( Tesla.Env.client(), Docspring.Model.CreateSubmissionBatchRequest.t(), keyword() ) :: {:ok, Docspring.Model.SubmissionBatch.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Generate PDFs in a batch
Creates up to 50 submissions in one request, from one template or several. The PDFs are only generated when every submission is valid. On sync.api hosts the request waits until every PDF has been generated (unless you pass wait=false), otherwise poll GET /submissions/batches/{submission_batch_id} until processed_at is set. When any submission is invalid, nothing is generated and the request returns a 422. Submissions whose data doesn't match their template's fields are still saved with their errors (an invalid_data error, with each one's submission_id in its details), so you can find them in DocSpring. The other submissions aren't saved.
Parameters
connection(Docspring.Connection): Connection to serverbody(CreateSubmissionBatchRequest): The submissions to create, and the settings they share.opts(keyword): Optional parameters:wait(boolean()): Wait until every file in the batch has been generated before responding. Default true on sync.api hosts.:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.SubmissionBatch.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec create_template( Tesla.Env.client(), Docspring.Model.CreateTemplateRequest.t(), keyword() ) :: {:ok, Docspring.Model.Template.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Create a template
Creates an HTML template, or a PDF or Word template from a file you uploaded with the presigned upload (GET /uploads/presign): pass its fields.key as cache_id. You can send a link to the file (document_url) or the file in base64 (document_base64) instead, or send the file with the request with POST /templates/upload. A Word template is made from a Word document (.docx) or an OpenDocument text file (.odt), which DocSpring converts to a Word document. It needs its output_format: what each submission makes, a Word document (docx), an OpenDocument file (odt) or a PDF. A page design (page_designer) takes its layout in the Page Designer layout format, or starts with an empty page without one. A PDF template is ready to generate PDFs once DocSpring has processed its PDF, a template created from a document_url once its document has been downloaded, and one created from an .odt once it has been converted (ready is true). On sync.api hosts the request waits for that unless you pass wait=false.
Parameters
connection(Docspring.Connection): Connection to serverbody(CreateTemplateRequest): The template to create.opts(keyword): Optional parameters:wait(boolean()): Wait until the PDF has been processed, adocument_url's PDF or Word document downloaded, and an OpenDocument file converted, before responding. Default true on sync.api hosts.:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.Template.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec create_template_preview( Tesla.Env.client(), String.t(), Docspring.Model.CreateTemplatePreviewRequest.t(), keyword() ) :: {:ok, Docspring.Model.TemplatePreview.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Preview a template with data
Makes PNG images of a template's pages filled in with the data you send (not a PDF), so you can check how an HTML, PDF or Word template or a page design prints with your data before you publish a version or send live data. A Word template's pages are its PDF's, whatever its output_format. It renders the template's draft, or the published version you ask for. A preview makes no submission and uses no credits, and its pages are watermarked like a test submission's PDF. It's pending while it renders: get it with GET /templates/{template_id}/previews/{preview_id} until it's processed, with an image of each page, or error.
Parameters
connection(Docspring.Connection): Connection to servertemplate_id(String.t): The template's ID.body(CreateTemplatePreviewRequest): The data to render the template with.opts(keyword): Optional parameters:version(String.t): A published version (1.2.0, or1for the latest 1.x.x),latest(the newest published version, or the draft when none has been published) ordraft. Defaultdraft.:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.TemplatePreview.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec create_webhook( Tesla.Env.client(), Docspring.Model.CreateWebhookRequest.t(), keyword() ) :: {:ok, Docspring.Model.Webhook.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Create a webhook Creates a webhook that sends a POST request to your endpoint whenever a subscribed event happens. Scope it to API tokens, templates or folders to receive only their events.
Parameters
connection(Docspring.Connection): Connection to serverbody(CreateWebhookRequest): The webhook to create.opts(keyword): Optional parameters:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.Webhook.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec delete_account_email_action(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Docspring.Model.EmailAction.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Delete an account email action Deletes one of your account's email actions, with every template's customization of it. Emails it has already queued for submissions aren't sent. Submissions keep the record of the emails it sent.
Parameters
connection(Docspring.Connection): Connection to serveremail_action_id(String.t): The account email action's ID.opts(keyword): Optional parameters:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.EmailAction.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec delete_custom_file(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Docspring.Model.CustomFile.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Delete a custom file Deletes a custom file and returns it. Use a live API token: test tokens can't delete custom files.
Parameters
connection(Docspring.Connection): Connection to servercustom_file_id(String.t): The custom file's ID.opts(keyword): Optional parameters:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.CustomFile.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec delete_email_action(Tesla.Env.client(), String.t(), String.t(), keyword()) :: {:ok, Docspring.Model.EmailAction.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Delete an email action Deletes an email action. Emails it has already queued for submissions aren't sent. Submissions keep the record of the emails it sent.
Parameters
connection(Docspring.Connection): Connection to servertemplate_id(String.t): The template's ID.email_action_id(String.t): The email action's ID.opts(keyword): Optional parameters:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.EmailAction.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec delete_email_action_customization( Tesla.Env.client(), String.t(), String.t(), keyword() ) :: {:ok, Docspring.Model.EmailAction.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Reset an account email action's customization Removes the template's changes to one of your account's email actions: it sends for this template as it is, and again if the template had turned it off.
Parameters
connection(Docspring.Connection): Connection to servertemplate_id(String.t): The template's ID.email_action_id(String.t): The ID of one of your account's email actions that sends for the template.opts(keyword): Optional parameters:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.EmailAction.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec delete_email_domain(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Docspring.Model.EmailDomain.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Remove an email domain
Removes an email domain. Email actions that send from an address at it fail until you add and verify it again, or change their from_address. You can then remove its DNS records.
Parameters
connection(Docspring.Connection): Connection to serveremail_domain_id(String.t): The email domain's ID.opts(keyword): Optional parameters:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.EmailDomain.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec delete_folder(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Docspring.Model.Folder.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Delete a folder Deletes an empty folder and returns it. A folder that still has templates or folders in it can't be deleted.
Parameters
connection(Docspring.Connection): Connection to serverfolder_id(String.t): The folder's ID.opts(keyword): Optional parameters:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.Folder.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec delete_template(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Docspring.Model.Template.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Delete a template
Deletes a template's draft and all of its published versions, or one published version (version). Returns the template as it was before it was deleted.
Parameters
connection(Docspring.Connection): Connection to servertemplate_id(String.t): The template's ID.opts(keyword): Optional parameters:version(String.t): Delete only this published version (1.2.0) or the draft (draft, when no version has been published). Without it, the draft and every published version are deleted.:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.Template.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec delete_webhook(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Docspring.Model.Webhook.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Delete a webhook Deletes a webhook so it stops receiving events, and returns it.
Parameters
connection(Docspring.Connection): Connection to serverwebhook_id(String.t): The webhook's ID.opts(keyword): Optional parameters:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.Webhook.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec expire_combined_pdf(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Docspring.Model.CombinedPdf.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Expire a combined PDF Deletes a combined PDF's PDF and returns the expired combined PDF.
Parameters
connection(Docspring.Connection): Connection to servercombined_pdf_id(String.t): The combined PDF's ID.opts(keyword): Optional parameters:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.CombinedPdf.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec expire_submission(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Docspring.Model.Submission.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Expire a submission Deletes a submission's data and PDF now, and returns the expired submission.
Parameters
connection(Docspring.Connection): Connection to serversubmission_id(String.t): The submission's ID.opts(keyword): Optional parameters:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.Submission.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec generate_submission_files( Tesla.Env.client(), String.t(), Docspring.Model.GenerateSubmissionFilesRequest.t(), keyword() ) :: {:ok, Docspring.Model.Submission.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Generate more files
Adds formats to a processed submission's files, in the background, without using credits again: pdf, the PDF of a Word template's submission that made only its Word document (converted from that document), docx, the Word document of a Word template's submission that made only its PDF (made again from its data and the template version it used), odt, a Word template's submission's OpenDocument file (converted from its Word document, or from one made again when it didn't keep one), and png, a PNG image of each page of the PDF (up to 100 pages), which makes the PDF first when the submission doesn't have one. To make them with the submission, add them to output_formats when you create it. Each new file is listed in files while it's made: on sync.api hosts the request waits for them (unless you pass wait=false), otherwise poll GET /submissions/{submission_id} until none of their state is pending. A file that couldn't be made has the state error and an error_message, and the submission stays processed. Asking for a format the submission already has (or is making) changes nothing.
Parameters
connection(Docspring.Connection): Connection to serversubmission_id(String.t): The submission's ID.body(GenerateSubmissionFilesRequest): The formats to make.opts(keyword): Optional parameters:wait(boolean()): Wait until the files have been generated before responding. Default true on sync.api hosts.:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.Submission.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec generate_submission_preview(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Docspring.Model.Submission.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Generate a preview PDF
Generates a preview of a submission's PDF in the background, such as for a submission still waiting for its signature requests. It's in files.preview once preview_generated_at changes.
Parameters
connection(Docspring.Connection): Connection to serversubmission_id(String.t): The submission's ID.opts(keyword): Optional parameters:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.Submission.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec get_account_email_action(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Docspring.Model.EmailAction.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Get an account email action Returns one of your account's email actions, with its settings and whether its emails are failing.
Parameters
connection(Docspring.Connection): Connection to serveremail_action_id(String.t): The account email action's ID.opts(keyword): Optional parameters
Returns
{:ok, Docspring.Model.EmailAction.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec get_combined_pdf(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Docspring.Model.CombinedPdf.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Get a combined PDF Returns a combined PDF, with a temporary link to download it once it has been generated.
Parameters
connection(Docspring.Connection): Connection to servercombined_pdf_id(String.t): The combined PDF's ID.opts(keyword): Optional parameters
Returns
{:ok, Docspring.Model.CombinedPdf.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec get_custom_file(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Docspring.Model.CustomFile.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Get a custom file Returns a custom file, with a temporary URL to download it.
Parameters
connection(Docspring.Connection): Connection to servercustom_file_id(String.t): The custom file's ID.opts(keyword): Optional parameters
Returns
{:ok, Docspring.Model.CustomFile.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec get_email_action(Tesla.Env.client(), String.t(), String.t(), keyword()) :: {:ok, Docspring.Model.EmailAction.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Get an email action Returns one of a template's email actions, with its settings and whether its emails are failing.
Parameters
connection(Docspring.Connection): Connection to servertemplate_id(String.t): The template's ID.email_action_id(String.t): The email action's ID.opts(keyword): Optional parameters
Returns
{:ok, Docspring.Model.EmailAction.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec get_email_domain(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Docspring.Model.EmailDomain.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Get an email domain Returns an email domain, whether it's verified, and the DNS records to add to it.
Parameters
connection(Docspring.Connection): Connection to serveremail_domain_id(String.t): The email domain's ID.opts(keyword): Optional parameters
Returns
{:ok, Docspring.Model.EmailDomain.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec get_folder(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Docspring.Model.Folder.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Get a folder Returns a folder.
Parameters
connection(Docspring.Connection): Connection to serverfolder_id(String.t): The folder's ID.opts(keyword): Optional parameters
Returns
{:ok, Docspring.Model.Folder.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec get_presign_url( Tesla.Env.client(), keyword() ) :: {:ok, Docspring.Model.UploadPresign.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Get a presigned URL to upload a file
Returns a presigned S3 form for uploading a file directly to DocSpring, for files too large to send in a request body. POST the fields and the file (as file) to url as multipart/form-data, then pass fields.key as the cache_id when you create a custom file.
Parameters
connection(Docspring.Connection): Connection to serveropts(keyword): Optional parameters
Returns
{:ok, Docspring.Model.UploadPresign.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec get_signature_request(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Docspring.Model.SignatureRequest.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Get a signature request Returns a signature request, with the values the person has entered so far.
Parameters
connection(Docspring.Connection): Connection to serversignature_request_id(String.t): The signature request's ID.opts(keyword): Optional parameters
Returns
{:ok, Docspring.Model.SignatureRequest.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec get_submission(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Docspring.Model.Submission.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Get a submission Returns a submission, with its data and links to download its PDF.
Parameters
connection(Docspring.Connection): Connection to serversubmission_id(String.t): The submission's ID.opts(keyword): Optional parameters
Returns
{:ok, Docspring.Model.Submission.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec get_submission_batch(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Docspring.Model.SubmissionBatch.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Get a batch
Returns a batch with its submissions. The batch has finished once processed_at is set: its state is processed when every PDF was generated, or error when any submission failed.
Parameters
connection(Docspring.Connection): Connection to serversubmission_batch_id(String.t): The batch's ID.opts(keyword): Optional parameters:include_data(boolean()): Include each submission'sdata(null without it).
Returns
{:ok, Docspring.Model.SubmissionBatch.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec get_template(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Docspring.Model.Template.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Get a template Returns a template: its draft, or one of its published versions.
Parameters
connection(Docspring.Connection): Connection to servertemplate_id(String.t): The template's ID.opts(keyword): Optional parameters:version(String.t): A published version (1.2.0, or1for the latest 1.x.x),latest(the newest published version, or the draft when none has been published) ordraft. Defaultdraft.
Returns
{:ok, Docspring.Model.Template.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec get_template_diff(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Docspring.Model.TemplateDiff.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Compare a version of a template with the one before it Returns what changed in the template's draft since its latest published version (or in a published version since the one before it): fields added, removed, changed and moved, the settings that changed, and whether the document was replaced. Check it before you publish a version.
Parameters
connection(Docspring.Connection): Connection to servertemplate_id(String.t): The template's ID.opts(keyword): Optional parameters:version(String.t): A published version (1.2.0, or1for the latest 1.x.x),latest(the newest published version, or the draft when none has been published) ordraft. Defaultdraft.
Returns
{:ok, Docspring.Model.TemplateDiff.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec get_template_model_code( Tesla.Env.client(), String.t(), Docspring.Model.ModelCodeLanguage.t(), keyword() ) :: {:ok, Docspring.Model.TemplateModelCode.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Generate typed code for a template's submission data
Generates types for a template's submission data in TypeScript, JavaScript, Ruby, Python, PHP, Java, C#, Elixir, Go or Rust, so your app catches mistakes before it calls the API. root_type_name is the type of the whole data object, and just_types=true leaves out the code that converts JSON to and from the types. Java returns every class in code, each under a // ClassName.java comment. A template with no named fields returns 422.
Parameters
connection(Docspring.Connection): Connection to servertemplate_id(String.t): The template's ID.lang(ModelCodeLanguage): The language to generate the code in.opts(keyword): Optional parameters:version(String.t): The template version: a published version (1.2.0, or1for the latest 1.x.x),latest(the newest published version, or the draft when none has been published) ordraft. Defaultlatest, the version a submission uses by default.:just_types(boolean()): Return only the types (interfaces, classes or structs), without the code that converts JSON to and from them. Default false. JavaScript has no types, PHP has no types-only code, and Rust's code is only types (serde converts the JSON), so theirs is the same either way.
Returns
{:ok, Docspring.Model.TemplateModelCode.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec get_template_page_images(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Docspring.Model.TemplatePageImages.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Get images of a template's pages Returns a JPEG image of each page of a PDF template's PDF, with temporary links to download them: the draft's PDF, or a published version's. Use them to see the pages that fields are placed on.
Parameters
connection(Docspring.Connection): Connection to servertemplate_id(String.t): The template's ID.opts(keyword): Optional parameters:version(String.t): A published version (1.2.0, or1for the latest 1.x.x),latest(the newest published version, or the draft when none has been published) ordraft. Defaultdraft.
Returns
{:ok, Docspring.Model.TemplatePageImages.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec get_template_preview(Tesla.Env.client(), String.t(), String.t(), keyword()) :: {:ok, Docspring.Model.TemplatePreview.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Get a template preview
Returns a preview made with POST /templates/{template_id}/previews. Once it's processed, pages has a PNG image of each page with a temporary link to download it: a preview has no PDF. Previews are deleted an hour after they're created.
Parameters
connection(Docspring.Connection): Connection to servertemplate_id(String.t): The template's ID.preview_id(String.t): The preview's ID.opts(keyword): Optional parameters
Returns
{:ok, Docspring.Model.TemplatePreview.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec get_template_schema(Tesla.Env.client(), String.t(), keyword()) :: {:ok, %{optional(String.t()) => any()}} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Get the JSON Schema of a template's submission data
Returns the JSON Schema that a submission's data must match. Use it to check data before you create submissions, or to build a form for the template's fields.
Parameters
connection(Docspring.Connection): Connection to servertemplate_id(String.t): The template's ID.opts(keyword): Optional parameters:version(String.t): The template version: a published version (1.2.0, or1for the latest 1.x.x),latest(the newest published version, or the draft when none has been published) ordraft. Defaultlatest, the version a submission uses by default.
Returns
{:ok, %{optional(String.t) => any()}} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec get_webhook(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Docspring.Model.Webhook.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Get a webhook Returns a webhook.
Parameters
connection(Docspring.Connection): Connection to serverwebhook_id(String.t): The webhook's ID.opts(keyword): Optional parameters
Returns
{:ok, Docspring.Model.Webhook.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec list_account_email_actions( Tesla.Env.client(), keyword() ) :: {:ok, Docspring.Model.EmailActionList.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
List account email actions
Returns your account's email actions, newest first, one page at a time. Each one emails the files of every template's processed submissions, or of the templates and folders it lists. A template's own email actions are listed with the template (GET /templates/{template_id}/email_actions).
Parameters
connection(Docspring.Connection): Connection to serveropts(keyword): Optional parameters:limit(integer()): How many items to return (1-100, default 50).:cursor(String.t): The previous page'snext_cursor, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one.
Returns
{:ok, Docspring.Model.EmailActionList.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec list_combined_pdfs( Tesla.Env.client(), keyword() ) :: {:ok, Docspring.Model.CombinedPdfList.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
List combined PDFs Returns the combined PDFs in your account, newest first, one page at a time.
Parameters
connection(Docspring.Connection): Connection to serveropts(keyword): Optional parameters:limit(integer()): How many items to return (1-100, default 50).:cursor(String.t): The previous page'snext_cursor, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one.
Returns
{:ok, Docspring.Model.CombinedPdfList.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec list_custom_files( Tesla.Env.client(), keyword() ) :: {:ok, Docspring.Model.CustomFileList.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
List custom files Returns the custom files in your account, newest first, one page at a time.
Parameters
connection(Docspring.Connection): Connection to serveropts(keyword): Optional parameters:limit(integer()): How many items to return (1-100, default 50).:cursor(String.t): The previous page'snext_cursor, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one.
Returns
{:ok, Docspring.Model.CustomFileList.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec list_email_actions(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Docspring.Model.EmailActionList.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
List email actions
Returns the email actions of a template's draft, and your account's email actions that send for it, newest first, one page at a time. Each one emails every processed submission's files to the people it lists. An account email action (template_id null) shows the settings it sends for this template, with the template's changes in customization.
Parameters
connection(Docspring.Connection): Connection to servertemplate_id(String.t): The template's ID.opts(keyword): Optional parameters:limit(integer()): How many items to return (1-100, default 50).:cursor(String.t): The previous page'snext_cursor, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one.
Returns
{:ok, Docspring.Model.EmailActionList.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec list_email_domains( Tesla.Env.client(), keyword() ) :: {:ok, Docspring.Model.EmailDomainList.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
List email domains Returns the domains in your account that email actions can send from once they're verified, newest first, one page at a time.
Parameters
connection(Docspring.Connection): Connection to serveropts(keyword): Optional parameters:limit(integer()): How many items to return (1-100, default 50).:cursor(String.t): The previous page'snext_cursor, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one.
Returns
{:ok, Docspring.Model.EmailDomainList.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec list_folders( Tesla.Env.client(), keyword() ) :: {:ok, Docspring.Model.FolderList.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
List folders
Returns the folders in your account, newest first, one page at a time. Pass parent_folder_id to list the folders in one folder.
Parameters
connection(Docspring.Connection): Connection to serveropts(keyword): Optional parameters:parent_folder_id(String.t): Only list the folders in this folder. Without it, the list has every folder, at any depth.:limit(integer()): How many items to return (1-100, default 50).:cursor(String.t): The previous page'snext_cursor, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one.
Returns
{:ok, Docspring.Model.FolderList.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec list_submissions( Tesla.Env.client(), keyword() ) :: {:ok, Docspring.Model.SubmissionList.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
List submissions
Returns the submissions in your account, newest first, one page at a time. Each one is a summary: its data is null unless you pass include_data=true, and its files are empty unless you pass include_files=true. Get a submission by its ID for its signature requests, uploads and page images.
Parameters
connection(Docspring.Connection): Connection to serveropts(keyword): Optional parameters:template_id(String.t): Only list this template's submissions.:test(boolean()): Only list test submissions (true) or live submissions (false).:created_after(DateTime.t): Only list submissions created after this time (RFC 3339, such as2025-01-31T09:00:00Z).:created_before(DateTime.t): Only list submissions created before this time.:include_data(boolean()): Include each submission'sdata(null without it).:limit(integer()): How many items to return (1-100, default 50).:cursor(String.t): The previous page'snext_cursor, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one.:state(SubmissionState): Only list submissions in this state (one state per request). The ones that failed areinvalid_data,error,syntax_error,image_download_failedandimage_processing_failed, and one stillpendingan hour after it was created is stuck.:include_files(boolean()): Include each submission's generated files and their download links (files, empty without it), without the page images' links.
Returns
{:ok, Docspring.Model.SubmissionList.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec list_template_fields(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Docspring.Model.TemplateFields.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
List a template's fields Returns a template's fields with all of their settings, page by page: the draft's fields, or a published version's. A PDF template's fields are placed on its pages: GET /templates/{template_id}/page_images has images of the pages.
Parameters
connection(Docspring.Connection): Connection to servertemplate_id(String.t): The template's ID.opts(keyword): Optional parameters:version(String.t): A published version (1.2.0, or1for the latest 1.x.x),latest(the newest published version, or the draft when none has been published) ordraft. Defaultdraft.
Returns
{:ok, Docspring.Model.TemplateFields.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec list_template_submissions(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Docspring.Model.SubmissionList.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
List a template's submissions Returns a template's submissions (from every version of the template), newest first.
Parameters
connection(Docspring.Connection): Connection to servertemplate_id(String.t): The template's ID.opts(keyword): Optional parameters:test(boolean()): Only list test submissions (true) or live submissions (false).:created_after(DateTime.t): Only list submissions created after this time (RFC 3339, such as2025-01-31T09:00:00Z).:created_before(DateTime.t): Only list submissions created before this time.:include_data(boolean()): Include each submission'sdata(null without it).:limit(integer()): How many items to return (1-100, default 50).:cursor(String.t): The previous page'snext_cursor, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one.:state(SubmissionState): Only list submissions in this state (one state per request). The ones that failed areinvalid_data,error,syntax_error,image_download_failedandimage_processing_failed, and one stillpendingan hour after it was created is stuck.:include_files(boolean()): Include each submission's generated files and their download links (files, empty without it), without the page images' links.
Returns
{:ok, Docspring.Model.SubmissionList.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec list_templates( Tesla.Env.client(), keyword() ) :: {:ok, Docspring.Model.TemplateSummaryList.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
List templates Returns the templates in your account (their drafts), newest first, one page at a time. Each one is a summary: get a template by its ID for its settings, its PDF in full, its HTML, defaults and published versions.
Parameters
connection(Docspring.Connection): Connection to serveropts(keyword): Optional parameters:query(String.t): Only list templates whose name contains this text (ignoring case).%and_match themselves.:parent_folder_id(String.t): Only list the templates in this folder (not in its subfolders).:limit(integer()): How many items to return (1-100, default 50).:cursor(String.t): The previous page'snext_cursor, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one.
Returns
{:ok, Docspring.Model.TemplateSummaryList.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec list_webhooks( Tesla.Env.client(), keyword() ) :: {:ok, Docspring.Model.WebhookList.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
List webhooks Returns the webhooks in your account, newest first, one page at a time. Filter them by event type, mode, or the API token, template or folder they're scoped to.
Parameters
connection(Docspring.Connection): Connection to serveropts(keyword): Optional parameters:event_type(WebhookEventType): Only list webhooks that subscribe to this event.:mode(WebhookMode): Only list webhooks set to this mode.:template_id(String.t): Only list webhooks scoped to this template.:folder_id(String.t): Only list webhooks scoped to this folder.:api_token_id(String.t): Only list webhooks scoped to this API token.:limit(integer()): How many items to return (1-100, default 50).:cursor(String.t): The previous page'snext_cursor, to get the next page. It's the ID of that page's last item, so get the next page before you delete or change the items on this one.
Returns
{:ok, Docspring.Model.WebhookList.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec move_folder( Tesla.Env.client(), String.t(), Docspring.Model.MoveFolderRequest.t(), keyword() ) :: {:ok, Docspring.Model.Folder.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Move a folder
Moves a folder into another folder, or to the root with parent_folder_id: null. Its templates and folders move with it. A folder can't move into itself or one of its own folders.
Parameters
connection(Docspring.Connection): Connection to serverfolder_id(String.t): The folder's ID.body(MoveFolderRequest): Where to move the folder.opts(keyword): Optional parameters:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.Folder.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec move_template( Tesla.Env.client(), String.t(), Docspring.Model.MoveTemplateRequest.t(), keyword() ) :: {:ok, Docspring.Model.Template.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Move a template to a folder
Moves a template and all of its published versions to a folder, or to the root (null).
Parameters
connection(Docspring.Connection): Connection to servertemplate_id(String.t): The template's ID.body(MoveTemplateRequest): Where to move the template.opts(keyword): Optional parameters:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.Template.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec publish_template_version( Tesla.Env.client(), String.t(), Docspring.Model.PublishTemplateVersionRequest.t(), keyword() ) :: {:ok, Docspring.Model.TemplateVersion.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Publish a template version
Publishes the template's draft as a new version. Its content (the PDF or HTML, fields, name and description) never changes, while settings such as webhook_url and public_submissions keep following the draft. version_type says which part of the latest version number goes up. While the template's PDF is downloading or being processed, or DocSpring is setting up its fields, it returns a 409 that says so.
Parameters
connection(Docspring.Connection): Connection to servertemplate_id(String.t): The template's ID.body(PublishTemplateVersionRequest): The version to publish.opts(keyword): Optional parameters:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.TemplateVersion.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec remove_template_fields( Tesla.Env.client(), String.t(), Docspring.Model.RemoveTemplateFieldsRequest.t(), keyword() ) :: {:ok, Docspring.Model.TemplateFields.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Remove fields from a template Removes fields from a template's draft and returns the fields that are left. Conditional logic that used only the removed fields is removed too.
Parameters
connection(Docspring.Connection): Connection to servertemplate_id(String.t): The template's ID.body(RemoveTemplateFieldsRequest): The fields to remove from the template's draft.opts(keyword): Optional parameters:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.TemplateFields.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec rename_folder( Tesla.Env.client(), String.t(), Docspring.Model.RenameFolderRequest.t(), keyword() ) :: {:ok, Docspring.Model.Folder.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Rename a folder Renames a folder. The name must be unique within its parent folder.
Parameters
connection(Docspring.Connection): Connection to serverfolder_id(String.t): The folder's ID.body(RenameFolderRequest): The folder's new name.opts(keyword): Optional parameters:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.Folder.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec reorder_template_fields( Tesla.Env.client(), String.t(), Docspring.Model.ReorderTemplateFieldsRequest.t(), keyword() ) :: {:ok, Docspring.Model.TemplateFields.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Reorder a template's fields Changes the order of the fields in a template's draft and returns them in their new order. Send every field's ID: each field stays on its page, and a page's fields are printed in this order, so a later field prints over an earlier one where they overlap. Their values are in this order in the template's data schema and forms.
Parameters
connection(Docspring.Connection): Connection to servertemplate_id(String.t): The template's ID.body(ReorderTemplateFieldsRequest): The new order of the fields in the template's draft.opts(keyword): Optional parameters:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.TemplateFields.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec restore_template_version( Tesla.Env.client(), String.t(), Docspring.Model.RestoreTemplateVersionRequest.t(), keyword() ) :: {:ok, Docspring.Model.Template.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Restore a template version
Replaces the template's draft with a copy of one of its published versions. The draft keeps its settings that apply to every version, such as webhook_url.
Parameters
connection(Docspring.Connection): Connection to servertemplate_id(String.t): The template's ID.body(RestoreTemplateVersionRequest): The version to restore.opts(keyword): Optional parameters:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.Template.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec send_account_email_action_test_email(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Docspring.Model.EmailActionTestEmail.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Send a test email for an account email action Sends the account email action's email to the API token's user only, as it would go for one template it sends for, with each field shown as its name in brackets, so you can check how it looks. When the email action attaches its files and that template is a PDF template, the test attaches the template's blank PDF. It isn't recorded on any submission.
Parameters
connection(Docspring.Connection): Connection to serveremail_action_id(String.t): The account email action's ID.opts(keyword): Optional parameters:body(SendAccountEmailActionTestEmailRequest): Which template the test email is for.:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.EmailActionTestEmail.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec send_email_action_test_email( Tesla.Env.client(), String.t(), String.t(), keyword() ) :: {:ok, Docspring.Model.EmailActionTestEmail.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Send a test email Sends the email action's email to the API token's user only, with each field and metadata value shown as its name in brackets, so you can check how it looks. When the email action attaches its files and the template is a PDF template, the test attaches the template's blank PDF. It isn't recorded on any submission. Without a paid plan, the user needs a confirmed email address.
Parameters
connection(Docspring.Connection): Connection to servertemplate_id(String.t): The template's ID.email_action_id(String.t): The email action's ID.opts(keyword): Optional parameters:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.EmailActionTestEmail.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec test_authentication( Tesla.Env.client(), keyword() ) :: {:ok, Docspring.Model.AuthenticationCheck.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Test authentication Checks whether your API token is valid by making an authenticated request. This endpoint is useful for verifying credentials during setup or troubleshooting issues.
Parameters
connection(Docspring.Connection): Connection to serveropts(keyword): Optional parameters
Returns
{:ok, Docspring.Model.AuthenticationCheck.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec update_account_email_action( Tesla.Env.client(), String.t(), Docspring.Model.UpdateAccountEmailActionRequest.t(), keyword() ) :: {:ok, Docspring.Model.EmailAction.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Update an account email action
Changes one of your account's email actions. Properties left out keep their values. Its templates' customizations keep their own changes, and follow the rest. Set enabled to false to stop its emails for every template.
Parameters
connection(Docspring.Connection): Connection to serveremail_action_id(String.t): The account email action's ID.body(UpdateAccountEmailActionRequest): The settings to change. Properties left out keep their values.opts(keyword): Optional parameters:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.EmailAction.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec update_email_action( Tesla.Env.client(), String.t(), String.t(), Docspring.Model.UpdateEmailActionRequest.t(), keyword() ) :: {:ok, Docspring.Model.EmailAction.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Update an email action
Changes an email action's settings. Properties left out keep their values. Set enabled to false to stop its emails, or to true to turn it back on after DocSpring turned it off.
Parameters
connection(Docspring.Connection): Connection to servertemplate_id(String.t): The template's ID.email_action_id(String.t): The email action's ID.body(UpdateEmailActionRequest): The settings to change. Properties left out keep their values.opts(keyword): Optional parameters:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.EmailAction.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec update_email_action_customization( Tesla.Env.client(), String.t(), String.t(), Docspring.Model.UpdateEmailActionCustomizationRequest.t(), keyword() ) :: {:ok, Docspring.Model.EmailAction.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Customize an account email action for a template
Changes one of your account's email actions for this template only, replacing any changes the template had. Each setting you send is changed for this template, and the ones you leave out follow the account email action, including later changes to it. Set enabled to false to stop it sending for this template.
Parameters
connection(Docspring.Connection): Connection to servertemplate_id(String.t): The template's ID.email_action_id(String.t): The ID of one of your account's email actions that sends for the template.body(UpdateEmailActionCustomizationRequest): The template's changes to the account email action, replacing any it had. Each setting you send is changed for this template, and the ones you leave out follow the account email action.enabled: falsestops it sending for this template; left out, it sends.opts(keyword): Optional parameters:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.EmailAction.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec update_signature_request( Tesla.Env.client(), String.t(), Docspring.Model.UpdateSignatureRequestRequest.t(), keyword() ) :: {:ok, Docspring.Model.SignatureRequest.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Update a signature request Changes a pending signature request's metadata, or how your app authenticated the person (for the audit trail). Once the person has opened it, only its metadata can be changed, and a completed or declined signature request can't be changed.
Parameters
connection(Docspring.Connection): Connection to serversignature_request_id(String.t): The signature request's ID.body(UpdateSignatureRequestRequest): The settings to change. Properties left out keep their values.opts(keyword): Optional parameters:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.SignatureRequest.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec update_template( Tesla.Env.client(), String.t(), Docspring.Model.UpdateTemplateRequest.t(), keyword() ) :: {:ok, Docspring.Model.Template.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Update a template
Changes a template's draft. Properties left out keep their values. defaults, html_engine_options and a page design's layout replace the whole object, and field_groups changes only the groups it lists. A new layout adds a field for each new value it reads. Settings such as webhook_url, public_submissions and expire_after apply to every published version too, and setting parent_folder_id moves the template and all of its published versions.
Parameters
connection(Docspring.Connection): Connection to servertemplate_id(String.t): The template's ID.body(UpdateTemplateRequest): The settings to change. Properties left out keep their values.opts(keyword): Optional parameters:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.Template.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec update_template_document( Tesla.Env.client(), String.t(), Docspring.Model.UpdateTemplateDocumentRequest.t(), keyword() ) :: {:ok, Docspring.Model.Template.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Replace a template's document
Replaces a PDF template's PDF, or a Word template's Word document (from a .docx or an .odt), with one you uploaded with the presigned upload (GET /uploads/presign) (cache_id), a link to download it from (document_url), or the file in base64 (document_base64). A PDF template's fields stay where they are, unless reimport_fields replaces them with the new PDF's fillable fields, and a Word template gets a field for each new tag. To send the file as multipart/form-data instead, use PUT /templates/{template_id}/document/upload.
Parameters
connection(Docspring.Connection): Connection to servertemplate_id(String.t): The template's ID.body(UpdateTemplateDocumentRequest): The new PDF, or a Word template's new Word document, as one ofcache_id,document_urlanddocument_base64.opts(keyword): Optional parameters:wait(boolean()): Wait until the PDF has been processed, adocument_url's PDF or Word document downloaded, and an OpenDocument file converted, before responding. Default true on sync.api hosts.:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.Template.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec update_template_fields( Tesla.Env.client(), String.t(), Docspring.Model.UpdateTemplateFieldsRequest.t(), keyword() ) :: {:ok, Docspring.Model.TemplateFields.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Update a template's fields
Changes fields of a template's draft and returns all of its fields. Settings left out keep their values. A shared setting (type, required, default, ...) changes for every field with the same name.
Parameters
connection(Docspring.Connection): Connection to servertemplate_id(String.t): The template's ID.body(UpdateTemplateFieldsRequest): The fields to change in the template's draft.opts(keyword): Optional parameters:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.TemplateFields.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec update_webhook( Tesla.Env.client(), String.t(), Docspring.Model.UpdateWebhookRequest.t(), keyword() ) :: {:ok, Docspring.Model.Webhook.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Update a webhook Updates a webhook. Only the properties you send change.
Parameters
connection(Docspring.Connection): Connection to serverwebhook_id(String.t): The webhook's ID.body(UpdateWebhookRequest): The settings to change. Properties left out keep their values.opts(keyword): Optional parameters:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.Webhook.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec upload_template(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Docspring.Model.Template.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Create a template from an uploaded PDF or Word document
Creates a PDF template from a PDF, or a Word template from a Word document (.docx) or an OpenDocument text file (.odt), sent with the request (multipart/form-data). A Word template needs its output_format. For large files, upload the file with the presigned upload (GET /uploads/presign) and create the template with POST /templates.
Parameters
connection(Docspring.Connection): Connection to serverdocument(String.t): A PDF (for a PDF template) or a Word document (.docx or .odt, for a Word template). DocSpring converts an OpenDocument text file (.odt) to a Word document after responding: the template'sdocument.stateisconvertinguntil then (sync.api hosts wait for it).opts(keyword): Optional parameters:wait(boolean()): Wait until the PDF has been processed, adocument_url's PDF or Word document downloaded, and an OpenDocument file converted, before responding. Default true on sync.api hosts.:name(String.t): The template's name.:description(String.t): The template's description.:parent_folder_id(String.t): The folder to put the template in. Left out, it's created at the root.:ai_field_naming_language(Docspring.Model.AiFieldNamingLanguage.t): The language AI field setup names fields in:autouses the form's language when it's written in the Latin alphabet without accents, and English otherwise;englishalways uses English;form_languageuses the form's language and script. Default: your account's template settings.:detect_fields(boolean()): Set up the PDF's fields as DocSpring's \"Automatically detect fields\" upload option does: import or detect the fields, name them with AI, and set up conditional logic.field_source,field_namingandfield_logicchoose how. Default false.document.page_processing_statusesanddocument.field_logic_statusshow how it's going, anddocument.statebecomesprocessedonce every page's fields are set up.:field_source(Docspring.Model.FieldSetupSource.t): Withdetect_fields, where the fields come from.auto(the default) imports the form fields of a fillable PDF and detects the fields of a PDF without them;pdf_detectiondetects the fields from the page layout, even on a fillable PDF;pdf_form_fieldsonly imports the PDF's form fields.:field_naming(Docspring.Model.FieldSetupNaming.t): Withdetect_fields, how the fields are named.ai(the default) names them and sets their types and settings with AI;preservekeeps the names of the PDF's form fields, and AI only names the fields it detected.preserveneedsfield_sourceautoorpdf_form_fields.:field_logic(Docspring.Model.FieldSetupLogic.t): Withdetect_fields, whether AI reads the whole form once the fields are named and sets up conditional logic and required fields (ai) or not (none). Default: your account's template settings.:output_format(Docspring.Model.OutputFormat.t): What each submission of a Word template makes unless its request setsoutput_formats:docx(a Word document),odt(an OpenDocument file, converted from the Word document) orpdf. Required whendocumentis a Word document.:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.Template.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec upload_template_document(Tesla.Env.client(), String.t(), String.t(), keyword()) :: {:ok, Docspring.Model.Template.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Replace a template's document with an uploaded file
Replaces a PDF template's PDF, or a Word template's Word document, with one sent with the request (multipart/form-data). A PDF template's fields stay where they are, unless reimport_fields replaces them with the new PDF's fillable fields, and a Word template gets a field for each new tag.
Parameters
connection(Docspring.Connection): Connection to servertemplate_id(String.t): The template's ID.document(String.t): The new PDF, or the new Word document (.docx or .odt) of a Word template.opts(keyword): Optional parameters:wait(boolean()): Wait until the PDF has been processed, adocument_url's PDF or Word document downloaded, and an OpenDocument file converted, before responding. Default true on sync.api hosts.:reimport_fields(boolean()): Replace all of the template's fields with the fillable fields in the new PDF, once DocSpring has processed it (document.field_reimport_state). As on a first upload, the default typeface, font size, bold and color are taken from the PDF's fields; the template's other settings are kept. If the PDF has no fillable fields, the template keeps its fields. A locked template can't re-import its fields. Only for PDF templates: a Word template adds a field for each new tag.:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.Template.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec validate_submission( Tesla.Env.client(), String.t(), Docspring.Model.ValidateSubmissionRequest.t(), keyword() ) :: {:ok, Docspring.Model.SubmissionValidation.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Check a submission without creating it Checks a submission as creating it would (its data against the template's fields, its settings and signature requests) without saving it, generating anything or using credits. It doesn't check your account's credits. The response says whether the submission is valid, and if not, has the error that creating it would return.
Parameters
connection(Docspring.Connection): Connection to servertemplate_id(String.t): The template's ID.body(ValidateSubmissionRequest): The submission's data and settings.opts(keyword): Optional parameters:version(String.t): The template version to use: a published version (1.2.0, or1for the latest 1.x.x),latest(the newest published version, or the draft when none has been published) ordraft. Defaultlatest.:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.SubmissionValidation.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure
@spec verify_email_domain(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Docspring.Model.EmailDomain.t()} | {:ok, Docspring.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Verify an email domain Checks the email domain's DNS records now, instead of waiting for the next check. If DocSpring has stopped looking for its DKIM records (3 days after they were created), it starts again with new ones: replace the CNAME records with them.
Parameters
connection(Docspring.Connection): Connection to serveremail_domain_id(String.t): The email domain's ID.opts(keyword): Optional parameters:"Idempotency-Key"(String.t): A key of your own, such as a UUID, that makes it safe to send this request again: for 24 hours, DocSpring answers a request with the same key from the same API token with the first request's response (and anIdempotent-Replayed: trueheader) instead of processing it again. Send a new key with each new request, and the same key each time you send the same request again, such as after a timeout, a network error or a 5xx. The same key with a different request is a 422idempotency_key_reused. A 409idempotency_key_in_usewith aRetry-Afterheader means the first request is still being processed: send the request again then.
Returns
{:ok, Docspring.Model.EmailDomain.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure