Axuz Developers

POST /teams/{teamId}/flowcharts/{id}/shares

Cria share multi-mode (`public`/`email`/`time`).

  • 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`.

— POST /teams/{tid}/flowcharts/{id}/shares. Validates mode/access enums, mode-specific fields (target_email for email, expires_at-in-future for time), then inserts. Handler thin: delegate → parseCreateShareInput → flowExists → randomShareToken → insertFlowchartShareRow.

Parameters

NameInTypeRequiredDescription
teamIdpathstringyes
idpathstringyes

Request body

application/json · Required

NameTypeRequiredDescription
modestringyes

enum: "public", "email", "time"

accessstringyes

enum: "view", "interact"

target_emailstring<email>no

Obrigatório quando mode=email.

expires_atstring<date-time>no

Obrigatório quando mode=time; opcional nos demais.

max_viewsinteger | nullno

Auto-revoga o share ao atingir esse número de views.

{
  "mode": "public",
  "access": "view",
  "target_email": "pessoa@example.test",
  "expires_at": "2026-01-15T12:00:00Z",
  "max_views": 1
}

Responses

201

Share criado.

NameTypeRequiredDescription
idstring<uuid>yes
flowchart_idstring<uuid>yes
created_bystring<uuid>yes
modestringyes

enum: "public", "email", "time"

accessstringyes

enum: "view", "interact"

target_emailstring<email> | nullno
expires_atstring<date-time> | nullno
tokenstringyes
urlstringyes
revoked_atstring<date-time> | nullno
created_atstring<date-time>yes
max_viewsinteger | nullno
current_viewsintegeryes

400

Payload inválido.

NameTypeRequiredDescription
errorstringyes

401

JWT ausente/expirado.

NameTypeRequiredDescription
errorstringyes

403

Sem permissao (nao e owner/admin; token sem escopo; token de integracao em rota nao permitida)

NameTypeRequiredDescription
errorstringyes

404

Recurso não encontrado ou fora de escopo.

NameTypeRequiredDescription
errorstringyes

429

Limite de requisições excedido.

NameTypeRequiredDescription
errorstringyes

500

Falha inesperada (log + trace).

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/ID/shares' \
  -H "Authorization: Bearer $AXUZ_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"mode":"public","access":"view","target_email":"pessoa@example.test","expires_at":"2026-01-15T12:00:00Z","max_views":1}'

Node.js

const res = await fetch("https://api-flow.axuz.net/teams/TEAM_ID/flowcharts/ID/shares", {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.AXUZ_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "mode": "public",
    "access": "view",
    "target_email": "pessoa@example.test",
    "expires_at": "2026-01-15T12:00:00Z",
    "max_views": 1
  }),
});
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/shares",
    headers={
        "Authorization": f"Bearer {os.environ['AXUZ_TOKEN']}",
    },
    json={
        "mode": "public",
        "access": "view",
        "target_email": "pessoa@example.test",
        "expires_at": "2026-01-15T12:00:00Z",
        "max_views": 1,
    },
    timeout=30,
)
res.raise_for_status()
print(res.json())