# Lines

A fuente is one sending line on the workspace. Tools take its Frepi UUID, never the provider's phone id.

## Fuente and línea

`list_phone_numbers` returns `id` (UUID), `label`, `is_default`, `connector_type`, `send_provider`, and `sends_enabled`. `connector_type` is `respond`, `custom`, or `coex`. At most one fuente is the project default. `phone_number_id` on every other marketing tool is this `id`.

`sends_enabled` false means the line is not allowed to send. Credentials are never returned.

## Capabilities per provider

- `connector_type` says how the line's conversations reach Frepi, not how it sends: `respond` = Respond.io contact/inbox sync (the default on older lines), `custom` = a partner-hosted connector that posts messages to Frepi (Frepi never calls out through it), `coex` = a WhatsApp Business app number coexisting with the API; inbound arrives on the Meta webhook and new coex lines start with `sends_enabled=false`.
- `list_phone_numbers` returns both axes: `send_provider` is the send lane (the provider the line sends through), `connector_type` is the inbound connector. A `respond` line may still send Meta-direct.
- Lines that send through Respond.io accept POSITIONAL templates only. When you cannot tell which path a line sends through, create POSITIONAL templates.

`AUDIENCE_FUENTE_MISMATCH` means the audience is bound to a different fuente than the line on the draft.
Fix: recreate the audience with the right `phone_number_id`, or use the fleet recipe (`campaigns#fleet-vs-line-routing`).

## Credentials

Media upload and media-header submit need a live Meta connection:

- `no_link`: «Esta línea no está vinculada a una conexión de Meta con App ID — conéctala desde Conexiones.»
- `link_not_live`: «La conexión de Meta de esta línea no está activa — reconéctala en Conexiones.»
- `link_pending`: «Aún no tenemos el App ID de la app de Meta de esta conexión; se completa solo en la verificación diaria o al reconectar.»

Those three are `fuente_missing_meta_app_id`. The id self-heals on the daily health cron or on reconnect.

Missing upload token (`fuente_missing_meta_access_token`):

«La fuente no tiene configurado el token de acceso de Meta, necesario para subir archivos multimedia.»

Placeholder creds (`fuente_placeholder_credentials`):

«La fuente tiene credenciales de pruebas (FAKE_/PLACEHOLDER_). Reemplázalas con credenciales reales de Meta antes de enviar.»

Who fixes it: a `ws_editor_advance` or `ws_owner` in Workspace Admin → Conexiones.

## Merged contacts

Respond.io 404 with `primaryId` means the contact was merged into that id. Send to the primary contact. The merged id is not a deliverable recipient.
