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

# Criar Agendamento

> Cria um agendamento. Se a loja tiver Google Calendar/Outlook conectado (Nylas), o evento é sincronizado automaticamente. Requer tier `starter` ou superior.



## OpenAPI

````yaml POST /appointments
openapi: 3.1.0
info:
  title: Cordialy API
  description: >-
    API pública para integração com a plataforma Cordialy de atendimento via
    WhatsApp com IA.
  version: 1.0.0
  contact:
    email: suporte@cordialy.ai
servers:
  - url: https://api.cordialy.ai/integrations/v1
    description: Produção
security:
  - ApiKeyAuth: []
paths:
  /appointments:
    post:
      tags:
        - Agendamentos
      summary: Criar agendamento
      description: >-
        Cria um agendamento. Se a loja tiver Google Calendar/Outlook conectado
        (Nylas), o evento é sincronizado automaticamente. Requer tier `starter`
        ou superior.
      operationId: createAppointment
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - title
                - scheduled_at
              properties:
                title:
                  type: string
                  example: Consulta com João Silva
                scheduled_at:
                  type: string
                  format: date-time
                duration_minutes:
                  type: integer
                  default: 60
                notes:
                  type: string
                  nullable: true
                lead_id:
                  type: string
                  format: uuid
                  nullable: true
                  description: Vincula o agendamento a um lead existente da loja
      responses:
        '201':
          description: Agendamento criado com sucesso
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Appointment'
        '400':
          description: Dados inválidos
        '404':
          description: Lead não encontrado
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: >-
        Chave opcional para evitar duplicação em retries de rede. Se a mesma
        chave for reenviada para o mesmo endpoint dentro de 24h, a resposta
        original é retornada (sem repetir o efeito colateral), com o header
        `Idempotent-Replay: true`.
      schema:
        type: string
  schemas:
    Appointment:
      type: object
      properties:
        id:
          type: string
          format: uuid
        store_id:
          type: string
          format: uuid
        lead_id:
          type: string
          format: uuid
          nullable: true
        title:
          type: string
          description: Título/assunto do agendamento
        scheduled_at:
          type: string
          format: date-time
        duration_minutes:
          type: integer
        status:
          type: string
          enum:
            - scheduled
            - done
            - cancelled
            - no_show
        notes:
          type: string
          nullable: true
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Chave de API gerada na plataforma em Integrações → API Keys

````