ZynzapAPI
Fluxos (bots)

Publicar fluxo

Permissão: product:flows.

POST
/rpc/PublishFlow
AuthorizationBearer <token>

Chave de API criada no painel (API e integrações). Prefixos: zz_live_, zz_test_ (e os antigos wl_live_/wl_test_).

In: header

requestPublishFlowRequest
billing?object

Não usado nesta operação.

deadlineMs?integer

Prazo máximo da operação em milissegundos.

Default30000
Range1 <= value <= 30000

Response Body

curl -X POST "https://api.zynzap.com.br/v1/rpc/PublishFlow" \  -H "Authorization: Bearer $ZYNZAP_API_KEY" \  -H "Content-Type: application/json" \  -d '{  "request": {}}'
{
  "flow": {
    "id": "string",
    "name": "string",
    "description": "string",
    "status": "string",
    "session_ids": [
      "string"
    ],
    "priority": 0,
    "published_version": 0,
    "has_unpublished_changes": true,
    "trigger_json": "string",
    "runs_today": "string",
    "errors_today": "string",
    "active_runs": "string",
    "created_by": "string",
    "created_at_unix_ms": "string",
    "updated_at_unix_ms": "string",
    "draft_revision": "string"
  },
  "version": {
    "id": "string",
    "version": 0,
    "notes": "string",
    "published_by": "string",
    "published_at_unix_ms": "string"
  },
  "issues": [
    {
      "node_id": "string",
      "field": "string",
      "code": "string",
      "message": "string",
      "severity": "string"
    }
  ]
}
{
  "error": {
    "code": "VALIDATION_FAILED",
    "message": "Requisição inválida para esta operação.",
    "requestId": "7f3c1a9e-2b4d-4c6e-8f10-a1b2c3d4e5f6",
    "reason": "RPC_REQUEST_INVALID"
  }
}
{
  "error": {
    "code": "UNAUTHENTICATED",
    "message": "Credencial de API ausente, inválida ou revogada.",
    "requestId": "7f3c1a9e-2b4d-4c6e-8f10-a1b2c3d4e5f6",
    "reason": "API_AUTH_REQUIRED"
  }
}
{
  "error": {
    "code": "FORBIDDEN",
    "message": "Este endereço IP não está autorizado a usar esta chave de API.",
    "requestId": "7f3c1a9e-2b4d-4c6e-8f10-a1b2c3d4e5f6",
    "reason": "API_KEY_IP_FORBIDDEN"
  }
}
{
  "error": {
    "code": "NOT_FOUND",
    "message": "Não encontramos o recurso solicitado.",
    "requestId": "7f3c1a9e-2b4d-4c6e-8f10-a1b2c3d4e5f6"
  }
}
{
  "error": {
    "code": "CONFLICT",
    "message": "A cotação expirou. Revise os custos novamente.",
    "requestId": "7f3c1a9e-2b4d-4c6e-8f10-a1b2c3d4e5f6",
    "reason": "BILLING_QUOTE_EXPIRED"
  }
}
{
  "error": {
    "code": "VALIDATION_FAILED",
    "message": "Requisição inválida para esta operação.",
    "requestId": "7f3c1a9e-2b4d-4c6e-8f10-a1b2c3d4e5f6",
    "reason": "RPC_REQUEST_INVALID"
  }
}
{
  "error": {
    "code": "RATE_LIMITED",
    "message": "Limite de requisições desta chave atingido. Aguarde um instante.",
    "requestId": "7f3c1a9e-2b4d-4c6e-8f10-a1b2c3d4e5f6",
    "reason": "API_KEY_RATE_LIMITED"
  }
}
{
  "error": {
    "code": "UNAVAILABLE",
    "message": "Resultado incerto. Confira o estado antes de repetir a operação.",
    "requestId": "7f3c1a9e-2b4d-4c6e-8f10-a1b2c3d4e5f6",
    "reason": "OUTCOME_UNCERTAIN"
  }
}