# Ejemplos con cURL

Define variables sin guardarlas en el historial compartido de tu equipo:

```bash
export NAHUI_CONNECTION_ID='ncc_...'
export NAHUI_API_KEY='nhc_...'
export CONVERSATION_ID='ncv_...'
```

## Respuesta de texto

```bash
curl --request POST \
  "https://api.nahui.studio/v1/connect/relay/${NAHUI_CONNECTION_ID}/reply" \
  --header "Authorization: Bearer ${NAHUI_API_KEY}" \
  --header "Content-Type: application/json" \
  --header "Idempotency-Key: crm:reply:$(date +%s):001" \
  --data "{\"conversationId\":\"${CONVERSATION_ID}\",\"message\":{\"text\":\"Hola desde mi CRM\"}}"
```

## Plantilla

```bash
curl --request POST \
  "https://api.nahui.studio/v1/connect/relay/${NAHUI_CONNECTION_ID}/template" \
  --header "Authorization: Bearer ${NAHUI_API_KEY}" \
  --header "Content-Type: application/json" \
  --header "Idempotency-Key: crm:template:$(date +%s):001" \
  --data "{\"conversationId\":\"${CONVERSATION_ID}\",\"templateName\":\"recordatorio_cita\",\"language\":\"es_MX\"}"
```

No agregues `to`, `phone`, `recipient`, `wa_id` ni listas de números.
