# Create document (OneClick)

## Create document via Upload

<mark style="color:green;">`POST`</mark> `https://api.zapsign.com.br/api/v1/docs/`

This endpoint allows you to create a document for signature from a PDF. You must send the data in JSON, as well as receive it in the same format.

#### Headers

<table><thead><tr><th width="198">Name</th><th width="163">Type</th><th>Description</th></tr></thead><tbody><tr><td>Authorization<mark style="color:red;">*</mark></td><td>string</td><td><p>apiToken ahead of the "Bearer" text. </p><p>Ex: Bearer c7f35c84-7893-4087-b4fb-d1f06c23</p></td></tr></tbody></table>

#### Request Body

<table><thead><tr><th width="186">Name</th><th width="123">Type</th><th>Description</th></tr></thead><tbody><tr><td>name</td><td>string</td><td>Title of the document. String of up to 255 characters</td></tr><tr><td>one_click_active</td><td>boolean</td><td>To activate the simplified signing experience, this parameter must be true.</td></tr><tr><td>require_signature</td><td>boolean</td><td>When the simplified signing experience (one_click_active) is enabled and this parameter is set to true, the signer will be required to accept the checkbox and draw their signature.</td></tr><tr><td>url_pdf</td><td>string</td><td>Define the PDF to be signed from a public URL with the file. For now, we only accept one file in PDF format, up to 10Mb. </td></tr><tr><td>base64_pdf</td><td>string</td><td><strong>Alternative to url_pdf:</strong> Set the PDF to be signed, starting from a base64. You must convert the file to a base64 string and send it to us in this parameter (more details below).</td></tr><tr><td>url_docx</td><td>string</td><td><strong>Alternative to url_pdf:</strong> Set the DOCX to be signed, starting from a public URL with the file.</td></tr><tr><td>base64_docx</td><td>string</td><td><strong>Alternative to url_docx:</strong> Set the DOCX to be signed, starting from a base64. You must convert the file to a base64 string and send it to us in this parameter (more details below).</td></tr><tr><td>signers[name]</td><td>Array&#x3C;Signer></td><td><p>The 'signers' field represents the people who will sign the document. You can find how to configure each signer bellow. </p><p>It's an array of Signer objects.</p></td></tr><tr><td>lang</td><td>string</td><td>Document language. Possible values: "pt-br" (Portuguese), "es" (Spanish), "en" (English), "fr" (French). Default: "pt-br"</td></tr><tr><td>disable_signer_emails </td><td>boolean</td><td>To disable emails sent to signers, send this parameter to true. Default: false</td></tr><tr><td>brand_logo</td><td>string</td><td>If you want to customize the logo of the signing experience for this specific document, submit the image URL (must be a publicly accessible link). Default: ""</td></tr><tr><td>brand_primary_color</td><td>string</td><td>If you want to customize the primary (button) color of the signing experience for this specific document, send it in rgb or hexadecimal. Ex: "#0011ee". Default: ""</td></tr><tr><td>brand_name </td><td>string</td><td>If you want to customize the sender name of emails sent to the signer, enter the brand name here. For example, if you entered "XPTO Company", the sender of the email will be "XPTO Company via ZapSign". Max-length: 100 characters. Default: ""</td></tr><tr><td>external_id</td><td>string</td><td><p>ID of the document in your application. </p><p>Default: ""</p></td></tr><tr><td>folder_path </td><td>string</td><td><p>Path of the folder inside ZapSign where the document will be placed. If the folders do not exist, they will be created automatically. Requirements: (1) folder_path can be up to 255 characters long, (2) each folder can be up to 50 characters long, (3) there is a limit of 5 folder levels. </p><p>Ex.: "/api/" or "/folder1/folder2/folder3/". Default: "/" (no folder).</p></td></tr><tr><td>created_by</td><td>string</td><td><p>Email of the user who will be defined as creator of the document, for internal organization purposes. If the email does not exist or is not your account user, this parameter will be ignored. </p><p>Default: "" (document will have account owner as creator)</p></td></tr><tr><td>date_limit_to_sign</td><td>DateTime</td><td><p>Deadline for signing the document. </p><p>(Accepted formats: YYYY-MM-DD, YYYY-MM-DDTH:m:s.ssssssZ)</p></td></tr><tr><td>signature_order_active </td><td>boolean</td><td><p>If true, the signer's signatures will be ordered sequentially. </p><p>Default: false</p></td></tr><tr><td>observers </td><td>array&#x3C;string></td><td>Represents document observers (limit 20), i.e. email addresses that will be notified upon completion of the signature flow. It's an array of strings.</td></tr><tr><td>reminder_every_n_days</td><td>integer</td><td>Represents the interval of days between reminders that will be sent to signers, as long as they don`t sign. There will be 6 tries at most. Observation: this field must only be filled if send_automatic_whatsapp or send_automatic_email are true. Example: if setted to 8 it will be sent one email every 7 days, until it's signed, for at most 21 days.</td></tr><tr><td>allow_refuse_signature</td><td>boolean</td><td><p>If true, signers have the option to refuse to sign. </p><p>Default: false.</p></td></tr><tr><td>disable_signers_get_original_file</td><td>boolean</td><td><p>If true, signers do not have the option to download the original document. </p><p>Default: false.</p></td></tr><tr><td>metadata</td><td>Array</td><td>Custom metadata sent during document creation, in <code>key</code> and <code>value</code> pair format. This information appears only in the creation, signing, rejection, and deletion webhooks.</td></tr></tbody></table>

