Documentation · v1.0.0

Iknal API

Everything the dashboard does —checking open slots, booking, canceling, reading conversations and writing in them— can be done from your system. One key per business, permissions per key and the same availability engine your agent uses: the API can't book a slot your agent would reject.

Authentication

Send your key in the Authorization header. Keys are created in Settings › API and are shown only once: we don't store them in plain text and there's no way to see them again. If you lose one, revoke it and create another.

curl -s "https://app.iknal.mx/api/v1/me" \
  -H "Authorization: Bearer $IKNAL_API_KEY"

Every successful response is wrapped in { "data": … } and every error in { "error": { "code", "message" } }. Every response carries an X-Request-Id: keep it, it's what lets us trace a specific request.

Permissions

Each key carries the list of permissions you granted it. An endpoint whose permission is missing replies 403 forbidden saying which one is missing. Grant only what the integration needs: a leaked read-only key can't cancel anyone's appointment.

PermissionWhat it allows
read:appointmentsView appointments
write:appointmentsCreate, cancel and complete appointments
read:contactsView contacts and their profile
write:contactsCreate contacts and edit tags and details
read:availabilityCheck open slots, services and staff
read:conversationsView conversations and their message history
write:messagesSend messages on behalf of the team
read:metricsView the business's metrics
read:productsView the store catalog and its stock
write:productsCreate and edit products, prices and stock
read:ordersView store orders
read:invoicesView CFDI invoices (without the recipient's tax details)

Rate limit

120 requests per minute per key (not per business: one integration's accidental loop doesn't take down the others). When you go over, the response is 429 with Retry-After in seconds. Every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset so you can slow down before you hit it.

Pagination

By cursor, not by page. Every list returns pagination: { next_cursor, limit }; pass that next_cursor as ?cursor= for the next one. limit goes from 1 to 200 (50 by default). With a cursor there are no duplicate rows even if new records come in while you paginate.

Errors

codeHTTPWhen
invalid_request400A field is missing, extra or in the wrong format. The message says which.
unauthorized401The key is missing, doesn't exist, was revoked or expired. Always the same message: the reason isn't revealed on purpose.
forbidden403The key is valid but doesn't have the permission that endpoint requires.
not_found404The resource doesn't exist in the key's business.
conflict409The current state doesn't allow the operation right now: the slot was taken, the contact already exists, the 24 h window closed.
rate_limited429Too many requests. Wait as long as the Retry-After header says.
internal_error500Our fault. Retry; if it persists, write to us with the response's X-Request-Id.

Endpoints

23 operations. All of them live under https://app.iknal.mx/api.

Identity

The detailed description of each endpoint and its parameters is in Spanish for now; the examples and field names are the same in any language.

OperationPermissionWhat it does
GET /v1/menoneThe business and the key's permissions

GET/v1/me

La primera llamada de cualquier integración: confirma que la clave sirve y devuelve la organización, su zona horaria y los permisos concedidos. Es el único endpoint que no exige ningún scope.

Example

curl -s "https://app.iknal.mx/api/v1/me" \
  -H "Authorization: Bearer $IKNAL_API_KEY"

Response · 200

{
  "data": {
    "organization": {
      "id": "3f7c…",
      "name": "Clínica Sonrisa",
      "slug": "clinica-sonrisa",
      "timezone": "America/Mexico_City",
      "vertical": "dental"
    },
    "api_key": {
      "id": "a1b2…",
      "name": "CRM de recepción",
      "prefix": "sk_live_a1B2c3D4",
      "scopes": [
        "read:appointments",
        "write:appointments"
      ],
      "last_used_at": "2026-08-19T18:20:00.000Z",
      "expires_at": null,
      "created_at": "2026-08-01T10:00:00.000Z"
    }
  }
}

Availability

The detailed description of each endpoint and its parameters is in Spanish for now; the examples and field names are the same in any language.

OperationPermissionWhat it does
GET /v1/availabilityread:availabilityOpen slots for a service

GET/v1/availability

Calcula la disponibilidad real con el mismo motor que usa el agente: horarios de cada recurso, menos bloqueos, menos citas ya reservadas, menos la ocupación del calendario externo, menos la antelación mínima. Si el calendario externo no responde, la respuesta llega igual con `degraded: true` y los huecos deben ofrecerse como «sujeto a confirmación».

ParameterWhereDescription
service_idqueryId del servicio (de `GET /v1/services`). Obligatorio si no mandas `service`.
servicequeryNombre exacto del servicio, como alternativa a `service_id`.
resource_idqueryLimita la búsqueda a un profesional, sala o unidad concretos.
fromqueryPrimer día a consultar (`YYYY-MM-DD`, zona del negocio). Por defecto, hoy.
toqueryÚltimo día (máximo 60 días desde `from`). Por defecto, `from` + 14 días.
limitqueryNúmero máximo de huecos devueltos (1-100). Por defecto 20.

Example

curl -s "https://app.iknal.mx/api/v1/availability?service_id=2b9c7f10-3a44-4f0c-9e11-77a2d5c8e001&service=Limpieza%20dental&from=2026-09-01&to=2026-09-07" \
  -H "Authorization: Bearer $IKNAL_API_KEY"

Response · 200

{
  "data": {
    "service": {
      "id": "2b9c…",
      "name": "Limpieza dental",
      "duration_minutes": 60
    },
    "from": "2026-09-01",
    "to": "2026-09-07",
    "slots": [
      {
        "starts_at": "2026-09-01T10:00:00-06:00",
        "ends_at": "2026-09-01T11:00:00-06:00",
        "display": "martes 1 de septiembre, 10:00",
        "resource_id": "0f61…",
        "resource_name": "Dra. Ruiz"
      }
    ],
    "degraded": false,
    "degraded_reason": null,
    "resources_considered": 2
  }
}

Appointments

The detailed description of each endpoint and its parameters is in Spanish for now; the examples and field names are the same in any language.

OperationPermissionWhat it does
GET /v1/appointmentsread:appointmentsList appointments
POST /v1/appointmentswrite:appointmentsCreate an appointment
GET /v1/appointments/{id}read:appointmentsView an appointment
PATCH /v1/appointments/{id}write:appointmentsCancel, complete or mark as no-show

GET/v1/appointments

Citas de la organización ordenadas de la más reciente a la más antigua por `starts_at`. Paginación por cursor.

ParameterWhereDescription
statusquery`confirmed`, `cancelled`, `completed`, `no_show` o `pending_payment`.
contact_idquerySolo las citas de un contacto.
resource_idquerySolo las de un recurso.
fromqueryCita a partir de este instante (ISO 8601).
toqueryCita hasta este instante (ISO 8601).
limitqueryTamaño de página (1-200). Por defecto 50.
cursorqueryCursor opaco de la página siguiente (`pagination.next_cursor`).

Example

curl -s "https://app.iknal.mx/api/v1/appointments?from=2026-09-01T00%3A00%3A00-06%3A00&limit=50&cursor=MjAyNi0wOC0xOVQxMDowMDowMFp8YWJj" \
  -H "Authorization: Bearer $IKNAL_API_KEY"

Response · 200

{
  "data": [
    {
      "id": "8f2a1c34-77d1-4d5e-9b3a-2a5f9d3c1b77",
      "status": "confirmed",
      "service": "Limpieza dental",
      "service_id": "2b9c7f10-3a44-4f0c-9e11-77a2d5c8e001",
      "starts_at": "2026-09-01T16:00:00.000Z",
      "ends_at": "2026-09-01T17:00:00.000Z",
      "resource": {
        "id": "0f61e2a9-9c3b-4d2e-8a11-5c7d9e2f4a10",
        "name": "Dra. Ruiz"
      },
      "contact": {
        "id": "c1a2b3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
        "name": "Ana Pérez",
        "phone": "+5215512345678"
      },
      "conversation_id": "d4c3b2a1-f6e5-4b7a-9d8c-1f0e3a2b5c4d",
      "notes": null,
      "created_by": "api",
      "created_at": "2026-08-19T18:22:04.117Z",
      "cancelled_at": null,
      "cancellation_reason": null,
      "no_show_at": null,
      "confirmation_status": "unconfirmed",
      "deposit_status": "none"
    }
  ],
  "pagination": {
    "next_cursor": null,
    "limit": 50
  }
}

POST/v1/appointments

Crea una cita con el mismo motor que el panel: revalida el hueco, respeta la antelación mínima, programa los recordatorios y espeja el evento en el calendario del recurso. El contacto se identifica por teléfono (se crea si no existía) o por `contact_id`. Devuelve 409 si el hueco se ocupó mientras tanto.

Body

`service` tiene que ser el nombre exacto de `GET /v1/services`. `force: true` salta la revalidación del hueco y queda anotado en la cita.

{
  "phone": "+5215512345678",
  "full_name": "Ana Pérez",
  "service": "Limpieza dental",
  "starts_at": "2026-09-01T10:00:00-06:00",
  "resource_id": "0f61e2a9-9c3b-4d2e-8a11-5c7d9e2f4a10",
  "notes": "Viene recomendada por su hermana.",
  "force": false,
  "requires_deposit": false
}

Example

curl -s -X POST "https://app.iknal.mx/api/v1/appointments" \
  -H "Authorization: Bearer $IKNAL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"phone":"+5215512345678","full_name":"Ana Pérez","service":"Limpieza dental","starts_at":"2026-09-01T10:00:00-06:00","resource_id":"0f61e2a9-9c3b-4d2e-8a11-5c7d9e2f4a10","notes":"Viene recomendada por su hermana.","force":false,"requires_deposit":false}'

Response · 201

{
  "data": {
    "id": "8f2a1c34-77d1-4d5e-9b3a-2a5f9d3c1b77",
    "status": "confirmed",
    "service": "Limpieza dental",
    "service_id": "2b9c7f10-3a44-4f0c-9e11-77a2d5c8e001",
    "starts_at": "2026-09-01T16:00:00.000Z",
    "ends_at": "2026-09-01T17:00:00.000Z",
    "resource": {
      "id": "0f61e2a9-9c3b-4d2e-8a11-5c7d9e2f4a10",
      "name": "Dra. Ruiz"
    },
    "contact": {
      "id": "c1a2b3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
      "name": "Ana Pérez",
      "phone": "+5215512345678"
    },
    "conversation_id": "d4c3b2a1-f6e5-4b7a-9d8c-1f0e3a2b5c4d",
    "notes": null,
    "created_by": "api",
    "created_at": "2026-08-19T18:22:04.117Z",
    "cancelled_at": null,
    "cancellation_reason": null,
    "no_show_at": null,
    "confirmation_status": "unconfirmed",
    "deposit_status": "none",
    "calendar_synced": true
  }
}

GET/v1/appointments/{id}

Una cita concreta de la organización de la clave.

ParameterWhereDescription
idrequiredpathId de la cita.

Example

curl -s "https://app.iknal.mx/api/v1/appointments/<id>" \
  -H "Authorization: Bearer $IKNAL_API_KEY"

Response · 200

{
  "data": {
    "id": "8f2a1c34-77d1-4d5e-9b3a-2a5f9d3c1b77",
    "status": "confirmed",
    "service": "Limpieza dental",
    "service_id": "2b9c7f10-3a44-4f0c-9e11-77a2d5c8e001",
    "starts_at": "2026-09-01T16:00:00.000Z",
    "ends_at": "2026-09-01T17:00:00.000Z",
    "resource": {
      "id": "0f61e2a9-9c3b-4d2e-8a11-5c7d9e2f4a10",
      "name": "Dra. Ruiz"
    },
    "contact": {
      "id": "c1a2b3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
      "name": "Ana Pérez",
      "phone": "+5215512345678"
    },
    "conversation_id": "d4c3b2a1-f6e5-4b7a-9d8c-1f0e3a2b5c4d",
    "notes": null,
    "created_by": "api",
    "created_at": "2026-08-19T18:22:04.117Z",
    "cancelled_at": null,
    "cancellation_reason": null,
    "no_show_at": null,
    "confirmation_status": "unconfirmed",
    "deposit_status": "none"
  }
}

PATCH/v1/appointments/{id}

Cambia el estado final de una cita. Cancelar cancela también los recordatorios pendientes y renombra el evento en el calendario externo en vez de borrarlo. Es idempotente: repetir la misma transición devuelve 200 con `changed: false`.

ParameterWhereDescription
idrequiredpathId de la cita.

Body

`status` solo admite `cancelled`, `completed` o `no_show`. Reagendar no se hace aquí: se cancela y se crea otra cita.

{
  "status": "cancelled",
  "cancellation_reason": "El paciente avisó por teléfono."
}

Example

curl -s -X PATCH "https://app.iknal.mx/api/v1/appointments/<id>" \
  -H "Authorization: Bearer $IKNAL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"status":"cancelled","cancellation_reason":"El paciente avisó por teléfono."}'

Response · 200

{
  "data": {
    "id": "8f2a1c34-77d1-4d5e-9b3a-2a5f9d3c1b77",
    "status": "cancelled",
    "service": "Limpieza dental",
    "service_id": "2b9c7f10-3a44-4f0c-9e11-77a2d5c8e001",
    "starts_at": "2026-09-01T16:00:00.000Z",
    "ends_at": "2026-09-01T17:00:00.000Z",
    "resource": {
      "id": "0f61e2a9-9c3b-4d2e-8a11-5c7d9e2f4a10",
      "name": "Dra. Ruiz"
    },
    "contact": {
      "id": "c1a2b3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
      "name": "Ana Pérez",
      "phone": "+5215512345678"
    },
    "conversation_id": "d4c3b2a1-f6e5-4b7a-9d8c-1f0e3a2b5c4d",
    "notes": null,
    "created_by": "api",
    "created_at": "2026-08-19T18:22:04.117Z",
    "cancelled_at": null,
    "cancellation_reason": null,
    "no_show_at": null,
    "confirmation_status": "unconfirmed",
    "deposit_status": "none",
    "changed": true
  }
}

Contacts

The detailed description of each endpoint and its parameters is in Spanish for now; the examples and field names are the same in any language.

OperationPermissionWhat it does
GET /v1/contactsread:contactsList contacts
POST /v1/contactswrite:contactsCreate a contact
GET /v1/contacts/{id}read:contactsView a contact
PATCH /v1/contacts/{id}write:contactsEdit name, tags and attributes

GET/v1/contacts

Contactos de la organización, del más reciente al más antiguo. Admite búsqueda por nombre o teléfono y filtro por etiqueta.

ParameterWhereDescription
qqueryBusca por nombre o por teléfono.
tagquerySolo los contactos con esta etiqueta.
limitqueryTamaño de página (1-200). Por defecto 50.
cursorqueryCursor opaco de la página siguiente (`pagination.next_cursor`).

Example

curl -s "https://app.iknal.mx/api/v1/contacts?limit=50&cursor=MjAyNi0wOC0xOVQxMDowMDowMFp8YWJj" \
  -H "Authorization: Bearer $IKNAL_API_KEY"

Response · 200

{
  "data": [
    {
      "id": "c1a2b3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
      "phone": "+5215512345678",
      "full_name": "Ana Pérez",
      "tags": [
        "vip",
        "recomendada"
      ],
      "attributes": {
        "crm_id": "A-1029"
      },
      "external_ids": {
        "hubspot": "77123"
      },
      "created_at": "2026-07-02T15:04:01.000Z"
    }
  ],
  "pagination": {
    "next_cursor": null,
    "limit": 50
  }
}

POST/v1/contacts

Alta de contacto. El teléfono en formato internacional es su identidad: si ya existe uno con ese número, se devuelve 409 en vez de duplicar la ficha.

Body

Solo `phone` es obligatorio.

{
  "phone": "+5215512345678",
  "full_name": "Ana Pérez",
  "tags": [
    "vip"
  ],
  "attributes": {
    "crm_id": "A-1029"
  }
}

Example

curl -s -X POST "https://app.iknal.mx/api/v1/contacts" \
  -H "Authorization: Bearer $IKNAL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"phone":"+5215512345678","full_name":"Ana Pérez","tags":["vip"],"attributes":{"crm_id":"A-1029"}}'

Response · 201

{
  "data": {
    "id": "c1a2b3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
    "phone": "+5215512345678",
    "full_name": "Ana Pérez",
    "tags": [
      "vip",
      "recomendada"
    ],
    "attributes": {
      "crm_id": "A-1029"
    },
    "external_ids": {
      "hubspot": "77123"
    },
    "created_at": "2026-07-02T15:04:01.000Z"
  }
}

GET/v1/contacts/{id}

La ficha de un contacto.

ParameterWhereDescription
idrequiredpathId del contacto.

Example

curl -s "https://app.iknal.mx/api/v1/contacts/<id>" \
  -H "Authorization: Bearer $IKNAL_API_KEY"

Response · 200

{
  "data": {
    "id": "c1a2b3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
    "phone": "+5215512345678",
    "full_name": "Ana Pérez",
    "tags": [
      "vip",
      "recomendada"
    ],
    "attributes": {
      "crm_id": "A-1029"
    },
    "external_ids": {
      "hubspot": "77123"
    },
    "created_at": "2026-07-02T15:04:01.000Z"
  }
}

PATCH/v1/contacts/{id}

Actualiza la ficha. `tags`, `attributes` y `external_ids` se REEMPLAZAN enteros, no se fusionan: manda siempre la lista completa. El teléfono no se puede cambiar — es la identidad del contacto.

ParameterWhereDescription
idrequiredpathId del contacto.

Body

Manda al menos uno de los cuatro campos.

{
  "full_name": "Ana Pérez Gómez",
  "tags": [
    "vip",
    "recomendada"
  ]
}

Example

curl -s -X PATCH "https://app.iknal.mx/api/v1/contacts/<id>" \
  -H "Authorization: Bearer $IKNAL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"full_name":"Ana Pérez Gómez","tags":["vip","recomendada"]}'

Response · 200

{
  "data": {
    "id": "c1a2b3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
    "phone": "+5215512345678",
    "full_name": "Ana Pérez",
    "tags": [
      "vip",
      "recomendada"
    ],
    "attributes": {
      "crm_id": "A-1029"
    },
    "external_ids": {
      "hubspot": "77123"
    },
    "created_at": "2026-07-02T15:04:01.000Z"
  }
}

Conversations

The detailed description of each endpoint and its parameters is in Spanish for now; the examples and field names are the same in any language.

OperationPermissionWhat it does
GET /v1/conversationsread:conversationsList conversations
GET /v1/conversations/{id}/messagesread:conversationsMessage history
POST /v1/conversations/{id}/messageswrite:messagesSend a message as the team

GET/v1/conversations

La bandeja, ordenada por actividad. `window_expires_at` dice hasta cuándo se le puede escribir texto libre al contacto; después solo se le puede escribir con una plantilla aprobada.

ParameterWhereDescription
contact_idquerySolo las de un contacto.
needs_attentionquery`true` = solo las que piden a una persona.
bot_activequeryFiltra por si el agente sigue contestando.
limitqueryTamaño de página (1-200). Por defecto 50.
cursorqueryCursor opaco de la página siguiente (`pagination.next_cursor`).

Example

curl -s "https://app.iknal.mx/api/v1/conversations?limit=50&cursor=MjAyNi0wOC0xOVQxMDowMDowMFp8YWJj" \
  -H "Authorization: Bearer $IKNAL_API_KEY"

Response · 200

{
  "data": [
    {
      "id": "d4c3b2a1-f6e5-4b7a-9d8c-1f0e3a2b5c4d",
      "contact": {
        "id": "c1a2b3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
        "name": "Ana Pérez",
        "phone": "+5215512345678"
      },
      "channel_id": "9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d",
      "bot_active": true,
      "needs_attention": false,
      "needs_attention_reason": null,
      "last_message_at": "2026-08-19T17:58:00.000Z",
      "last_inbound_at": "2026-08-19T17:57:12.000Z",
      "window_expires_at": "2026-08-20T17:57:12.000Z",
      "created_at": "2026-07-02T15:04:01.000Z"
    }
  ],
  "pagination": {
    "next_cursor": null,
    "limit": 50
  }
}

GET/v1/conversations/{id}/messages

Mensajes de una conversación, del más reciente al más antiguo.

ParameterWhereDescription
idrequiredpathId de la conversación.
limitqueryTamaño de página (1-200). Por defecto 50.
cursorqueryCursor opaco de la página siguiente (`pagination.next_cursor`).

Example

curl -s "https://app.iknal.mx/api/v1/conversations/<id>/messages?limit=50&cursor=MjAyNi0wOC0xOVQxMDowMDowMFp8YWJj" \
  -H "Authorization: Bearer $IKNAL_API_KEY"

Response · 200

{
  "data": [
    {
      "id": "1c2d3e4f-5a6b-4c7d-8e9f-0a1b2c3d4e5f",
      "conversation_id": "d4c3b2a1-f6e5-4b7a-9d8c-1f0e3a2b5c4d",
      "direction": "inbound",
      "sender": "contact",
      "content": "Hola, ¿tienen hueco el jueves?",
      "template_name": null,
      "delivery_status": null,
      "media_type": null,
      "transcript": null,
      "created_at": "2026-08-19T17:57:12.000Z"
    }
  ],
  "pagination": {
    "next_cursor": null,
    "limit": 50
  }
}

POST/v1/conversations/{id}/messages

Guarda el mensaje antes de entregarlo al cliente y desactiva el agente en esa conversación. Devuelve 201 con status=sent si el proveedor lo aceptó, o 202 con status=pending si quedó guardado para reintento automático; en ese caso no vuelvas a enviarlo. Fuera de la ventana de 24 h de Meta hay que mandar template (una plantilla aprobada); si mandas content con la ventana cerrada, la respuesta es 409.

ParameterWhereDescription
idrequiredpathId de la conversación.

Body

`content` para texto libre (ventana abierta) o `template` para reabrir la conversación.

{
  "content": "Hola Ana, te confirmamos tu cita del jueves a las 10."
}

Example

curl -s -X POST "https://app.iknal.mx/api/v1/conversations/<id>/messages" \
  -H "Authorization: Bearer $IKNAL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"content":"Hola Ana, te confirmamos tu cita del jueves a las 10."}'

Response · 201

{
  "data": {
    "id": "1c2d…",
    "conversation_id": "d4c3…",
    "status": "sent",
    "bot_deactivated": true
  }
}

Catalog

The detailed description of each endpoint and its parameters is in Spanish for now; the examples and field names are the same in any language.

OperationPermissionWhat it does
GET /v1/servicesread:availabilityBusiness services
GET /v1/resourcesread:availabilityStaff and resources (practitioners, rooms, units)

GET/v1/services

Catálogo de servicios con duración, precio y política de anticipo. Es la fuente del campo `service` al crear una cita.

ParameterWhereDescription
include_inactivequery`true` para incluir los dados de baja.

Example

curl -s "https://app.iknal.mx/api/v1/services" \
  -H "Authorization: Bearer $IKNAL_API_KEY"

Response · 200

{
  "data": [
    {
      "id": "2b9c…",
      "name": "Limpieza dental",
      "description": "",
      "duration_minutes": 60,
      "buffer_before_min": 0,
      "buffer_after_min": 10,
      "price_cents": 80000,
      "currency": "MXN",
      "deposit_type": "none",
      "deposit_value": 0,
      "requires_intake": false,
      "category": null,
      "active": true,
      "position": 0
    }
  ]
}

GET/v1/resources

Quién o qué atiende. `services` dice qué servicios da cada recurso; `null` significa todos.

ParameterWhereDescription
include_inactivequery`true` para incluir los inactivos.

Example

curl -s "https://app.iknal.mx/api/v1/resources" \
  -H "Authorization: Bearer $IKNAL_API_KEY"

Response · 200

{
  "data": [
    {
      "id": "0f61…",
      "name": "Dra. Ruiz",
      "kind": "practitioner",
      "timezone": null,
      "services": [
        "Limpieza dental"
      ],
      "active": true,
      "position": 0
    }
  ]
}

Metrics

The detailed description of each endpoint and its parameters is in Spanish for now; the examples and field names are the same in any language.

OperationPermissionWhat it does
GET /v1/metrics/summaryread:metricsBusiness summary

GET/v1/metrics/summary

Los mismos números que el panel: citas y sus finales, mezcla de clientes nuevos y recurrentes, embudo de conversación y reparto entre bot, equipo e integraciones.

ParameterWhereDescription
rangequery`7d`, `30d` (por defecto) o `90d`.

Example

curl -s "https://app.iknal.mx/api/v1/metrics/summary" \
  -H "Authorization: Bearer $IKNAL_API_KEY"

Response · 200

{
  "data": {
    "range": {
      "from": "2026-07-20T00:00:00.000Z",
      "to": "2026-08-19T00:00:00.000Z",
      "days": 30,
      "bucket": "week"
    },
    "appointments": {
      "booked": 142,
      "completed": 118,
      "cancelled": 12,
      "no_show": 9,
      "upcoming": 3,
      "late_cancels": 4,
      "no_show_rate_pct": 7.1,
      "cancel_rate_pct": 8.5,
      "series": []
    },
    "customers": {
      "new_customers": 34,
      "returning_customers": 61,
      "active_customers": 95,
      "repeat_rate_pct": 64.2
    },
    "conversations": {
      "conversations": 210,
      "conversations_with_booking": 128,
      "conversion_pct": 61,
      "handoffs": 11
    },
    "by_source": [
      {
        "created_by": "bot",
        "appointments": 96,
        "completed": 80,
        "no_show": 6,
        "share_pct": 67.6,
        "after_hours": 41
      }
    ]
  }
}

Store

The detailed description of each endpoint and its parameters is in Spanish for now; the examples and field names are the same in any language.

OperationPermissionWhat it does
GET /v1/productsread:productsStore catalog
POST /v1/productswrite:productsCreate a product
GET /v1/products/{id}read:productsView a product
PATCH /v1/products/{id}write:productsEdit price, details and stock
GET /v1/ordersread:ordersList orders
GET /v1/orders/{id}read:ordersView an order

GET/v1/products

Productos con precio, existencias y variantes, del último modificado al primero. Con `updated_since` un POS o ERP trae solo lo que cambió. `retailer_id` es el identificador estable para cruzar catálogos. Solo para negocios del giro tienda (otro giro: 403).

ParameterWhereDescription
categoryquerySolo los de esta categoría.
skuqueryBusca por SKU exacto.
include_inactivequery`true` para incluir los dados de baja.
updated_sincequeryISO 8601: solo los modificados desde ese instante.
limitqueryTamaño de página (1-200). Por defecto 50.
cursorqueryCursor opaco de la página siguiente (`pagination.next_cursor`).

Example

curl -s "https://app.iknal.mx/api/v1/products?updated_since=2026-11-11T00%3A00%3A00-06%3A00&limit=50&cursor=MjAyNi0wOC0xOVQxMDowMDowMFp8YWJj" \
  -H "Authorization: Bearer $IKNAL_API_KEY"

Response · 200

{
  "data": [
    {
      "id": "6e5d4c3b-2a1f-4e0d-9c8b-7a6f5e4d3c2b",
      "retailer_id": "6e5d4c3b-2a1f-4e0d-9c8b-7a6f5e4d3c2b",
      "name": "Playera básica",
      "description": "Algodón, cuello redondo.",
      "sku": "PLY-001",
      "category": "Ropa",
      "price_cents": 19900,
      "active": true,
      "track_inventory": true,
      "stock": 0,
      "external_catalog_id": null,
      "variants": [
        {
          "id": "5d4c3b2a-1f0e-4d9c-8b7a-6f5e4d3c2b1a",
          "retailer_id": "5d4c3b2a-1f0e-4d9c-8b7a-6f5e4d3c2b1a",
          "name": "Talla M",
          "sku": "PLY-001-M",
          "price_cents": 19900,
          "stock": 12,
          "active": true
        }
      ],
      "created_at": "2026-11-11T15:04:05.000Z",
      "updated_at": "2026-11-11T15:04:05.000Z"
    }
  ],
  "pagination": {
    "next_cursor": null,
    "limit": 50
  }
}

POST/v1/products

Alta de producto con variantes opcionales (talla, color, presentación) con precio y existencias propias. Importes en centavos. Un `sku` repetido da 409.

Body

Solo `name` es obligatorio; sin `price_cents` el precio queda por confirmar y el agente no lo vende.

{
  "name": "Playera básica",
  "sku": "PLY-001",
  "category": "Ropa",
  "price_cents": 19900,
  "track_inventory": true,
  "variants": [
    {
      "name": "Talla M",
      "sku": "PLY-001-M",
      "price_cents": 19900,
      "stock": 12
    }
  ]
}

Example

curl -s -X POST "https://app.iknal.mx/api/v1/products" \
  -H "Authorization: Bearer $IKNAL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Playera básica","sku":"PLY-001","category":"Ropa","price_cents":19900,"track_inventory":true,"variants":[{"name":"Talla M","sku":"PLY-001-M","price_cents":19900,"stock":12}]}'

