{
  "actions": [
    {
      "description": "Cria um post ou uma página. Só 'titulo' é obrigatório. 'texto' é Markdown (HTML cru é escapado). Nasce como rascunho (status 'draft'); use status 'published' para publicar já, ou 'publicar_em' (UTC, AAAA-MM-DD HH:mm) com status 'published' para agendar. 'tipo' é 'post' ou 'page'. O endereço (slug) sai do título se você não enviar. Devolve o conteúdo criado, com 'url'.",
      "input": {
        "additionalProperties": false,
        "properties": {
          "conteudo": {
            "additionalProperties": false,
            "properties": {
              "em_menu": {
                "type": "boolean"
              },
              "publicar_em": {
                "type": "string"
              },
              "resumo": {
                "type": "string"
              },
              "slug": {
                "type": "string"
              },
              "status": {
                "type": "string"
              },
              "tags": {
                "type": "array"
              },
              "texto": {
                "type": "string"
              },
              "tipo": {
                "type": "string"
              },
              "titulo": {
                "type": "string"
              }
            },
            "required": [
              "titulo"
            ],
            "title": "Entrada",
            "type": "object"
          }
        },
        "required": [
          "conteudo"
        ],
        "type": "object"
      },
      "method": "POST",
      "name": "criar_conteudo",
      "path": "/api/conteudo",
      "returns": {
        "properties": {
          "ao_vivo": {
            "type": "boolean"
          },
          "atualizado": {
            "type": "string"
          },
          "autor": {
            "type": "string"
          },
          "criado": {
            "type": "string"
          },
          "em_menu": {
            "type": "boolean"
          },
          "id": {
            "type": "integer"
          },
          "publicar_em": {
            "type": "string"
          },
          "resumo": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "tags": {
            "type": "array"
          },
          "texto": {
            "type": "string"
          },
          "tipo": {
            "type": "string"
          },
          "titulo": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "title": "Conteudo",
        "type": "object"
      }
    },
    {
      "description": "Substitui um conteúdo por inteiro: o que você não enviar volta ao padrão (texto vazio, sem tags, rascunho...). Para mudar só alguns campos use alterar_conteudo.",
      "input": {
        "additionalProperties": false,
        "properties": {
          "conteudo": {
            "additionalProperties": false,
            "properties": {
              "em_menu": {
                "type": "boolean"
              },
              "publicar_em": {
                "type": "string"
              },
              "resumo": {
                "type": "string"
              },
              "slug": {
                "type": "string"
              },
              "status": {
                "type": "string"
              },
              "tags": {
                "type": "array"
              },
              "texto": {
                "type": "string"
              },
              "tipo": {
                "type": "string"
              },
              "titulo": {
                "type": "string"
              }
            },
            "required": [
              "titulo"
            ],
            "title": "Entrada",
            "type": "object"
          }
        },
        "required": [
          "conteudo"
        ],
        "type": "object"
      },
      "method": "POST",
      "name": "editar_conteudo",
      "path": "/api/conteudo/{id}/editar",
      "path_params": [
        {
          "in": "path",
          "name": "id",
          "type": "integer"
        }
      ],
      "returns": {
        "properties": {
          "ao_vivo": {
            "type": "boolean"
          },
          "atualizado": {
            "type": "string"
          },
          "autor": {
            "type": "string"
          },
          "criado": {
            "type": "string"
          },
          "em_menu": {
            "type": "boolean"
          },
          "id": {
            "type": "integer"
          },
          "publicar_em": {
            "type": "string"
          },
          "resumo": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "tags": {
            "type": "array"
          },
          "texto": {
            "type": "string"
          },
          "tipo": {
            "type": "string"
          },
          "titulo": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "title": "Conteudo",
        "type": "object"
      }
    },
    {
      "description": "Altera só os campos enviados em 'campos' e preserva o resto. Campos aceitos: titulo, texto, slug, resumo, tipo, status, tags, publicar_em, em_menu. Exemplo: {\"campos\": {\"texto\": \"novo corpo em Markdown\", \"tags\": [\"ia\"]}}. Use para revisar um texto sem reenviar tudo.",
      "input": {
        "additionalProperties": false,
        "properties": {
          "campos": {
            "type": "object"
          }
        },
        "required": [
          "campos"
        ],
        "type": "object"
      },
      "method": "POST",
      "name": "alterar_conteudo",
      "path": "/api/conteudo/{id}/alterar",
      "path_params": [
        {
          "in": "path",
          "name": "id",
          "type": "integer"
        }
      ],
      "returns": {
        "properties": {
          "ao_vivo": {
            "type": "boolean"
          },
          "atualizado": {
            "type": "string"
          },
          "autor": {
            "type": "string"
          },
          "criado": {
            "type": "string"
          },
          "em_menu": {
            "type": "boolean"
          },
          "id": {
            "type": "integer"
          },
          "publicar_em": {
            "type": "string"
          },
          "resumo": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "tags": {
            "type": "array"
          },
          "texto": {
            "type": "string"
          },
          "tipo": {
            "type": "string"
          },
          "titulo": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "title": "Conteudo",
        "type": "object"
      }
    },
    {
      "description": "Publica um conteúdo agora (ou na data de 'publicar_em', se ela estiver no futuro).",
      "input": {
        "additionalProperties": false,
        "properties": {},
        "required": [],
        "type": "object"
      },
      "method": "POST",
      "name": "publicar_conteudo",
      "path": "/api/conteudo/{id}/publicar",
      "path_params": [
        {
          "in": "path",
          "name": "id",
          "type": "integer"
        }
      ],
      "returns": {
        "properties": {
          "ao_vivo": {
            "type": "boolean"
          },
          "atualizado": {
            "type": "string"
          },
          "autor": {
            "type": "string"
          },
          "criado": {
            "type": "string"
          },
          "em_menu": {
            "type": "boolean"
          },
          "id": {
            "type": "integer"
          },
          "publicar_em": {
            "type": "string"
          },
          "resumo": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "tags": {
            "type": "array"
          },
          "texto": {
            "type": "string"
          },
          "tipo": {
            "type": "string"
          },
          "titulo": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "title": "Conteudo",
        "type": "object"
      }
    },
    {
      "description": "Volta o conteúdo para rascunho (sai do ar, mas não é apagado).",
      "input": {
        "additionalProperties": false,
        "properties": {},
        "required": [],
        "type": "object"
      },
      "method": "POST",
      "name": "despublicar_conteudo",
      "path": "/api/conteudo/{id}/despublicar",
      "path_params": [
        {
          "in": "path",
          "name": "id",
          "type": "integer"
        }
      ],
      "returns": {
        "properties": {
          "ao_vivo": {
            "type": "boolean"
          },
          "atualizado": {
            "type": "string"
          },
          "autor": {
            "type": "string"
          },
          "criado": {
            "type": "string"
          },
          "em_menu": {
            "type": "boolean"
          },
          "id": {
            "type": "integer"
          },
          "publicar_em": {
            "type": "string"
          },
          "resumo": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "tags": {
            "type": "array"
          },
          "texto": {
            "type": "string"
          },
          "tipo": {
            "type": "string"
          },
          "titulo": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "title": "Conteudo",
        "type": "object"
      }
    },
    {
      "description": "Apaga o conteúdo de vez. Não dá para desfazer; prefira despublicar_conteudo se tiver dúvida.",
      "input": {
        "additionalProperties": false,
        "properties": {},
        "required": [],
        "type": "object"
      },
      "method": "POST",
      "name": "apagar_conteudo",
      "path": "/api/conteudo/{id}/apagar",
      "path_params": [
        {
          "in": "path",
          "name": "id",
          "type": "integer"
        }
      ]
    },
    {
      "description": "Altera as configurações do site. Só os campos enviados (não vazios) mudam: titulo, slogan, descricao, rodape, url (endereço público, usado em links e feeds).",
      "input": {
        "additionalProperties": false,
        "properties": {
          "ajustes": {
            "additionalProperties": false,
            "properties": {
              "descricao": {
                "type": "string"
              },
              "rodape": {
                "type": "string"
              },
              "slogan": {
                "type": "string"
              },
              "titulo": {
                "type": "string"
              },
              "url": {
                "type": "string"
              }
            },
            "title": "Ajustes",
            "type": "object"
          }
        },
        "required": [
          "ajustes"
        ],
        "type": "object"
      },
      "method": "POST",
      "name": "configurar_site",
      "path": "/api/site",
      "returns": {
        "type": "object"
      }
    }
  ],
  "format": "djo-manifest/1",
  "routes": [
    {
      "description": "Agente: título, endereço e contagens do site",
      "method": "GET",
      "path": "/",
      "query": [
        {
          "description": "campos desejados, separados por vírgula (ex.: id,titulo); aninhados com ponto",
          "name": "campos",
          "type": "string"
        }
      ],
      "returns": {
        "type": "object"
      }
    },
    {
      "description": "Lista conteúdos. Sem token só o publicado; com token também rascunhos. Filtros: tipo (post|page), status, tag, q, pagina, por, texto=1 (traz o corpo)",
      "method": "GET",
      "path": "/blog",
      "query": [
        {
          "description": "campos desejados, separados por vírgula (ex.: id,titulo); aninhados com ponto",
          "name": "campos",
          "type": "string"
        },
        {
          "description": "devolve a lista como CSV (text/csv): cabeçalho uma vez, uma linha por item; poupa tokens",
          "name": "tabela",
          "type": "flag"
        }
      ],
      "returns": {
        "items": {
          "properties": {
            "ao_vivo": {
              "type": "boolean"
            },
            "atualizado": {
              "type": "string"
            },
            "autor": {
              "type": "string"
            },
            "criado": {
              "type": "string"
            },
            "em_menu": {
              "type": "boolean"
            },
            "id": {
              "type": "integer"
            },
            "publicar_em": {
              "type": "string"
            },
            "resumo": {
              "type": "string"
            },
            "slug": {
              "type": "string"
            },
            "status": {
              "type": "string"
            },
            "tags": {
              "type": "array"
            },
            "texto": {
              "type": "string"
            },
            "tipo": {
              "type": "string"
            },
            "titulo": {
              "type": "string"
            },
            "url": {
              "type": "string"
            }
          },
          "title": "Conteudo",
          "type": "object"
        },
        "type": "array"
      }
    },
    {
      "description": "Um post, com o texto em Markdown. Com token, também rascunhos (slug ou id)",
      "method": "GET",
      "path": "/blog/{slug}",
      "path_params": [
        {
          "in": "path",
          "name": "slug",
          "type": "string"
        }
      ],
      "query": [
        {
          "description": "campos desejados, separados por vírgula (ex.: id,titulo); aninhados com ponto",
          "name": "campos",
          "type": "string"
        }
      ],
      "returns": {
        "properties": {
          "ao_vivo": {
            "type": "boolean"
          },
          "atualizado": {
            "type": "string"
          },
          "autor": {
            "type": "string"
          },
          "criado": {
            "type": "string"
          },
          "em_menu": {
            "type": "boolean"
          },
          "id": {
            "type": "integer"
          },
          "publicar_em": {
            "type": "string"
          },
          "resumo": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "tags": {
            "type": "array"
          },
          "texto": {
            "type": "string"
          },
          "tipo": {
            "type": "string"
          },
          "titulo": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "title": "Conteudo",
        "type": "object"
      }
    },
    {
      "description": "Posts de uma tag",
      "method": "GET",
      "path": "/tag/{slug}",
      "path_params": [
        {
          "in": "path",
          "name": "slug",
          "type": "string"
        }
      ],
      "query": [
        {
          "description": "campos desejados, separados por vírgula (ex.: id,titulo); aninhados com ponto",
          "name": "campos",
          "type": "string"
        },
        {
          "description": "devolve a lista como CSV (text/csv): cabeçalho uma vez, uma linha por item; poupa tokens",
          "name": "tabela",
          "type": "flag"
        }
      ],
      "returns": {
        "items": {
          "properties": {
            "ao_vivo": {
              "type": "boolean"
            },
            "atualizado": {
              "type": "string"
            },
            "autor": {
              "type": "string"
            },
            "criado": {
              "type": "string"
            },
            "em_menu": {
              "type": "boolean"
            },
            "id": {
              "type": "integer"
            },
            "publicar_em": {
              "type": "string"
            },
            "resumo": {
              "type": "string"
            },
            "slug": {
              "type": "string"
            },
            "status": {
              "type": "string"
            },
            "tags": {
              "type": "array"
            },
            "texto": {
              "type": "string"
            },
            "tipo": {
              "type": "string"
            },
            "titulo": {
              "type": "string"
            },
            "url": {
              "type": "string"
            }
          },
          "title": "Conteudo",
          "type": "object"
        },
        "type": "array"
      }
    },
    {
      "description": "Busca por ?q= em posts e páginas",
      "method": "GET",
      "path": "/busca",
      "query": [
        {
          "description": "campos desejados, separados por vírgula (ex.: id,titulo); aninhados com ponto",
          "name": "campos",
          "type": "string"
        },
        {
          "description": "devolve a lista como CSV (text/csv): cabeçalho uma vez, uma linha por item; poupa tokens",
          "name": "tabela",
          "type": "flag"
        }
      ],
      "returns": {
        "items": {
          "properties": {
            "ao_vivo": {
              "type": "boolean"
            },
            "atualizado": {
              "type": "string"
            },
            "autor": {
              "type": "string"
            },
            "criado": {
              "type": "string"
            },
            "em_menu": {
              "type": "boolean"
            },
            "id": {
              "type": "integer"
            },
            "publicar_em": {
              "type": "string"
            },
            "resumo": {
              "type": "string"
            },
            "slug": {
              "type": "string"
            },
            "status": {
              "type": "string"
            },
            "tags": {
              "type": "array"
            },
            "texto": {
              "type": "string"
            },
            "tipo": {
              "type": "string"
            },
            "titulo": {
              "type": "string"
            },
            "url": {
              "type": "string"
            }
          },
          "title": "Conteudo",
          "type": "object"
        },
        "type": "array"
      }
    },
    {
      "description": "Uma página, com o texto em Markdown. Com token, também rascunhos (slug ou id)",
      "method": "GET",
      "path": "/{slug}",
      "path_params": [
        {
          "in": "path",
          "name": "slug",
          "type": "string"
        }
      ],
      "query": [
        {
          "description": "campos desejados, separados por vírgula (ex.: id,titulo); aninhados com ponto",
          "name": "campos",
          "type": "string"
        }
      ],
      "returns": {
        "properties": {
          "ao_vivo": {
            "type": "boolean"
          },
          "atualizado": {
            "type": "string"
          },
          "autor": {
            "type": "string"
          },
          "criado": {
            "type": "string"
          },
          "em_menu": {
            "type": "boolean"
          },
          "id": {
            "type": "integer"
          },
          "publicar_em": {
            "type": "string"
          },
          "resumo": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "tags": {
            "type": "array"
          },
          "texto": {
            "type": "string"
          },
          "tipo": {
            "type": "string"
          },
          "titulo": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "title": "Conteudo",
        "type": "object"
      }
    },
    {
      "description": "Lista os arquivos enviados (exige token)",
      "method": "GET",
      "path": "/api/midia",
      "query": [
        {
          "description": "campos desejados, separados por vírgula (ex.: id,titulo); aninhados com ponto",
          "name": "campos",
          "type": "string"
        },
        {
          "description": "devolve a lista como CSV (text/csv): cabeçalho uma vez, uma linha por item; poupa tokens",
          "name": "tabela",
          "type": "flag"
        }
      ],
      "returns": {
        "items": {
          "type": "object"
        },
        "type": "array"
      }
    }
  ]
}