> ## 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/scheduling/appointments/:id/confirm

> Confirm an appointment, moving it from pending to confirmed. Returns 409 if the appointment isn't in pending.

Moves the appointment from `pending` to `confirmed`. The call reads the current appointment first and rejects with `409` if the state isn't `pending` (you can't confirm an appointment that's already confirmed, completed, or cancelled).

## Endpoint

```
POST https://api.keebai.com/v1/scheduling/appointments/:id/confirm
```

## Required scope

`scheduling:appointments:confirm`

## Path params

| Param | Type     | Description     |
| ----- | -------- | --------------- |
| `id`  | `string` | Appointment id. |

## Headers

| Header          | Required | Value                    |
| --------------- | -------- | ------------------------ |
| `Authorization` | Yes      | `Bearer kbai_pk_<token>` |

No body required.

## Example request

```bash theme={null}
curl -X POST https://api.keebai.com/v1/scheduling/appointments/9d5b1f4e-7c2a-4a4d-9d3e-9f1b1f8c7a3a/confirm \
  -H "Authorization: Bearer kbai_pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
```

## Response

### 200 OK

Returns the appointment with `status: "confirmed"`. Shape identical to the body of [`GET /appointments/:id`](/dev/endpoints/scheduling-appointment-get).

### 409 Conflict

```json theme={null}
{
  "error": {
    "code": "INVALID_APPOINTMENT_STATE",
    "message": "Sólo se puede confirmar una cita en estado 'pending' (estado actual: 'confirmed')."
  }
}
```

### 404 Not Found

The appointment doesn't exist or belongs to another company.

### 401 Unauthorized · 403 Forbidden

Same semantics as the rest of the public API.


## OpenAPI

````yaml POST /v1/scheduling/appointments/{id}/confirm
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/scheduling/appointments/{id}/confirm:
    post:
      tags:
        - scheduling-appointments
      summary: Confirmar una cita
      description: >-
        Sólo permite confirmar citas en estado `pending`. Devuelve 409 en caso
        contrario.
      operationId: PublicAppointmentsController_confirm
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicAppointmentResponseDto'
      security:
        - PAT: []
components:
  schemas:
    PublicAppointmentResponseDto:
      type: object
      properties:
        _id:
          type: string
          description: Id de la cita
        appointment_number:
          type: number
          description: Correlativo legible de la cita
        branch:
          $ref: '#/components/schemas/PublicAppointmentRefDto'
        service:
          $ref: '#/components/schemas/PublicAppointmentRefDto'
        professional:
          $ref: '#/components/schemas/PublicAppointmentProfessionalDto'
        customer:
          $ref: '#/components/schemas/PublicAppointmentCustomerDto'
        dates:
          $ref: '#/components/schemas/PublicAppointmentDatesDto'
        appointment_type:
          type: string
          description: online | in-person
        status:
          type: string
          description: pending | confirmed | cancelled | …
        payment_status:
          type: string
          description: Estado del pago
        notes:
          type: string
        price:
          type: number
        currency:
          type: string
          description: Moneda ISO 4217
        paid:
          type: boolean
        cancelled_at:
          type: string
          format: date-time
        cancellation_reason:
          type: string
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - _id
        - branch
        - dates
        - status
    PublicAppointmentRefDto:
      type: object
      properties:
        id:
          type: string
        display_name:
          type: string
      required:
        - id
    PublicAppointmentProfessionalDto:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        last_name:
          type: string
        specialty:
          type: string
      required:
        - id
    PublicAppointmentCustomerDto:
      type: object
      properties:
        name:
          type: string
        last_name:
          type: string
        email:
          type: string
        phone:
          type: string
      required:
        - name
    PublicAppointmentDatesDto:
      type: object
      properties:
        start:
          type: string
          format: date-time
        end:
          type: string
          format: date-time
        time_zone:
          type: string
          description: IANA, ej. America/Santiago
      required:
        - start
        - end
  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`.

````