# 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`


---

# 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.signius.eu/api/seal-api/client-methods/document-methods.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.