### Signers configuration

**Document** - JSON root:

{% hint style="warning" %}
**Warning:** When creating a document with OneClick, the **name, email, or phone** information must be provided, as the signer will only accept the document signature through a checkbox (enabling a signature is optional). Additionally, it is **not possible** to define authentication methods (**auth\_mode, selfie\_validation\_type, require\_document\_photo, require\_selfie**).
{% endhint %}

* **Signers -** for each signer:

  * **name (string):** The signer's name. **Required.**

  * **email (string):** The signer's email. Either **email or phone number must be provided**, as the signer will not be able to fill in this information.

  * **phone\_country (string):** The country code of the signer's phone number. Either **email or phone number must be provided**, as the signer will not be able to fill in this information.

  * **phone\_number (string):** The signer's phone number. Either **email or phone number must be provided**, as the signer will not be able to fill in this information.

  * **send\_automatic\_email (boolean):** If true, ZapSign will send an email to the signer with the link to sign the document. If false (default), you will be responsible for sharing the signature link with the signer, whether through your website, widget, WhatsApp, SMS, email,  etc.  For this to work, it is mandatory that the signer's email address is defined. **Tip**: Define the parameters 'brand\_name', 'brand\_primary\_color', and 'brand\_logo' to personalize the emails sent to signers.

  * **send\_automatic\_whatsapp** (boolean): If **true**, ZapSign will send a whatsapp message to the signer with the link to sign the document. Default: false\
    **Note:** For this to work, it is mandatory that the signer's phone number is defined. Each automatic sending via WhatsApp costs $0,1 USD. Buy credits in [**Configuration > Plan**](https://app.zapsign.com.br/conta/configuracoes?tab=plans)**.**

  * **send\_automatic\_whatsapp\_signed\_file** (boolean): If **true**, ZapSign will send a whatsapp message to the signer with the link to the signed document.\
    **Note:** For this to work, it is mandatory that the signer's phone number is defined. Each automatic sending via WhatsApp costs $0,1 USD. Buy credits in [Configuration > Plan](https://app.zapsign.com.br/conta/configuracoes?tab=plans).

  * **order\_group (integer):** In case "signature\_order\_active" is active in the document, this field controls the signing order. Example: If the field is set to 1, then this signer will be the first to sign. If the field is set to 2, then this signer will be the second to sign and so on.

  * **custom\_message (string):** (only relevant if send\_automatic\_email: true). The custom\_message is the personalized message that you can insert in the email sent by ZapSign to the signer. \
    Example: "Hello So-and-so, \n This is your employment contract. \n Hugs, Team XPTO". The \n symbol serves to "skip a line" in the email text. Default: ""

  * **blank\_email** **(boolean):** If true, the signer's email will not be requested, and this information will not be included in the signature report. It is mandatory to have the signer's email OR phone number. Default: false

  * **hide\_email** **(boolean):** You can hide signer email in signatures report. Default: false

  * **blank\_phone** **(boolean):** If true, the signer's phone will not be requested, and this information will not be included in the signature report. It is mandatory to have the signer's email OR phone number. Default: false

  * **hide\_phone** **(boolean):** You can hide the signer's phone in the signatures report. Default: false

  * **qualification (string):** Qualification to appear in the signatures report. Ex: "Witness" value will result in "Signed as a witness". Default: ""

  * **external\_id (string):** ID of the signer in your application. Default: ""

  * **redirect\_link (string):** link to redirect after signer signs. For example: "<https://www.yoursite.co/thank-ypu>". It will appear as a "CONTINUE" after signing the document. Remember to insert http\:// or https\:// at the beginning of the link. Default: ""&#x20;

### Request

