POST /teams/{teamId}/flowcharts/import-db-schema
Introspeciona schema de DB e devolve FlowDocument.
- Acesso: Membro da equipe
- Serviço:
https://api-flow.axuz.net
Autenticação aceita
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.
Parâmetros
| Nome | Em | Tipo | Obrigatório | Descrição |
|---|---|---|---|---|
teamId | path | string | sim |
Corpo da requisição
application/json · Obrigatório
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
dialect | string | sim | enum: |
host | string | sim | |
port | integer | não | |
db | string | sim | |
user | string | sim | |
password | string<password> | não |
{
"dialect": "mysql",
"host": "string",
"port": 1,
"db": "string",
"user": "string",
"password": "string"
}Respostas
200
Schema convertido em FlowDocument.
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
nodes | array<FlowNode> | sim | |
nodes[].id | string | sim | |
nodes[].type | string | sim | |
nodes[].position | FlowXY | sim | |
nodes[].position.x | number | sim | |
nodes[].position.y | number | sim | |
nodes[].width | integer | null | não | |
nodes[].height | integer | null | não | |
nodes[].parentNode | string | não | |
nodes[].extent | string | não | |
nodes[].data | object | sim | |
nodes[].style | object | não | |
edges | array<FlowEdge> | sim | |
edges[].id | string | sim | |
edges[].source | string | sim | |
edges[].target | string | sim | |
edges[].type | string | não | |
edges[].data | object | não |
400
Payload inválido.
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
401
JWT ausente/expirado.
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
403
Host resolve pra IP privado (SSRF guard).
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
429
Limite de requisições excedido.
| 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 |
501
Dialect drivers não linkados no build.
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
502
Falha ao conectar / introspectar DB alvo.
| 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/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())