Axuz Developers

POST /teams/{teamId}/flowcharts/import-db-schema

Introspeciona schema de DB e devolve FlowDocument.

  • Access: Team member
  • Service: https://api-flow.axuz.net

Accepted authentication

  • sessionCookie — Sessão plena Axuz (cookie de sessão da casa). Sessão restrita é 403 enrollment_required.
  • bearerSession — JWT de acesso da sessão em `Authorization: Bearer`.

Suporta MySQL + Postgres. Guardas SSRF em IPs privados. 501 quando o build não tem dialect drivers linkados.

Parameters

NameInTypeRequiredDescription
teamIdpathstringyes

Request body

application/json · Required

NameTypeRequiredDescription
dialectstringyes

enum: "mysql", "postgres"

hoststringyes
portintegerno
dbstringyes
userstringyes
passwordstring<password>no
{
  "dialect": "mysql",
  "host": "string",
  "port": 1,
  "db": "string",
  "user": "string",
  "password": "string"
}

Responses

200

Schema convertido em FlowDocument.

NameTypeRequiredDescription
nodesarray<FlowNode>yes
nodes[].idstringyes
nodes[].typestringyes
nodes[].positionFlowXYyes
nodes[].position.xnumberyes
nodes[].position.ynumberyes
nodes[].widthinteger | nullno
nodes[].heightinteger | nullno
nodes[].parentNodestringno
nodes[].extentstringno
nodes[].dataobjectyes
nodes[].styleobjectno
edgesarray<FlowEdge>yes
edges[].idstringyes
edges[].sourcestringyes
edges[].targetstringyes
edges[].typestringno
edges[].dataobjectno

400

Payload inválido.

NameTypeRequiredDescription
errorstringyes

401

JWT ausente/expirado.

NameTypeRequiredDescription
errorstringyes

403

Host resolve pra IP privado (SSRF guard).

NameTypeRequiredDescription
errorstringyes

429

Limite de requisições excedido.

NameTypeRequiredDescription
errorstringyes

500

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

NameTypeRequiredDescription
errorstringyes

501

Dialect drivers não linkados no build.

NameTypeRequiredDescription
errorstringyes

502

Falha ao conectar / introspectar DB alvo.

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/teams/TEAM_ID/flowcharts/import-db-schema' \
  -H "Authorization: Bearer $AXUZ_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"dialect":"mysql","host":"string","port":1,"db":"string","user":"string","password":"string"}'

Node.js

const res = await fetch("https://api-flow.axuz.net/teams/TEAM_ID/flowcharts/import-db-schema", {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.AXUZ_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "dialect": "mysql",
    "host": "string",
    "port": 1,
    "db": "string",
    "user": "string",
    "password": "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/teams/TEAM_ID/flowcharts/import-db-schema",
    headers={
        "Authorization": f"Bearer {os.environ['AXUZ_TOKEN']}",
    },
    json={
        "dialect": "mysql",
        "host": "string",
        "port": 1,
        "db": "string",
        "user": "string",
        "password": "string",
    },
    timeout=30,
)
res.raise_for_status()
print(res.json())