Response · 201

{
  "data": {
    "id": "6e5d4c3b-2a1f-4e0d-9c8b-7a6f5e4d3c2b",
    "retailer_id": "6e5d4c3b-2a1f-4e0d-9c8b-7a6f5e4d3c2b",
    "name": "Playera básica",
    "description": "Algodón, cuello redondo.",
    "sku": "PLY-001",
    "category": "Ropa",
    "price_cents": 19900,
    "active": true,
    "track_inventory": true,
    "stock": 0,
    "external_catalog_id": null,
    "variants": [
      {
        "id": "5d4c3b2a-1f0e-4d9c-8b7a-6f5e4d3c2b1a",
        "retailer_id": "5d4c3b2a-1f0e-4d9c-8b7a-6f5e4d3c2b1a",
        "name": "Talla M",
        "sku": "PLY-001-M",
        "price_cents": 19900,
        "stock": 12,
        "active": true
      }
    ],
    "created_at": "2026-11-11T15:04:05.000Z",
    "updated_at": "2026-11-11T15:04:05.000Z"
  }
}

GET/v1/products/{id}

Un producto con sus variantes, precio y existencias actuales.

ParameterWhereDescription
idrequiredpathId del producto.

Example

curl -s "https://app.iknal.mx/api/v1/products/<id>" \
  -H "Authorization: Bearer $IKNAL_API_KEY"

