Docspring.Api.Client (docspring v4.1.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.
Copy a template Copies a template (its draft, or a published version) into a new template.
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 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.
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.
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 template from a PDF you uploaded with the presigned upload (GET /uploads/presign): pass its fields.key as cache_id. To send the PDF with the request instead, use POST /templates/upload. A PDF template is ready to generate PDFs once DocSpring has processed its PDF (ready is true). On sync.api hosts the request waits for that unless you pass wait=false.
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 a custom file Deletes a custom file and returns it. Use a live API token: test tokens can't delete custom files.
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: png, a PNG image of each page of the PDF (up to 100 pages). 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 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 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 or Go, so your app catches mistakes before it calls the API. root_type_name is the type of the whole data object. 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 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 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 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. Lists leave out each submission's data unless you pass include_data=true.
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. Get a template by its ID for 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 that doesn't change. 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.
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 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 and html_engine_options replace the whole object, and field_groups changes only the groups it lists. Setting parent_folder_id moves the template and all of its published versions.
Replace a template's PDF
Replaces a PDF template's PDF 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). The fields stay where they are, unless reimport_fields replaces them with the new PDF's fillable fields. To send the PDF 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 PDF template from an uploaded PDF
Creates a PDF template from a PDF sent with the request (multipart/form-data). For large files, upload the PDF with the presigned upload (GET /uploads/presign) and create the template with POST /templates.
Replace a template's PDF with an uploaded PDF
Replaces a PDF template's PDF with one sent with the request (multipart/form-data). The fields stay where they are, unless reimport_fields replaces them with the new PDF's fillable fields.
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.
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.
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
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.
Returns
{:ok, Docspring.Model.Template.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.
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
Returns
{:ok, Docspring.Model.CustomFile.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
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.
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
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.
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.
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),latestordraft. Defaultlatest(the draft when no version has been published).:wait(boolean()): Wait until the files have been generated before responding. Default true on sync.api hosts.
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 PDF in the batch has been generated before responding. Default true on sync.api hosts.
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 template from a PDF you uploaded with the presigned upload (GET /uploads/presign): pass its fields.key as cache_id. To send the PDF with the request instead, use POST /templates/upload. A PDF template is ready to generate PDFs once DocSpring has processed its PDF (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, and adocument_urldownloaded, before responding. Default true on sync.api hosts.
Returns
{:ok, Docspring.Model.Template.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
Returns
{:ok, Docspring.Model.Webhook.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
Returns
{:ok, Docspring.Model.CustomFile.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
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.
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
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
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
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: png, a PNG image of each page of the PDF (up to 100 pages). 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.
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
Returns
{:ok, Docspring.Model.Submission.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_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),latestordraft. 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),latestordraft. 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 or Go, so your app catches mistakes before it calls the API. root_type_name is the type of the whole data object. 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),latestordraft. Defaultlatest(the draft when no version has been published), the version a submission uses by default.
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),latestordraft. Defaultdraft.
Returns
{:ok, Docspring.Model.TemplatePageImages.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),latestordraft. Defaultlatest(the draft when no version has been published), 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_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_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. Lists leave out each submission's data unless you pass include_data=true.
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.
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),latestordraft. 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.
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. Get a template by its ID for 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).: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
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
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 that doesn't change. 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
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
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
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
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.
Parameters
connection(Docspring.Connection): Connection to servertemplate_id(String.t): The template's ID.body(RestoreTemplateVersionRequest): The version to restore.opts(keyword): Optional parameters
Returns
{:ok, Docspring.Model.Template.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_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
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 and html_engine_options replace the whole object, and field_groups changes only the groups it lists. 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
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 PDF
Replaces a PDF template's PDF 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). The fields stay where they are, unless reimport_fields replaces them with the new PDF's fillable fields. To send the PDF 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, as one ofcache_id,document_urlanddocument_base64.opts(keyword): Optional parameters:wait(boolean()): Wait until the PDF has been processed, and adocument_urldownloaded, before responding. Default true on sync.api hosts.
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
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
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 PDF template from an uploaded PDF
Creates a PDF template from a PDF sent with the request (multipart/form-data). For large files, upload the PDF with the presigned upload (GET /uploads/presign) and create the template with POST /templates.
Parameters
connection(Docspring.Connection): Connection to serverdocument(String.t): The PDF.opts(keyword): Optional parameters:wait(boolean()): Wait until the PDF has been processed, and adocument_urldownloaded, 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.
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 PDF with an uploaded PDF
Replaces a PDF template's PDF with one sent with the request (multipart/form-data). The fields stay where they are, unless reimport_fields replaces them with the new PDF's fillable fields.
Parameters
connection(Docspring.Connection): Connection to servertemplate_id(String.t): The template's ID.document(String.t): The new PDF.opts(keyword): Optional parameters:wait(boolean()): Wait until the PDF has been processed, and adocument_urldownloaded, 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.
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),latestordraft. Defaultlatest(the draft when no version has been published).
Returns
{:ok, Docspring.Model.SubmissionValidation.t} | {:ok, Docspring.Model.ErrorResponse.t}on success{:error, Tesla.Env.t}on failure