# Document Methods

## Sign document

<mark style="color:green;">`POST`</mark> `/api/sign?processId={{processId}}&filename={{name-of-pdf}}&encrypt={{url-encoded-password}}`

### Headers

| Name          | Value             | Description                                |
| ------------- | ----------------- | ------------------------------------------ |
| Content-Type  | `application/pdf` |                                            |
| Authorization | `basicAuth`       | optional (depends on client configuration) |

### Query parameters

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| processId | Integer | required    |
| filename  | string  | optional    |
| encrypt   | string  | optional    |

### Request Body

| Name       | Type                   | Description                        |
| ---------- | ---------------------- | ---------------------------------- |
| `pdf-file` | \<binary-octet-stream> | pfd file for sealing and encryting |

### Response

{% tabs %}
{% tab title="200: OK" %}
\<binary-octet-stream>
{% endtab %}

{% tab title="404: Not Found Process not found" %}

{% endtab %}
{% endtabs %}

### Examples

Example url:

<mark style="color:green;">`POST`</mark> `http://localhost:8089/api/sign?processId=17`

Example url with password encryption ("my!password" url encoded):

<mark style="color:green;">`POST`</mark> `http://localhost:8089/api/sign?processId=17&encrypt=my%21password`

Example url with filename and password encryption:

<mark style="color:green;">`POST`</mark> `http://localhost:8089/api/sign?processId=17&filename=test.pdf&encrypt=my%21password`