Response · 200

{
  "data": {
    "id": "6e5d4c3b-2a1f-4e0d-9c8b-7a6f5e4d3c2b",
    "retailer_id": "6e5d4c3b-2a1f-4e0d-9c8b-7a6f5e4d3c2b",
    "name": "Playera básica",
    "description": "Algodón, cuello redondo.",
    "sku": "PLY-001",
    "category": "Ropa",
    "price_cents": 19900,
    "active": true,
    "track_inventory": true,
    "stock": 0,
    "external_catalog_id": null,
    "variants": [
      {
        "id": "5d4c3b2a-1f0e-4d9c-8b7a-6f5e4d3c2b1a",
        "retailer_id": "5d4c3b2a-1f0e-4d9c-8b7a-6f5e4d3c2b1a",
        "name": "Talla M",
        "sku": "PLY-001-M",
        "price_cents": 19900,
        "stock": 12,
        "active": true
      }
    ],
    "created_at": "2026-11-11T15:04:05.000Z",
    "updated_at": "2026-11-11T15:04:05.000Z"
  }
}

PATCH/v1/products/{id}

Actualiza el producto y sus variantes (por `id`; sin `id` se crea una variante nueva). `stock` FIJA las existencias (conteo); `stock_adjustment` las mueve de forma relativa y atómica (vendí 2 en mostrador = -2) sin pisar un pedido de WhatsApp que entre a la vez. Un ajuste que dejaría existencias negativas da 409.

