# Signing

## Sign document

<mark style="color:green;">`POST`</mark> `https://professional.signius.eu:8200/api/signature`

Returns base64 encoded signiature, that you have to add at the end of the document. Hash should be generated using the sha256 algorithm.

#### Headers

| Name                                           | Type   | Description      |
| ---------------------------------------------- | ------ | ---------------- |
| X-AUTH-TOKEN<mark style="color:red;">\*</mark> | String | User acces token |
| User-Language                                  | String | Example: en      |

#### Request Body

| Name                                                  | Type   | Description                              |
| ----------------------------------------------------- | ------ | ---------------------------------------- |
| x509Certificate<mark style="color:red;">\*</mark>     | String | User certificate                         |
| challengeId<mark style="color:red;">\*</mark>         | String | challengeId from Authorization request   |
| documentHash<mark style="color:red;">\*</mark>        | String | Base64 encoded hash of document to sign. |
| secureHashAlgorithm<mark style="color:red;">\*</mark> | String | Used algorithm                           |

{% tabs %}
{% tab title="400: Bad Request Something went wrong" %}
{% code title="Example response:" %}

```json
{
    "message": "<message>"
}
```

{% endcode %}
{% endtab %}

{% tab title="200: OK Document signed." %}
{% code title="Example response:" %}

```json
{
    "signature": "<base64_signature>"
}
```

{% endcode %}
{% endtab %}
{% endtabs %}


---

# 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/harmony-api-1/signing.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.
