> For the complete documentation index, see [llms.txt](https://docs.signius.eu/api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.signius.eu/api/harmony-api-1/signing.md).

# 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 %}
