Skip to content

Cria um novo template HTML

Request

Cria um novo template de documento HTML associado a uma cidade. O nome do template segue o padrão {Cidade}/{NomeArquivo}.html (ex: MogidascruzesSP/Alvara.html).

O campo opcional from identifica o caller no histórico de versões do template (ex.: "ticket-solver:movidesk-259147: template novo"). Sem from, o histórico é registrado como "hub-api".

Security
InternalAuth
Bodyapplication/jsonrequired
namestringrequired

Nome do template no formato {Cidade}/{NomeArquivo}.html.

Example:"MogidascruzesSP/Alvara.html"
htmlstringrequired

Conteúdo HTML do template.

Example:"<!DOCTYPE html><html><head><title>Alvará</title></head><body>...</body></html>"
fromstring

Identificador do caller/origem gravado no histórico de versões do template. Default: hub-api

Example:"ticket-solver:movidesk-259147: template novo"
POST
/hub-api/template/create
curl -i -X POST \
  https://api.producao.aprova.com.br/hub-api/template/create \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: YOUR_API_KEY_HERE' \
  -d '{
    "name": "MogidascruzesSP/Alvara.html",
    "html": "<!DOCTYPE html><html><head><title>Alvará</title></head><body>...</body></html>",
    "from": "ticket-solver:movidesk-259147: template novo"
  }'

Responses

Template criado com sucesso

Bodyapplication/json
namestring

Nome do arquivo de template

Example:"MogidascruzesSP/Alvara.html"
htmlstring

Conteúdo HTML do template

Example:"<!DOCTYPE html><html><head><title>Alvará</title></head><body>...</body></html>"
created_at_isostring or null

Data de criação da versão (ISO 8601)

Example:"2026-01-15T10:30:00.000Z"
fromstring or null

Autor ou origem da versão criada

Example:"admin@cidade.gov.br"
Response
{ "name": "MogidascruzesSP/Alvara.html", "html": "<!DOCTYPE html><html><head><title>Alvará</title></head><body>...</body></html>", "created_at_iso": "2026-01-15T10:30:00.000Z", "from": "admin@cidade.gov.br" }