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

# POST /v1/meet/meetings

> Book a meeting on an open slot: assigns the host, creates the calendar event with the video link and invitation, and schedules the reminders.

Books a meeting. Keebai checks the slot again, assigns the host, creates the event on the host's calendar with the video link, invites the customer and the guests, schedules the [reminders](https://docs.keebai.com/dev/meet/overview.md#reminders), and adds the meeting to the CRM timeline when you pass a `chat_user_id` or `ticket_id` and the contact has an open ticket.

The meeting is recorded with `source: "public"` and `created_by` set to the owner of the token. You never send either one.

## Endpoint

```
POST https://api.keebai.com/v1/meet/meetings
```

## Required scope

`meet:meetings:create`

## Headers

| Header | Required | Value |
| - | - | - |
| `Authorization` | Yes | `Bearer kbai_pk_<token>` |
| `Content-Type` | Yes | `application/json` |
| `Idempotency-Key` | Yes | Up to 128 letters, digits, `-` or `_`. A retry with the same key and body returns the meeting already booked. |

## Body

| Field | Type | Required | Description |
| - | - | - | - |
| `type_id` | `string` | Yes | Meeting type. |
| `start` | `string` | Yes | Slot start, ISO 8601 with `Z` or an offset. Use a `start` from [availability](https://docs.keebai.com/dev/endpoints/meet-availability.md) unchanged. |
| `host_user_id` | `string` | No | Pin a host. Omit it and the type's assignment picks one. |
| `customer.name` | `string` | Yes | Customer name, shown in the invitation (max 120). |
| `customer.email` | `string` | No | Receives the calendar invitation and email reminders. |
| `customer.phone` | `string` | No | International format, such as `+56912345678`. Used for WhatsApp reminders. |
| `customer.chat_user_id` | `string` | No | The customer's chat in Keebai. |
| `customer.customer_id` | `string` | No | The CRM customer. |
| `customer.ticket_id` | `string` | No | CRM ticket whose timeline gets the meeting. |
| `invitee_emails` | `string[]` | No | Extra guests' emails, at most 20, without repeats. |

## Example request

```bash curl theme={"system"}
curl -X POST https://api.keebai.com/v1/meet/meetings \
  -H "Authorization: Bearer kbai_pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: lead-8841-demo" \
  -d '{
    "type_id": "6731a2b3c4d5e6f7a8b9c0d1",
    "start": "2026-11-16T14:00:00.000Z",
    "customer": {
      "name": "Lucía Fernández",
      "email": "lucia@empresa.example",
      "phone": "+56912345678"
    }
  }'
```

```python Python theme={"system"}
import os, requests

resp = requests.post(
    "https://api.keebai.com/v1/meet/meetings",
    headers={
        "Authorization": f"Bearer {os.environ['KEEBAI_API_TOKEN']}",
        "Idempotency-Key": f"lead-{lead_id}-demo",
    },
    json={
        "type_id": type_id,
        "start": slot["start"],
        "customer": {"name": "Lucía Fernández", "email": "lucia@empresa.example"},
    },
    timeout=20,
)
resp.raise_for_status()
meeting = resp.json()
```

## Response

### 201 Created

```json theme={"system"}
{
  "id": "6735f1e2d3c4b5a697887766",
  "type_id": "6731a2b3c4d5e6f7a8b9c0d1",
  "type_name": "Demo de 30 minutos",
  "host_user_id": "66c1d2e3f4a5b6c7d8e9f0a2",
  "host_name": "Pedro Rojas",
  "co_host_user_ids": [],
  "customer": {
    "name": "Lucía Fernández",
    "email": "lucia@empresa.example",
    "phone": "+56912345678"
  },
  "invitee_emails": [],
  "start": "2026-11-16T14:00:00.000Z",
  "end": "2026-11-16T14:30:00.000Z",
  "time_zone": "America/Santiago",
  "meet_url": "https://meet.google.com/abc-defg-hij",
  "status": "scheduled",
  "source": "public",
  "created_by": { "kind": "user", "id": "66c1d2e3f4a5b6c7d8e9f0a9", "name": "ventas@empresa.example" },
  "reminders": [
    { "key": "booked", "audience": "customer", "channel": "email", "scheduled_at": "2026-11-13T18:02:11.000Z", "status": "scheduled" },
    { "key": "24h", "audience": "customer", "channel": "whatsapp", "scheduled_at": "2026-11-15T14:00:00.000Z", "status": "scheduled" },
    { "key": "1h", "audience": "customer", "channel": "whatsapp", "scheduled_at": "2026-11-16T13:00:00.000Z", "status": "scheduled" },
    { "key": "15m", "audience": "team", "channel": "push", "scheduled_at": "2026-11-16T13:45:00.000Z", "status": "scheduled" }
  ],
  "created_at": "2026-11-13T18:02:10.000Z",
  "updated_at": "2026-11-13T18:02:10.000Z"
}
```

`created_by.name` is the name of the token owner when the token carries it, and their email otherwise. A company token that belongs to no person is recorded as `API`, with the token id.

### 400 Bad Request

A missing or invalid `Idempotency-Key` (`IDEMPOTENCY_KEY_REQUIRED`), a `start` without a zone, a field that is not an ObjectId, or fields the API does not accept, such as `company`, `source`, or `created_by`.

### 404 Not Found

`MEETING_TYPE_NOT_FOUND`: the type does not exist in your company.

### 409 Conflict

```json theme={"system"}
{
  "error": {
    "code": "SLOT_NOT_AVAILABLE",
    "message": "El horario ya no está disponible."
  }
}
```

| Code | What to do |
| - | - |
| `SLOT_NOT_AVAILABLE` | Someone took the slot. Query availability again and offer the new options. |
| `NO_HOST_AVAILABLE` | No host can take that slot. Offer another one. |
| `IDEMPOTENCY_KEY_IN_PROGRESS` | The first request with this `Idempotency-Key` is still running. Wait a moment and retry with the same key and body: you get that booking, not a second one. |
| `IDEMPOTENCY_KEY_MISMATCH` | The `Idempotency-Key` was already used with a different body. Use a new key for a different booking. |

### 422 Unprocessable Entity

`HOST_CALENDAR_NOT_CONNECTED`: the host has no calendar connected in Keebai, so the event cannot be created. Someone on your team has to connect it under **Meet › People**.

### 503 Service Unavailable

Retryable: the response carries `error.details.retryable: true` and nothing was written. Retry in a few seconds with the same slot and the same `Idempotency-Key`.

| Code | When |
| - | - |
| `MEETING_LOCK_UNAVAILABLE` | Another booking or change for the same host is in progress. |
| `HOST_CALENDAR_UNAVAILABLE` | The host's calendar is connected but could not be read right now. This is not `HOST_CALENDAR_NOT_CONNECTED`, and it does not mean the slot is taken. |

### 401 Unauthorized · 403 Forbidden

Same semantics as the rest of the public API.


## OpenAPI

````yaml POST /v1/meet/meetings
openapi: 3.0.0
info:
  title: Keebai Public API
  description: Superficie pública REST autenticada con Personal Access Tokens (PAT).
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.keebai.com
    description: Production
security: []
tags: []
paths:
  /v1/meet/meetings:
    post:
      tags:
        - meet
      summary: Agendar una reunión
      description: >-
        Valida el horario otra vez, asigna la persona, crea el evento con la
        videollamada e invitados y programa los recordatorios. Repetir la
        llamada con el mismo `Idempotency-Key` devuelve la misma reunión.
      operationId: PublicMeetController_create
      parameters:
        - name: idempotency-key
          required: true
          in: header
          schema:
            type: string
        - name: Idempotency-Key
          in: header
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MeetingCreateDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicMeetingResponseDto'
      security:
        - PAT: []
components:
  schemas:
    MeetingCreateDto:
      type: object
      properties:
        type_id:
          type: string
          description: Tipo de reunión (ObjectId).
        start:
          type: string
          description: >-
            Inicio, ISO 8601 con zona (ej. `2026-11-16T14:00:00.000Z`). Debe ser
            un horario devuelto por la disponibilidad.
          example: '2026-11-16T14:00:00.000Z'
        host_user_id:
          type: string
          description: >-
            Persona que atiende. Si se omite, la asigna el reparto del tipo de
            reunión.
        customer:
          $ref: '#/components/schemas/MeetingCustomerDto'
        invitee_emails:
          description: Correos de invitados adicionales, sin repetir (máximo 20).
          type: array
          items:
            type: string
      required:
        - type_id
        - start
        - customer
    PublicMeetingResponseDto:
      type: object
      properties:
        id:
          type: string
          description: ObjectId de la reunión
        type_id:
          type: string
          description: >-
            Tipo de reunión. No viene en las reuniones importadas del calendario
            conectado (`source: calendar`).
        type_name:
          type: string
          description: Nombre del tipo; vacío en las importadas del calendario.
        title:
          type: string
          description: >-
            Título del evento del calendario; solo en las importadas (`source:
            calendar`).
        host_user_id:
          type: string
        host_name:
          type: string
        co_host_user_ids:
          description: >-
            Resto de las personas que atienden cuando el reparto es `collective`
            (auth_users._id).
          type: array
          items:
            type: string
        customer:
          $ref: '#/components/schemas/PublicMeetingCustomerDto'
        invitee_emails:
          type: array
          items:
            type: string
        start:
          type: string
          format: date-time
        end:
          type: string
          format: date-time
        time_zone:
          type: string
          example: America/Santiago
        meet_url:
          type: string
          description: Enlace de la videollamada
        location:
          type: string
          description: Lugar del evento importado del calendario
        status:
          type: string
          enum:
            - scheduled
            - confirmed
            - rescheduled
            - cancelled
            - completed
            - no_show
        source:
          type: string
          enum:
            - agent
            - manual
            - public
            - calendar
          description: >-
            `calendar`: evento creado fuera de Keebai en el calendario conectado
            e importado; se mueve o cancela desde el calendario (reagendar o
            cancelar acá responde 409 `MEETING_MANAGED_IN_CALENDAR`).
        created_by:
          $ref: '#/components/schemas/PublicMeetingCreatedByDto'
        reminders:
          type: array
          items:
            $ref: '#/components/schemas/PublicMeetingReminderDto'
        confirmed_at:
          type: string
          format: date-time
        cancelled_at:
          type: string
          format: date-time
        cancel_reason:
          type: string
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - id
        - type_name
        - host_user_id
        - host_name
        - co_host_user_ids
        - customer
        - invitee_emails
        - start
        - end
        - time_zone
        - status
        - source
        - reminders
    MeetingCustomerDto:
      type: object
      properties:
        name:
          type: string
          description: Nombre del cliente, va en la invitación.
        email:
          type: string
          description: 'Correo del cliente: recibe la invitación del calendario.'
        phone:
          type: string
          description: Teléfono en formato internacional, ej. +56912345678.
        chat_user_id:
          type: string
          description: Cliente del chat (ObjectId).
        customer_id:
          type: string
          description: Cliente del CRM (ObjectId).
        ticket_id:
          type: string
          description: Ticket del CRM; la reunión queda en su línea de tiempo (ObjectId).
      required:
        - name
    PublicMeetingCustomerDto:
      type: object
      properties:
        name:
          type: string
        email:
          type: string
        phone:
          type: string
        chat_user_id:
          type: string
        customer_id:
          type: string
        ticket_id:
          type: string
      required:
        - name
    PublicMeetingCreatedByDto:
      type: object
      properties:
        kind:
          type: string
          enum:
            - agent
            - user
            - calendar
        id:
          type: string
        name:
          type: string
      required:
        - kind
        - id
        - name
    PublicMeetingReminderDto:
      type: object
      properties:
        key:
          type: string
          example: 24h
        audience:
          type: string
          enum:
            - customer
            - team
          description: 'A quién va: el cliente, o la persona que atiende (aviso del equipo).'
        channel:
          type: string
          enum:
            - whatsapp
            - email
            - push
        scheduled_at:
          type: string
          format: date-time
        status:
          type: string
          enum:
            - scheduled
            - sent
            - failed
            - skipped
        sent_at:
          type: string
          format: date-time
        reason:
          type: string
      required:
        - key
        - audience
        - channel
        - scheduled_at
        - status
  securitySchemes:
    PAT:
      scheme: bearer
      bearerFormat: kbai_pk_<hex>
      type: http
      description: >-
        Personal Access Token con prefijo `kbai_pk_`. Generar desde el portal
        con permiso `developer.manage_tokens`.

````

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