ParameterWhereDescription
idrequiredpathId del producto.

Body

Manda solo lo que cambia.

{
  "price_cents": 18900,
  "variants": [
    {
      "id": "5d4c3b2a-1f0e-4d9c-8b7a-6f5e4d3c2b1a",
      "stock_adjustment": -2
    }
  ]
}

Example

curl -s -X PATCH "https://app.iknal.mx/api/v1/products/<id>" \
  -H "Authorization: Bearer $IKNAL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"price_cents":18900,"variants":[{"id":"5d4c3b2a-1f0e-4d9c-8b7a-6f5e4d3c2b1a","stock_adjustment":-2}]}'

Response · 200

{
  "data": {
    "id": "6e5d4c3b-2a1f-4e0d-9c8b-7a6f5e4d3c2b",
    "retailer_id": "6e5d4c3b-2a1f-4e0d-9c8b-7a6f5e4d3c2b",
    "name": "Playera básica",
    "description": "Algodón, cuello redondo.",
    "sku": "PLY-001",
    "category": "Ropa",
    "price_cents": 19900,
    "active": true,
    "track_inventory": true,
    "stock": 0,
    "external_catalog_id": null,
    "variants": [
      {
        "id": "5d4c3b2a-1f0e-4d9c-8b7a-6f5e4d3c2b1a",
        "retailer_id": "5d4c3b2a-1f0e-4d9c-8b7a-6f5e4d3c2b1a",
        "name": "Talla M",
        "sku": "PLY-001-M",
        "price_cents": 19900,
        "stock": 12,
        "active": true
      }
    ],
    "created_at": "2026-11-11T15:04:05.000Z",
    "updated_at": "2026-11-11T15:04:05.000Z"
  }
}

