VitrinaAPI

Canales

La lectura y desconexión de un canal de mensajería — conectar uno sigue siendo un flujo de navegador.

Beta
Puede cambiar en cualquier momento, con una entrada en el changelog y aviso a quienes la llamaron recientemente — ver versionado.

Descarga la proyección completa de la API pública: openapi.json.

Revisar y desconectar canales explica este recurso en prosa, con ejemplos ejecutables.

MétodoRutaQué hace
GET/messaging-accountsList channels
DELETE/messaging-accounts/{id}Disconnect a channel
GET/messaging-accounts/{id}Fetch one channel
GET/messaging-accounts/{id}/healthLive channel identity & health
GET/messaging-accounts/statsPer-account traffic stats

GET /messaging-accounts

List channels

Every messaging account in the workspace, secrets redacted. Connecting a new one is a browser flow (OAuth/Atribu/IMAP) — see the MessagingAccounts reference — but everything already connected is readable here.

curl https://api.vitrinadev.com/api/v1/messaging-accounts \
  -H "Authorization: Bearer $VITRINA_KEY"

Ejemplo de respuesta (200)

{
  "data": [
    {
      "id": "e4e4e4e4-0000-4000-8000-000000000001",
      "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
      "name": "WhatsApp Providencia",
      "kind": "whatsapp_cloud",
      "channels": [
        "whatsapp"
      ],
      "config": {
        "connected_via": "atribu_partner"
      },
      "secrets": {
        "atribu_access_token": "<redacted>"
      },
      "enabled": true,
      "default_team_id": "cccccccc-0000-4000-8000-000000000001",
      "assignment_mode": "auto_round_robin",
      "assignee_user_ids": [],
      "assignee_ai_agent_id": null,
      "help_center_id": null,
      "public_number_id": null,
      "voice_attachable": false,
      "voice_attach_source": null,
      "created_at": "2026-01-10T13:00:00.000Z",
      "updated_at": "2026-09-10T13:00:00.000Z"
    }
  ],
  "meta": {
    "total": 1
  }
}

Responde: 200 · 400 · 401 · 403 · 404 · 409 · 429

DELETE /messaging-accounts/{id}

Disconnect a channel

Tears down the provider-side connection first (best-effort, a no-op for a non-partner kind — so a fan-out subscription never keeps delivering to a connection the workspace already deleted locally), then removes the account row. Every conversation, message and lead the channel already produced is untouched: this ends the CONNECTION, not the history.

ParámetroEnTipoObligatorioRestricciones
idpathuuid
curl -X DELETE https://api.vitrinadev.com/api/v1/messaging-accounts/<id> \
  -H "Authorization: Bearer $VITRINA_KEY"

Responde: 204 · 400 · 401 · 403 · 404 · 409 · 429

GET /messaging-accounts/{id}

Fetch one channel

The account row, secrets redacted.

ParámetroEnTipoObligatorioRestricciones
idpathuuid
curl https://api.vitrinadev.com/api/v1/messaging-accounts/<id> \
  -H "Authorization: Bearer $VITRINA_KEY"

Ejemplo de respuesta (200)

{
  "data": {
    "id": "e4e4e4e4-0000-4000-8000-000000000001",
    "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
    "name": "WhatsApp Providencia",
    "kind": "whatsapp_cloud",
    "channels": [
      "whatsapp"
    ],
    "config": {
      "connected_via": "atribu_partner"
    },
    "secrets": {
      "atribu_access_token": "<redacted>"
    },
    "enabled": true,
    "default_team_id": "cccccccc-0000-4000-8000-000000000001",
    "assignment_mode": "auto_round_robin",
    "assignee_user_ids": [],
    "assignee_ai_agent_id": null,
    "help_center_id": null,
    "public_number_id": null,
    "voice_attachable": false,
    "voice_attach_source": null,
    "created_at": "2026-01-10T13:00:00.000Z",
    "updated_at": "2026-09-10T13:00:00.000Z"
  }
}

Responde: 200 · 400 · 401 · 403 · 404 · 409 · 429

GET /messaging-accounts/{id}/health

Live channel identity & health

Dials the provider (or Atribu, for a partner-connected account) right now — the connected phone/IG account/mailbox identity, webhook delivery state, and WhatsApp account health (quality rating, messaging limit) where applicable. stored rides along: the last health snapshot the periodic checker wrote, for comparing a live read against what was already known. ?refresh=true forces a fresh probe instead of the provider’s own cache. A live check that itself fails (provider down, expired token) still answers 200, with a fallback identity/webhook reporting the failure — this call never breaks a health dashboard by 500ing.

ParámetroEnTipoObligatorioRestricciones
idpathuuid
refreshquerytrue \falseno
curl https://api.vitrinadev.com/api/v1/messaging-accounts/<id>/health \
  -H "Authorization: Bearer $VITRINA_KEY"

Ejemplo de respuesta (200)

{
  "data": {
    "channel": "whatsapp",
    "kind": "whatsapp",
    "connected_via": "atribu_partner",
    "identity": {
      "phone_number": "+56912345000",
      "display_name": "Autos del Valle"
    },
    "webhook": {
      "status": "delivering",
      "last_event_at": "2026-09-15T18:20:00.000Z"
    },
    "whatsapp": {
      "quality_rating": "GREEN",
      "messaging_limit": "TIER_10K"
    },
    "stored": {
      "status": "ok",
      "checked_at": "2026-09-15T18:00:00.000Z",
      "since": "2026-09-01T00:00:00.000Z"
    }
  }
}

Responde: 200 · 400 · 401 · 403 · 404 · 409 · 429

GET /messaging-accounts/stats

Per-account traffic stats

One row per account that has traffic in the last 30 days — an idle account is absent rather than present with zeros, so join against GET /messaging-accounts for a complete list. Registered before /\{id\} on the router so stats is never read as an account id.

curl https://api.vitrinadev.com/api/v1/messaging-accounts/stats \
  -H "Authorization: Bearer $VITRINA_KEY"

Ejemplo de respuesta (200)

{
  "data": [
    {
      "messaging_account_id": "e4e4e4e4-0000-4000-8000-000000000001",
      "conversations_total": 128,
      "messages_30d": 640,
      "inbound_30d": 410,
      "outbound_30d": 230,
      "last_message_at": "2026-09-15T18:20:00.000Z"
    }
  ]
}

Responde: 200 · 400 · 401 · 403 · 404 · 409 · 429

En esta página