# Assinatura + Carimbo em Lote

Essa API é responsável por realizar a assinatura de vários hashes utilizando o BirdID e atribuir-lhes um carimbo do tempo.

É necessário que o requerente possua um certificado BirdID, um **client id** e **client secret** previamente cadastrado e **permitido** no portal **Wings**.

A requisição deve ser realizada com o tipo de autenticação Basic, que envia no header o base64 do "clientid:clientsecret".

<mark style="color:green;">`POST`</mark> `https://gateway-act.hom.vaultid.com.br/api/batch-sign`

#### Headers

| Name                                            | Type   | Description                           |
| ----------------------------------------------- | ------ | ------------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Basic base64("clientid:clientsecret") |
| Content-Type<mark style="color:red;">\*</mark>  | String | application/json                      |

#### Request Body

| Name                                             | Type    | Description                                                                       |
| ------------------------------------------------ | ------- | --------------------------------------------------------------------------------- |
| hashes\[].hash<mark style="color:red;">\*</mark> | String  | Conteúdo a ser assinado                                                           |
| access\_token<mark style="color:red;">\*</mark>  | String  | Token adquirido com autenticação do usuário BirdID                                |
| skip\_timestamp                                  | Boolean | É possível obter o CMS sem o carimbo passando **true** nesse parâmetro            |
| hashes\[].id                                     | String  | Identificador do conteúdo a ser assinado                                          |
| hashes\[].alias                                  | String  | Identificador do conteúdo que será exibido no histórico de assinaturas do usuário |
| hashes<mark style="color:red;">\*</mark>         | Array   | Lista dos hashes a serem assinados                                                |
| certificate\_alias                               | String  | Identificador do certificado correspondente à chave utilizada na assinatura       |

{% tabs %}
{% tab title="401: Unauthorized " %}

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="200: OK Hashes assinados e carimbados" %}

```json
{
    "signatures": [{
            "id": "id informado na req",
            "signature": "CMS binário / DER codificado em base64"
        }
    ],
    "certificate_alias": "FULANO:98765456789"
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

Exemplo:

```shell
curl --location --request POST 'https://gateway-act.hom.vaultid.com.br/api/batch-sign' \
--header 'Authorization: Basic dGVzdGU6dGVzdGU=' \
--header 'Content-Type: application/json' \
--data-raw '{
    "hashes": [{
        "id": "1",
        "alias": "act-test",
        "hash": "196f2abba063cff054042ed77cda5a4e4cb35f0d5ecac23a08a3f7345a001423"        
    }],
    "certificate_alias": "crt-test",
    "access_token": "538c1c9c3a0a345a617760a8607ebe7e2125ce44",
    "skip_timestamp": false
}'
```


---

# 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.vaultid.com.br/workspace/gateway-act/assinatura-+-carimbo-em-lote.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.
