Ir al contenido
VELOFLUX docsAbrir panel

Inicio / Referencia de la API

Referencia de la API

URL base, autenticación exclusiva vía Cuenta Ciatto, API keys, rate limits, formato de error, endpoints de org, dominios, upstreams, métricas, billing y equipo, SDK y webhooks.

URL base#

EntornoURL
Producciónhttps://api.veloflux.io
Desarrollohttp://localhost:8080

Todos los endpoints autenticados siguientes usan el prefijo /api; por ejemplo, GET https://api.veloflux.io/api/org.

Autenticación: solo Cuenta Ciatto#

El inicio de sesión es exclusivamente vía Cuenta Ciatto, en el navegador:

  1. Acceda a https://app.veloflux.io/login y haga clic en Continuar con Ciatto.
  2. El navegador ejecuta Authorization Code + PKCE; el callback registrado es https://app.veloflux.io/api/auth/ciatto/callback y, una vez autorizado, el retorno es /dashboard.
  3. VeloFlux instala cookies seguras HttpOnly para la sesión local.

No existe inicio de sesión por correo/contraseña, ni registro local ni recuperación de contraseña. Las rutas antiguas devuelven HTTP 410 (410 ciatto_only_authentication): POST /api/auth/login, POST /api/auth/register, restablecimientos de contraseña e invitaciones antiguas. La API no crea usuarios, organizaciones ni permisos en el login: la cuenta preexistente de VeloFlux debe estar vinculada al subject de Ciatto Accounts.

Para integraciones automatizadas, use una API key creada y autorizada por la organización, o una credencial de sesión obtenida legítimamente. Nunca envíe su contraseña de Ciatto a VeloFlux.

Bearer token

bash
curl https://api.veloflux.io/api/org \  -H "Authorization: Bearer ${VELOFLUX_ACCESS_TOKEN}"

API keys

Cree y gestione claves en API Keys en el panel:

bash
# Listar clavescurl https://api.veloflux.io/api/org/api-keys \  -H "Authorization: Bearer ${VELOFLUX_ACCESS_TOKEN}"# Crear clavecurl https://api.veloflux.io/api/org/api-keys \  -H "Authorization: Bearer ${VELOFLUX_ACCESS_TOKEN}" \  -H "Content-Type: application/json" \  -d '{"name": "ci-automation", "permissions": ["domains:read"], "expires_in_days": 90}'# Revocar clavecurl -X DELETE https://api.veloflux.io/api/org/api-keys/key_123 \  -H "Authorization: Bearer ${VELOFLUX_ACCESS_TOKEN}"

Rate limits#

Endpoints públicos

EndpointLímite
GET /api/public/status1 solicitud por IP cada 24 horas
GET /api/public/metrics-bootstrap1 solicitud por IP cada 24 horas

Endpoints autenticados (según lo documentado en la API)

PlanLímite
Starter100 solicitudes/minuto
Pro500 solicitudes/minuto
EnterpriseIlimitado

Encabezados de rate limit:

text
X-RateLimit-Limit: 100X-RateLimit-Remaining: 95X-RateLimit-Reset: 1642694400

Formato de error#

Todos los errores siguen este formato:

json
{  "error": "Error message describing what went wrong",  "code": "ERROR_CODE",  "details": {    "field": "Additional context"  }}
CódigoSignificado
200Éxito
201Creado
204Sin contenido
400Solicitud inválida
401No autorizado
403Prohibido
404No encontrado
410Eliminado: use el inicio de sesión vía Cuenta Ciatto
429Demasiadas solicitudes (rate limit)
500Error interno
503Servicio no disponible

Organización#

bash
# Obtener la organizacióncurl https://api.veloflux.io/api/org \  -H "Authorization: Bearer ${VELOFLUX_ACCESS_TOKEN}"# Uso y límites del plancurl https://api.veloflux.io/api/org/usage \  -H "Authorization: Bearer ${VELOFLUX_ACCESS_TOKEN}"

Respuesta de uso:

json
{  "plan": "starter",  "req_used": 1234567,  "req_limit": 20000000,  "domain_limit": 20,  "node_limit": 3,  "bandwidth": 987654321,  "period": "2026-02"}

