Gerar API Key
5 minutos

Quick Start

Do contexto ao agendamento.

1

Gere sua API Key

No App Kóden, acesse Configurações > Developer Hub e crie uma chave com escopos de booking.

2

Consulte unidades

Escolha a unidade que o chatbot deve operar.

3

Consulte serviços

Mostre apenas serviços ativos e permitidos.

4

Consulte profissionais

Filtre por unidade e serviço quando necessário.

5

Consulte horários

Use disponibilidade antes de confirmar com o cliente.

6

Crie o agendamento

Envie external_reference para evitar duplicidade.

bash
API_KEY="YOUR_API_KEY"
BASE_URL="https://app.kodenoficial.com.br/api/integrations/v1"

curl -H "X-BarberHub-Api-Key: $API_KEY" "$BASE_URL/context"

curl -H "X-BarberHub-Api-Key: $API_KEY" "$BASE_URL/units"

curl -H "X-BarberHub-Api-Key: $API_KEY" \
  "$BASE_URL/services?unit_id=UNIT_ID"

curl -H "X-BarberHub-Api-Key: $API_KEY" \
  "$BASE_URL/barbers?unit_id=UNIT_ID&service_id=SERVICE_ID"

curl -H "X-BarberHub-Api-Key: $API_KEY" \
  "$BASE_URL/availability?unit_id=UNIT_ID&service_id=SERVICE_ID&barber_id=BARBER_ID&date=2026-07-10"

curl -X POST "$BASE_URL/appointments" \
  -H "Content-Type: application/json" \
  -H "X-BarberHub-Api-Key: $API_KEY" \
  -d '{
    "unit_id": "UNIT_ID",
    "service_id": "SERVICE_ID",
    "barber_id": "BARBER_ID",
    "starts_at": "2026-07-10T10:00:00",
    "client": {
      "name": "Cliente Exemplo",
      "phone": "+5511999999999",
      "email": "cliente@example.com"
    },
    "external_reference": "whatsapp-5511999999999-20260710"
  }'