Skip to content
Ravisign

Documents and templates

This page brings together the actions that work with files: listing and viewing the details of the account's templates (to create envelopes from them) and downloading the original or the signed final copy of an envelope. Since templates are created and versioned in the panel, see Templates.

In the examples, the key is in the RAVISIGN_CHAVE environment variable and the responses were shortened where indicated:

BASH
export RAVISIGN_CHAVE="rsg_..."
API="https://ravisign.com.br/api/v1"

modelos/listar#

GET, scope modelos.ler. The account's document templates (without the content). tipo is html (text with variables {{chave}}, filled in when the envelope is created) or pdf (fixed PDF, without variables). Optional parameters: busca (in the name or description), ativo (true default, false or todos), pagina, limite.

BASH
curl -sS -G "$API/modelos/listar" -H "Authorization: Bearer $RAVISIGN_CHAVE" -d limite=20
JSON
{
    "ok": true,
    "modelos": [
        {
            "id": 1,
            "nome": "Contrato de adesão",
            "descricao": "",
            "tipo": "html",
            "variaveis": [
                { "chave": "cliente", "rotulo": "Nome do cliente", "obrigatoria": true },
                { "chave": "plano", "rotulo": "Plano", "obrigatoria": false }
            ],
            "versao": 1,
            "ativo": true,
            "criado_em": "2026-10-09T20:28:25-03:00",
            "atualizado_em": "2026-10-09T20:28:25-03:00"
        }
    ],
    "paginacao": { "pagina": 1, "limite": 20, "total": 1, "paginas": 1 }
}

modelos/detalhe#

GET, scope modelos.ler. Parameter id. Same format as the list item, plus the html content (for templates of type html).

BASH
curl -sS -G "$API/modelos/detalhe" -H "Authorization: Bearer $RAVISIGN_CHAVE" -d id=1
JSON
{
    "ok": true,
    "modelo": {
        "id": 1,
        "nome": "Contrato de adesão",
        "tipo": "html",
        "variaveis": [ { "chave": "cliente", "rotulo": "Nome do cliente", "obrigatoria": true } ],
        "versao": 1,
        "ativo": true,
        "html": "<p>Cliente: {{cliente}} | Plano: {{plano}}</p>"
    }
}

(shortened response)

documentos/baixar#

GET, scope documentos.ler. Parameters envelope_uuid and tipo: final (default: the signed copy, with the signature manifest embedded) or original (the PDF as it was sent). The success response is the PDF itself (Content-Type: application/pdf, Content-Disposition: attachment with the file name); errors remain in JSON.

BASH
curl -sS -G "$API/documentos/baixar" -H "Authorization: Bearer $RAVISIGN_CHAVE" \
  -d envelope_uuid=157b650a-75e0-4eaa-a32c-b92b5a432ee4 -d tipo=final \
  -o "contrato-assinado.pdf" -w "%{http_code}\n"
Text
200

File name: the document name (documento.nome, which comes from the title or, for uploads, from the name of the uploaded file), with - assinado before the .pdf in the final copy ("signed" and "firmado" in accounts in English and Spanish). Errors: 409 arquivo_indisponivel (final copy before completion), 409 documento_pendente (template original still being prepared), 400 parametro_invalido in the tipo field. The signature manifest is inside the final copy, which is why documento.disponivel.manifesto is false and tipo=manifesto responds 409 arquivo_indisponivel. To check integrity, compare the SHA-256 of the downloaded file with hash_final or hash_original from detalhe.

Create an envelope from a template#

Use modelo_id and variaveis in envelopes/criar. The keys of variaveis are the same ones returned in modelos/detalhe. The complete example is in Envelopes in the API.

Note template management through the API (create and edit) is reserved for a future version, with the modelos.escrever scope. Today templates are created in the panel.

Did not find what you were looking for?

Contact Ravi Systems support at the e-mail below.

contato@ravisystems.com.br