Editar blocos do conteúdo de uma página
curl --request PATCH \
--url https://api.olie.ai/api/management/forums/{forum_id}/threads/{thread_id}/content \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"base_revision": 0,
"operations": [
{
"type": "insert_blocks",
"position": "end",
"markdown": "## Próximos passos\n\n- Validar o cronograma"
}
]
}
'import requests
url = "https://api.olie.ai/api/management/forums/{forum_id}/threads/{thread_id}/content"
payload = {
"base_revision": 0,
"operations": [
{
"type": "insert_blocks",
"position": "end",
"markdown": "## Próximos passos
- Validar o cronograma"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
base_revision: 0,
operations: [
{
type: 'insert_blocks',
position: 'end',
markdown: '## Próximos passos\n\n- Validar o cronograma'
}
]
})
};
fetch('https://api.olie.ai/api/management/forums/{forum_id}/threads/{thread_id}/content', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.olie.ai/api/management/forums/{forum_id}/threads/{thread_id}/content",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'base_revision' => 0,
'operations' => [
[
'type' => 'insert_blocks',
'position' => 'end',
'markdown' => '## Próximos passos
- Validar o cronograma'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.olie.ai/api/management/forums/{forum_id}/threads/{thread_id}/content"
payload := strings.NewReader("{\n \"base_revision\": 0,\n \"operations\": [\n {\n \"type\": \"insert_blocks\",\n \"position\": \"end\",\n \"markdown\": \"## Próximos passos\\n\\n- Validar o cronograma\"\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.olie.ai/api/management/forums/{forum_id}/threads/{thread_id}/content")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"base_revision\": 0,\n \"operations\": [\n {\n \"type\": \"insert_blocks\",\n \"position\": \"end\",\n \"markdown\": \"## Próximos passos\\n\\n- Validar o cronograma\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.olie.ai/api/management/forums/{forum_id}/threads/{thread_id}/content")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"base_revision\": 0,\n \"operations\": [\n {\n \"type\": \"insert_blocks\",\n \"position\": \"end\",\n \"markdown\": \"## Próximos passos\\n\\n- Validar o cronograma\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"response": true,
"content": {
"thread_id": 1202,
"revision": 4,
"doc": {
"type": "doc",
"content": [
{
"type": "heading",
"attrs": {
"level": 2
},
"content": [
{
"type": "text",
"text": "Briefing"
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Implantação prevista para dezembro."
}
]
}
]
},
"updated_at": "2026-11-09T14:22:05.000000Z",
"updated_by": null
}
}{
"response": false,
"message": "thread_content_block_conflict",
"error": "The page changed since it was read: some referenced blocks no longer exist with the same content. Read the page again and retry.",
"refs": [
"1:9f2c4a7b"
],
"current_revision": 5
}{
"response": false,
"message": "thread_content_invalid_operation",
"error": "Operation #0 is invalid: insert_blocks needs exactly one of after_ref or position.",
"context": {
"operation_index": 0
}
}forums
Editar blocos do conteúdo de uma página
Altera partes da página sem reenviar o documento inteiro: troca de texto, troca, inserção ou remoção de blocos, em Markdown. Os ref de bloco ({índice}:{hash8}) vêm da leitura da página pelo MCP (read-notebook-page-tool); sem eles, use insert_blocks com position ou replace_text sem ref. Se a página mudou depois da base_revision, as operações são reaplicadas sobre a versão atual, e um bloco alterado no meio do caminho gera erro 409. Aceita token de aplicação.
PATCH
/
api
/
management
/
forums
/
{forum_id}
/
threads
/
{thread_id}
/
content
Editar blocos do conteúdo de uma página
curl --request PATCH \
--url https://api.olie.ai/api/management/forums/{forum_id}/threads/{thread_id}/content \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"base_revision": 0,
"operations": [
{
"type": "insert_blocks",
"position": "end",
"markdown": "## Próximos passos\n\n- Validar o cronograma"
}
]
}
'import requests
url = "https://api.olie.ai/api/management/forums/{forum_id}/threads/{thread_id}/content"
payload = {
"base_revision": 0,
"operations": [
{
"type": "insert_blocks",
"position": "end",
"markdown": "## Próximos passos
- Validar o cronograma"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
base_revision: 0,
operations: [
{
type: 'insert_blocks',
position: 'end',
markdown: '## Próximos passos\n\n- Validar o cronograma'
}
]
})
};
fetch('https://api.olie.ai/api/management/forums/{forum_id}/threads/{thread_id}/content', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.olie.ai/api/management/forums/{forum_id}/threads/{thread_id}/content",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'base_revision' => 0,
'operations' => [
[
'type' => 'insert_blocks',
'position' => 'end',
'markdown' => '## Próximos passos
- Validar o cronograma'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.olie.ai/api/management/forums/{forum_id}/threads/{thread_id}/content"
payload := strings.NewReader("{\n \"base_revision\": 0,\n \"operations\": [\n {\n \"type\": \"insert_blocks\",\n \"position\": \"end\",\n \"markdown\": \"## Próximos passos\\n\\n- Validar o cronograma\"\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.olie.ai/api/management/forums/{forum_id}/threads/{thread_id}/content")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"base_revision\": 0,\n \"operations\": [\n {\n \"type\": \"insert_blocks\",\n \"position\": \"end\",\n \"markdown\": \"## Próximos passos\\n\\n- Validar o cronograma\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.olie.ai/api/management/forums/{forum_id}/threads/{thread_id}/content")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"base_revision\": 0,\n \"operations\": [\n {\n \"type\": \"insert_blocks\",\n \"position\": \"end\",\n \"markdown\": \"## Próximos passos\\n\\n- Validar o cronograma\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"response": true,
"content": {
"thread_id": 1202,
"revision": 4,
"doc": {
"type": "doc",
"content": [
{
"type": "heading",
"attrs": {
"level": 2
},
"content": [
{
"type": "text",
"text": "Briefing"
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Implantação prevista para dezembro."
}
]
}
]
},
"updated_at": "2026-11-09T14:22:05.000000Z",
"updated_by": null
}
}{
"response": false,
"message": "thread_content_block_conflict",
"error": "The page changed since it was read: some referenced blocks no longer exist with the same content. Read the page again and retry.",
"refs": [
"1:9f2c4a7b"
],
"current_revision": 5
}{
"response": false,
"message": "thread_content_invalid_operation",
"error": "Operation #0 is invalid: insert_blocks needs exactly one of after_ref or position.",
"context": {
"operation_index": 0
}
}Authorizations
Path Parameters
Body
application/json
Was this page helpful?