GET/v1/orders

Pedidos de la tienda, del más reciente al más antiguo, con sus líneas a precio congelado. Para enterarte al momento suscríbete a los webhooks `order.*`; este listado sirve para conciliar.

ParameterWhereDescription
statusquery`nuevo`, `confirmado`, `preparando`, `listo`, `en_camino`, `entregado` o `cancelado`.
payment_statusquery`pendiente` o `pagado`.
contact_idquerySolo los de un contacto.
updated_sincequeryISO 8601: solo los modificados desde ese instante.
limitqueryTamaño de página (1-200). Por defecto 50.
cursorqueryCursor opaco de la página siguiente (`pagination.next_cursor`).

Example

curl -s "https://app.iknal.mx/api/v1/orders?limit=50&cursor=MjAyNi0wOC0xOVQxMDowMDowMFp8YWJj" \
  -H "Authorization: Bearer $IKNAL_API_KEY"

Response · 200

{
  "data": [
    {
      "id": "4a3f2e1d-0c9b-4a8f-7e6d-5c4b3a2f1e0d",
      "folio": 37,
      "status": "nuevo",
      "payment_status": "pendiente",
      "payment_method": "contra_entrega",
      "fulfillment": "domicilio",
      "delivery_address": "Av. Juárez 120, Centro. Portón verde.",
      "delivery_zone": "Centro",
      "currency": "MXN",
      "subtotal_cents": 39800,
      "shipping_cents": 3000,
      "total_cents": 42800,
      "notes": null,
      "source": "whatsapp",
      "contact_id": "5b0c7f3e-1f2a-4c1d-9f0e-2a3b4c5d6e7f",
      "items": [
        {
          "product_id": "6e5d4c3b-2a1f-4e0d-9c8b-7a6f5e4d3c2b",
          "variant_id": "5d4c3b2a-1f0e-4d9c-8b7a-6f5e4d3c2b1a",
          "name": "Playera básica",
          "variant_name": "Talla M",
          "sku": "PLY-001-M",
          "quantity": 2,
          "unit_price_cents": 19900,
          "line_total_cents": 39800
        }
      ],
      "created_at": "2026-11-11T15:04:05.000Z",
      "updated_at": "2026-11-11T15:04:05.000Z",
      "paid_at": null,
      "delivered_at": null,
      "cancelled_at": null
    }
  ],
  "pagination": {
    "next_cursor": null,
    "limit": 50
  }
}

