POST /public/shared/{token}/ops
Aplica batch de ops tipadas com LWW (Fase C).
- Acesso: Pública (link ou assinatura)
- Serviço:
https://api-flow.axuz.net
Autenticação aceita
Sem autenticação (rota pública ou protegida por link/assinatura).
Cada batch aceito bumpa flowcharts.version uma vez e insere N rows em flowchart_op_log. Ver ADR-0006 (LWW) + internal/ops.
Parâmetros
| Nome | Em | Tipo | Obrigatório | Descrição |
|---|---|---|---|---|
token | path | string | sim | 16 bytes hex (2^128 espaço). |
Corpo da requisição
application/json · Obrigatório
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
ops | array<FlowOp> | sim | |
ops[].client_id | string | sim | |
ops[].type | string | sim | enum: |
ops[].entity_id | string | sim | |
ops[].ts | integer | sim | Client-side ms epoch. Clampado em [server_now-60s, server_now+60s]. |
ops[].patch | object | não | |
ops[].payload | object | não |
{
"ops": [
{
"client_id": "string",
"type": "node.add",
"entity_id": "string",
"ts": 1,
"patch": {},
"payload": {}
}
]
}Respostas
200
Batch processado (accepted + rejected reportados).
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
version | integer | sim | |
accepted | array<string> | sim | |
rejected | array<FlowOpRejection> | sim | |
rejected[].client_id | string | sim | |
rejected[].reason | string | sim |
400
Payload inválido.
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
403
Share access=view.
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
404
Recurso não encontrado ou fora de escopo.
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
410
Share expirou.
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
413
Batch maior que opsBatchMax (100) ou body > FLOW_DOC_MAX_BYTES.
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
429
Rate limit estourado (per-token ou per-team).
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
500
Erro interno. Tente de novo com backoff; reporte o X-Request-Id.
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
503
Kill-switch FLOW_COLLAB_ENABLED=false.
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
Exemplos
O "Try it" está desligado nesta referência. Use os exemplos com a sua credencial de teste.
curl
curl -sS -X POST 'https://api-flow.axuz.net/public/shared/TOKEN/ops' \
-H "Content-Type: application/json" \
-d '{"ops":[{"client_id":"string","type":"node.add","entity_id":"string","ts":1,"patch":{},"payload":{}}]}'Node.js
const res = await fetch("https://api-flow.axuz.net/public/shared/TOKEN/ops", {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
"ops": [
{
"client_id": "string",
"type": "node.add",
"entity_id": "string",
"ts": 1,
"patch": {},
"payload": {}
}
]
}),
});
if (!res.ok) throw new Error(`HTTP ${res.status}: ${await res.text()}`);
console.log(await res.json());Python
import os
import requests
res = requests.request(
"POST",
"https://api-flow.axuz.net/public/shared/TOKEN/ops",
json={
"ops": [
{
"client_id": "string",
"type": "node.add",
"entity_id": "string",
"ts": 1,
"patch": {},
"payload": {},
},
],
},
timeout=30,
)
res.raise_for_status()
print(res.json())