Fluxos: listar e consultar
Lista os fluxos de automação da loja com o contador de execuções dos últimos 7 dias e consulta um fluxo.
Um fluxo (ops flow) é uma automação sem código: quando algo acontece (um pedido é criado), a plataforma avalia condições e executa ações (avisar a equipe, mudar o status). Esta página lê os fluxos. A lista traz também os fluxos criados por sellers (lojistas), identificados por vendor_id. Leitura exige view_ops_flows ou manage_ops_flows.
Listar fluxos
/api/v1/admin/ops-flowsAdminListar fluxos
Exemplo de requisição (listar)
bash
curl "$BASE_URL/api/v1/admin/ops-flows" \
-H "Authorization: Bearer $TOKEN"Resposta (listar)
200Fluxos
json
{
"flows": [{
"id": "7f89112b-4bef-46fb-ac55-4e66baf978c4",
"name": "Avisar pedido grande",
"status": "draft",
"trigger_type": "order.created",
"trigger_config": {},
"graph": {
"nodes": [
{ "id": "n_trigger", "type": "trigger", "config": {}, "position": { "x": 240, "y": 40 } },
{ "id": "n_cond", "type": "condition", "config": { "field": "order.total", "op": "gte", "value": 100000 }, "position": { "x": 240, "y": 180 } },
{ "id": "n_action", "type": "action", "config": { "kind": "notify_inbox", "params": { "title": "Pedido grande", "body": "Pedido acima de R$ 1.000" } }, "position": { "x": 120, "y": 320 } },
{ "id": "n_exit", "type": "exit", "config": {}, "position": { "x": 240, "y": 440 } }
],
"edges": [
{ "id": "e1", "from": "n_trigger", "to": "n_cond", "branch": null },
{ "id": "e2", "from": "n_cond", "to": "n_action", "branch": "yes" },
{ "id": "e3", "from": "n_cond", "to": "n_exit", "branch": "no" },
{ "id": "e4", "from": "n_action", "to": "n_exit", "branch": null }
]
},
"runs_7d": 0,
"failed_7d": 0,
"created_at": "2026-10-11T21:19:34.256049Z",
"updated_at": "2026-10-11T21:19:34.256049Z"
}],
"total": 1
}Campos da resposta
flowsarrayFluxos não apagados, do mais novo para o mais antigo.
flows[].iduuidId do fluxo.
flows[].namestringNome.
flows[].statusstringdraftactivepauseddraft rascunho, active ligado, paused pausado.flows[].trigger_typestringGatilho.
flows[].trigger_configobjectConfiguração do gatilho.
flows[].graphobjectO desenho (
nodes e edges).flows[].vendor_iduuidSó em fluxos criados por um seller (lojista). Ausente nos fluxos da loja.
flows[].runs_7dintegerExecuções nos últimos 7 dias. Só vem calculado na listagem; na consulta e nas escritas é
0.flows[].failed_7dintegerExecuções com falha nos últimos 7 dias. Mesma regra.
flows[].created_atstringCriação, RFC 3339.
flows[].updated_atstringÚltima alteração, RFC 3339.
totalintegerQuantidade.
Erros (listar)
| Status | Quando | Corpo |
|---|---|---|
| 401 | Sem token, token inválido ou expirado. | {"error":"missing authorization header"} |
| 403 | O usuário não tem view_ops_flows nem manage_ops_flows. | {"error":"insufficient privileges","privilege_required_any":["view_ops_flows","manage_ops_flows"]} |
| 500 | Falha ao consultar ou gravar. | {"error":"failed","detail":"..."} |
Consultar fluxo
/api/v1/admin/ops-flows/{id}AdminConsultar um fluxo
Parâmetros de caminho
iduuidobrigatórioId do fluxo (UUID).
Exemplo de requisição (consultar)
bash
curl "$BASE_URL/api/v1/admin/ops-flows/7f89112b-4bef-46fb-ac55-4e66baf978c4" \
-H "Authorization: Bearer $TOKEN"Resposta (consultar)
200Fluxo
json
{
"id": "7f89112b-4bef-46fb-ac55-4e66baf978c4",
"name": "Avisar pedido grande",
"status": "draft",
"trigger_type": "order.created",
"trigger_config": {},
"graph": {
"nodes": [
{ "id": "n_trigger", "type": "trigger", "config": {}, "position": { "x": 240, "y": 40 } },
{ "id": "n_cond", "type": "condition", "config": { "field": "order.total", "op": "gte", "value": 100000 }, "position": { "x": 240, "y": 180 } },
{ "id": "n_action", "type": "action", "config": { "kind": "notify_inbox", "params": { "title": "Pedido grande", "body": "Pedido acima de R$ 1.000" } }, "position": { "x": 120, "y": 320 } },
{ "id": "n_exit", "type": "exit", "config": {}, "position": { "x": 240, "y": 440 } }
],
"edges": [
{ "id": "e1", "from": "n_trigger", "to": "n_cond", "branch": null },
{ "id": "e2", "from": "n_cond", "to": "n_action", "branch": "yes" },
{ "id": "e3", "from": "n_cond", "to": "n_exit", "branch": "no" },
{ "id": "e4", "from": "n_action", "to": "n_exit", "branch": null }
]
},
"runs_7d": 0,
"failed_7d": 0,
"created_at": "2026-10-11T21:19:34.256049Z",
"updated_at": "2026-10-11T21:19:34.256049Z"
}Campos da resposta
iduuidId do fluxo.
namestringNome.
statusstringdraftactivepauseddraft rascunho, active ligado, paused pausado.trigger_typestringGatilho.
trigger_configobjectConfiguração do gatilho.
graphobjectO desenho (
nodes e edges).vendor_iduuidSó em fluxos criados por um seller (lojista). Ausente nos fluxos da loja.
runs_7dintegerExecuções nos últimos 7 dias. Só vem calculado na listagem; na consulta e nas escritas é
0.failed_7dintegerExecuções com falha nos últimos 7 dias. Mesma regra.
created_atstringCriação, RFC 3339.
updated_atstringÚltima alteração, RFC 3339.
Erros (consultar)
| Status | Quando | Corpo |
|---|---|---|
| 401 | Sem token, token inválido ou expirado. | {"error":"missing authorization header"} |
| 403 | O usuário não tem view_ops_flows nem manage_ops_flows. | {"error":"insufficient privileges","privilege_required_any":["view_ops_flows","manage_ops_flows"]} |
| 404 | O fluxo não existe, foi apagado ou o id não é um UUID válido. | {"error":"not found"} |