Skip to content

Atualiza um template HTML existente

Request

Atualiza o conteúdo HTML de um template existente, identificado pelo name. Cria uma nova versão do template a partir do HTML enviado.

O campo opcional from identifica o caller no histórico de versões do template (ex.: "ticket-solver:movidesk-259147: ajuste no cabeçalho"). 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

Novo conteúdo HTML do template.

Example:"<!DOCTYPE html><html><head><title>Alvará v2</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: ajuste no cabeçalho"
PUT
/hub-api/template/edit
curl -i -X PUT \
  https://api.producao.aprova.com.br/hub-api/template/edit \
  -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á v2</title></head><body>...</body></html>",
    "from": "ticket-solver:movidesk-259147: ajuste no cabeçalho"
  }'

Responses

Template atualizado com sucesso

Bodyapplication/json
namestring

Nome do arquivo de template

Example:"MogidascruzesSP/Alvara.html"
htmlstring

Conteúdo HTML atualizado

Example:"<!DOCTYPE html><html><head><title>Alvará v2</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 atualizada

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