Referencia
Webhooks y eventos
Endpoints que reciben eventos firmados y el registro de eventos.
- GET
/v1/events· Listar eventos - GET
/v1/events/{id}· Obtener un evento - GET
/v1/webhook_endpoints· Listar endpoints de webhook - POST
/v1/webhook_endpoints· Crear un endpoint de webhook - GET
/v1/webhook_endpoints/{id}· Obtener un endpoint de webhook - PATCH
/v1/webhook_endpoints/{id}· Editar un endpoint de webhook - DELETE
/v1/webhook_endpoints/{id}· Eliminar un endpoint de webhook - POST
/v1/webhook_endpoints/{id}/test· Enviar un evento de prueba
Listar eventos
GET/v1/events
Eventos de los últimos 30 días, del más nuevo al más antiguo. Sirve para recuperar lo que tu sistema no alcanzó a procesar. Solo aparecen los tipos que la clave puede leer (reservas con appointments:read, clientes con clients:read).
Parámetros
| Nombre | En | Tipo | Descripción |
|---|---|---|---|
limit | query | integer | Elementos por página (1 a 100). Por defecto: 25 · Entre 1 y 100 |
cursor | query | string | Valor next_cursor de la página anterior. |
type | query | EventType | Valores: appointment.created, appointment.updated, appointment.rescheduled, appointment.confirmed, appointment.cancelled, appointment.deleted, client.created, client.updated |
created_since | query | string |
Ejemplo
curl "https://api.mihoraya.com/v1/events?type=appointment.created" \
-H "Authorization: Bearer $MIHORAYA_API_KEY"JavaScript (Node.js 18+)
const res = await fetch("https://api.mihoraya.com/v1/events?type=appointment.created", {
headers: {
Authorization: `Bearer ${process.env.MIHORAYA_API_KEY}`,
},
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.message} (${data.error.request_id})`);
console.log(data);Python (requests)
import os
import requests
res = requests.get(
"https://api.mihoraya.com/v1/events?type=appointment.created",
headers={"Authorization": f"Bearer {os.environ['MIHORAYA_API_KEY']}"},
timeout=30,
)
data = res.json()
if not res.ok:
raise RuntimeError(f"{data['error']['code']}: {data['error']['message']}")
print(data)PHP (cURL)
<?php
$ch = curl_init('https://api.mihoraya.com/v1/events?type=appointment.created');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('MIHORAYA_API_KEY'),
],
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($status >= 400) {
throw new RuntimeException($data['error']['code'] . ': ' . $data['error']['message']);
}
print_r($data);Respuestas
- 200 OK · Página de eventos.
- 400 Petición inválida · Parámetros inválidos (
parameter_invalid,parameter_missing,parameter_unknown,invalid_body,idempotency_key_required). - 401 No autenticado · API key ausente, inválida (
invalid_api_key), revocada (api_key_revoked) o vencida (api_key_expired). - 402 Plan · El plan del negocio no incluye la API (
feature_locked) o se alcanzó un límite del plan (limit_reached). - 403 Sin permiso · La API key no tiene el permiso necesario (
insufficient_scope). - 429 Demasiadas llamadas · Se superó el límite por minuto (
rate_limited) o la cuota mensual del plan (quota_exceeded).
Obtener un evento
GET/v1/events/{id}
Parámetros
| Nombre | En | Tipo | Descripción |
|---|---|---|---|
id obligatorio | ruta | integer |
Ejemplo
curl https://api.mihoraya.com/v1/events/1200 \
-H "Authorization: Bearer $MIHORAYA_API_KEY"JavaScript (Node.js 18+)
const res = await fetch("https://api.mihoraya.com/v1/events/1200", {
headers: {
Authorization: `Bearer ${process.env.MIHORAYA_API_KEY}`,
},
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.message} (${data.error.request_id})`);
console.log(data);Python (requests)
import os
import requests
res = requests.get(
"https://api.mihoraya.com/v1/events/1200",
headers={"Authorization": f"Bearer {os.environ['MIHORAYA_API_KEY']}"},
timeout=30,
)
data = res.json()
if not res.ok:
raise RuntimeError(f"{data['error']['code']}: {data['error']['message']}")
print(data)PHP (cURL)
<?php
$ch = curl_init('https://api.mihoraya.com/v1/events/1200');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('MIHORAYA_API_KEY'),
],
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($status >= 400) {
throw new RuntimeException($data['error']['code'] . ': ' . $data['error']['message']);
}
print_r($data);Respuesta de ejemplo (200)
{
"id": 1200,
"object": "event",
"type": "appointment.rescheduled",
"api_version": "2026-11-24",
"created_at": "2026-11-24T15:30:00-03:00",
"livemode": true,
"data": {
"object": {
"id": 987,
"object": "appointment",
"status": "scheduled",
"starts_at": "2026-12-02T16:00:00-03:00",
"ends_at": "2026-12-02T17:00:00-03:00",
"duration_minutes": 60,
"time_zone": "America/Santiago",
"service_id": 15,
"professional_id": 21,
"location_id": 7,
"client_id": 3301,
"price": {
"amount": 15000,
"currency": "CLP"
},
"notes": "Reservado desde el sitio web",
"source": "api",
"confirmed_at": null,
"attended_at": null,
"no_show_at": null,
"cancellation": null,
"created_at": "2026-11-24T12:00:00-03:00",
"updated_at": "2026-11-24T15:30:00-03:00",
"livemode": true
},
"previous_attributes": {
"starts_at": "2026-12-01T10:00:00-03:00"
}
}
}Respuestas
- 200 OK · El evento.
- 401 No autenticado · API key ausente, inválida (
invalid_api_key), revocada (api_key_revoked) o vencida (api_key_expired). - 402 Plan · El plan del negocio no incluye la API (
feature_locked) o se alcanzó un límite del plan (limit_reached). - 403 Sin permiso · La API key no tiene el permiso necesario (
insufficient_scope). - 404 No encontrado · El recurso no existe o es de otro negocio (
resource_not_found). - 429 Demasiadas llamadas · Se superó el límite por minuto (
rate_limited) o la cuota mensual del plan (quota_exceeded).
Listar endpoints de webhook
GET/v1/webhook_endpoints
Ejemplo
curl https://api.mihoraya.com/v1/webhook_endpoints \
-H "Authorization: Bearer $MIHORAYA_API_KEY"JavaScript (Node.js 18+)
const res = await fetch("https://api.mihoraya.com/v1/webhook_endpoints", {
headers: {
Authorization: `Bearer ${process.env.MIHORAYA_API_KEY}`,
},
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.message} (${data.error.request_id})`);
console.log(data);Python (requests)
import os
import requests
res = requests.get(
"https://api.mihoraya.com/v1/webhook_endpoints",
headers={"Authorization": f"Bearer {os.environ['MIHORAYA_API_KEY']}"},
timeout=30,
)
data = res.json()
if not res.ok:
raise RuntimeError(f"{data['error']['code']}: {data['error']['message']}")
print(data)PHP (cURL)
<?php
$ch = curl_init('https://api.mihoraya.com/v1/webhook_endpoints');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('MIHORAYA_API_KEY'),
],
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($status >= 400) {
throw new RuntimeException($data['error']['code'] . ': ' . $data['error']['message']);
}
print_r($data);Respuestas
- 200 OK · Todos los endpoints del negocio (máximo 10).
- 401 No autenticado · API key ausente, inválida (
invalid_api_key), revocada (api_key_revoked) o vencida (api_key_expired). - 402 Plan · El plan del negocio no incluye la API (
feature_locked) o se alcanzó un límite del plan (limit_reached). - 403 Sin permiso · La API key no tiene el permiso necesario (
insufficient_scope). - 429 Demasiadas llamadas · Se superó el límite por minuto (
rate_limited) o la cuota mensual del plan (quota_exceeded).
Crear un endpoint de webhook
POST/v1/webhook_endpoints
Registra una URL https:// pública que recibirá los eventos elegidos (["*"] = todos). La respuesta incluye secret (whsec_…) para verificar la firma: guárdalo, no se vuelve a mostrar por la API. Para suscribirte a eventos de reservas la clave necesita appointments:read; a los de clientes, clients:read. No se aceptan direcciones privadas, locales ni reservadas.
Cuerpo (JSON)
| Campo | Tipo | Descripción |
|---|---|---|
url obligatorio | string (uri) | https:// pública |
events obligatorio | array de string | |
description | string | Máx. 200 caracteres |
Ejemplo
curl -X POST https://api.mihoraya.com/v1/webhook_endpoints \
-H "Authorization: Bearer $MIHORAYA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://crm.example.com/webhooks/mihoraya",
"events": [
"appointment.created",
"appointment.cancelled",
"appointment.rescheduled"
],
"description": "CRM"
}'JavaScript (Node.js 18+)
const res = await fetch("https://api.mihoraya.com/v1/webhook_endpoints", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.MIHORAYA_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"url": "https://crm.example.com/webhooks/mihoraya",
"events": [
"appointment.created",
"appointment.cancelled",
"appointment.rescheduled"
],
"description": "CRM"
}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.message} (${data.error.request_id})`);
console.log(data);Python (requests)
import os
import requests
res = requests.post(
"https://api.mihoraya.com/v1/webhook_endpoints",
headers={"Authorization": f"Bearer {os.environ['MIHORAYA_API_KEY']}"},
json={
"url": "https://crm.example.com/webhooks/mihoraya",
"events": ["appointment.created", "appointment.cancelled", "appointment.rescheduled"],
"description": "CRM",
},
timeout=30,
)
data = res.json()
if not res.ok:
raise RuntimeError(f"{data['error']['code']}: {data['error']['message']}")
print(data)PHP (cURL)
<?php
$ch = curl_init('https://api.mihoraya.com/v1/webhook_endpoints');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('MIHORAYA_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'url' => 'https://crm.example.com/webhooks/mihoraya',
'events' => ['appointment.created', 'appointment.cancelled', 'appointment.rescheduled'],
'description' => 'CRM',
]),
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($status >= 400) {
throw new RuntimeException($data['error']['code'] . ': ' . $data['error']['message']);
}
print_r($data);Respuesta de ejemplo (201)
{
"id": 5,
"object": "webhook_endpoint",
"url": "https://crm.example.com/webhooks/mihoraya",
"description": "CRM",
"events": [
"appointment.created",
"appointment.cancelled",
"appointment.rescheduled"
],
"status": "enabled",
"disabled_reason": "",
"consecutive_failures": 0,
"last_success_at": null,
"last_failure_at": null,
"created_at": "2026-11-24T12:00:00-03:00",
"updated_at": "2026-11-24T12:00:00-03:00",
"secret": "whsec_3kT9pQ2xV7mN1bL8cR4sY6dF0gH5jK2a",
"livemode": true
}Respuestas
- 201 Creado · Endpoint creado (con su secreto).
- 400 Petición inválida · Parámetros inválidos (
parameter_invalid,parameter_missing,parameter_unknown,invalid_body,idempotency_key_required). - 401 No autenticado · API key ausente, inválida (
invalid_api_key), revocada (api_key_revoked) o vencida (api_key_expired). - 402 Plan · El plan del negocio no incluye la API (
feature_locked) o se alcanzó un límite del plan (limit_reached). - 403 Sin permiso · La API key no tiene el permiso necesario (
insufficient_scope). - 409 Conflicto · Conflicto con el estado actual (
slot_unavailable,appointment_cancelled,client_exists,idempotency_in_progress,conflict). - 429 Demasiadas llamadas · Se superó el límite por minuto (
rate_limited) o la cuota mensual del plan (quota_exceeded).
Obtener un endpoint de webhook
GET/v1/webhook_endpoints/{id}
Parámetros
| Nombre | En | Tipo | Descripción |
|---|---|---|---|
id obligatorio | ruta | integer |
Ejemplo
curl https://api.mihoraya.com/v1/webhook_endpoints/5 \
-H "Authorization: Bearer $MIHORAYA_API_KEY"JavaScript (Node.js 18+)
const res = await fetch("https://api.mihoraya.com/v1/webhook_endpoints/5", {
headers: {
Authorization: `Bearer ${process.env.MIHORAYA_API_KEY}`,
},
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.message} (${data.error.request_id})`);
console.log(data);Python (requests)
import os
import requests
res = requests.get(
"https://api.mihoraya.com/v1/webhook_endpoints/5",
headers={"Authorization": f"Bearer {os.environ['MIHORAYA_API_KEY']}"},
timeout=30,
)
data = res.json()
if not res.ok:
raise RuntimeError(f"{data['error']['code']}: {data['error']['message']}")
print(data)PHP (cURL)
<?php
$ch = curl_init('https://api.mihoraya.com/v1/webhook_endpoints/5');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('MIHORAYA_API_KEY'),
],
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($status >= 400) {
throw new RuntimeException($data['error']['code'] . ': ' . $data['error']['message']);
}
print_r($data);Respuestas
- 200 OK · El endpoint (sin el secreto).
- 401 No autenticado · API key ausente, inválida (
invalid_api_key), revocada (api_key_revoked) o vencida (api_key_expired). - 402 Plan · El plan del negocio no incluye la API (
feature_locked) o se alcanzó un límite del plan (limit_reached). - 403 Sin permiso · La API key no tiene el permiso necesario (
insufficient_scope). - 404 No encontrado · El recurso no existe o es de otro negocio (
resource_not_found). - 429 Demasiadas llamadas · Se superó el límite por minuto (
rate_limited) o la cuota mensual del plan (quota_exceeded).
Editar un endpoint de webhook
PATCH/v1/webhook_endpoints/{id}
Cambia URL, eventos, descripción o estado. status=enabled reactiva un endpoint desactivado (por ti o por fallos) y reinicia el contador de fallos.
Parámetros
| Nombre | En | Tipo | Descripción |
|---|---|---|---|
id obligatorio | ruta | integer |
Cuerpo (JSON)
| Campo | Tipo | Descripción |
|---|---|---|
url | string (uri) | |
events | array de string | |
description | string | Máx. 200 caracteres |
status | string | Valores: enabled, disabled |
Ejemplo
curl -X PATCH https://api.mihoraya.com/v1/webhook_endpoints/5 \
-H "Authorization: Bearer $MIHORAYA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"status": "enabled"
}'JavaScript (Node.js 18+)
const res = await fetch("https://api.mihoraya.com/v1/webhook_endpoints/5", {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.MIHORAYA_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"status": "enabled"
}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.message} (${data.error.request_id})`);
console.log(data);Python (requests)
import os
import requests
res = requests.patch(
"https://api.mihoraya.com/v1/webhook_endpoints/5",
headers={"Authorization": f"Bearer {os.environ['MIHORAYA_API_KEY']}"},
json={
"status": "enabled",
},
timeout=30,
)
data = res.json()
if not res.ok:
raise RuntimeError(f"{data['error']['code']}: {data['error']['message']}")
print(data)PHP (cURL)
<?php
$ch = curl_init('https://api.mihoraya.com/v1/webhook_endpoints/5');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('MIHORAYA_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'status' => 'enabled',
]),
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($status >= 400) {
throw new RuntimeException($data['error']['code'] . ': ' . $data['error']['message']);
}
print_r($data);Respuestas
- 200 OK · Endpoint actualizado.
- 400 Petición inválida · Parámetros inválidos (
parameter_invalid,parameter_missing,parameter_unknown,invalid_body,idempotency_key_required). - 401 No autenticado · API key ausente, inválida (
invalid_api_key), revocada (api_key_revoked) o vencida (api_key_expired). - 402 Plan · El plan del negocio no incluye la API (
feature_locked) o se alcanzó un límite del plan (limit_reached). - 403 Sin permiso · La API key no tiene el permiso necesario (
insufficient_scope). - 404 No encontrado · El recurso no existe o es de otro negocio (
resource_not_found). - 429 Demasiadas llamadas · Se superó el límite por minuto (
rate_limited) o la cuota mensual del plan (quota_exceeded).
Eliminar un endpoint de webhook
DELETE/v1/webhook_endpoints/{id}
Parámetros
| Nombre | En | Tipo | Descripción |
|---|---|---|---|
id obligatorio | ruta | integer |
Ejemplo
curl -X DELETE https://api.mihoraya.com/v1/webhook_endpoints/5 \
-H "Authorization: Bearer $MIHORAYA_API_KEY"JavaScript (Node.js 18+)
const res = await fetch("https://api.mihoraya.com/v1/webhook_endpoints/5", {
method: "DELETE",
headers: {
Authorization: `Bearer ${process.env.MIHORAYA_API_KEY}`,
},
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.message} (${data.error.request_id})`);
console.log(data);Python (requests)
import os
import requests
res = requests.delete(
"https://api.mihoraya.com/v1/webhook_endpoints/5",
headers={"Authorization": f"Bearer {os.environ['MIHORAYA_API_KEY']}"},
timeout=30,
)
data = res.json()
if not res.ok:
raise RuntimeError(f"{data['error']['code']}: {data['error']['message']}")
print(data)PHP (cURL)
<?php
$ch = curl_init('https://api.mihoraya.com/v1/webhook_endpoints/5');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('MIHORAYA_API_KEY'),
],
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($status >= 400) {
throw new RuntimeException($data['error']['code'] . ': ' . $data['error']['message']);
}
print_r($data);Respuesta de ejemplo (200)
{
"id": 5,
"object": "webhook_endpoint",
"deleted": true,
"livemode": true
}Respuestas
- 200 OK · Eliminado.
- 401 No autenticado · API key ausente, inválida (
invalid_api_key), revocada (api_key_revoked) o vencida (api_key_expired). - 402 Plan · El plan del negocio no incluye la API (
feature_locked) o se alcanzó un límite del plan (limit_reached). - 403 Sin permiso · La API key no tiene el permiso necesario (
insufficient_scope). - 404 No encontrado · El recurso no existe o es de otro negocio (
resource_not_found). - 429 Demasiadas llamadas · Se superó el límite por minuto (
rate_limited) o la cuota mensual del plan (quota_exceeded).
Enviar un evento de prueba
POST/v1/webhook_endpoints/{id}/test
Envía al endpoint, en el acto, un evento de prueba firmado (livemode: false): ping por defecto o un ejemplo ficticio del tipo pedido. Devuelve el resultado de la entrega. Máximo 10 pruebas por minuto.
Parámetros
| Nombre | En | Tipo | Descripción |
|---|---|---|---|
id obligatorio | ruta | integer |
Cuerpo (JSON) · opcional
| Campo | Tipo | Descripción |
|---|---|---|
type | string | ping o un tipo de evento.Por defecto: "ping" |
Ejemplo
curl -X POST https://api.mihoraya.com/v1/webhook_endpoints/5/test \
-H "Authorization: Bearer $MIHORAYA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "appointment.created"
}'JavaScript (Node.js 18+)
const res = await fetch("https://api.mihoraya.com/v1/webhook_endpoints/5/test", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.MIHORAYA_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"type": "appointment.created"
}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.message} (${data.error.request_id})`);
console.log(data);Python (requests)
import os
import requests
res = requests.post(
"https://api.mihoraya.com/v1/webhook_endpoints/5/test",
headers={"Authorization": f"Bearer {os.environ['MIHORAYA_API_KEY']}"},
json={
"type": "appointment.created",
},
timeout=30,
)
data = res.json()
if not res.ok:
raise RuntimeError(f"{data['error']['code']}: {data['error']['message']}")
print(data)PHP (cURL)
<?php
$ch = curl_init('https://api.mihoraya.com/v1/webhook_endpoints/5/test');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('MIHORAYA_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'type' => 'appointment.created',
]),
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($status >= 400) {
throw new RuntimeException($data['error']['code'] . ': ' . $data['error']['message']);
}
print_r($data);Respuesta de ejemplo (200)
{
"id": 77,
"object": "webhook_delivery",
"endpoint_id": 5,
"event_id": 1201,
"event_type": "ping",
"status": "succeeded",
"attempts": 1,
"response_status": 200,
"response_body": "ok",
"error": "",
"duration_ms": 182,
"created_at": "2026-11-24T12:01:00-03:00",
"last_attempt_at": "2026-11-24T12:01:00-03:00",
"next_attempt_at": null,
"delivered_at": "2026-11-24T12:01:00-03:00"
}Respuestas
- 200 OK · Resultado de la entrega de prueba.
- 400 Petición inválida · Parámetros inválidos (
parameter_invalid,parameter_missing,parameter_unknown,invalid_body,idempotency_key_required). - 401 No autenticado · API key ausente, inválida (
invalid_api_key), revocada (api_key_revoked) o vencida (api_key_expired). - 402 Plan · El plan del negocio no incluye la API (
feature_locked) o se alcanzó un límite del plan (limit_reached). - 403 Sin permiso · La API key no tiene el permiso necesario (
insufficient_scope). - 404 No encontrado · El recurso no existe o es de otro negocio (
resource_not_found). - 429 Demasiadas llamadas · Se superó el límite por minuto (
rate_limited) o la cuota mensual del plan (quota_exceeded).
Objetos
El objeto Event
| Campo | Tipo | Descripción |
|---|---|---|
id | integer | Úsalo para no procesar dos veces el mismo evento. |
object | string | Siempre event |
type | string | Tipo de evento (o ping en las pruebas). |
api_version | string | |
created_at | string (date-time) | |
livemode | boolean | false en los eventos de prueba. |
data | object | |
data.object | object | El recurso tal como quedó (Appointment o Client). |
data.previous_attributes | object | Valores anteriores (en appointment.rescheduled). |
El objeto WebhookEndpoint
| Campo | Tipo | Descripción |
|---|---|---|
id | integer | |
object | string | Siempre webhook_endpoint |
url | string (uri) | |
description | string | |
events | array de string | |
status | string | Valores: enabled, disabled |
disabled_reason | string | Valores: "", manual, failures |
consecutive_failures | integer | |
last_success_at | string | null (date-time) | |
last_failure_at | string | null (date-time) | |
created_at | string (date-time) | |
updated_at | string (date-time) | |
secret | string | Solo al crear. Clave para verificar MiHoraYa-Signature. |
livemode | boolean |
El objeto WebhookDelivery
| Campo | Tipo | Descripción |
|---|---|---|
id | integer | |
object | string | Siempre webhook_delivery |
endpoint_id | integer | |
event_id | integer | |
event_type | string | |
status | string | Valores: pending, succeeded, failed |
attempts | integer | |
response_status | integer | null | |
response_body | string | Primeros 1.024 bytes de la respuesta. |
error | string | |
duration_ms | integer | null | |
created_at | string (date-time) | |
last_attempt_at | string | null (date-time) | |
next_attempt_at | string | null (date-time) | |
delivered_at | string | null (date-time) |