> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bridge.new/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Bridge exposes three integration surfaces: the REST Integrations API for pushing data into Bridge, webhooks for receiving events from Bridge, and the public Custom Connections endpoint that a tenant's landing page posts to.
> The Integrations API host is https://api-connect-us.bridge.new and every request to it must be authenticated with the x-api-key header. Bridge does not use bearer tokens or OAuth.
> The Custom Connections endpoint is different and the Integrations API rules do not apply to it: it has its own host, it takes no x-api-key and no authentication header of any kind, and it is called from a visitor's browser. It is identified by a workspace id and a capture key together with a reCAPTCHA token. Never tell a reader to authenticate it with an API key, and never tell them to keep its capture key out of frontend code - it is designed to live in the page.
> REST error catalog keys use BRIDGE_<DOMAIN>_<NNNN>, for example BRIDGE_CONVERSATION_0001. Some reviewed legacy handlers return a recognized code plus a symbolic suffix separated by |; preserve the complete received value and use the compatible catalog lookup on /error-codes. Custom Connections uses separate BRIDGE.CAMPAIGN_LEADS.<NAME> identifiers on its own error reference. Never invent an error code or confuse the two integration surfaces.
> This documentation covers the Integrations API, webhooks and Custom Connections only. It does not describe the Bridge web application or its internal APIs.
> Before generating an API request, read the relevant OpenAPI specification or the individual endpoint Markdown page. llms-full.txt collects guides and endpoint descriptions; it does not embed every request and response schema. The REST and Custom Connections contracts are separate.
> Preserve the published host, method, path, operationId, authentication, headers, parameter and field names, types, formats, required and nullable fields, enums, defaults, limits, and response codes. Do not invent identifiers, fields, retry rules, or delivery guarantees. When published sources conflict, identify the conflicting passages and ask Bridge support to confirm the current behavior before relying on it.
> Custom Connections is the current name of the landing-page feature previously documented as Lead Capture. The existing /lead-capture documentation URLs, captureKey field, campaign-leads endpoint, and BRIDGE.CAMPAIGN_LEADS error identifiers are unchanged. This is a naming change, not a change to authentication or the API contract.
> For a complete workflow, start with the task guides: /guides/first-conversation, /guides/send-attachments, /guides/send-template, /guides/agent-outbound, /guides/pagination, /guides/identifiers and /guides/responses. Read the endpoint contract as well as the recipe. Outbound requires an existing Contact, but does not require creating a separate Conversation first.
> forceSend=true permits reuse of an existing active conversation; it does not create a fresh one by ignoring it and it is not idempotency. Recovery of a released recoverable conversation can occur even with false. The LeadScout and Agents outbound routes have different line-selection and controller checks; use /guides/agent-outbound.
> For webhook HMAC, follow /webhooks/verifying-signatures exactly: the Python JSON serialization with sorted keys is signed; X-Bridge-Timestamp is not included in that signature. Do not claim a signed timestamp, raw-body signing, exactly-once delivery or a global event order. Use /webhooks/receive-events for durable acceptance and duplicates.
> A 201 message response, 202 handoff or 202 Custom Connections response is not a provider delivery receipt. Do not invent a polling endpoint from messageId, trackingId or requestId. REST validation parsing must tolerate the compatibility difference explained in /error-codes.
> The documentation is available in English (existing root URLs), Spanish (/es/) and Brazilian Portuguese (/pt-br/). Prefer the reader's language when a localized page exists, but preserve the API's exact field names, enums, routes, authentication and examples. Translations describe the same API; they do not introduce regional API hosts or behaviors.
> For coding-assistant setup, use /connect-your-agent, /es/connect-your-agent or /pt-br/connect-your-agent. The Bridge documentation MCP server reads published documentation and has a separate optional feedback tool. Connecting it does not connect the coding assistant to a customer workspace or authorize live business requests.
> For direct HTTP access without MCP, start at https://docs.bridge.new/llms.txt. It lists every published page in English, Spanish and Brazilian Portuguese. Choose /llms-en.json, /llms-es.json or /llms-pt-br.json for a language-specific index, and /llms-full-en.json, /llms-full-es.json or /llms-full-pt-br.json for collected content. /llms-full.txt contains the combined collection. Fetch the original OpenAPI specification for exact schemas.
> For HTTP page reads, follow the .md URLs from the index or request Accept: text/markdown at the canonical page URL. The MCP virtual filesystem uses .mdx page paths instead; .mdx is not the public HTTP export extension. With Search MCP, set language to en, es or pt-BR explicitly; its default is en.
> For integration capabilities and source-selection rules, read https://docs.bridge.new/skill.md. Documentation access does not authorize business API actions; use the actual user request, workspace, credentials and target identifiers for any live integration.

