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

# Create a booking

> Books an appointment with the first available provider that offers the requested service in the requested time window.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/scheduling/{business_id}/bookings
openapi: 3.1.0
info:
  title: iZap API
  version: v1
  description: Public REST API for the iZap WhatsApp business messaging platform.
  contact:
    name: iZap API Support
    email: suporte@izap.ai
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: https://api.izap.ai
    description: Production
  - url: https://api-staging.izap.ai
    description: Staging
security:
  - bearerAuth: []
tags:
  - name: Auth
    description: Login and token refresh.
  - name: OAuth
    description: OAuth 2.1 / PKCE authorization for third-party and MCP clients.
  - name: Businesses
    description: Business profile, hours, menus, and chatbot configuration.
  - name: Chats
    description: Conversations, messages, and template sends.
  - name: Scheduling
    description: Customers, services, providers, and bookings (Trinks-backed).
  - name: WhatsApp Templates
    description: Manage and sync WhatsApp message templates.
  - name: Transmissions
    description: Bulk WhatsApp template broadcasts.
  - name: Me
    description: The authenticated user's own profile and active business.
paths:
  /api/v1/scheduling/{business_id}/bookings:
    post:
      tags:
        - Scheduling
      summary: Create a booking
      description: >-
        Books an appointment with the first available provider that offers the
        requested service in the requested time window.
      operationId: createBooking
      parameters:
        - name: business_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BookingCreate'
      responses:
        '200':
          description: Booking created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Booking'
              example:
                id: '501'
                establishment_id: '12'
                provider_id: '7'
                customer_id: '9001'
                service_id: '42'
                start_time: '2026-07-10 14:00:00'
                end_time: '2026-07-10 14:30:00'
                duration: 30
                value: 60
                status: confirmed
        '401':
          description: Missing or invalid credentials.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                detail: Not authenticated
components:
  schemas:
    BookingCreate:
      type: object
      required:
        - establishment_id
        - customer_id
        - service_id
        - start_time
        - duration
        - value
      properties:
        establishment_id:
          type: string
        customer_id:
          type: string
        service_id:
          type: string
        start_time:
          type: string
          format: date-time
        duration:
          type: integer
          description: Minutes.
        value:
          type: number
        resource_type:
          type: string
          nullable: true
    Booking:
      type: object
      properties:
        id:
          type: string
        establishment_id:
          type: string
          nullable: true
        provider_id:
          type: string
          nullable: true
        customer_id:
          type: string
          nullable: true
        service_id:
          type: string
          nullable: true
        start_time:
          type: string
        end_time:
          type: string
          nullable: true
        duration:
          type: integer
        value:
          type: number
        status:
          type: string
          nullable: true
      additionalProperties: true
    Error:
      type: object
      properties:
        detail:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT access token obtained from POST /api/v1/auth/jwt/login, the OAuth
        token endpoint, or a business-scoped API token. Some
        Business/Chat/Template/Scheduling endpoints alternatively accept HTTP
        Basic credentials scoped to the business slug.

````