Cambiar de plan:

bash
curl -X PUT https://api.veloflux.io/api/org/change-plan \  -H "Authorization: Bearer ${VELOFLUX_ACCESS_TOKEN}" \  -H "Content-Type: application/json" \  -d '{"plan": "pro"}'

Dominios#

bash
# Listarcurl https://api.veloflux.io/api/domains \  -H "Authorization: Bearer ${VELOFLUX_ACCESS_TOKEN}"# Crearcurl https://api.veloflux.io/api/domains \  -H "Authorization: Bearer ${VELOFLUX_ACCESS_TOKEN}" \  -H "Content-Type: application/json" \  -d '{"domain": "example.com"}'# Obtener / estado / eliminarcurl https://api.veloflux.io/api/domains/dom_123 \  -H "Authorization: Bearer ${VELOFLUX_ACCESS_TOKEN}"curl https://api.veloflux.io/api/domains/dom_123/status \  -H "Authorization: Bearer ${VELOFLUX_ACCESS_TOKEN}"curl -X DELETE https://api.veloflux.io/api/domains/dom_123 \  -H "Authorization: Bearer ${VELOFLUX_ACCESS_TOKEN}"

Detalles del flujo de verificación en Dominios y DNS.

Upstreams#

bash
# Listarcurl https://api.veloflux.io/api/upstreams \  -H "Authorization: Bearer ${VELOFLUX_ACCESS_TOKEN}"# Crearcurl https://api.veloflux.io/api/upstreams \  -H "Authorization: Bearer ${VELOFLUX_ACCESS_TOKEN}" \  -H "Content-Type: application/json" \  -d '{    "name": "api-backend",    "strategy": "round_robin",    "targets": [{ "url": "https://backend-1.example.com:8080" }]  }'# Actualizar (por ejemplo, cambiar a weighted)curl -X PUT https://api.veloflux.io/api/upstreams/ups_123 \  -H "Authorization: Bearer ${VELOFLUX_ACCESS_TOKEN}" \  -H "Content-Type: application/json" \  -d '{    "name": "api-backend",    "strategy": "weighted",    "targets": [      { "url": "https://backend-1.example.com:8080", "weight": 3 },      { "url": "https://backend-2.example.com:8080", "weight": 2 }    ]  }'# Eliminarcurl -X DELETE https://api.veloflux.io/api/upstreams/ups_123 \  -H "Authorization: Bearer ${VELOFLUX_ACCESS_TOKEN}"

Métricas#

bash
# Métricas de la organización (diarias)curl https://api.veloflux.io/api/metrics/org \  -H "Authorization: Bearer ${VELOFLUX_ACCESS_TOKEN}"# Métricas de un dominiocurl https://api.veloflux.io/api/metrics/domain/dom_123 \  -H "Authorization: Bearer ${VELOFLUX_ACCESS_TOKEN}"# Métricas en tiempo realcurl https://api.veloflux.io/api/metrics/live \  -H "Authorization: Bearer ${VELOFLUX_ACCESS_TOKEN}"

Billing (Stripe)#

bash
# Facturascurl https://api.veloflux.io/api/billing/invoices \  -H "Authorization: Bearer ${VELOFLUX_ACCESS_TOKEN}"# Sesión del portal del cliente Stripecurl -X POST https://api.veloflux.io/api/billing/portal \  -H "Authorization: Bearer ${VELOFLUX_ACCESS_TOKEN}"# Cancelar suscripcióncurl -X POST https://api.veloflux.io/api/billing/cancel \  -H "Authorization: Bearer ${VELOFLUX_ACCESS_TOKEN}"

El webhook de Stripe (/api/billing/webhook) usa idempotencia vía billing_events. Vea Planes.

Equipo#

bash
# Listar miembroscurl https://api.veloflux.io/api/org/members \  -H "Authorization: Bearer ${VELOFLUX_ACCESS_TOKEN}"# Cambiar rol (viewer / admin / owner)curl -X PUT https://api.veloflux.io/api/org/members/usr_123/role \  -H "Authorization: Bearer ${VELOFLUX_ACCESS_TOKEN}" \  -H "Content-Type: application/json" \  -d '{"role": "viewer"}'# Eliminar miembrocurl -X DELETE https://api.veloflux.io/api/org/members/usr_123 \  -H "Authorization: Bearer ${VELOFLUX_ACCESS_TOKEN}"

