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

# Autenticación

> Cómo autenticar las solicitudes a la API de Iobot

Todas las solicitudes a la API de Iobot requieren autenticación mediante el **App Key** de tu negocio.

## App Key

Incluye tu App Key en cada solicitud como encabezado HTTP:

```http theme={null}
x-api-key: <tu-app-key>
```

### Ejemplo

```bash theme={null}
curl -X POST https://beta.api-iobot-desarrollo.com/chats/obtener/mensaje/plantilla \
  -H "Content-Type: application/json" \
  -H "x-api-key: TU_APP_KEY" \
  -d '{
    "empresa_id": 1,
    "usuario_id": 42
  }'
```

***

## Errores de autenticación

| Estado | Mensaje                                 | Causa                                                               |
| ------ | --------------------------------------- | ------------------------------------------------------------------- |
| `401`  | `Invalid API key`                       | El valor del encabezado `x-api-key` no corresponde a ningún negocio |
| `401`  | `No admin user found for this business` | El negocio existe pero no tiene un usuario administrador            |