GET/v1/orders/{id}

Un pedido con sus líneas, totales, forma de entrega (incluida la dirección) y estado de pago.

ParameterWhereDescription
idrequiredpathId del pedido.

Example

curl -s "https://app.iknal.mx/api/v1/orders/<id>" \
  -H "Authorization: Bearer $IKNAL_API_KEY"

Response · 200

{
  "data": {
    "id": "4a3f2e1d-0c9b-4a8f-7e6d-5c4b3a2f1e0d",
    "folio": 37,
    "status": "nuevo",
    "payment_status": "pendiente",
    "payment_method": "contra_entrega",
    "fulfillment": "domicilio",
    "delivery_address": "Av. Juárez 120, Centro. Portón verde.",
    "delivery_zone": "Centro",
    "currency": "MXN",
    "subtotal_cents": 39800,
    "shipping_cents": 3000,
    "total_cents": 42800,
    "notes": null,
    "source": "whatsapp",
    "contact_id": "5b0c7f3e-1f2a-4c1d-9f0e-2a3b4c5d6e7f",
    "items": [
      {
        "product_id": "6e5d4c3b-2a1f-4e0d-9c8b-7a6f5e4d3c2b",
        "variant_id": "5d4c3b2a-1f0e-4d9c-8b7a-6f5e4d3c2b1a",
        "name": "Playera básica",
        "variant_name": "Talla M",
        "sku": "PLY-001-M",
        "quantity": 2,
        "unit_price_cents": 19900,
        "line_total_cents": 39800
      }
    ],
    "created_at": "2026-11-11T15:04:05.000Z",
    "updated_at": "2026-11-11T15:04:05.000Z",
    "paid_at": null,
    "delivered_at": null,
    "cancelled_at": null
  }
}