Las invitaciones de miembros por el flujo antiguo están temporalmente no disponibles: POST /api/org/invite devuelve HTTP 410 hasta que esté disponible el onboarding vía Cuenta Ciatto. Los nuevos miembros deben ser aprovisionados y vinculados por la Cuenta Ciatto.

Nodos / Edge#

bash
# Listar nodoscurl https://api.veloflux.io/api/org/nodes \  -H "Authorization: Bearer ${VELOFLUX_ACCESS_TOKEN}"# Generar token de registro de nodocurl -X POST https://api.veloflux.io/api/org/nodes/token \  -H "Authorization: Bearer ${VELOFLUX_ACCESS_TOKEN}"# Estado de una instalación vía SSHcurl https://api.veloflux.io/api/org/nodes/install/job_123/status \  -H "Authorization: Bearer ${VELOFLUX_ACCESS_TOKEN}"

Vea Edge y BYOS.

Endpoints públicos#

bash
# Estado público por dominio (1x/día por IP)curl "https://api.veloflux.io/api/public/status?domain=example.com"# Handshake de métricas públicas (token efímero, 1x/día por IP)curl https://api.veloflux.io/api/public/metrics-bootstrap# Stream SSE de métricas agregadas (con el token efímero)curl -N https://api.veloflux.io/api/public/metrics-stream \  -H "Authorization: Bearer ${PUBLIC_METRICS_TOKEN}"

Ejemplo de evento SSE:

text
data: {"updated_at":"2025-01-01T00:00:00Z","hosts":3,"requests":1234,"bytes":45678,"errors":2,"p95_ms":12.3,"p99_ms":21.0}

SDK#

SDK TypeScript disponible en packages/sdk (@veloflux/sdk):

javascript
import { VeloFluxClient } from '@veloflux/sdk';const client = new VeloFluxClient({  apiUrl: 'https://api.veloflux.io',  accessToken: 'YOUR_TOKEN'});// Listar dominiosconst domains = await client.domains.list();// Crear upstreamconst upstream = await client.upstreams.create({  name: 'my-backend',  strategy: 'round_robin',  targets: [{ url: 'https://backend.example.com' }]});

Ejemplo en Python (requests) con un token ya autorizado:

python
import osimport requestsresponse = requests.get(    'https://api.veloflux.io/api/org',    headers={'Authorization': f"Bearer {os.environ['VELOFLUX_ACCESS_TOKEN']}"})response.raise_for_status()print(response.json())

Webhooks#

VeloFlux puede enviar webhooks para eventos importantes. Configuración documentada:

bash
curl -X POST https://api.veloflux.io/api/webhooks \  -H "Authorization: Bearer ${VELOFLUX_ACCESS_TOKEN}" \  -H "Content-Type: application/json" \  -d '{    "url": "https://your-app.com/webhooks/veloflux",    "events": ["domain.verified", "upstream.unhealthy"]  }'

Eventos

EventoSignificado
domain.verifiedDominio verificado con éxito
domain.errorFallo en la verificación del dominio
upstream.unhealthyFallo en el health check del upstream
ssl.expiringEl certificado SSL expira en 7 días
usage.limitSe alcanzó el 80% del límite del plan

Formato del payload:

json
{  "event": "domain.verified",  "timestamp": "2025-01-14T12:00:00Z",  "data": {    "id": "dom_123",    "domain": "example.com"  }}

Privacidad / DSAR#

bash
# Exportar datos de la organizacióncurl https://api.veloflux.io/api/privacy/dsar/export \  -H "Authorization: Bearer ${VELOFLUX_ACCESS_TOKEN}"# Registrar consentimientocurl https://api.veloflux.io/api/privacy/dsar/consent \  -H "Authorization: Bearer ${VELOFLUX_ACCESS_TOKEN}"

Soporte#