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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
teamId | path | string | yes | |
id | path | string | yes |
Request body
application/json · Required
| Name | Type | Required | Description |
|---|---|---|---|
mode | string | yes | enum: |
access | string | yes | enum: |
target_email | string<email> | no | Obrigatório quando |
expires_at | string<date-time> | no | Obrigatório quando |
max_views | integer | null | no | 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.
| Name | Type | Required | Description |
|---|---|---|---|
id | string<uuid> | yes | |
flowchart_id | string<uuid> | yes | |
created_by | string<uuid> | yes | |
mode | string | yes | enum: |
access | string | yes | enum: |
target_email | string<email> | null | no | |
expires_at | string<date-time> | null | no | |
token | string | yes | |
url | string | yes | |
revoked_at | string<date-time> | null | no | |
created_at | string<date-time> | yes | |
max_views | integer | null | no | |
current_views | integer | yes |
400
Payload inválido.
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
401
JWT ausente/expirado.
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
403
Sem permissao (nao e owner/admin; token sem escopo; token de integracao em rota nao permitida)
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
404
Recurso não encontrado ou fora de escopo.
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
429
Limite de requisições excedido.
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
500
Falha inesperada (log + trace).
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
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())