Invoices

The detailed description of each endpoint and its parameters is in Spanish for now; the examples and field names are the same in any language.

OperationPermissionWhat it does
GET /v1/invoicesread:invoicesList CFDI invoices

GET/v1/invoices

Facturas que el negocio emitió con su PAC desde Iknal (de un cobro o la global a público en general), de la más reciente a la más antigua. Del receptor solo se publica el RFC enmascarado. Para enterarte al momento suscríbete a los webhooks `invoice.issued` e `invoice.cancelled`; el XML y el PDF se descargan del PAC con el `uuid`.

ParameterWhereDescription
statusquery`issuing`, `valid`, `cancellation_pending`, `cancelled` o `failed`.
kindquery`nominativa` o `global`.
payment_idquerySolo las que cubren ese cobro.
contact_idquerySolo las de un contacto.
updated_sincequeryISO 8601: solo las modificadas desde ese instante.
limitqueryTamaño de página (1-200). Por defecto 50.
cursorqueryCursor opaco de la página siguiente (`pagination.next_cursor`).

Example

curl -s "https://app.iknal.mx/api/v1/invoices?limit=50&cursor=MjAyNi0wOC0xOVQxMDowMDowMFp8YWJj" \
  -H "Authorization: Bearer $IKNAL_API_KEY"

Response · 200

{
  "data": [
    {
      "id": "6f5e4d3c-2b1a-4c0d-9e8f-7a6b5c4d3e2f",
      "kind": "nominativa",
      "status": "valid",
      "cancellation_status": "none",
      "uuid": "39c85a3f-275b-4341-b259-e8971d9f8a94",
      "series": "A",
      "folio_number": 128,
      "currency": "MXN",
      "subtotal_cents": 43103,
      "tax_cents": 6897,
      "total_cents": 50000,
      "payment_form": "04",
      "payment_method": "PUE",
      "receptor_rfc_masked": "PEGA••••••Q12",
      "payment_ids": [
        "2d1c0b9a-8f7e-4d6c-5b4a-3f2e1d0c9b8a"
      ],
      "contact_id": "c1a2b3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
      "global": null,
      "livemode": true,
      "issued_by": "agent",
      "issued_at": "2026-11-12T16:20:00.000Z",
      "cancellation_motive": null,
      "cancelled_at": null,
      "created_at": "2026-11-12T16:19:58.000Z",
      "updated_at": "2026-11-12T16:20:00.000Z"
    }
  ],
  "pagination": {
    "next_cursor": null,
    "limit": 50
  }
}