{
    "openapi": "3.1.0",
    "info": {
        "title": "e-Temsilci API",
        "version": "1.0.0",
        "description": "e-Temsilci REST API. Kimlik doğrulama: Authorization: Bearer et_live_… (Entegrasyonlar → API). Ayrıntılı rehber: https://panel.etemsilci.com/gelistiriciler/api"
    },
    "servers": [
        {
            "url": "https://panel.etemsilci.com/api/v1"
        }
    ],
    "security": [
        {
            "bearerAuth": []
        }
    ],
    "tags": [
        {
            "name": "Arama talepleri",
            "description": "Bir kişiyi bir kampanyanın asistanıyla, belirli bir neden ve bilgilerle arattırın. Talep kişiyi kampanyanın listesine \"yeni\" olarak koyar (önceki denemeler sıfırlanır); arama, kampanyanın ses, arama saatleri, eşzamanlı arama ve tekrar deneme kurallarıyla yapılır. Aynı kişi için aynı kampanyada açık bir talep varsa yeni talep onun yerini alır (eskisi `cancelled`, `superseded`)."
        },
        {
            "name": "Kişiler",
            "description": "Kişileri telefon numarasına göre ekleyin, güncelleyin ve bulun. `campaign_id` ile kişiyi bir kampanyanın arama listesine de koyabilirsiniz (kampanyanın kendi sırasıyla aranır)."
        },
        {
            "name": "Kampanyalar",
            "description": "Kampanyaları listeleyin ve kayıtlı kişileri kampanya listesine ekleyin. Kampanyaların kendisi panelde oluşturulur ve düzenlenir."
        },
        {
            "name": "Görüşmeler",
            "description": "Sonuçlanmış görüşmeleri, yapay zekâ özeti, notları ve sonraki adımıyla çekin. Düzenli çekimde `since` kullanın."
        },
        {
            "name": "Otomasyon",
            "description": "Zapier, Make, n8n, Pabbly ya da Power Automate için anlık tetikleyiciler (REST hooks): akış açılınca `POST /hooks` ile tetikleyici açın, kapanınca `DELETE /hooks/{id}` ile kapatın. Olaylar webhook'larla aynı gövdede, tetikleyicinin kendi imza anahtarıyla gelir. Adresiniz `410 Gone` derse tetikleyici kapatılır; art arda başarısız gönderimlerde durdurulur (`disabled`). Bir anahtar iptal edilince açtığı tetikleyiciler de kapanır. Panelde bunlar **Entegrasyonlar → Webhook → Giden webhook**'ta görünür. Kod yazmadan kişi arattırmak için kampanyanın gelen webhook adresini kullanın (aynı sayfada **Gelen webhook**)."
        }
    ],
    "paths": {
        "/call-requests": {
            "post": {
                "operationId": "callRequestsStore",
                "tags": [
                    "Arama talepleri"
                ],
                "summary": "Arama talebi oluştur",
                "description": "Kişiyi telefonuna göre bulur ya da oluşturur (gönderdiğiniz kişi alanları güncellenir), kampanyanın listesine koyar ve `scheduled_at` zamanında (boşsa hemen) aranmak üzere sıraya alır. Yeni talep `201`, aynı `external_id` ile açık bir talep varsa o talep `200` döner. Kişi aranmayacaklar listesindeyse talep `201` ile ama `blocked` durumunda oluşturulur ve aranmaz.",
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Ağ hatasında isteği güvenle tekrarlamak için benzersiz bir anahtar (en fazla 255 karakter). Bkz. [Tekrarlanan istekler](#idempotency).",
                        "schema": {
                            "type": "string",
                            "description": "Ağ hatasında isteği güvenle tekrarlamak için benzersiz bir anahtar (en fazla 255 karakter). Bkz. [Tekrarlanan istekler](#idempotency).",
                            "maxLength": 255
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "campaign_id": {
                                        "type": "integer",
                                        "description": "Aramayı yapacak kampanya (`GET /campaigns`). Aktif veya duraklatılmış olmalı; asistan, ses, arama saatleri ve tekrar deneme kuralları bu kampanyadan gelir."
                                    },
                                    "phone": {
                                        "type": "string",
                                        "description": "Aranacak numara. `0532…`, `+90532…` veya `532…` biçiminde; yurt dışı numaralar `+` veya `00` ile.",
                                        "maxLength": 32
                                    },
                                    "first_name": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Ad (en fazla 120 karakter). Asistan kişiye adıyla hitap eder.",
                                        "maxLength": 120
                                    },
                                    "last_name": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Soyad (en fazla 120 karakter).",
                                        "maxLength": 120
                                    },
                                    "company": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Firma adı (en fazla 255 karakter).",
                                        "maxLength": 255
                                    },
                                    "email": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "E-posta adresi. Asistan dosya gönderirken kullanabilir.",
                                        "format": "email",
                                        "maxLength": 255
                                    },
                                    "customer_type": {
                                        "type": "string",
                                        "description": "Müşteri tipi; İYS kuralını belirler. Yeni kişide varsayılan `individual`.",
                                        "enum": [
                                            "individual",
                                            "merchant"
                                        ]
                                    },
                                    "iys_status": {
                                        "type": "string",
                                        "description": "Kişinin İYS'deki arama izni. İYS entegrasyonunuz bağlıysa izin İYS'den sorgulanır; değilse bu değer kullanılır. Yeni kişide varsayılan `unchecked` (aranamaz). Bkz. [Uyum](#compliance).",
                                        "enum": [
                                            "unchecked",
                                            "allowed",
                                            "denied",
                                            "not_found"
                                        ]
                                    },
                                    "consent_source": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "İzni nereden aldığınız (en fazla 120 karakter), örneğin \"Abonelik sözleşmesi, 2025-03-12\".",
                                        "maxLength": 120
                                    },
                                    "about": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Kişi hakkında kalıcı bilgi (en fazla 2000 karakter); asistan bu kişiyle her görüşmede kullanır.",
                                        "maxLength": 2000
                                    },
                                    "custom_fields": {
                                        "type": [
                                            "object",
                                            "null"
                                        ],
                                        "additionalProperties": {
                                            "type": [
                                                "string",
                                                "number"
                                            ]
                                        },
                                        "description": "Kişinin özel alanları: ad → metin veya sayı (en fazla 30 alan, değer en fazla 500 karakter). Mevcut alanlarla birleştirilir.",
                                        "maxProperties": 30
                                    },
                                    "reason": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Aramanın nedeni, kısa (en fazla 200 karakter), örneğin \"Fatura hatırlatma\". Asistan görüşmeyi bu amaca göre yürütür.",
                                        "maxLength": 200
                                    },
                                    "instructions": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Yalnızca bu talebin görüşmelerinde asistana verilecek ek talimat (en fazla 2000 karakter). Kampanyanın talimatlarına eklenir, onları değiştirmez.",
                                        "maxLength": 2000
                                    },
                                    "variables": {
                                        "type": [
                                            "object",
                                            "null"
                                        ],
                                        "additionalProperties": {
                                            "type": [
                                                "string",
                                                "number"
                                            ]
                                        },
                                        "description": "Asistanın görüşmede kullanacağı bilgiler: ad → değer (en fazla 30). Adlar küçük harfle başlar, yalnızca `a-z`, `0-9` ve `_` içerir (en fazla 40 karakter); değerler metin veya sayıdır (en fazla 500 karakter) ve metin olarak saklanır. Değerleri müşteriye söylenecek biçimde yazın: `\"1.250,00 TL\"`, `\"10 Ekim\"`.",
                                        "maxProperties": 30
                                    },
                                    "scheduled_at": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "En erken arama zamanı (ISO 8601), en fazla 30 gün sonrası. Boş ya da geçmiş bir zaman \"hemen\" demektir. Zaman arama saatleri dışındaysa arama pencerenin açılışına kayar.",
                                        "format": "date-time"
                                    },
                                    "external_id": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Sisteminizdeki referans (en fazla 100 karakter), örneğin fatura veya müşteri numarası. Aynı `external_id` ile açık bir talep varsa yenisi oluşturulmaz.",
                                        "maxLength": 100
                                    }
                                },
                                "required": [
                                    "campaign_id",
                                    "phone"
                                ]
                            },
                            "example": {
                                "campaign_id": 12,
                                "phone": "05321234567",
                                "first_name": "Ayşe",
                                "last_name": "Yılmaz",
                                "customer_type": "individual",
                                "iys_status": "allowed",
                                "consent_source": "Abonelik sözleşmesi, 2025-03-12",
                                "reason": "Fatura hatırlatma",
                                "instructions": "Son ödeme tarihinin geçtiğini nazikçe hatırlat ve ödeme kanallarını anlat. Kart bilgisi isteme. Müşteri ödediğini söylerse teşekkür edip görüşmeyi kibarca bitir.",
                                "variables": {
                                    "fatura_no": "FTR-2026-1042",
                                    "fatura_tutari": "1.250,00 TL",
                                    "son_odeme_tarihi": "30 Eylül 2026"
                                },
                                "scheduled_at": "2026-10-07T10:30:00+03:00",
                                "external_id": "FTR-2026-1042"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Arama talebi oluştur",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/CallRequest"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": "01k6zq3m8v2c4x7b9n5t1r0wyd",
                                        "status": "queued",
                                        "campaign": {
                                            "id": 12,
                                            "name": "Fatura hatırlatma"
                                        },
                                        "contact": {
                                            "id": 4821,
                                            "phone": "+905321234567",
                                            "name": "Ayşe Yılmaz"
                                        },
                                        "external_id": "FTR-2026-1042",
                                        "reason": "Fatura hatırlatma",
                                        "instructions": "Son ödeme tarihinin geçtiğini nazikçe hatırlat ve ödeme kanallarını anlat. Kart bilgisi isteme. Müşteri ödediğini söylerse teşekkür edip görüşmeyi kibarca bitir.",
                                        "variables": {
                                            "fatura_no": "FTR-2026-1042",
                                            "fatura_tutari": "1.250,00 TL",
                                            "son_odeme_tarihi": "30 Eylül 2026"
                                        },
                                        "scheduled_at": "2026-10-07T07:30:00+00:00",
                                        "attempts": 0,
                                        "next_attempt_at": "2026-10-07T07:30:00+00:00",
                                        "waiting_reason": null,
                                        "blocked_reason": null,
                                        "failure_reason": null,
                                        "outcome": null,
                                        "outcome_label": null,
                                        "last_call": null,
                                        "created_at": "2026-10-06T19:02:11+00:00",
                                        "updated_at": "2026-10-06T19:02:11+00:00",
                                        "completed_at": null
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "`unauthenticated`: API anahtarı yok, hatalı ya da iptal edilmiş.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "`tenant_suspended`: Firmanın hesabı askıya alınmış.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "`contact_busy`: Kişi bu kampanyada şu anda aranıyor (arama kuyrukta ya da görüşme sürüyor)., `request_in_progress`: Aynı `Idempotency-Key` (ya da aynı `external_id`) ile gönderilen ilk istek hâlâ işleniyor.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "`validation_failed`: Bir veya daha fazla alan geçersiz; ayrıntılar `fields` içinde., `campaign_not_ready`: Kampanya taslak ya da tamamlanmış; arama talebi yalnızca aktif veya duraklatılmış kampanyaya verilebilir., `idempotency_key_reused`: Bu `Idempotency-Key` son 24 saatte başka bir istek gövdesiyle kullanılmış.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "`rate_limited`: Anahtar başına dakikada 120 istek sınırı aşıldı.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "get": {
                "operationId": "callRequestsIndex",
                "tags": [
                    "Arama talepleri"
                ],
                "summary": "Arama taleplerini listele",
                "description": "Son değişen önce. Düzenli çekimde son aldığınız talebin `updated_at` değerini bir sonraki istekte `since` olarak kullanın; webhook kullanıyorsanız çekime gerek yoktur.",
                "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "Yalnızca bu durumdaki talepler.",
                        "schema": {
                            "type": "string",
                            "description": "Yalnızca bu durumdaki talepler.",
                            "enum": [
                                "queued",
                                "calling",
                                "retrying",
                                "completed",
                                "failed",
                                "cancelled",
                                "blocked"
                            ]
                        }
                    },
                    {
                        "name": "external_id",
                        "in": "query",
                        "required": false,
                        "description": "Yalnızca bu `external_id` ile açılmış talepler.",
                        "schema": {
                            "type": "string",
                            "description": "Yalnızca bu `external_id` ile açılmış talepler.",
                            "maxLength": 100
                        }
                    },
                    {
                        "name": "campaign_id",
                        "in": "query",
                        "required": false,
                        "description": "Yalnızca bu kampanyanın kayıtları.",
                        "schema": {
                            "type": "integer",
                            "description": "Yalnızca bu kampanyanın kayıtları."
                        }
                    },
                    {
                        "name": "since",
                        "in": "query",
                        "required": false,
                        "description": "Bu zamandan sonra değişen (`updated_at`) talepler.",
                        "schema": {
                            "type": "string",
                            "description": "Bu zamandan sonra değişen (`updated_at`) talepler.",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "En fazla kaç kayıt dönsün (1–100). Varsayılan 25.",
                        "schema": {
                            "type": "integer",
                            "description": "En fazla kaç kayıt dönsün (1–100). Varsayılan 25.",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 25
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Arama taleplerini listele",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/CallRequest"
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": "01k6zq3m8v2c4x7b9n5t1r0wyd",
                                            "status": "completed",
                                            "campaign": {
                                                "id": 12,
                                                "name": "Fatura hatırlatma"
                                            },
                                            "contact": {
                                                "id": 4821,
                                                "phone": "+905321234567",
                                                "name": "Ayşe Yılmaz"
                                            },
                                            "external_id": "FTR-2026-1042",
                                            "reason": "Fatura hatırlatma",
                                            "instructions": "Son ödeme tarihinin geçtiğini nazikçe hatırlat ve ödeme kanallarını anlat. Kart bilgisi isteme. Müşteri ödediğini söylerse teşekkür edip görüşmeyi kibarca bitir.",
                                            "variables": {
                                                "fatura_no": "FTR-2026-1042",
                                                "fatura_tutari": "1.250,00 TL",
                                                "son_odeme_tarihi": "30 Eylül 2026"
                                            },
                                            "scheduled_at": "2026-10-07T07:30:00+00:00",
                                            "attempts": 2,
                                            "next_attempt_at": null,
                                            "waiting_reason": null,
                                            "blocked_reason": null,
                                            "failure_reason": null,
                                            "outcome": "completed",
                                            "outcome_label": "Görüşme yapıldı",
                                            "last_call": {
                                                "id": "01k6zq9h4e2r7s5d3f8g6j1k0m",
                                                "campaign": {
                                                    "id": 12,
                                                    "name": "Fatura hatırlatma"
                                                },
                                                "contact": {
                                                    "id": 4821,
                                                    "phone": "+905321234567",
                                                    "name": "Ayşe Yılmaz"
                                                },
                                                "status": "completed",
                                                "outcome": "completed",
                                                "outcome_label": "Görüşme yapıldı",
                                                "direction": "outbound",
                                                "is_test": false,
                                                "answered_at": "2026-10-07T08:45:02+00:00",
                                                "ended_at": "2026-10-07T08:47:16+00:00",
                                                "duration_seconds": 134,
                                                "summary": "Ayşe Hanım faturayı 9 Ekim'de mobil uygulamadan ödeyeceğini söyledi.",
                                                "notes": "- Ödeme 9 Ekim'de yapılacak\n- Taksit sormadı",
                                                "interest_score": 70,
                                                "next_action": "9 Ekim akşamı ödemeyi kontrol et.",
                                                "callback_at": null,
                                                "finalized_at": "2026-10-07T08:47:40+00:00",
                                                "created_at": "2026-10-07T08:44:31+00:00"
                                            },
                                            "created_at": "2026-10-06T19:02:11+00:00",
                                            "updated_at": "2026-10-07T08:47:40+00:00",
                                            "completed_at": "2026-10-07T08:47:40+00:00"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "`unauthenticated`: API anahtarı yok, hatalı ya da iptal edilmiş.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "`tenant_suspended`: Firmanın hesabı askıya alınmış.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "`validation_failed`: Bir veya daha fazla alan geçersiz; ayrıntılar `fields` içinde.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "`rate_limited`: Anahtar başına dakikada 120 istek sınırı aşıldı.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/call-requests/{id}": {
            "get": {
                "operationId": "callRequestsShow",
                "tags": [
                    "Arama talepleri"
                ],
                "summary": "Arama talebini getir",
                "description": "Talebin güncel durumu, deneme sayısı, bir sonraki deneme zamanı ve son görüşmesi (özetiyle).",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Arama talebinin kimliği.",
                        "schema": {
                            "type": "string",
                            "description": "Arama talebinin kimliği."
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Arama talebini getir",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/CallRequest"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": "01k6zq3m8v2c4x7b9n5t1r0wyd",
                                        "status": "completed",
                                        "campaign": {
                                            "id": 12,
                                            "name": "Fatura hatırlatma"
                                        },
                                        "contact": {
                                            "id": 4821,
                                            "phone": "+905321234567",
                                            "name": "Ayşe Yılmaz"
                                        },
                                        "external_id": "FTR-2026-1042",
                                        "reason": "Fatura hatırlatma",
                                        "instructions": "Son ödeme tarihinin geçtiğini nazikçe hatırlat ve ödeme kanallarını anlat. Kart bilgisi isteme. Müşteri ödediğini söylerse teşekkür edip görüşmeyi kibarca bitir.",
                                        "variables": {
                                            "fatura_no": "FTR-2026-1042",
                                            "fatura_tutari": "1.250,00 TL",
                                            "son_odeme_tarihi": "30 Eylül 2026"
                                        },
                                        "scheduled_at": "2026-10-07T07:30:00+00:00",
                                        "attempts": 2,
                                        "next_attempt_at": null,
                                        "waiting_reason": null,
                                        "blocked_reason": null,
                                        "failure_reason": null,
                                        "outcome": "completed",
                                        "outcome_label": "Görüşme yapıldı",
                                        "last_call": {
                                            "id": "01k6zq9h4e2r7s5d3f8g6j1k0m",
                                            "campaign": {
                                                "id": 12,
                                                "name": "Fatura hatırlatma"
                                            },
                                            "contact": {
                                                "id": 4821,
                                                "phone": "+905321234567",
                                                "name": "Ayşe Yılmaz"
                                            },
                                            "status": "completed",
                                            "outcome": "completed",
                                            "outcome_label": "Görüşme yapıldı",
                                            "direction": "outbound",
                                            "is_test": false,
                                            "answered_at": "2026-10-07T08:45:02+00:00",
                                            "ended_at": "2026-10-07T08:47:16+00:00",
                                            "duration_seconds": 134,
                                            "summary": "Ayşe Hanım faturayı 9 Ekim'de mobil uygulamadan ödeyeceğini söyledi.",
                                            "notes": "- Ödeme 9 Ekim'de yapılacak\n- Taksit sormadı",
                                            "interest_score": 70,
                                            "next_action": "9 Ekim akşamı ödemeyi kontrol et.",
                                            "callback_at": null,
                                            "finalized_at": "2026-10-07T08:47:40+00:00",
                                            "created_at": "2026-10-07T08:44:31+00:00"
                                        },
                                        "created_at": "2026-10-06T19:02:11+00:00",
                                        "updated_at": "2026-10-07T08:47:40+00:00",
                                        "completed_at": "2026-10-07T08:47:40+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "`unauthenticated`: API anahtarı yok, hatalı ya da iptal edilmiş.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "`tenant_suspended`: Firmanın hesabı askıya alınmış.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "`not_found`: Kayıt bulunamadı. Başka bir firmanın kaydı da 404 döner.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "`rate_limited`: Anahtar başına dakikada 120 istek sınırı aşıldı.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/call-requests/{id}/cancel": {
            "post": {
                "operationId": "callRequestsCancel",
                "tags": [
                    "Arama talepleri"
                ],
                "summary": "Arama talebini iptal et",
                "description": "Yalnızca araması başlamamış talepler (`queued`, `retrying`) iptal edilebilir; kişi kampanyanın arama sırasından çıkarılır. Örneğin fatura arama saatinden önce ödendiyse kullanın. Aranmakta olan ya da sonuçlanmış talep `409 request_not_cancellable` döner.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Arama talebinin kimliği.",
                        "schema": {
                            "type": "string",
                            "description": "Arama talebinin kimliği."
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Ağ hatasında isteği güvenle tekrarlamak için benzersiz bir anahtar (en fazla 255 karakter). Bkz. [Tekrarlanan istekler](#idempotency).",
                        "schema": {
                            "type": "string",
                            "description": "Ağ hatasında isteği güvenle tekrarlamak için benzersiz bir anahtar (en fazla 255 karakter). Bkz. [Tekrarlanan istekler](#idempotency).",
                            "maxLength": 255
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Arama talebini iptal et",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/CallRequest"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": "01k6zq3m8v2c4x7b9n5t1r0wyd",
                                        "status": "cancelled",
                                        "campaign": {
                                            "id": 12,
                                            "name": "Fatura hatırlatma"
                                        },
                                        "contact": {
                                            "id": 4821,
                                            "phone": "+905321234567",
                                            "name": "Ayşe Yılmaz"
                                        },
                                        "external_id": "FTR-2026-1042",
                                        "reason": "Fatura hatırlatma",
                                        "instructions": "Son ödeme tarihinin geçtiğini nazikçe hatırlat ve ödeme kanallarını anlat. Kart bilgisi isteme. Müşteri ödediğini söylerse teşekkür edip görüşmeyi kibarca bitir.",
                                        "variables": {
                                            "fatura_no": "FTR-2026-1042",
                                            "fatura_tutari": "1.250,00 TL",
                                            "son_odeme_tarihi": "30 Eylül 2026"
                                        },
                                        "scheduled_at": "2026-10-07T07:30:00+00:00",
                                        "attempts": 0,
                                        "next_attempt_at": null,
                                        "waiting_reason": null,
                                        "blocked_reason": null,
                                        "failure_reason": "cancelled_by_api",
                                        "outcome": null,
                                        "outcome_label": null,
                                        "last_call": null,
                                        "created_at": "2026-10-06T19:02:11+00:00",
                                        "updated_at": "2026-10-07T06:58:03+00:00",
                                        "completed_at": "2026-10-07T06:58:03+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "`unauthenticated`: API anahtarı yok, hatalı ya da iptal edilmiş.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "`tenant_suspended`: Firmanın hesabı askıya alınmış.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "`not_found`: Kayıt bulunamadı. Başka bir firmanın kaydı da 404 döner.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "`request_not_cancellable`: Talep iptal edilemez: araması başlamış ya da talep zaten sonuçlanmış.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "`rate_limited`: Anahtar başına dakikada 120 istek sınırı aşıldı.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/contacts": {
            "post": {
                "operationId": "contactsStore",
                "tags": [
                    "Kişiler"
                ],
                "summary": "Kişi ekle veya güncelle",
                "description": "Kişiyi telefona göre bulur; yoksa oluşturur (`201`), varsa yalnızca gönderdiğiniz alanları günceller (`200`). `campaign_id` verilirse kişi kampanyanın listesine eklenir (zaten listedeyse dokunulmaz) ve kampanya aktifse arama saatlerinde sırası gelince aranır.",
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Ağ hatasında isteği güvenle tekrarlamak için benzersiz bir anahtar (en fazla 255 karakter). Bkz. [Tekrarlanan istekler](#idempotency).",
                        "schema": {
                            "type": "string",
                            "description": "Ağ hatasında isteği güvenle tekrarlamak için benzersiz bir anahtar (en fazla 255 karakter). Bkz. [Tekrarlanan istekler](#idempotency).",
                            "maxLength": 255
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "phone": {
                                        "type": "string",
                                        "description": "Aranacak numara. `0532…`, `+90532…` veya `532…` biçiminde; yurt dışı numaralar `+` veya `00` ile.",
                                        "maxLength": 32
                                    },
                                    "first_name": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Ad (en fazla 120 karakter). Asistan kişiye adıyla hitap eder.",
                                        "maxLength": 120
                                    },
                                    "last_name": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Soyad (en fazla 120 karakter).",
                                        "maxLength": 120
                                    },
                                    "company": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Firma adı (en fazla 255 karakter).",
                                        "maxLength": 255
                                    },
                                    "email": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "E-posta adresi. Asistan dosya gönderirken kullanabilir.",
                                        "format": "email",
                                        "maxLength": 255
                                    },
                                    "customer_type": {
                                        "type": "string",
                                        "description": "Müşteri tipi; İYS kuralını belirler. Yeni kişide varsayılan `individual`.",
                                        "enum": [
                                            "individual",
                                            "merchant"
                                        ]
                                    },
                                    "iys_status": {
                                        "type": "string",
                                        "description": "Kişinin İYS'deki arama izni. İYS entegrasyonunuz bağlıysa izin İYS'den sorgulanır; değilse bu değer kullanılır. Yeni kişide varsayılan `unchecked` (aranamaz). Bkz. [Uyum](#compliance).",
                                        "enum": [
                                            "unchecked",
                                            "allowed",
                                            "denied",
                                            "not_found"
                                        ]
                                    },
                                    "consent_source": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "İzni nereden aldığınız (en fazla 120 karakter), örneğin \"Abonelik sözleşmesi, 2025-03-12\".",
                                        "maxLength": 120
                                    },
                                    "about": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Kişi hakkında kalıcı bilgi (en fazla 2000 karakter); asistan bu kişiyle her görüşmede kullanır.",
                                        "maxLength": 2000
                                    },
                                    "custom_fields": {
                                        "type": [
                                            "object",
                                            "null"
                                        ],
                                        "additionalProperties": {
                                            "type": [
                                                "string",
                                                "number"
                                            ]
                                        },
                                        "description": "Kişinin özel alanları: ad → metin veya sayı (en fazla 30 alan, değer en fazla 500 karakter). Mevcut alanlarla birleştirilir.",
                                        "maxProperties": 30
                                    },
                                    "campaign_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "description": "Verilirse kişi bu kampanyanın arama listesine eklenir."
                                    }
                                },
                                "required": [
                                    "phone"
                                ]
                            },
                            "example": {
                                "phone": "05321234567",
                                "first_name": "Ayşe",
                                "last_name": "Yılmaz",
                                "email": "ayse.yilmaz@ornek.com",
                                "customer_type": "individual",
                                "iys_status": "allowed",
                                "consent_source": "Web sitesi teklif formu, 2026-10-06",
                                "about": "Web sitemizdeki teklif formunu doldurdu.",
                                "custom_fields": {
                                    "musteri_no": "M-20931"
                                },
                                "campaign_id": 12
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Kişi ekle veya güncelle",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Contact"
                                        },
                                        "created": {
                                            "type": "boolean"
                                        },
                                        "campaign": {
                                            "oneOf": [
                                                {
                                                    "$ref": "#/components/schemas/CampaignMembership"
                                                },
                                                {
                                                    "type": "null"
                                                }
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "created",
                                        "campaign"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 4821,
                                        "phone": "+905321234567",
                                        "first_name": "Ayşe",
                                        "last_name": "Yılmaz",
                                        "company": null,
                                        "email": "ayse.yilmaz@ornek.com",
                                        "customer_type": "individual",
                                        "iys_status": "allowed",
                                        "do_not_call": false,
                                        "about": "Web sitemizdeki teklif formunu doldurdu.",
                                        "custom_fields": {
                                            "musteri_no": "M-20931"
                                        },
                                        "created_at": "2026-10-06T19:02:11+00:00"
                                    },
                                    "created": true,
                                    "campaign": {
                                        "campaign_id": 12,
                                        "status": "pending",
                                        "next_attempt_at": "2026-10-06T19:02:11+00:00",
                                        "excluded_reason": null
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "`unauthenticated`: API anahtarı yok, hatalı ya da iptal edilmiş.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "`tenant_suspended`: Firmanın hesabı askıya alınmış.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "`request_in_progress`: Aynı `Idempotency-Key` (ya da aynı `external_id`) ile gönderilen ilk istek hâlâ işleniyor.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "`validation_failed`: Bir veya daha fazla alan geçersiz; ayrıntılar `fields` içinde., `idempotency_key_reused`: Bu `Idempotency-Key` son 24 saatte başka bir istek gövdesiyle kullanılmış.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "`rate_limited`: Anahtar başına dakikada 120 istek sınırı aşıldı.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "get": {
                "operationId": "contactsIndex",
                "tags": [
                    "Kişiler"
                ],
                "summary": "Telefonla kişi bul",
                "description": "Kişi bulunursa tek elemanlı, bulunamazsa boş bir liste döner.",
                "parameters": [
                    {
                        "name": "phone",
                        "in": "query",
                        "required": true,
                        "description": "Aranan telefon numarası, kabul edilen her biçimde.",
                        "schema": {
                            "type": "string",
                            "description": "Aranan telefon numarası, kabul edilen her biçimde.",
                            "maxLength": 32
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Telefonla kişi bul",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Contact"
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 4821,
                                            "phone": "+905321234567",
                                            "first_name": "Ayşe",
                                            "last_name": "Yılmaz",
                                            "company": null,
                                            "email": "ayse.yilmaz@ornek.com",
                                            "customer_type": "individual",
                                            "iys_status": "allowed",
                                            "do_not_call": false,
                                            "about": "Web sitemizdeki teklif formunu doldurdu.",
                                            "custom_fields": {
                                                "musteri_no": "M-20931"
                                            },
                                            "created_at": "2026-10-06T19:02:11+00:00"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "`unauthenticated`: API anahtarı yok, hatalı ya da iptal edilmiş.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "`tenant_suspended`: Firmanın hesabı askıya alınmış.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "`validation_failed`: Bir veya daha fazla alan geçersiz; ayrıntılar `fields` içinde.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "`rate_limited`: Anahtar başına dakikada 120 istek sınırı aşıldı.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/contacts/{id}": {
            "get": {
                "operationId": "contactsShow",
                "tags": [
                    "Kişiler"
                ],
                "summary": "Kişiyi getir",
                "description": "Tek bir kişinin bilgileri.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Kişinin kimliği.",
                        "schema": {
                            "type": "integer",
                            "description": "Kişinin kimliği."
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Kişiyi getir",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Contact"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 4821,
                                        "phone": "+905321234567",
                                        "first_name": "Ayşe",
                                        "last_name": "Yılmaz",
                                        "company": null,
                                        "email": "ayse.yilmaz@ornek.com",
                                        "customer_type": "individual",
                                        "iys_status": "allowed",
                                        "do_not_call": false,
                                        "about": "Web sitemizdeki teklif formunu doldurdu.",
                                        "custom_fields": {
                                            "musteri_no": "M-20931"
                                        },
                                        "created_at": "2026-10-06T19:02:11+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "`unauthenticated`: API anahtarı yok, hatalı ya da iptal edilmiş.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "`tenant_suspended`: Firmanın hesabı askıya alınmış.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "`not_found`: Kayıt bulunamadı. Başka bir firmanın kaydı da 404 döner.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "`rate_limited`: Anahtar başına dakikada 120 istek sınırı aşıldı.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/campaigns": {
            "get": {
                "operationId": "campaignsIndex",
                "tags": [
                    "Kampanyalar"
                ],
                "summary": "Kampanyaları listele",
                "description": "Giden arama kampanyalarınız, ada göre sıralı. Arama talebi için `active` veya `paused` bir kampanya seçin.",
                "responses": {
                    "200": {
                        "description": "Kampanyaları listele",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Campaign"
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 14,
                                            "name": "Abonelik yenileme",
                                            "status": "active",
                                            "goal": "upsell"
                                        },
                                        {
                                            "id": 12,
                                            "name": "Fatura hatırlatma",
                                            "status": "active",
                                            "goal": "collection"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "`unauthenticated`: API anahtarı yok, hatalı ya da iptal edilmiş.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "`tenant_suspended`: Firmanın hesabı askıya alınmış.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "`rate_limited`: Anahtar başına dakikada 120 istek sınırı aşıldı.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/campaigns/{id}/contacts": {
            "post": {
                "operationId": "campaignsContacts",
                "tags": [
                    "Kampanyalar"
                ],
                "summary": "Kişileri kampanyaya ekle",
                "description": "Kayıtlı kişileri kimlik veya telefonla kampanyanın listesine ekler. Listede olanlara dokunulmaz; aranmayacaklar listesindekiler \"hariç tutuldu\" olarak eklenir.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Kampanyanın kimliği.",
                        "schema": {
                            "type": "integer",
                            "description": "Kampanyanın kimliği."
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Ağ hatasında isteği güvenle tekrarlamak için benzersiz bir anahtar (en fazla 255 karakter). Bkz. [Tekrarlanan istekler](#idempotency).",
                        "schema": {
                            "type": "string",
                            "description": "Ağ hatasında isteği güvenle tekrarlamak için benzersiz bir anahtar (en fazla 255 karakter). Bkz. [Tekrarlanan istekler](#idempotency).",
                            "maxLength": 255
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "contact_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Eklenecek kişilerin kimlikleri (en fazla 1000).",
                                        "maxItems": 1000
                                    },
                                    "phones": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "description": "Eklenecek kişilerin telefonları (en fazla 1000). Yalnızca kayıtlı kişiler eklenir.",
                                        "maxItems": 1000
                                    }
                                }
                            },
                            "example": {
                                "contact_ids": [
                                    4821
                                ],
                                "phones": [
                                    "05329998877"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Kişileri kampanyaya ekle",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "added": {
                                            "type": "integer"
                                        },
                                        "matched": {
                                            "type": "integer"
                                        }
                                    },
                                    "required": [
                                        "added",
                                        "matched"
                                    ]
                                },
                                "example": {
                                    "added": 2,
                                    "matched": 2
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "`unauthenticated`: API anahtarı yok, hatalı ya da iptal edilmiş.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "`tenant_suspended`: Firmanın hesabı askıya alınmış.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "`not_found`: Kayıt bulunamadı. Başka bir firmanın kaydı da 404 döner.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "`request_in_progress`: Aynı `Idempotency-Key` (ya da aynı `external_id`) ile gönderilen ilk istek hâlâ işleniyor.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "`validation_failed`: Bir veya daha fazla alan geçersiz; ayrıntılar `fields` içinde., `idempotency_key_reused`: Bu `Idempotency-Key` son 24 saatte başka bir istek gövdesiyle kullanılmış.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "`rate_limited`: Anahtar başına dakikada 120 istek sınırı aşıldı.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/calls": {
            "get": {
                "operationId": "callsIndex",
                "tags": [
                    "Görüşmeler"
                ],
                "summary": "Görüşmeleri listele",
                "description": "Sonucu kesinleşmiş görüşmeler, en yeni önce. Test aramaları varsayılan olarak gelmez. Sayfalama yoktur: son aldığınız görüşmenin `finalized_at` değerini bir sonraki istekte `since` olarak kullanın.",
                "parameters": [
                    {
                        "name": "since",
                        "in": "query",
                        "required": false,
                        "description": "Bu zamandan sonra sonuçlanan (`finalized_at`) görüşmeler.",
                        "schema": {
                            "type": "string",
                            "description": "Bu zamandan sonra sonuçlanan (`finalized_at`) görüşmeler.",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "campaign_id",
                        "in": "query",
                        "required": false,
                        "description": "Yalnızca bu kampanyanın kayıtları.",
                        "schema": {
                            "type": "integer",
                            "description": "Yalnızca bu kampanyanın kayıtları."
                        }
                    },
                    {
                        "name": "outcome",
                        "in": "query",
                        "required": false,
                        "description": "Yalnızca bu sonuçtaki görüşmeler.",
                        "schema": {
                            "type": "string",
                            "description": "Yalnızca bu sonuçtaki görüşmeler.",
                            "enum": [
                                "no_answer",
                                "busy",
                                "wrong_number",
                                "failed",
                                "voicemail",
                                "completed",
                                "hung_up",
                                "interested",
                                "callback_requested",
                                "follow_up_planned",
                                "meeting_scheduled",
                                "sale_made",
                                "payment_promised",
                                "survey_completed",
                                "confirmed",
                                "resolved",
                                "not_interested",
                                "do_not_call",
                                "transferred",
                                "dialed_out"
                            ]
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "En fazla kaç kayıt dönsün (1–100). Varsayılan 25.",
                        "schema": {
                            "type": "integer",
                            "description": "En fazla kaç kayıt dönsün (1–100). Varsayılan 25.",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 25
                        }
                    },
                    {
                        "name": "include_tests",
                        "in": "query",
                        "required": false,
                        "description": "`true` ise paneldeki test aramaları da gelir.",
                        "schema": {
                            "type": "boolean",
                            "description": "`true` ise paneldeki test aramaları da gelir."
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Görüşmeleri listele",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Call"
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": "01k6zq9h4e2r7s5d3f8g6j1k0m",
                                            "campaign": {
                                                "id": 12,
                                                "name": "Fatura hatırlatma"
                                            },
                                            "contact": {
                                                "id": 4821,
                                                "phone": "+905321234567",
                                                "name": "Ayşe Yılmaz"
                                            },
                                            "status": "completed",
                                            "outcome": "completed",
                                            "outcome_label": "Görüşme yapıldı",
                                            "direction": "outbound",
                                            "is_test": false,
                                            "answered_at": "2026-10-07T08:45:02+00:00",
                                            "ended_at": "2026-10-07T08:47:16+00:00",
                                            "duration_seconds": 134,
                                            "summary": "Ayşe Hanım faturayı 9 Ekim'de mobil uygulamadan ödeyeceğini söyledi.",
                                            "notes": "- Ödeme 9 Ekim'de yapılacak\n- Taksit sormadı",
                                            "interest_score": 70,
                                            "next_action": "9 Ekim akşamı ödemeyi kontrol et.",
                                            "callback_at": null,
                                            "finalized_at": "2026-10-07T08:47:40+00:00",
                                            "created_at": "2026-10-07T08:44:31+00:00"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "`unauthenticated`: API anahtarı yok, hatalı ya da iptal edilmiş.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "`tenant_suspended`: Firmanın hesabı askıya alınmış.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "`validation_failed`: Bir veya daha fazla alan geçersiz; ayrıntılar `fields` içinde.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "`rate_limited`: Anahtar başına dakikada 120 istek sınırı aşıldı.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/calls/{id}": {
            "get": {
                "operationId": "callsShow",
                "tags": [
                    "Görüşmeler"
                ],
                "summary": "Görüşmeyi getir",
                "description": "Tek bir görüşme. Görüşme sürerken de okunabilir; `finalized_at` dolunca sonuç ve özet kesinleşmiştir.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Görüşmenin kimliği.",
                        "schema": {
                            "type": "string",
                            "description": "Görüşmenin kimliği."
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Görüşmeyi getir",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Call"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": "01k6zq9h4e2r7s5d3f8g6j1k0m",
                                        "campaign": {
                                            "id": 12,
                                            "name": "Fatura hatırlatma"
                                        },
                                        "contact": {
                                            "id": 4821,
                                            "phone": "+905321234567",
                                            "name": "Ayşe Yılmaz"
                                        },
                                        "status": "completed",
                                        "outcome": "completed",
                                        "outcome_label": "Görüşme yapıldı",
                                        "direction": "outbound",
                                        "is_test": false,
                                        "answered_at": "2026-10-07T08:45:02+00:00",
                                        "ended_at": "2026-10-07T08:47:16+00:00",
                                        "duration_seconds": 134,
                                        "summary": "Ayşe Hanım faturayı 9 Ekim'de mobil uygulamadan ödeyeceğini söyledi.",
                                        "notes": "- Ödeme 9 Ekim'de yapılacak\n- Taksit sormadı",
                                        "interest_score": 70,
                                        "next_action": "9 Ekim akşamı ödemeyi kontrol et.",
                                        "callback_at": null,
                                        "finalized_at": "2026-10-07T08:47:40+00:00",
                                        "created_at": "2026-10-07T08:44:31+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "`unauthenticated`: API anahtarı yok, hatalı ya da iptal edilmiş.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "`tenant_suspended`: Firmanın hesabı askıya alınmış.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "`not_found`: Kayıt bulunamadı. Başka bir firmanın kaydı da 404 döner.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "`rate_limited`: Anahtar başına dakikada 120 istek sınırı aşıldı.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/me": {
            "get": {
                "operationId": "automationMe",
                "tags": [
                    "Otomasyon"
                ],
                "summary": "Anahtarın hesabı",
                "description": "Anahtarın hangi hesaba ait olduğu. Otomasyon araçlarının \"bağlantıyı test et\" adımı ve hesap etiketi için.",
                "responses": {
                    "200": {
                        "description": "Anahtarın hesabı",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "account": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "required": [
                                                        "id",
                                                        "name"
                                                    ]
                                                },
                                                "api_key": {
                                                    "type": "object",
                                                    "properties": {
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "prefix": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "required": [
                                                        "name",
                                                        "prefix"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "account",
                                                "api_key"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "account": {
                                            "id": 318,
                                            "name": "Ayşe Mobilya"
                                        },
                                        "api_key": {
                                            "name": "Zapier",
                                            "prefix": "et_live_k3Fq"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "`unauthenticated`: API anahtarı yok, hatalı ya da iptal edilmiş.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "`tenant_suspended`: Firmanın hesabı askıya alınmış.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "`rate_limited`: Anahtar başına dakikada 120 istek sınırı aşıldı.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/hooks": {
            "post": {
                "operationId": "hooksStore",
                "tags": [
                    "Otomasyon"
                ],
                "summary": "Tetikleyici aç",
                "description": "Olay olduğunda `target_url` adresine imzalı `POST` gönderilir. İmza anahtarı (`secret`) yalnızca bu cevapta döner. `campaign_id` ile yalnızca o kampanyanın olayları, `outcomes` ile (yalnızca `call.finalized`) yalnızca o sonuçlar gönderilir. Adres `https://` olmalı ve herkese açık bir sunucuda bulunmalıdır.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "event": {
                                        "type": "string",
                                        "description": "Olay: `call.finalized`, `meeting.scheduled`, `contact.dnc` ya da `call_request.completed`.",
                                        "enum": [
                                            "call.finalized",
                                            "meeting.scheduled",
                                            "contact.dnc",
                                            "call_request.completed"
                                        ]
                                    },
                                    "target_url": {
                                        "type": "string",
                                        "description": "Olayların gönderileceği adres (aracınızın webhook adresi), `https://` ile.",
                                        "format": "uri",
                                        "maxLength": 2048
                                    },
                                    "campaign_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "description": "Yalnızca bu kampanyanın olayları (`call.finalized`, `meeting.scheduled`, `call_request.completed`)."
                                    },
                                    "outcomes": {
                                        "type": [
                                            "array",
                                            "null"
                                        ],
                                        "items": {
                                            "type": "string"
                                        },
                                        "description": "Yalnızca bu sonuçlar (`call.finalized` için); boşsa her sonuç."
                                    },
                                    "source": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Tetikleyiciyi açan araç; panelde gösterilir. Verilmezse adresin alan adından anlaşılır.",
                                        "enum": [
                                            "zapier",
                                            "make",
                                            "n8n",
                                            "pabbly",
                                            "power_automate",
                                            "other",
                                            null
                                        ]
                                    }
                                },
                                "required": [
                                    "event",
                                    "target_url"
                                ]
                            },
                            "example": {
                                "event": "call.finalized",
                                "target_url": "https://hooks.zapier.com/hooks/standard/1234567/abcdef/",
                                "campaign_id": 12,
                                "outcomes": [
                                    "interested",
                                    "meeting_scheduled"
                                ],
                                "source": "zapier"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Tetikleyici aç",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Hook"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 27,
                                        "event": "call.finalized",
                                        "target_url": "https://hooks.zapier.com/hooks/standard/1234567/abcdef/",
                                        "source": "zapier",
                                        "filters": {
                                            "campaign_id": 12,
                                            "outcomes": [
                                                "interested",
                                                "meeting_scheduled"
                                            ]
                                        },
                                        "status": "active",
                                        "created_at": "2026-10-07T08:30:00+00:00",
                                        "last_delivered_at": "2026-10-07T08:47:41+00:00",
                                        "disabled_at": null,
                                        "secret": "whsec_9pX2mLq7RfT4vN8bK1cW5hJ3dY6sA0eZ"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "`unauthenticated`: API anahtarı yok, hatalı ya da iptal edilmiş.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "`tenant_suspended`: Firmanın hesabı askıya alınmış.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "`validation_failed`: Bir veya daha fazla alan geçersiz; ayrıntılar `fields` içinde.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "`rate_limited`: Anahtar başına dakikada 120 istek sınırı aşıldı.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "get": {
                "operationId": "hooksIndex",
                "tags": [
                    "Otomasyon"
                ],
                "summary": "Tetikleyicileri listele",
                "description": "Hesabın açık ve durdurulmuş tetikleyicileri, en yeni önce (panelden eklenenler dahil).",
                "responses": {
                    "200": {
                        "description": "Tetikleyicileri listele",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Hook"
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 27,
                                            "event": "call.finalized",
                                            "target_url": "https://hooks.zapier.com/hooks/standard/1234567/abcdef/",
                                            "source": "zapier",
                                            "filters": {
                                                "campaign_id": 12,
                                                "outcomes": [
                                                    "interested",
                                                    "meeting_scheduled"
                                                ]
                                            },
                                            "status": "active",
                                            "created_at": "2026-10-07T08:30:00+00:00",
                                            "last_delivered_at": "2026-10-07T08:47:41+00:00",
                                            "disabled_at": null
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "`unauthenticated`: API anahtarı yok, hatalı ya da iptal edilmiş.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "`tenant_suspended`: Firmanın hesabı askıya alınmış.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "`rate_limited`: Anahtar başına dakikada 120 istek sınırı aşıldı.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/hooks/{id}": {
            "get": {
                "operationId": "hooksShow",
                "tags": [
                    "Otomasyon"
                ],
                "summary": "Tetikleyiciyi getir",
                "description": "Tek tetikleyici: durumu ve son başarılı gönderim zamanı.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Tetikleyicinin kimliği.",
                        "schema": {
                            "type": "integer",
                            "description": "Tetikleyicinin kimliği."
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Tetikleyiciyi getir",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Hook"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": {
                                        "id": 27,
                                        "event": "call.finalized",
                                        "target_url": "https://hooks.zapier.com/hooks/standard/1234567/abcdef/",
                                        "source": "zapier",
                                        "filters": {
                                            "campaign_id": 12,
                                            "outcomes": [
                                                "interested",
                                                "meeting_scheduled"
                                            ]
                                        },
                                        "status": "active",
                                        "created_at": "2026-10-07T08:30:00+00:00",
                                        "last_delivered_at": "2026-10-07T08:47:41+00:00",
                                        "disabled_at": null
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "`unauthenticated`: API anahtarı yok, hatalı ya da iptal edilmiş.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "`tenant_suspended`: Firmanın hesabı askıya alınmış.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "`not_found`: Kayıt bulunamadı. Başka bir firmanın kaydı da 404 döner.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "`rate_limited`: Anahtar başına dakikada 120 istek sınırı aşıldı.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "hooksDestroy",
                "tags": [
                    "Otomasyon"
                ],
                "summary": "Tetikleyiciyi kapat",
                "description": "Akış kapatıldığında çağırın; bu adrese artık olay gönderilmez.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Tetikleyicinin kimliği.",
                        "schema": {
                            "type": "integer",
                            "description": "Tetikleyicinin kimliği."
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Tetikleyiciyi kapat"
                    },
                    "401": {
                        "description": "`unauthenticated`: API anahtarı yok, hatalı ya da iptal edilmiş.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "`tenant_suspended`: Firmanın hesabı askıya alınmış.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "`not_found`: Kayıt bulunamadı. Başka bir firmanın kaydı da 404 döner.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "`rate_limited`: Anahtar başına dakikada 120 istek sınırı aşıldı.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/hooks/samples/{event}": {
            "get": {
                "operationId": "hooksSamples",
                "tags": [
                    "Otomasyon"
                ],
                "summary": "Örnek olaylar",
                "description": "Hesabın son gerçek olayları (en yeni önce, en fazla 3), tetikleyicinin alacağı gövdeyle; henüz olay yoksa dokümandaki örnek. Alan eşleme ekranları ve Zapier'in \"perform list\" adımı için. `campaign_id` ve `outcomes[]` filtreleri `POST /hooks`'taki gibidir.",
                "parameters": [
                    {
                        "name": "event",
                        "in": "path",
                        "required": true,
                        "description": "Olay: `call.finalized`, `meeting.scheduled`, `contact.dnc` ya da `call_request.completed`.",
                        "schema": {
                            "type": "string",
                            "description": "Olay: `call.finalized`, `meeting.scheduled`, `contact.dnc` ya da `call_request.completed`.",
                            "enum": [
                                "call.finalized",
                                "meeting.scheduled",
                                "contact.dnc",
                                "call_request.completed"
                            ]
                        }
                    },
                    {
                        "name": "campaign_id",
                        "in": "query",
                        "required": false,
                        "description": "Yalnızca bu kampanyanın olayları (`call.finalized`, `meeting.scheduled`, `call_request.completed`).",
                        "schema": {
                            "type": "integer",
                            "description": "Yalnızca bu kampanyanın olayları (`call.finalized`, `meeting.scheduled`, `call_request.completed`)."
                        }
                    },
                    {
                        "name": "outcomes[]",
                        "in": "query",
                        "required": false,
                        "description": "Yalnızca bu sonuçlar (`call.finalized` için); boşsa her sonuç.",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            },
                            "description": "Yalnızca bu sonuçlar (`call.finalized` için); boşsa her sonuç."
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Örnek olaylar",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": "5f0c2a7e-9b1d-4e3a-8c6f-2d7b1a9e4c30",
                                            "event": "call.finalized",
                                            "created_at": "2026-10-07T08:47:40+00:00",
                                            "data": {
                                                "call": {
                                                    "id": "01k6zq9h4e2r7s5d3f8g6j1k0m",
                                                    "direction": "outbound",
                                                    "is_test": false,
                                                    "status": "completed",
                                                    "outcome": "completed",
                                                    "outcome_label": "Görüşme yapıldı",
                                                    "interest_score": 70,
                                                    "duration_seconds": 134,
                                                    "answered_at": "2026-10-07T08:45:02+00:00",
                                                    "ended_at": "2026-10-07T08:47:16+00:00",
                                                    "callback_at": null,
                                                    "summary": "Ayşe Hanım faturayı 9 Ekim'de mobil uygulamadan ödeyeceğini söyledi.",
                                                    "notes": "- Ödeme 9 Ekim'de yapılacak\n- Taksit sormadı",
                                                    "next_action": "9 Ekim akşamı ödemeyi kontrol et."
                                                },
                                                "campaign": {
                                                    "id": 12,
                                                    "name": "Fatura hatırlatma"
                                                },
                                                "contact": {
                                                    "id": 4821,
                                                    "first_name": "Ayşe",
                                                    "last_name": "Yılmaz",
                                                    "company": null,
                                                    "email": "ayse.yilmaz@ornek.com",
                                                    "phone": "+905321234567",
                                                    "custom_fields": {
                                                        "musteri_no": "M-20931"
                                                    }
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "`unauthenticated`: API anahtarı yok, hatalı ya da iptal edilmiş.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "`tenant_suspended`: Firmanın hesabı askıya alınmış.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "`not_found`: Kayıt bulunamadı. Başka bir firmanın kaydı da 404 döner.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "`validation_failed`: Bir veya daha fazla alan geçersiz; ayrıntılar `fields` içinde.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "`rate_limited`: Anahtar başına dakikada 120 istek sınırı aşıldı.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "webhooks": {
        "call.finalized": {
            "post": {
                "operationId": "callFinalizedWebhook",
                "summary": "Görüşme sonuçlandı",
                "description": "Her görüşmenin sonucu kesinleştiğinde, bir kez (talebe bağlı her deneme dahil). Test aramaları da gönderilir (`is_test`).",
                "parameters": [
                    {
                        "name": "X-Arar-Event",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "X-Arar-Event-Id",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "X-Arar-Timestamp",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "X-Arar-Signature",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "id",
                                    "event",
                                    "created_at",
                                    "data"
                                ],
                                "properties": {
                                    "id": {
                                        "type": "string"
                                    },
                                    "event": {
                                        "type": "string",
                                        "const": "call.finalized"
                                    },
                                    "created_at": {
                                        "type": "string",
                                        "format": "date-time"
                                    },
                                    "data": {
                                        "type": "object"
                                    }
                                }
                            },
                            "example": {
                                "id": "5f0c2a7e-9b1d-4e3a-8c6f-2d7b1a9e4c30",
                                "event": "call.finalized",
                                "created_at": "2026-10-07T08:47:40+00:00",
                                "data": {
                                    "call": {
                                        "id": "01k6zq9h4e2r7s5d3f8g6j1k0m",
                                        "direction": "outbound",
                                        "is_test": false,
                                        "status": "completed",
                                        "outcome": "completed",
                                        "outcome_label": "Görüşme yapıldı",
                                        "interest_score": 70,
                                        "duration_seconds": 134,
                                        "answered_at": "2026-10-07T08:45:02+00:00",
                                        "ended_at": "2026-10-07T08:47:16+00:00",
                                        "callback_at": null,
                                        "summary": "Ayşe Hanım faturayı 9 Ekim'de mobil uygulamadan ödeyeceğini söyledi.",
                                        "notes": "- Ödeme 9 Ekim'de yapılacak\n- Taksit sormadı",
                                        "next_action": "9 Ekim akşamı ödemeyi kontrol et."
                                    },
                                    "campaign": {
                                        "id": 12,
                                        "name": "Fatura hatırlatma"
                                    },
                                    "contact": {
                                        "id": 4821,
                                        "first_name": "Ayşe",
                                        "last_name": "Yılmaz",
                                        "company": null,
                                        "email": "ayse.yilmaz@ornek.com",
                                        "phone": "+905321234567",
                                        "custom_fields": {
                                            "musteri_no": "M-20931"
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "2XX": {
                        "description": "OK"
                    }
                }
            }
        },
        "meeting.scheduled": {
            "post": {
                "operationId": "meetingScheduledWebhook",
                "summary": "Toplantı ayarlandı",
                "description": "Asistan bir görüşmede toplantı ayarladığında.",
                "parameters": [
                    {
                        "name": "X-Arar-Event",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "X-Arar-Event-Id",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "X-Arar-Timestamp",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "X-Arar-Signature",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "id",
                                    "event",
                                    "created_at",
                                    "data"
                                ],
                                "properties": {
                                    "id": {
                                        "type": "string"
                                    },
                                    "event": {
                                        "type": "string",
                                        "const": "meeting.scheduled"
                                    },
                                    "created_at": {
                                        "type": "string",
                                        "format": "date-time"
                                    },
                                    "data": {
                                        "type": "object"
                                    }
                                }
                            },
                            "example": {
                                "id": "5f0c2a7e-9b1d-4e3a-8c6f-2d7b1a9e4c30",
                                "event": "meeting.scheduled",
                                "created_at": "2026-10-07T08:47:40+00:00",
                                "data": {
                                    "meeting": {
                                        "id": 318,
                                        "call_id": "01k6zq9h4e2r7s5d3f8g6j1k0m",
                                        "starts_at": "2026-10-09T14:30:00+03:00",
                                        "duration_minutes": 30,
                                        "timezone": "Europe/Istanbul",
                                        "meet_link": "https://meet.google.com/abc-defg-hij",
                                        "calendar_link": null,
                                        "status": "scheduled",
                                        "notes": "Kurumsal paket için tanıtım görüşmesi."
                                    },
                                    "campaign": {
                                        "id": 12,
                                        "name": "Fatura hatırlatma"
                                    },
                                    "contact": {
                                        "id": 4821,
                                        "first_name": "Ayşe",
                                        "last_name": "Yılmaz",
                                        "company": null,
                                        "email": "ayse.yilmaz@ornek.com",
                                        "phone": "+905321234567",
                                        "custom_fields": {
                                            "musteri_no": "M-20931"
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "2XX": {
                        "description": "OK"
                    }
                }
            }
        },
        "contact.dnc": {
            "post": {
                "operationId": "contactDncWebhook",
                "summary": "Kişi aranmak istemiyor",
                "description": "Aranmayacaklar listesine yeni bir numara eklendiğinde.",
                "parameters": [
                    {
                        "name": "X-Arar-Event",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "X-Arar-Event-Id",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "X-Arar-Timestamp",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "X-Arar-Signature",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "id",
                                    "event",
                                    "created_at",
                                    "data"
                                ],
                                "properties": {
                                    "id": {
                                        "type": "string"
                                    },
                                    "event": {
                                        "type": "string",
                                        "const": "contact.dnc"
                                    },
                                    "created_at": {
                                        "type": "string",
                                        "format": "date-time"
                                    },
                                    "data": {
                                        "type": "object"
                                    }
                                }
                            },
                            "example": {
                                "id": "5f0c2a7e-9b1d-4e3a-8c6f-2d7b1a9e4c30",
                                "event": "contact.dnc",
                                "created_at": "2026-10-07T08:47:40+00:00",
                                "data": {
                                    "phone": "+905321234567",
                                    "source": "agent",
                                    "reason": "Aranmak istemediğini söyledi.",
                                    "call_id": "01k6zq9h4e2r7s5d3f8g6j1k0m",
                                    "contact_ids": [
                                        4821
                                    ]
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "2XX": {
                        "description": "OK"
                    }
                }
            }
        },
        "call_request.completed": {
            "post": {
                "operationId": "callRequestCompletedWebhook",
                "summary": "Arama talebi sonuçlandı",
                "description": "Bir arama talebi sonuçlandığında (`completed`, `failed`, `cancelled`, `blocked`), talep başına bir kez. `data.call_request`, `GET /call-requests/{id}` cevabıyla aynıdır.",
                "parameters": [
                    {
                        "name": "X-Arar-Event",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "X-Arar-Event-Id",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "X-Arar-Timestamp",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "X-Arar-Signature",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "id",
                                    "event",
                                    "created_at",
                                    "data"
                                ],
                                "properties": {
                                    "id": {
                                        "type": "string"
                                    },
                                    "event": {
                                        "type": "string",
                                        "const": "call_request.completed"
                                    },
                                    "created_at": {
                                        "type": "string",
                                        "format": "date-time"
                                    },
                                    "data": {
                                        "type": "object",
                                        "required": [
                                            "call_request"
                                        ],
                                        "properties": {
                                            "call_request": {
                                                "$ref": "#/components/schemas/CallRequest"
                                            }
                                        }
                                    }
                                }
                            },
                            "example": {
                                "id": "5f0c2a7e-9b1d-4e3a-8c6f-2d7b1a9e4c30",
                                "event": "call_request.completed",
                                "created_at": "2026-10-07T08:47:40+00:00",
                                "data": {
                                    "call_request": {
                                        "id": "01k6zq3m8v2c4x7b9n5t1r0wyd",
                                        "status": "completed",
                                        "campaign": {
                                            "id": 12,
                                            "name": "Fatura hatırlatma"
                                        },
                                        "contact": {
                                            "id": 4821,
                                            "phone": "+905321234567",
                                            "name": "Ayşe Yılmaz"
                                        },
                                        "external_id": "FTR-2026-1042",
                                        "reason": "Fatura hatırlatma",
                                        "instructions": "Son ödeme tarihinin geçtiğini nazikçe hatırlat ve ödeme kanallarını anlat. Kart bilgisi isteme. Müşteri ödediğini söylerse teşekkür edip görüşmeyi kibarca bitir.",
                                        "variables": {
                                            "fatura_no": "FTR-2026-1042",
                                            "fatura_tutari": "1.250,00 TL",
                                            "son_odeme_tarihi": "30 Eylül 2026"
                                        },
                                        "scheduled_at": "2026-10-07T07:30:00+00:00",
                                        "attempts": 2,
                                        "next_attempt_at": null,
                                        "waiting_reason": null,
                                        "blocked_reason": null,
                                        "failure_reason": null,
                                        "outcome": "completed",
                                        "outcome_label": "Görüşme yapıldı",
                                        "last_call": {
                                            "id": "01k6zq9h4e2r7s5d3f8g6j1k0m",
                                            "campaign": {
                                                "id": 12,
                                                "name": "Fatura hatırlatma"
                                            },
                                            "contact": {
                                                "id": 4821,
                                                "phone": "+905321234567",
                                                "name": "Ayşe Yılmaz"
                                            },
                                            "status": "completed",
                                            "outcome": "completed",
                                            "outcome_label": "Görüşme yapıldı",
                                            "direction": "outbound",
                                            "is_test": false,
                                            "answered_at": "2026-10-07T08:45:02+00:00",
                                            "ended_at": "2026-10-07T08:47:16+00:00",
                                            "duration_seconds": 134,
                                            "summary": "Ayşe Hanım faturayı 9 Ekim'de mobil uygulamadan ödeyeceğini söyledi.",
                                            "notes": "- Ödeme 9 Ekim'de yapılacak\n- Taksit sormadı",
                                            "interest_score": 70,
                                            "next_action": "9 Ekim akşamı ödemeyi kontrol et.",
                                            "callback_at": null,
                                            "finalized_at": "2026-10-07T08:47:40+00:00",
                                            "created_at": "2026-10-07T08:44:31+00:00"
                                        },
                                        "created_at": "2026-10-06T19:02:11+00:00",
                                        "updated_at": "2026-10-07T08:47:40+00:00",
                                        "completed_at": "2026-10-07T08:47:40+00:00"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "2XX": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "bearerAuth": {
                "type": "http",
                "scheme": "bearer",
                "description": "Her isteğe API anahtarınızı `Authorization` başlığında **Bearer** olarak ekleyin. Anahtarı olmayan, hatalı ya da iptal edilmiş istekler `401 unauthenticated` döner."
            }
        },
        "schemas": {
            "CallRequest": {
                "type": "object",
                "title": "Arama talebi",
                "properties": {
                    "id": {
                        "type": "string",
                        "description": "Talebin kimliği (ULID)."
                    },
                    "status": {
                        "type": "string",
                        "description": "Talebin durumu; bkz. [Talebin durumları](#lifecycle).",
                        "enum": [
                            "queued",
                            "calling",
                            "retrying",
                            "completed",
                            "failed",
                            "cancelled",
                            "blocked"
                        ]
                    },
                    "campaign": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": "string"
                            }
                        },
                        "required": [
                            "id",
                            "name"
                        ],
                        "description": "Aramayı yapan kampanya: `id`, `name`."
                    },
                    "contact": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "phone": {
                                "type": "string"
                            },
                            "name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "required": [
                            "id",
                            "phone",
                            "name"
                        ],
                        "description": "Aranan kişi: `id`, `phone` (E.164), `name` (ad soyad, yoksa `null`)."
                    },
                    "external_id": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Gönderdiğiniz referans."
                    },
                    "reason": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Aramanın nedeni."
                    },
                    "instructions": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Asistana bu talep için verilen ek talimat."
                    },
                    "variables": {
                        "type": "object",
                        "additionalProperties": {
                            "type": "string"
                        },
                        "description": "Asistanın kullandığı bilgiler (değerler metin). Yoksa `{}`."
                    },
                    "scheduled_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "İstenen en erken arama zamanı.",
                        "format": "date-time"
                    },
                    "attempts": {
                        "type": "integer",
                        "description": "Bu talep için yapılan arama sayısı."
                    },
                    "next_attempt_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Sıradaki aramanın en erken zamanı (`queued` ve `retrying` durumunda).",
                        "format": "date-time"
                    },
                    "waiting_reason": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Sıradaki talebin neden henüz aranmadığı: `campaign_paused`, `outside_calling_window`, `holiday`, `daily_attempt_limit`, `iys_unavailable`, `line_refused`.",
                        "enum": [
                            "campaign_paused",
                            "iys_unavailable",
                            "holiday",
                            "outside_calling_window",
                            "daily_attempt_limit",
                            "line_refused",
                            null
                        ]
                    },
                    "blocked_reason": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "`blocked` talebin nedeni; bkz. [Uyum](#compliance).",
                        "enum": [
                            "contact_do_not_call",
                            "dnc_listed",
                            "iys_denied",
                            "iys_no_consent",
                            "max_attempts_reached",
                            null
                        ]
                    },
                    "failure_reason": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "`failed` veya `cancelled` talebin nedeni: `not_reached`, `cancelled_by_api`, `superseded`, `removed_from_campaign`, `campaign_completed`.",
                        "enum": [
                            "not_reached",
                            "cancelled_by_api",
                            "superseded",
                            "removed_from_campaign",
                            "campaign_completed",
                            null
                        ]
                    },
                    "outcome": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Talebin sonucu: kişi açtıysa son cevaplanan görüşmenin sonucu, açmadıysa son denemenin sonucu.",
                        "enum": [
                            "no_answer",
                            "busy",
                            "wrong_number",
                            "failed",
                            "voicemail",
                            "completed",
                            "hung_up",
                            "interested",
                            "callback_requested",
                            "follow_up_planned",
                            "meeting_scheduled",
                            "sale_made",
                            "payment_promised",
                            "survey_completed",
                            "confirmed",
                            "resolved",
                            "not_interested",
                            "do_not_call",
                            "transferred",
                            "dialed_out",
                            null
                        ]
                    },
                    "outcome_label": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Sonucun Türkçe adı."
                    },
                    "last_call": {
                        "oneOf": [
                            {
                                "$ref": "#/components/schemas/Call"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Talebin son görüşmesi ([Görüşme](#object-call) nesnesi) ya da `null`."
                    },
                    "created_at": {
                        "type": "string",
                        "description": "Talebin oluşturulma zamanı.",
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": "string",
                        "description": "Talebin son değiştiği zaman.",
                        "format": "date-time"
                    },
                    "completed_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Talebin sonuçlandığı zaman (`completed`, `failed`, `cancelled`, `blocked`).",
                        "format": "date-time"
                    }
                },
                "required": [
                    "id",
                    "status",
                    "campaign",
                    "contact",
                    "external_id",
                    "reason",
                    "instructions",
                    "variables",
                    "scheduled_at",
                    "attempts",
                    "next_attempt_at",
                    "waiting_reason",
                    "blocked_reason",
                    "failure_reason",
                    "outcome",
                    "outcome_label",
                    "last_call",
                    "created_at",
                    "updated_at",
                    "completed_at"
                ]
            },
            "Call": {
                "type": "object",
                "title": "Görüşme",
                "properties": {
                    "id": {
                        "type": "string",
                        "description": "Görüşmenin kimliği (ULID)."
                    },
                    "campaign": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": "string"
                            }
                        },
                        "required": [
                            "id",
                            "name"
                        ],
                        "description": "Kampanya: `id`, `name`."
                    },
                    "contact": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "phone": {
                                "type": "string"
                            },
                            "name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "required": [
                            "id",
                            "phone",
                            "name"
                        ],
                        "description": "Kişi: `id`, `phone`, `name`."
                    },
                    "status": {
                        "type": "string",
                        "description": "Teknik durum: `queued`, `dialing`, `ringing`, `in_progress`, `completed`, `failed`.",
                        "enum": [
                            "queued",
                            "dialing",
                            "ringing",
                            "in_progress",
                            "completed",
                            "failed"
                        ]
                    },
                    "outcome": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Görüşmenin sonucu; bkz. [sonuç değerleri](#outcomes).",
                        "enum": [
                            "no_answer",
                            "busy",
                            "wrong_number",
                            "failed",
                            "voicemail",
                            "completed",
                            "hung_up",
                            "interested",
                            "callback_requested",
                            "follow_up_planned",
                            "meeting_scheduled",
                            "sale_made",
                            "payment_promised",
                            "survey_completed",
                            "confirmed",
                            "resolved",
                            "not_interested",
                            "do_not_call",
                            "transferred",
                            "dialed_out",
                            null
                        ]
                    },
                    "outcome_label": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Sonucun Türkçe adı."
                    },
                    "direction": {
                        "type": "string",
                        "description": "`outbound` (giden) veya `inbound` (gelen çağrı).",
                        "enum": [
                            "outbound",
                            "inbound"
                        ]
                    },
                    "is_test": {
                        "type": "boolean",
                        "description": "Panelden yapılan test araması mı?"
                    },
                    "answered_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Kişinin açtığı zaman; açmadıysa `null`.",
                        "format": "date-time"
                    },
                    "ended_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Görüşmenin bittiği zaman.",
                        "format": "date-time"
                    },
                    "duration_seconds": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Görüşme süresi (saniye)."
                    },
                    "summary": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Görüşmenin yapay zekâ özeti."
                    },
                    "notes": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Önemli noktalar (madde işaretli metin)."
                    },
                    "interest_score": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "İlgi puanı (0–100)."
                    },
                    "next_action": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Önerilen sonraki adım."
                    },
                    "callback_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Kişinin tekrar aranmak istediği zaman.",
                        "format": "date-time"
                    },
                    "finalized_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Sonucun kesinleştiği zaman; boşsa görüşme sürüyor ya da özetleniyor.",
                        "format": "date-time"
                    },
                    "created_at": {
                        "type": "string",
                        "description": "Görüşme kaydının oluşturulma zamanı.",
                        "format": "date-time"
                    }
                },
                "required": [
                    "id",
                    "campaign",
                    "contact",
                    "status",
                    "outcome",
                    "outcome_label",
                    "direction",
                    "is_test",
                    "answered_at",
                    "ended_at",
                    "duration_seconds",
                    "summary",
                    "notes",
                    "interest_score",
                    "next_action",
                    "callback_at",
                    "finalized_at",
                    "created_at"
                ]
            },
            "Contact": {
                "type": "object",
                "title": "Kişi",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Kişinin kimliği."
                    },
                    "phone": {
                        "type": "string",
                        "description": "Telefon (E.164)."
                    },
                    "first_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Ad."
                    },
                    "last_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Soyad."
                    },
                    "company": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Firma."
                    },
                    "email": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "E-posta."
                    },
                    "customer_type": {
                        "type": "string",
                        "description": "`individual` (Bireysel) veya `merchant` (Tacir / esnaf).",
                        "enum": [
                            "individual",
                            "merchant"
                        ]
                    },
                    "iys_status": {
                        "type": "string",
                        "description": "`unchecked`, `allowed`, `denied` veya `not_found`.",
                        "enum": [
                            "unchecked",
                            "allowed",
                            "denied",
                            "not_found"
                        ]
                    },
                    "do_not_call": {
                        "type": "boolean",
                        "description": "Kişi aranmak istemiyor mu (aranmayacaklar listesi)?"
                    },
                    "about": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Kişi hakkında bilgi."
                    },
                    "custom_fields": {
                        "type": "object",
                        "additionalProperties": {
                            "type": "string"
                        },
                        "description": "Özel alanlar (ad → metin)."
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Oluşturulma zamanı.",
                        "format": "date-time"
                    }
                },
                "required": [
                    "id",
                    "phone",
                    "first_name",
                    "last_name",
                    "company",
                    "email",
                    "customer_type",
                    "iys_status",
                    "do_not_call",
                    "about",
                    "custom_fields",
                    "created_at"
                ]
            },
            "Campaign": {
                "type": "object",
                "title": "Kampanya",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Kampanyanın kimliği."
                    },
                    "name": {
                        "type": "string",
                        "description": "Kampanyanın adı."
                    },
                    "status": {
                        "type": "string",
                        "description": "`draft` (Taslak), `active` (Aktif), `paused` (Duraklatıldı) veya `completed` (Tamamlandı).",
                        "enum": [
                            "draft",
                            "active",
                            "paused",
                            "completed"
                        ]
                    },
                    "goal": {
                        "type": "string",
                        "description": "Kampanyanın hedefi: `sales` (satış), `upsell` (yenileme ve ek satış), `reactivation` (geri kazanma), `qualify` (nitelendirme), `meeting` (toplantı ve randevu), `product_intro` (ürün tanıtımı), `promotion` (kampanya duyurusu), `event` (etkinlik daveti), `survey` (anket), `collection` (ödeme hatırlatma), `confirmation` (teyit), `inform` (bilgilendirme) veya `callback` (geri arama).",
                        "enum": [
                            "sales",
                            "upsell",
                            "reactivation",
                            "qualify",
                            "meeting",
                            "product_intro",
                            "promotion",
                            "event",
                            "survey",
                            "collection",
                            "confirmation",
                            "inform",
                            "callback"
                        ]
                    }
                },
                "required": [
                    "id",
                    "name",
                    "status",
                    "goal"
                ]
            },
            "Hook": {
                "type": "object",
                "title": "Tetikleyici",
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Tetikleyicinin kimliği."
                    },
                    "event": {
                        "type": "string",
                        "description": "Gönderilen olay.",
                        "enum": [
                            "call.finalized",
                            "meeting.scheduled",
                            "contact.dnc",
                            "call_request.completed"
                        ]
                    },
                    "target_url": {
                        "type": "string",
                        "description": "Olayların gönderildiği adres.",
                        "format": "uri"
                    },
                    "source": {
                        "type": "string",
                        "description": "Tetikleyiciyi açan araç.",
                        "enum": [
                            "zapier",
                            "make",
                            "n8n",
                            "pabbly",
                            "power_automate",
                            "other"
                        ]
                    },
                    "filters": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "campaign_id": {
                                "type": "integer"
                            },
                            "outcomes": {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                }
                            }
                        },
                        "required": [
                            "campaign_id",
                            "outcomes"
                        ],
                        "description": "Varsa filtreler: `campaign_id`, `outcomes`."
                    },
                    "status": {
                        "type": "string",
                        "description": "`active` ya da `disabled` (art arda başarısız gönderimlerden sonra durduruldu).",
                        "enum": [
                            "active",
                            "disabled"
                        ]
                    },
                    "created_at": {
                        "type": "string",
                        "description": "Açıldığı zaman.",
                        "format": "date-time"
                    },
                    "last_delivered_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Son başarılı gönderim.",
                        "format": "date-time"
                    },
                    "disabled_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Durdurulduğu zaman.",
                        "format": "date-time"
                    }
                },
                "required": [
                    "id",
                    "event",
                    "target_url",
                    "source",
                    "filters",
                    "status",
                    "created_at",
                    "last_delivered_at",
                    "disabled_at"
                ]
            },
            "CampaignMembership": {
                "type": "object",
                "title": "Kampanya listesindeki yeri",
                "properties": {
                    "campaign_id": {
                        "type": "integer",
                        "description": "Kampanyanın kimliği."
                    },
                    "status": {
                        "type": "string",
                        "description": "`pending` (bekliyor), `dialing` (aranıyor), `done` (tamamlandı) veya `excluded` (hariç tutuldu).",
                        "enum": [
                            "pending",
                            "dialing",
                            "done",
                            "excluded"
                        ]
                    },
                    "next_attempt_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Sıradaki aramanın en erken zamanı.",
                        "format": "date-time"
                    },
                    "excluded_reason": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Hariç tutulma nedeni (ör. `dnc_listed`)."
                    }
                },
                "required": [
                    "campaign_id",
                    "status",
                    "next_attempt_at",
                    "excluded_reason"
                ]
            },
            "Error": {
                "type": "object",
                "title": "Hata cevabı",
                "required": [
                    "error"
                ],
                "properties": {
                    "error": {
                        "type": "object",
                        "required": [
                            "code",
                            "message"
                        ],
                        "properties": {
                            "code": {
                                "type": "string",
                                "enum": [
                                    "unauthenticated",
                                    "tenant_suspended",
                                    "not_found",
                                    "contact_busy",
                                    "request_not_cancellable",
                                    "request_in_progress",
                                    "validation_failed",
                                    "campaign_not_ready",
                                    "idempotency_key_reused",
                                    "rate_limited"
                                ]
                            },
                            "message": {
                                "type": "string"
                            },
                            "fields": {
                                "type": "object",
                                "additionalProperties": {
                                    "type": "array",
                                    "items": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "example": {
                    "error": {
                        "code": "validation_failed",
                        "message": "Geçerli bir telefon numarası girin.",
                        "fields": {
                            "phone": [
                                "Geçerli bir telefon numarası girin."
                            ]
                        }
                    }
                }
            }
        }
    }
}