POST /public/shared/{token}/draft
Pulso rápido publish-only (~500 ms) sem write no DB.
- Access: Public (link or signature)
- Service:
https://api-flow.axuz.net
Accepted authentication
No authentication (public route, or protected by link/signature).
Publica snapshot em Redis para SSE consumir; NÃO grava em Neon. Elimina o "delay de 30 s" que o viewer share-interact tinha antes do commit periódico.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
token | path | string | yes | 16 bytes hex (2^128 espaço). |
Request body
application/json · Required
| Name | Type | Required | Description |
|---|---|---|---|
document | FlowDocument | yes | Shape enxuta espelhando |
document.nodes | array<FlowNode> | yes | |
document.nodes[].id | string | yes | |
document.nodes[].type | string | yes | |
document.nodes[].position | FlowXY | yes | |
document.nodes[].position.x | number | yes | |
document.nodes[].position.y | number | yes | |
document.nodes[].width | integer | null | no | |
document.nodes[].height | integer | null | no | |
document.nodes[].parentNode | string | no | |
document.nodes[].extent | string | no | |
document.nodes[].data | object | yes | |
document.nodes[].style | object | no | |
document.edges | array<FlowEdge> | yes | |
document.edges[].id | string | yes | |
document.edges[].source | string | yes | |
document.edges[].target | string | yes | |
document.edges[].type | string | no | |
document.edges[].data | object | no | |
client_id | string | no |
{
"document": {
"nodes": [
{
"id": "string",
"type": "string",
"position": {},
"width": 1,
"height": 1,
"parentNode": "string",
"extent": "string",
"data": {},
"style": {}
}
],
"edges": [
{
"id": "string",
"source": "string",
"target": "string",
"type": "string",
"data": {}
}
]
},
"client_id": "string"
}Responses
204
Publicado (sem body).
400
Payload inválido.
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
403
Share access=view.
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
404
Recurso não encontrado ou fora de escopo.
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
410
Share expirou.
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
413
Body maior que FLOW_DOC_MAX_BYTES.
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
429
Limite de requisições excedido.
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
500
Erro interno. Tente de novo com backoff; reporte o X-Request-Id.
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
503
Redis ou kill-switch.
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
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/draft' \
-H "Content-Type: application/json" \
-d '{"document":{"nodes":[{"id":"string","type":"string","position":{},"width":1,"height":1,"parentNode":"string","extent":"string","data":{},"style":{}}],"edges":[{"id":"string","source":"string","target":"string","type":"string","data":{}}]},"client_id":"string"}'Node.js
const res = await fetch("https://api-flow.axuz.net/public/shared/TOKEN/draft", {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
"document": {
"nodes": [
{
"id": "string",
"type": "string",
"position": {},
"width": 1,
"height": 1,
"parentNode": "string",
"extent": "string",
"data": {},
"style": {}
}
],
"edges": [
{
"id": "string",
"source": "string",
"target": "string",
"type": "string",
"data": {}
}
]
},
"client_id": "string"
}),
});
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/draft",
json={
"document": {
"nodes": [
{
"id": "string",
"type": "string",
"position": {},
"width": 1,
"height": 1,
"parentNode": "string",
"extent": "string",
"data": {},
"style": {},
},
],
"edges": [
{
"id": "string",
"source": "string",
"target": "string",
"type": "string",
"data": {},
},
],
},
"client_id": "string",
},
timeout=30,
)
res.raise_for_status()
print(res.json())