# Decreto e Oficio

# Decreto Oficio | Schema V1 | 2025 - ∞

##### **Tipo Envio: Diário**

---

##### **Objeto Raiz**

<figure class="wp-block-table is-style-stripes" id="bkmrk-campo-informa%C3%A7%C3%B5es-ti"><table class="has-fixed-layout" style="width: 100%;"><thead><tr><td style="width: 16.0859%;">**Campo**</td><td style="width: 83.9141%;">**Informações**</td></tr></thead><tbody><tr><td style="width: 16.0859%;">`timestamp`</td><td style="width: 83.9141%;">Campo utilizado para **ordenar** a validação das informações enviadas. Caso sejam enviados **múltiplos payloads** do mesmo tipo, a ordenação ocorrerá da **<span style="color: rgb(186, 55, 42);">data mais antiga para a mais recente</span>**</td></tr><tr><td style="width: 16.0859%;">`elementos`</td><td style="width: 83.9141%;">–</td></tr></tbody></table>

</figure>---

##### **Item**  


<figure class="wp-block-table is-style-stripes" id="bkmrk-campo-chave-informa%C3%A7"><table class="has-fixed-layout" style="width: 98.3333%; height: 200.813px;"><thead><tr style="height: 29.7969px;"><td style="width: 21.5762%; height: 29.7969px;">**Campo**</td><td class="has-text-align-left align-center" data-align="left" style="width: 8.60488%; height: 29.7969px;">**Chave**</td><td style="width: 69.8208%; height: 29.7969px;">**Informações**</td></tr></thead><tbody><tr style="height: 30.6094px;"><td style="width: 21.5762%; height: 30.6094px;">`numeroDecretoOficio`</td><td class="has-text-align-left align-center" data-align="left" style="width: 8.60488%; height: 30.6094px;">✅</td><td style="width: 69.8208%; height: 30.6094px;">–</td></tr><tr style="height: 32.5938px;"><td style="width: 21.5762%; height: 32.5938px;">`tipoDocumento`</td><td class="has-text-align-left align-center" data-align="left" style="width: 8.60488%; height: 32.5938px;">✅</td><td style="width: 69.8208%; height: 32.5938px;">`Decreto` / `Oficio`</td></tr><tr style="height: 30.6094px;"><td style="width: 21.5762%; height: 30.6094px;">`protolocoLei`</td><td class="has-text-align-left align-center" data-align="left" style="width: 8.60488%; height: 30.6094px;">–</td><td style="width: 69.8208%; height: 30.6094px;">Número do protocolo da Lei no banco de legislação do TCE</td></tr><tr style="height: 30.6094px;"><td style="width: 21.5762%; height: 30.6094px;">`dataDecretoOficio`</td><td class="has-text-align-left align-center" data-align="left" style="width: 8.60488%; height: 30.6094px;">–</td><td style="width: 69.8208%; height: 30.6094px;">–</td></tr><tr style="height: 46.5938px;"><td style="width: 21.5762%; height: 46.5938px;">`action`</td><td class="has-text-align-left align-center" data-align="left" style="width: 8.60488%; height: 46.5938px;">–</td><td style="width: 69.8208%; height: 46.5938px;">Define a operação a ser realizada com a informação, seja ela **criação, atualização ou exclusão**</td></tr></tbody></table>

</figure>---

##### **Schema**

```
"$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Decretos e Ofícios",
  "description": "Schema para envio de decretos e ofícios por unidade gestora",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])T([01]\\d|2[0-3]):([0-5]\\d):([0-5]\\d)\\.\\d{3,6}$",
      "examples": ["2025-09-11T15:30:00.123456"]
    },
    "elementos": {
      "type": "array",
      "uniqueItems": true,
      "items": {
        "type": "object",
        "properties": {
          "codigoUnidadeGestora": {
            "type": "string",
            "minLength": 6,
            "maxLength": 6,
            "pattern": "^[0-9]+$"
          },
          "numeroDecretoOficio": {
            "type": "string",
            "minLength": 9,
            "maxLength": 9,
            "pattern": "^[0-9]+$"
          },
          "numeroLei": {
            "type": "string",
            "minLength": 9,
            "maxLength": 9,
            "pattern": "^[0-9]+$"
          },
          "dataDecretoOficio": {
            "type": "string",
            "format": "date"
          },
          "tipoDocumento": {
            "type": "integer",
            "enum": [
              "DECRETO", 
              "OFICIO"
            ],
          },
          "action": {
            "type": "string",
            "enum": [
              "CREATE", 
              "UPDATE", 
              "DELETE"
            ]
          }
        },
        "required": [
          "codigoUnidadeGestora",
          "numeroDecretoOficio",
          "numeroLei",
          "dataDecretoOficio",
          "tipoDocumento",
          "action"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": ["timestamp", "elementos"],
  "additionalProperties": false
}
```

---

##### **Exemplo de Payload**

```
{
  "timestamp": "2026-03-02T11:32:45.123456",
  "elementos": [
    {
      "codigoUnidadeGestora": "123456",
      "numeroDecretoOficio": "000012026",
      "numeroLei": "000452025",
      "dataDecretoOficio": "2026-01-02",
      "tipoDocumento": "DECRETO",
      "action": "CREATE"
    },
    {
      "codigoUnidadeGestora": "654321",
      "numeroDecretoOficio": "000022026",
      "numeroLei": "000122024",
      "dataDecretoOficio": "2025-02-21",
      "tipoDocumento": "OFICIO",
      "action": "UPDATE"
    }
  ]
}
```