Axuz Developers

POST /public/shared/{token}/ops

Aplica batch de ops tipadas com LWW (Fase C).

  • Access: Public (link or signature)
  • Service: https://api-flow.axuz.net

Accepted authentication

No authentication (public route, or protected by link/signature).

Cada batch aceito bumpa flowcharts.version uma vez e insere N rows em flowchart_op_log. Ver ADR-0006 (LWW) + internal/ops.

Parameters

NameInTypeRequiredDescription
tokenpathstringyes

16 bytes hex (2^128 espaço).

Request body

application/json · Required

NameTypeRequiredDescription
opsarray<FlowOp>yes
ops[].client_idstringyes
ops[].typestringyes

enum: "node.add", "node.update", "node.delete", "edge.add", "edge.update", "edge.delete", "doc.replace"

ops[].entity_idstringyes
ops[].tsintegeryes

Client-side ms epoch. Clampado em [server_now-60s, server_now+60s].

ops[].patchobjectno
ops[].payloadobjectno
{
  "ops": [
    {
      "client_id": "string",
      "type": "node.add",
      "entity_id": "string",
      "ts": 1,
      "patch": {},
      "payload": {}
    }
  ]
}

Responses

200

Batch processado (accepted + rejected reportados).

NameTypeRequiredDescription
versionintegeryes
acceptedarray<string>yes
rejectedarray<FlowOpRejection>yes
rejected[].client_idstringyes
rejected[].reasonstringyes

400

Payload inválido.

NameTypeRequiredDescription
errorstringyes

403

Share access=view.

NameTypeRequiredDescription
errorstringyes

404

Recurso não encontrado ou fora de escopo.

NameTypeRequiredDescription
errorstringyes

410

Share expirou.

NameTypeRequiredDescription
errorstringyes

413

Batch maior que opsBatchMax (100) ou body > FLOW_DOC_MAX_BYTES.

NameTypeRequiredDescription
errorstringyes

429

Rate limit estourado (per-token ou per-team).

NameTypeRequiredDescription
errorstringyes

500

Erro interno. Tente de novo com backoff; reporte o X-Request-Id.

NameTypeRequiredDescription
errorstringyes

503

Kill-switch FLOW_COLLAB_ENABLED=false.

NameTypeRequiredDescription
errorstringyes

Examples

"Try it" is turned off in this reference. Use the examples with your test credential.

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())