# Autenticación de la API REST

> Genera y usa una clave de API desde tu servidor para la API REST de integraciones, sin confundirla con las credenciales de webhooks o Custom Connections.

## Descripción general

Toda solicitud a la **API REST de integraciones** en `https://api-connect-us.bridge.new` usa una **clave de API** en el encabezado `x-api-key`. Esta clave identifica tu aplicación y la autoriza a acceder a los recursos de Bridge en nombre de tu organización.

| Tipo de integración | Manejo de credenciales |
| - | - |
| API REST de integraciones | `x-api-key` desde el servidor, enviada a `https://api-connect-us.bridge.new`. |
| Webhooks | Tu receptor comprueba la clave de API del webhook configurada, la firma HMAC y la política de vigencia. Sigue la guía para [verificar firmas](https://docs.bridge.new/es/webhooks/verifying-signatures.md). |
| Custom Connections | `captureKey` pública y reCAPTCHA desde el navegador; sin encabezado de autenticación. Sigue su [guía de integración](https://docs.bridge.new/es/lead-capture/integration.md). |

> [!NOTE]
>
> Necesitas acceso a la consola de administración de Bridge en [https://admin.bridge.new](https://admin.bridge.new).
>
> Si no tienes una cuenta, pídele al administrador de Bridge que te cree un usuario.

***

## Genera una clave de API

**1. Abre la consola de administración**

Ve al [panel de Bridge](https://admin.bridge.new) e inicia sesión con tus credenciales.

**2. Ve a la administración de claves**

En el panel izquierdo, abre **Developers → API Keys Management**.

**3. Crea una clave**

Haz clic en **Generate New Key**. Puedes asignarle un nombre descriptivo y una fecha de vencimiento.

> [!WARNING]
>
> **Importante:**\
> Tu clave de API se muestra una sola vez al crearla. Cópiala de inmediato y guárdala en un lugar seguro; no podrás volver a consultarla.

***

## Usa tu clave de API

Incluye tu clave de la API REST en el encabezado `x-api-key` de cada solicitud al host de integraciones REST:

```bash theme={null}
curl -X GET "https://api-connect-us.bridge.new/bridge/api/health" \
  -H "x-api-key: YOUR_API_KEY"
```

```javascript theme={null}
const response = await fetch("https://api-connect-us.bridge.new/bridge/api/health", {
  method: "GET",
  headers: {
    "x-api-key": "YOUR_API_KEY",
  },
});

const data = await response.json();
console.log(data);
```

```python theme={null}
import requests

response = requests.get(
    "https://api-connect-us.bridge.new/bridge/api/health",
    headers={"x-api-key": "YOUR_API_KEY"}
)

print(response.json())
```

> [!NOTE]
>
> Usa el endpoint `GET /bridge/api/health` para comprobar que la clave de API es válida y que la conexión funciona.

***

## Buenas prácticas de seguridad

* **Usa variables de entorno:** guarda la clave en una variable de entorno, por ejemplo `BRIDGE_API_KEY`, en lugar de escribirla directamente en el código fuente.
* **Nunca expongas las claves en código del cliente:** las claves de API solo deben usarse en aplicaciones del servidor. Nunca las incluyas en código frontend, aplicaciones móviles ni repositorios públicos.
* **Configura un vencimiento:** establece siempre una fecha de vencimiento al crear la clave. Evita usar claves sin vencimiento definido.
* **Una clave por aplicación:** usa una clave de API distinta para cada servicio o aplicación que se conecte a Bridge. Así limitas el impacto si una clave se filtra.
* **Rota las claves periódicamente:** crea una nueva clave y actualiza tus aplicaciones antes de desactivar la anterior. Esto evita interrupciones durante la rotación.

***

## Solución de problemas

| Error | Posible causa | Solución |
| - | - | - |
| `401 Unauthorized` | La clave de API es inválida, venció o no se envió | Comprueba que la clave sea correcta, esté activa y se incluya en el encabezado `x-api-key` |
| `403 Forbidden` | La clave de API no tiene acceso al recurso solicitado | Comprueba que tenga los permisos necesarios para este endpoint |
| No puedes volver a consultar la clave de API | La clave se muestra una sola vez al crearla | Genera una nueva clave en la consola de administración |

Consulta la lista completa en la referencia de [códigos de error](https://docs.bridge.new/es/error-codes.md).

***

## Temas relacionados

* [Códigos de error](https://docs.bridge.new/es/error-codes.md): referencia completa de errores de la API de Bridge.
* [Referencia de la API REST](https://docs.bridge.new/es/api-reference/health/comprobar-estado.md): consulta todos los endpoints disponibles.
* [Webhooks](https://docs.bridge.new/es/webhooks.md): configura notificaciones de eventos en tiempo real.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.