{"openapi":"3.1.0","info":{"title":"Calendsk API","version":"1.0.0","description":"API da agenda do Calendsk para bots de atendimento (WhatsApp e outros canais). Com uma API key do negócio, o bot lê serviços e horários livres e cria, remarca, cancela e confirma agendamentos. Limite de 120 requisições por minuto por API key. Datas e horas em ISO 8601; campos `*_local` e `local_time` já estão no fuso do negócio. O mesmo conjunto de operações existe como servidor MCP em `/api/mcp`."},"servers":[{"url":"https://calendsk.com.br/api/v1"}],"security":[{"bearerAuth":[]},{"apiKeyHeader":[]}],"tags":[{"name":"Negócio","description":"Dados do negócio dono da API key."},{"name":"Horários","description":"Horários livres para agendar."},{"name":"Agendamentos","description":"Criar, consultar, remarcar, cancelar e confirmar."}],"paths":{"/business":{"get":{"tags":["Negócio"],"operationId":"getBusiness","summary":"Negócio, serviços e profissionais","description":"Serviços ativos, profissionais, fuso, data e hora de agora no fuso do negócio e o limite mensal. Permissão mínima da API key: `read`.","responses":{"200":{"description":"Negócio da API key.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Business"}},"required":["success","data"]}}}},"401":{"description":"`UNAUTHORIZED`: API key ausente, inválida ou revogada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`RATE_LIMITED`: Muitas requisições. Aguarde e tente novamente.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`INTERNAL_ERROR`: Erro interno. Tente novamente em instantes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/usage":{"get":{"tags":["Negócio"],"operationId":"getUsage","summary":"Uso do limite mensal","description":"Quantos agendamentos já foram criados neste mês e quando o limite renova. Permissão mínima da API key: `read`.","responses":{"200":{"description":"Uso do mês.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Usage"}},"required":["success","data"]}}}},"401":{"description":"`UNAUTHORIZED`: API key ausente, inválida ou revogada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`RATE_LIMITED`: Muitas requisições. Aguarde e tente novamente.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`INTERNAL_ERROR`: Erro interno. Tente novamente em instantes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/slots":{"get":{"tags":["Horários"],"operationId":"getSlots","summary":"Horários livres de um serviço","description":"Horários livres dia a dia, a partir de `date`, só no futuro. Use o `starts_at` devolvido aqui para criar ou remarcar. Permissão mínima da API key: `read`.","parameters":[{"name":"service_id","in":"query","required":true,"schema":{"type":"string","format":"uuid"},"description":"Serviço (de `/business`)."},{"name":"date","in":"query","schema":{"type":"string","format":"date"},"description":"Primeiro dia, `AAAA-MM-DD`, no fuso do negócio. Padrão: hoje."},{"name":"days","in":"query","schema":{"type":"integer","minimum":1,"maximum":14,"default":1},"description":"Quantos dias a partir de `date` (1 a 14)."},{"name":"professional_id","in":"query","schema":{"type":"string","format":"uuid"},"description":"Só horários deste profissional. Sem ele, qualquer profissional que atenda o serviço."}],"responses":{"200":{"description":"Horários livres.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Slots"}},"required":["success","data"]}}}},"400":{"description":"`VALIDATION_ERROR`: Dados inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`UNAUTHORIZED`: API key ausente, inválida ou revogada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`SERVICE_UNAVAILABLE`: Este serviço não está disponível. · `PROFESSIONAL_UNAVAILABLE`: Este profissional não está disponível.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`RATE_LIMITED`: Muitas requisições. Aguarde e tente novamente.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`INTERNAL_ERROR`: Erro interno. Tente novamente em instantes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/bookings":{"get":{"tags":["Agendamentos"],"operationId":"listBookings","summary":"Listar agendamentos","description":"Agendamentos em ordem de horário. Filtre por `customer_phone` para achar os agendamentos de quem está falando com o bot. Permissão mínima da API key: `read`.","parameters":[{"name":"from","in":"query","schema":{"type":"string","format":"date-time"},"description":"Início do período (inclusive)."},{"name":"to","in":"query","schema":{"type":"string","format":"date-time"},"description":"Fim do período (exclusivo)."},{"name":"status","in":"query","schema":{"type":"string","enum":["confirmed","cancelled"]},"description":"Sem ele, os dois."},{"name":"professional_id","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"customer_phone","in":"query","schema":{"type":"string"},"description":"Celular do cliente com DDD (ex.: `+5581999990000`)."},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0},"description":"Use `next_offset` da página anterior."}],"responses":{"200":{"description":"Página de agendamentos.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/BookingList"}},"required":["success","data"]}}}},"400":{"description":"`VALIDATION_ERROR`: Dados inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`UNAUTHORIZED`: API key ausente, inválida ou revogada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`RATE_LIMITED`: Muitas requisições. Aguarde e tente novamente.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`INTERNAL_ERROR`: Erro interno. Tente novamente em instantes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Agendamentos"],"operationId":"createBooking","summary":"Criar agendamento","description":"Cria um agendamento confirmado e consome 1 do limite mensal. Informe `customer_phone` ou `customer_email`. Sem `professional_id`, o Calendsk escolhe um profissional livre. Com celular válido e `sends_reminders` ligado em `/business`, o cliente recebe o lembrete por WhatsApp até 24 h antes. Permissão mínima da API key: `write`.","parameters":[{"name":"Idempotency-Key","in":"header","schema":{"type":"string","pattern":"^[A-Za-z0-9_.:-]{8,100}$"},"description":"Repetir com a mesma chave devolve o mesmo agendamento (200 + `Idempotent-Replayed: true`), sem criar outro nem consumir o limite. Também aceito como `idempotency_key` no corpo."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBooking"}}}},"responses":{"200":{"description":"Repetição com a mesma chave de idempotência: o agendamento original.","headers":{"Idempotent-Replayed":{"schema":{"type":"string","const":"true"},"description":"Presente quando a resposta é uma repetição."}},"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Booking"}},"required":["success","data"]}}}},"201":{"description":"Agendamento criado.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Booking"}},"required":["success","data"]}}}},"400":{"description":"`VALIDATION_ERROR`: Dados inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`UNAUTHORIZED`: API key ausente, inválida ou revogada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`QUOTA_EXCEEDED`: Limite mensal de agendamentos atingido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`SCOPE_REQUIRED`: Esta operação exige uma API key com permissão write.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`SLOT_TAKEN`: Este horário acabou de ser ocupado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`SLOT_IN_PAST`: Este horário já passou. · `OUTSIDE_AVAILABILITY`: Horário fora da disponibilidade do profissional. · `SERVICE_UNAVAILABLE`: Este serviço não está disponível. · `PROFESSIONAL_UNAVAILABLE`: Este profissional não está disponível.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`RATE_LIMITED`: Muitas requisições. Aguarde e tente novamente.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`INTERNAL_ERROR`: Erro interno. Tente novamente em instantes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/bookings/{id}":{"get":{"tags":["Agendamentos"],"operationId":"getBooking","summary":"Ver agendamento","description":"Permissão mínima da API key: `read`.","parameters":[{"name":"id","in":"path","required":true,"description":"Id (uuid) ou código curto do agendamento (ex.: `A1B2C3D4`).","schema":{"type":"string"}}],"responses":{"200":{"description":"Agendamento.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Booking"}},"required":["success","data"]}}}},"401":{"description":"`UNAUTHORIZED`: API key ausente, inválida ou revogada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`NOT_FOUND`: Registro não encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`RATE_LIMITED`: Muitas requisições. Aguarde e tente novamente.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`INTERNAL_ERROR`: Erro interno. Tente novamente em instantes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/bookings/{id}/reschedule":{"post":{"tags":["Agendamentos"],"operationId":"rescheduleBooking","summary":"Remarcar agendamento","description":"Muda o horário (e, se quiser, o profissional). É o mesmo agendamento: não consome o limite mensal. Permissão mínima da API key: `write`.","parameters":[{"name":"id","in":"path","required":true,"description":"Id (uuid) ou código curto do agendamento (ex.: `A1B2C3D4`).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"starts_at":{"type":"string","description":"Novo início, como veio em `/slots`.","format":"date-time"},"professional_id":{"type":["string","null"],"description":"Novo profissional. Sem ele, mantém o atual.","format":"uuid"},"force":{"type":"boolean","description":"`true` ignora o prazo de cancelamento/remarcação do negócio (`cancel_window_hours`). Padrão `false`."}},"required":["starts_at"]}}}},"responses":{"200":{"description":"Agendamento remarcado.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Booking"}},"required":["success","data"]}}}},"400":{"description":"`VALIDATION_ERROR`: Dados inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`UNAUTHORIZED`: API key ausente, inválida ou revogada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`SCOPE_REQUIRED`: Esta operação exige uma API key com permissão write.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`NOT_FOUND`: Registro não encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`SLOT_TAKEN`: Este horário acabou de ser ocupado. · `WINDOW_CLOSED`: O prazo para o cliente alterar este agendamento já passou. · `ALREADY_CANCELLED`: Este agendamento já foi cancelado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`SLOT_IN_PAST`: Este horário já passou. · `OUTSIDE_AVAILABILITY`: Horário fora da disponibilidade do profissional. · `PROFESSIONAL_UNAVAILABLE`: Este profissional não está disponível.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`RATE_LIMITED`: Muitas requisições. Aguarde e tente novamente.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`INTERNAL_ERROR`: Erro interno. Tente novamente em instantes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/bookings/{id}/cancel":{"post":{"tags":["Agendamentos"],"operationId":"cancelBooking","summary":"Cancelar agendamento","description":"Cancela e libera o horário. Por padrão vale o prazo do negócio. Permissão mínima da API key: `write`.","parameters":[{"name":"id","in":"path","required":true,"description":"Id (uuid) ou código curto do agendamento (ex.: `A1B2C3D4`).","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"force":{"type":"boolean","description":"`true` ignora o prazo de cancelamento/remarcação do negócio (`cancel_window_hours`). Padrão `false`."}},"required":[]}}}},"responses":{"200":{"description":"Agendamento cancelado.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Booking"}},"required":["success","data"]}}}},"400":{"description":"`VALIDATION_ERROR`: Dados inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`UNAUTHORIZED`: API key ausente, inválida ou revogada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`SCOPE_REQUIRED`: Esta operação exige uma API key com permissão write.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`NOT_FOUND`: Registro não encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`WINDOW_CLOSED`: O prazo para o cliente alterar este agendamento já passou. · `ALREADY_CANCELLED`: Este agendamento já foi cancelado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`RATE_LIMITED`: Muitas requisições. Aguarde e tente novamente.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`INTERNAL_ERROR`: Erro interno. Tente novamente em instantes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/bookings/{id}/confirm":{"post":{"tags":["Agendamentos"],"operationId":"confirmBooking","summary":"Confirmar presença","description":"Registra que o cliente confirmou que vai comparecer. Repetir não muda nada. Permissão mínima da API key: `write`.","parameters":[{"name":"id","in":"path","required":true,"description":"Id (uuid) ou código curto do agendamento (ex.: `A1B2C3D4`).","schema":{"type":"string"}}],"responses":{"200":{"description":"Agendamento com `customer_confirmed_at` preenchido.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Booking"}},"required":["success","data"]}}}},"401":{"description":"`UNAUTHORIZED`: API key ausente, inválida ou revogada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`SCOPE_REQUIRED`: Esta operação exige uma API key com permissão write.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`NOT_FOUND`: Registro não encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`ALREADY_CANCELLED`: Este agendamento já foi cancelado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`SLOT_IN_PAST`: Este horário já passou.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`RATE_LIMITED`: Muitas requisições. Aguarde e tente novamente.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`INTERNAL_ERROR`: Erro interno. Tente novamente em instantes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key do negócio (`csk_...`), criada em Ajustes → API e MCP. Permissões: `read`, `write`."},"apiKeyHeader":{"type":"apiKey","in":"header","name":"X-API-Key","description":"Alternativa ao cabeçalho Authorization."}},"schemas":{"Error":{"type":"object","required":["success","code","message"],"properties":{"success":{"type":"boolean","const":false},"code":{"type":"string","enum":["VALIDATION_ERROR","UNAUTHORIZED","SCOPE_REQUIRED","NOT_FOUND","QUOTA_EXCEEDED","SLOT_TAKEN","SLOT_IN_PAST","OUTSIDE_AVAILABILITY","SERVICE_UNAVAILABLE","PROFESSIONAL_UNAVAILABLE","WINDOW_CLOSED","ALREADY_CANCELLED","RATE_LIMITED","INTERNAL_ERROR"],"description":"Código estável: decida o próximo passo por ele, não pelo texto."},"message":{"type":"string","description":"Explicação em português."},"error":{"type":"string","description":"Igual a `message`."},"retry_after":{"type":"integer","description":"Segundos até poder tentar de novo (também no cabeçalho `Retry-After`)."},"details":{"type":"object","description":"Dados extras do erro (campos inválidos, prazo, limite…).","additionalProperties":true}}},"Quota":{"type":"object","properties":{"used":{"type":"integer","description":"Agendamentos criados neste mês."},"limit":{"type":"integer","description":"Limite mensal do plano."},"remaining":{"type":"integer"},"resets_at":{"type":"string","description":"Quando o limite renova.","format":"date-time"}},"required":["used","limit","remaining","resets_at"]},"Service":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"duration_minutes":{"type":"integer"},"price_cents":{"type":["integer","null"],"description":"Preço em centavos; `null` = sem preço informado."}},"required":["id","name","duration_minutes","price_cents"]},"Professional":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"service_ids":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Serviços que este profissional atende."}},"required":["id","name","service_ids"]},"Business":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"slug":{"type":"string","description":"Endereço público do negócio."},"booking_url":{"type":"string","description":"Página pública de agendamento.","format":"uri"},"timezone":{"type":"string","description":"Fuso IANA, ex.: `America/Recife`."},"now":{"type":"object","properties":{"utc":{"type":"string","format":"date-time"},"local_date":{"type":"string","format":"date"},"local_time":{"type":"string","description":"`HH:MM`"},"weekday":{"type":"integer","description":"0 = domingo … 6 = sábado."}},"required":["utc","local_date","local_time","weekday"]},"cancel_window_hours":{"type":"integer","description":"Até quantas horas antes o cliente pode cancelar ou remarcar."},"accepting":{"type":"boolean","description":"`false` = limite do mês atingido; novos agendamentos falham com `QUOTA_EXCEEDED`."},"sends_reminders":{"type":"boolean","description":"`true` = o Calendsk manda o lembrete por WhatsApp (até 24 h antes) para agendamentos criados pela API; `false` = o negócio desligou e o lembrete fica por conta do bot."},"quota":{"$ref":"#/components/schemas/Quota"},"services":{"type":"array","items":{"$ref":"#/components/schemas/Service"}},"professionals":{"type":"array","items":{"$ref":"#/components/schemas/Professional"}}},"required":["id","name","slug","booking_url","timezone","now","cancel_window_hours","accepting","sends_reminders","quota","services","professionals"]},"Usage":{"type":"object","properties":{"bookings":{"$ref":"#/components/schemas/Quota"},"accepting":{"type":"boolean"},"timezone":{"type":"string"}},"required":["bookings","accepting","timezone"]},"Slots":{"type":"object","properties":{"service_id":{"type":"string","format":"uuid"},"professional_id":{"type":["string","null"],"format":"uuid"},"timezone":{"type":"string"},"days":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"weekday":{"type":"integer","description":"0 = domingo … 6 = sábado."},"slots":{"type":"array","items":{"type":"object","properties":{"starts_at":{"type":"string","description":"Use este valor para criar ou remarcar.","format":"date-time"},"local_time":{"type":"string","description":"`HH:MM` no fuso do negócio."},"professional_ids":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Profissionais livres neste horário."}},"required":["starts_at","local_time","professional_ids"]}}},"required":["date","weekday","slots"]}}},"required":["service_id","professional_id","timezone","days"]},"CreateBooking":{"type":"object","required":["service_id","starts_at","customer_name"],"description":"`customer_phone` ou `customer_email` é obrigatório.","properties":{"service_id":{"type":"string","format":"uuid"},"starts_at":{"type":"string","description":"Início, como veio em `/slots`.","format":"date-time"},"customer_name":{"type":"string","minLength":2,"maxLength":80},"customer_phone":{"type":["string","null"],"description":"Celular com DDD. Números brasileiros sem `+55` são aceitos; fica guardado em E.164."},"customer_email":{"type":["string","null"],"format":"email"},"professional_id":{"type":["string","null"],"description":"Sem ele, o Calendsk escolhe um profissional livre.","format":"uuid"},"notes":{"type":["string","null"],"description":"Observação para o negócio. O cliente não vê.","maxLength":500},"idempotency_key":{"type":"string","description":"Alternativa ao cabeçalho `Idempotency-Key`.","pattern":"^[A-Za-z0-9_.:-]{8,100}$"}}},"Booking":{"type":"object","required":["id","code","status","source","starts_at","ends_at","starts_at_local","timezone","service","professional","customer","can_modify","created_at"],"properties":{"id":{"type":"string","format":"uuid"},"code":{"type":"string","description":"Código curto para o cliente guardar."},"status":{"type":"string","enum":["confirmed","cancelled"]},"source":{"type":"string","enum":["public","manual","api"],"description":"`api` = criado pelo bot; `public` = página pública; `manual` = painel."},"starts_at":{"type":"string","format":"date-time"},"ends_at":{"type":"string","format":"date-time"},"starts_at_local":{"type":"string","description":"`AAAA-MM-DDTHH:MM` no fuso do negócio."},"timezone":{"type":"string"},"service":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"duration_minutes":{"type":"integer"}},"required":["id","name","duration_minutes"]},"professional":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]},"customer":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"phone":{"type":["string","null"],"description":"E.164."},"email":{"type":["string","null"]}},"required":["id","name","phone","email"]},"notes":{"type":["string","null"]},"customer_confirmed_at":{"type":["string","null"],"description":"Quando o cliente confirmou presença.","format":"date-time"},"reminder_sent_at":{"type":["string","null"],"description":"Quando o lembrete por WhatsApp saiu.","format":"date-time"},"can_modify":{"type":"boolean","description":"O cliente ainda está no prazo para cancelar ou remarcar."},"created_at":{"type":"string","format":"date-time"},"cancelled_at":{"type":["string","null"],"format":"date-time"},"manage_url":{"type":"string","description":"Link para o cliente ver, remarcar ou cancelar sozinho. Só vem na criação.","format":"uri"},"quota":{"type":"object","properties":{"used":{"type":"integer"},"limit":{"type":"integer"}},"required":["used","limit"]},"idempotent_replay":{"type":"boolean","const":true,"description":"Presente quando a criação foi uma repetição."}}},"BookingList":{"type":"object","properties":{"bookings":{"type":"array","items":{"$ref":"#/components/schemas/Booking"}},"has_more":{"type":"boolean"},"limit":{"type":"integer"},"offset":{"type":"integer"},"next_offset":{"type":["integer","null"],"description":"`offset` da próxima página; `null` na última."}},"required":["bookings","has_more","limit","offset","next_offset"]}}}}