POST /teams/{teamId}/flowcharts/{id}/share
Grava public_share_token (single-token model).
- 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`.
Serve POST /teams/{teamId}/flowcharts/{id}/share — grava um public_share_token no flowchart (schema legado single-token).
POR QUE FICA: os links /public/flowcharts/{token} já foram enviados a terceiros e a coluna flowcharts.public_share_token ainda tem linhas preenchidas — desmontar a rota quebra share vivo de usuário. CONDIÇÃO DE SAÍDA: quando public_share_token IS NOT NULL for zero em produção (ou os tokens tiverem sido migrados pra tabela shares). Novos shares multi-mode vão em POST /shares (handler_shares.go).
Entradas: URL {teamId}/{id}, JWT, body opcional {expires_at}.
Retorno: 200 {token, url, expires_at}; 404 se flowchart inexistente.
Parâmetros
| Nome | Em | Tipo | Obrigatório | Descrição |
|---|---|---|---|---|
teamId | path | string | sim | |
id | path | string | sim |
Corpo da requisição
application/json
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
expires_at | string<date-time> | null | não |
{
"expires_at": "2026-01-15T12:00:00Z"
}Respostas
200
Token gerado.
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
token | string | sim | |
url | string | sim | |
expires_at | string<date-time> | null | não |
401
JWT ausente/expirado.
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
403
Sem permissao (nao e owner/admin; token sem escopo; token de integracao em rota nao permitida)
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
404
Recurso não encontrado ou fora de escopo.
| 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 |
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/ID/share' \
-H "Authorization: Bearer $AXUZ_TOKEN" \
-H "Content-Type: application/json" \
-d '{"expires_at":"2026-01-15T12:00:00Z"}'Node.js
const res = await fetch("https://api-flow.axuz.net/teams/TEAM_ID/flowcharts/ID/share", {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.AXUZ_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"expires_at": "2026-01-15T12:00:00Z"
}),
});
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/ID/share",
headers={
"Authorization": f"Bearer {os.environ['AXUZ_TOKEN']}",
},
json={
"expires_at": "2026-01-15T12:00:00Z",
},
timeout=30,
)
res.raise_for_status()
print(res.json())