````javascript
{
	"name":"Document name",
	"url_pdf":"https://zapsign.s3.amazonaws.com/2022/1/pdf/63d19807-cbfa-4b51-8571-215ad0f4eb98/ca42e7be-c932-482c-b70b-92ad7aea04be.pdf",
        "one_click_active": true,
        "require_signature": true,
	"external_id": null,
	"signers":[
		{
			"name":"Maria Perez",
			"email":"maria@gmail.com",
			"send_automatic_email": false
		}
	],
    "lang": "en",
    "signed_file_only_finished": false,
    "folder_path":"/",
    "created_by":"",
    "date_limit_to_sign": null,
    "signature_order_active": false,
    "reminder_every_n_days": 0,
    "allow_refuse_signature": false,
    "disable_signers_get_original_file": false
}
```
````

### Response

After a successful request, you should receive a response like this:

{% hint style="warning" %}
**Caution:** the **original\_file** and **signed\_file** links are temporary and **expires in 60 minutes**. In case your system needs to save those links it is recommended that you save them in your own CDN or that you call the [Detail document](/english/documentos/detalhar-documento.md) endpoint every time your user needs a valid URL that will expires in more 60 minutes.
{% endhint %}

```javascript
{
    "open_id": 5,
    "token": "eb9c367a-e62f-4992-8360-b0219deaeecc",
    "status": "pending",
    "name": "John's contract",
    "original_file": "https://zapsign.s3.amazonaws.com/pdf/62xxxxx-d8fc-4392-8575-f3c46c3cfc7a/df6bac91-2766-4182-8c8b-ded5287e4c0f.pdf",
    "signed_file": null,
    "created_at": "2020-04-16T03:33:46.241747Z",
    "last_update_at": "2020-04-16T03:33:46.241775Z",
    "signers": [
        {
            "token": "921c115d-4a6e-445d-bdca-03fadedbbc0b",
            "sign_url": "https://app.zapsign.co/verificar/921c115d-4a6e-445d-bdca-03fadedbbc0b",
            "status": "new",
            "name": "John Doe",
            "email": "",
            "phone_country": "",
            "phone_number": "",
            "times_viewed": 0,
            "last_view_at": null,
            "signed_at": null,
            "resend_attempts": null
        },
        {
            "token": "07fb0a0a-4b7d-49a5-bd7b-4958265c4e46",
            "sign_url": "https://app.zapsign.co/verificar/07fb0a0a-4b7d-49a5-bd7b-4958265c4e46",
            "status": "new",
            "name": "Grumpy Jones",
            "email": "",
            "phone_country": "",
            "phone_number": "",
            "times_viewed": 0,
            "last_view_at": null,
            "signed_at": null,
            "resend_attempts": null
        }
    ]
}
```

What you should do with this response is send the signature link to the signers through your application.

The signature link consists of the route:

**<https://app.zapsign.co/verificar/\\{{signer\\_token\\}}>**

Thus, in the example above, where we have two signers, you must send two signature links, each signer with their respective token:

\- John Doe: <https://app.zapsign.co/verificar/oneclikc/921c115d-4a6e-445d-bdca-03fadedbbc0b>

\- Grumpy Jones: <https://app.zapsign.co/verificar/oneclick/07fb0a0a-4b7d-49a5-bd7b-4958265c4e46>

And now just wait for the signers to sign!

### **Editing an Ongoing OneClick Document**

It is possible to **add, remove, or edit a signer** in an ongoing OneClick document. However, it is important to note that when adding or editing a signer, the following parameters **cannot** be used:

* **auth\_mode**
* **selfie\_validation\_type**
* **require\_document\_photo**
* **require\_selfie**

Since **OneClick** provides a simplified signing experience, it is **not compatible** with advanced authentication methods.

#### **Read the documentation for:**

* [Adding a signer](/english/signatarios/adicionar-signatario.md)
* [Deleting a signer](/english/signatarios/excluir-signatario.md)
* E[diting a signer](/english/signatarios/atualizar-signatario.md)

### About the base64

Base64 its a simply way to convert files to text. You can check a more detailed definition here <https://en.wikipedia.org/wiki/Base64>. Therefore, convert a file to base64 and send it as a text on the request\`s body is easier then dealing with the **multipart/form-data**, for example.

To test the API you can manually convert your PDF into a base64 through a lot of websites, such as this one: <https://base64.guru/converter/encode/pdf>

When the API is alredy integrated to your system, look for the correspondent function in your software language to convert files to base64.

**Watch out:** you must send the base64\_pdf parameter only with the base64 file conversion. **Dont** send the data:application/pdf;base64, on your parameter.

{% hint style="info" %}
Dont want to work with base64? Upload your PDF in a public URL and use the url\_pdf parameter.
{% endhint %}

### Chat with Gepeto!

Have any questions? Use our artificial intelligence trained with all the API documentation. =)

{% embed url="<https://n8n.zapsign.com.br/webhook/fee2c476-7f23-4a4f-8928-5c7ab081ffcd/chat>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.zapsign.com.br/english/documentos/oneclick/criar-documento-oneclick.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
