{
  "openapi": "3.1.1",
  "info": {
    "title": "Postlip Metrics Management API",
    "version": "1.0.0",
    "description": "Uygulama, kaynak ve olay şemasının otomasyonu (ör. CI'da şema senkronu, `metrics pull`) ve Query API (panelin metrik sorgusu, `/v1/query`). Kimlik: organizasyonun panelden oluşturduğu API anahtarı, `Authorization: Bearer mk_…`. Kapsamlar: `management:read`, `management:write` (okumayı da içerir), `query:read` (Query API: `POST /v1/query`, `GET /v1/query/catalogue`, huni sonuçları; reklam metrikleri dahil), `leads:read` (talep kutusu), `ads:read` (reklam hesapları, kampanyalar, bütçe, bağlantıların sağlığı), `reports:read` (kayıtlı raporlar, donmuş çıktıları ve PDF’leri, tahmin senaryoları), `social:read` (sosyal medya hesapları, özetin sayıları, gönderiler ve sayıları), `messaging:read` / `messaging:write` (Mailing & SMS listeleri, kampanyalar ve sonuçları; kişi, izin, bastırma), `persons:read` (analitik kişi ve hesap profilleri ve zaman çizelgeleri, panelin saklama kurallarıyla; dalga 16). Dalga 16’dan `management:write` ayrıca kaynakları ve anahtarlarını, olay tanımlarının durumunu ve silinmesini, kişi / hesap özellik tanımlarını yönetir ve üye davet eder (`management:read`: üyeler, roller, davetler). Hata gövdesi her uçta `{ \"error\": { \"code\", \"message\", \"fields\"?, \"details\"?, \"traceId\" } }`; `message` isteğin dilinde (`Accept-Language`: tr, en). Liste uçları imleç sayfalamalıdır: `?cursor=&limit=` (≤ 200), yanıt `{ items, nextCursor }`."
  },
  "servers": [
    {
      "url": "https://api.metrics.example",
      "description": "Management API"
    }
  ],
  "tags": [
    {
      "name": "Sağlık",
      "description": "Sürecin ve veritabanı bağlantısının durumu."
    },
    {
      "name": "Organizasyon",
      "description": "Organizasyon ayarları, üyeler, davetler, roller."
    },
    {
      "name": "Uygulamalar",
      "description": "Ölçülen ürünler: saat dilimi, para birimi, doğrulama kipi, atıf ve saklama ayarları; test, iç ve bot trafiği işaretleyen trafik filtresi kuralları."
    },
    {
      "name": "Kaynaklar",
      "description": "Veri gönderen istemciler, yakalama ayarları, yazma anahtarları ve imza anahtarları, kaynak sağlığı."
    },
    {
      "name": "Olay şeması",
      "description": "Olay ve özellik tanımları, kişi/hesap özellikleri, değişiklik geçmişi, keşfedilen olaylar, şema paketi."
    },
    {
      "name": "Ölçüm",
      "description": "Metrik kataloğu ve sorgu servisi: metrik sorgusu, katalog, Trafik ekranı, tüm uygulamalar, uygulamanın tanımladığı metrikler ve Query API."
    },
    {
      "name": "Davranış",
      "description": "Oturumlar ve zaman çizelgesi, ısı haritası, takılma sinyalleri ve hızlı geri dönüş, JS hataları, ziyaretçi yolları ve sayfadan sayfaya geçişler, kişi ve hesap profilleri."
    },
    {
      "name": "Veri hakları",
      "description": "Kişisel veri silme talepleri (KVKK): kullanıcı kimliği, anonim kimlik ya da kişi kimliğiyle bir kişinin uygulamadaki bütün verisi silinir, talep kaydı ve silinenler kalır."
    },
    {
      "name": "Dönüşüm",
      "description": "Huniler (tanım, sonuç, dönüşüm süresi, kırılım, adımın kişileri) ve atıf servisinin modelleri."
    },
    {
      "name": "Talepler",
      "description": "Talep kutusu: durum, sorumlu, notlar, kaynak ve atıf anlık görüntüsü; kişisel veri yok."
    },
    {
      "name": "Bağlantılar",
      "description": "Reklam ve analytics platformlarına bağlantılar (OAuth 2.0 + PKCE, API anahtarı, CSV), hesap seçimi, senkron, çalışma günlüğü, sağlık."
    },
    {
      "name": "Reklam",
      "description": "Reklam özeti, kampanyalar ve reklamlar, raporlar, kırılımlar, bütçe planı ve tempo, kampanya planları."
    },
    {
      "name": "Raporlar",
      "description": "Bölüm kataloğu, raporlar ve şablonlar, donmuş çıktılar ve PDF, e-posta ve zamanlanmış gönderim, teslim günlüğü, paylaşım bağlantıları, AI özeti, tahmin."
    },
    {
      "name": "Sosyal medya",
      "description": "Instagram, Facebook sayfası ve LinkedIn şirket sayfası hesapları; özet, en iyi paylaşım zamanı, gönderiler ve sayıları; içerik takvimi, planlanan gönderiler, onay akışı, zamanlanmış yayın ve hatırlatmalar."
    },
    {
      "name": "Segmentler",
      "description": "Kural tabanlı kişi kümeleri: kişi alanları, izinler, listeler ve bağlı kişinin olayları (iş rolüyle); kullanıldıkları anda değerlendirilir."
    },
    {
      "name": "Mailing & SMS",
      "description": "Kişiler (kimlik bilgileri yalnız şifreli), listeler, özel alanlar, izinler ve kanıtları, içe / dışa aktarma, şablonlar, kampanyalar (test, onay, zamanlama, sonuçlar), işlemsel tetikleyiciler, sağlayıcılar, gönderen kimlikleri; iletilerin herkese açık adresleri (açılma pikseli, tıklama yönlendirmesi, abonelikten çıkma) ve sağlayıcı webhook'ları."
    }
  ],
  "paths": {
    "/v1/apps": {
      "get": {
        "tags": [
          "Uygulamalar"
        ],
        "summary": "Uygulamalar",
        "description": "Anahtarın uygulama kapsamındakiler.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `management:read`.",
        "operationId": "managementApps.list",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,512}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "archived"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "management:read"
        ]
      },
      "post": {
        "tags": [
          "Uygulamalar"
        ],
        "summary": "Uygulama ekle",
        "description": "Bütün uygulamalar kapsamlı anahtar gerekir.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `management:write`.",
        "operationId": "managementApps.create",
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAppRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Oluşturuldu.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/App"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "management:write"
        ]
      }
    },
    "/v1/apps/{appId}": {
      "get": {
        "tags": [
          "Uygulamalar"
        ],
        "summary": "Uygulama",
        "description": "Uygulamanın ayarları. Tek uygulama okumasında (dalga 16) ayrıca, uygulama kendi setini kaydetmemişken Genel bakış ve Reklam özetinin gösterdiği varsayılan setler: `defaultOverviewTiles` (uygulamanın tanımlarının oynadığı dönüşüm rolleri, uygulamanın sırasıyla, en çok 5) ve `defaultAdsKpis` (harcama, gösterim, tıklama, ilk dört rolün reklamdan dönüşümü, ilk rolün dönüşüm başı maliyeti) — kural contracts `defaultOverviewTiles` / `defaultAdsKpis`. Kapsam: `management:read`.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `management:read`.",
        "operationId": "managementApps.get",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/App"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "management:read"
        ]
      },
      "patch": {
        "tags": [
          "Uygulamalar"
        ],
        "summary": "Uygulamayı güncelle",
        "description": "Ayarlar (13. dalga): `revenueBasis` (`gross` | `net` — başlık gelir), `pricesIncludeTax` (tutarlar KDV dahil mi; brüt para metriklerinin etiketi bunu söyler), `overviewTiles` (Genel bakış kutuları, en çok 12: katalog metriği ve isteğe bağlı kırılım — metrik ve boyut katalogla doğrulanır), `adsKpis` (Reklam KPI seti, en çok 12; boş: varsayılan), `modules` (açık modüller: `ads`, `social`, `messaging`, `content`, `leads`, `behavior`; kapalı modülün uçları `403 APP_MODULE_DISABLED`), `defaultAlertRecipients` (alıcı vermeyen yeni uyarı kuralının alıcıları; üyeler ve kanallar doğrulanır), `searchBrandTerms` (Search Console marka ayrımı, küçük harfe çevrilir). Hatalı alan `fields` altında (ör. `overviewTiles.0.metric`).\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `management:write`.",
        "operationId": "managementApps.update",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAppRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/App"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "management:write"
        ]
      }
    },
    "/v1/apps/{appId}/accounts": {
      "get": {
        "tags": [
          "Davranış"
        ],
        "summary": "Hesaplar",
        "description": "Uygulamanın hesapları (`group` çağrıları ve `context.groupId`; B2B müşteri hesabı), son görülme, ilk görülme ya da üye sayısı sırasıyla, imleç sayfalı, toplamla. `search` hesap kimliğinin başı ya da `name` özelliğinin bir parçası. Management API (dalga 16; 07 YEN-13): kapsam `persons:read`; panelle aynı saklama kuralları — kişisel ya da hassas veri tanımlı ya da eylemi `allow` olmayan özellik özetiyle döner (`hash`) ya da hiç dönmez (`drop`, `reject`: yalnız adı `withheldTraits`te), kimlikler opak; profildeki talepler yalnız anahtarda `leads:read` de varsa.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `persons:read`.",
        "operationId": "managementProfiles.accountList",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,512}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "last_seen",
              "type": "string",
              "enum": [
                "last_seen",
                "first_seen",
                "members"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "persons:read"
        ]
      }
    },
    "/v1/apps/{appId}/accounts/{groupId}": {
      "get": {
        "tags": [
          "Davranış"
        ],
        "summary": "Hesap profili",
        "description": "Hesabın özellikleri (olay zamanına göre en yeni değer; kişisel veri tanımlı olanlar özetlenir ya da gösterilmez), ilk ve son görülme (olay zamanı), üyeleri (en son görülen 20), üyelerin son oturumları, olayları, dönüşümleri, ulaşılan roller, `summary` (üye, oturum, olay, dönüşüm, brüt gelir, iade, net gelir; metrik kataloğunun kurallarıyla, bütün geçmiş), talepler (`leads.read` ile). Bir olay hesabındır: kendi `groupId`si, yoksa kişisinin tek hesabıysa (hunilerin `group` kuralı). Hesap kimliği uygulamanın opak kimliğidir (adreste URL kodlu). Management API (dalga 16; 07 YEN-13): kapsam `persons:read`; panelle aynı saklama kuralları — kişisel ya da hassas veri tanımlı ya da eylemi `allow` olmayan özellik özetiyle döner (`hash`) ya da hiç dönmez (`drop`, `reject`: yalnız adı `withheldTraits`te), kimlikler opak; profildeki talepler yalnız anahtarda `leads:read` de varsa.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `persons:read`.",
        "operationId": "managementProfiles.account",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "description": "Sayfa grubunun kimliği (sayfa grubu uçları) ya da hesabın kimliği (`groupId`, hesap uçları).",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountProfile"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "persons:read"
        ]
      }
    },
    "/v1/apps/{appId}/accounts/{groupId}/events": {
      "get": {
        "tags": [
          "Davranış"
        ],
        "summary": "Hesabın olay zaman çizelgesi",
        "description": "Hesabın bütün olayları (kişisiyle), yeniden eskiye, imleç sayfalı; `type`, `conversions=true` süzgeçleri. Management API (dalga 16; 07 YEN-13): kapsam `persons:read`; panelle aynı saklama kuralları — kişisel ya da hassas veri tanımlı ya da eylemi `allow` olmayan özellik özetiyle döner (`hash`) ya da hiç dönmez (`drop`, `reject`: yalnız adı `withheldTraits`te), kimlikler opak; profildeki talepler yalnız anahtarda `leads:read` de varsa.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `persons:read`.",
        "operationId": "managementProfiles.accountEvents",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "description": "Sayfa grubunun kimliği (sayfa grubu uçları) ya da hesabın kimliği (`groupId`, hesap uçları).",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,512}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "track",
                "identify",
                "page",
                "screen",
                "group",
                "alias"
              ]
            }
          },
          {
            "name": "conversions",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountEventPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "persons:read"
        ]
      }
    },
    "/v1/apps/{appId}/accounts/{groupId}/members": {
      "get": {
        "tags": [
          "Davranış"
        ],
        "summary": "Hesabın üyeleri",
        "description": "Hesabın bütün kişileri, son görülme sırasıyla, imleç sayfalı, toplamla; `joinedAt` kişinin hesapta ilk görüldüğü olay zamanı. Management API (dalga 16; 07 YEN-13): kapsam `persons:read`; panelle aynı saklama kuralları — kişisel ya da hassas veri tanımlı ya da eylemi `allow` olmayan özellik özetiyle döner (`hash`) ya da hiç dönmez (`drop`, `reject`: yalnız adı `withheldTraits`te), kimlikler opak; profildeki talepler yalnız anahtarda `leads:read` de varsa.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `persons:read`.",
        "operationId": "managementProfiles.accountMembers",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "description": "Sayfa grubunun kimliği (sayfa grubu uçları) ya da hesabın kimliği (`groupId`, hesap uçları).",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,512}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountMemberPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "persons:read"
        ]
      }
    },
    "/v1/apps/{appId}/ads/accounts": {
      "get": {
        "tags": [
          "Reklam"
        ],
        "summary": "Management API: reklam hesapları",
        "description": "Kapsam `ads:read`.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `ads:read`.",
        "operationId": "managementAds.accounts",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdAccountList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "ads:read"
        ]
      }
    },
    "/v1/apps/{appId}/ads/budget": {
      "get": {
        "tags": [
          "Reklam"
        ],
        "summary": "Management API: bütçe ve tempo",
        "description": "Kapsam `ads:read`.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `ads:read`.",
        "operationId": "managementAds.budget",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "month",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 7,
              "maxLength": 7,
              "pattern": "^\\d{4}-(0[1-9]|1[0-2])$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdsBudget"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "ads:read"
        ]
      }
    },
    "/v1/apps/{appId}/ads/campaigns": {
      "get": {
        "tags": [
          "Reklam"
        ],
        "summary": "Management API: kampanyalar",
        "description": "Kapsam `ads:read`. Her sayı metrik kataloğundandır (sorgu servisi): platformun sayıları (`spend`, `impressions`, `ad_clicks`, `ctr`, `cpc`, `cpm`, `platform_conversions`) ve Postlip Metrics’in atıf servisiyle reklama verdiği dönüşümler (`ad_conversions`, `ad_conversions:<rol>`, `cpa`, `cpa:<rol>`, `ad_revenue`, `roas`) yan yana, hiç karıştırılmaz. Harcama KDV hariç, günün kuruyla uygulamanın para biriminde; ROAS net gelir ÷ harcama. Hepsi olay tarihiyle sayılır (harcama harcandığı gün, dönüşüm gerçekleştiği gün). Aynı metrikler Query API'de (`POST /v1/query`, `ad_*` boyutları) de vardır.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `ads:read`.",
        "operationId": "managementAds.campaigns",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "compare",
            "in": "query",
            "required": false,
            "schema": {
              "default": "previous_period",
              "type": "string",
              "enum": [
                "none",
                "previous_period",
                "previous_year"
              ]
            }
          },
          {
            "name": "alignment",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "week_to_date",
                "month_to_date",
                "calendar_month",
                "quarter_to_date",
                "calendar_quarter",
                "year_to_date",
                "calendar_year"
              ]
            }
          },
          {
            "name": "includeTest",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "includeInternal",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "includeBot",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "platforms",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4000
            }
          },
          {
            "name": "accountIds",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4000
            }
          },
          {
            "name": "attributionModel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "first_touch",
                "last_touch",
                "last_non_direct",
                "linear",
                "position_based",
                "time_decay",
                "last_paid"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "default": "all",
              "type": "string",
              "enum": [
                "active",
                "paused",
                "ended",
                "all"
              ]
            }
          },
          {
            "name": "orderBy",
            "in": "query",
            "required": false,
            "schema": {
              "default": "spend",
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "default": "desc",
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "minClicks",
            "in": "query",
            "required": false,
            "schema": {
              "default": 20,
              "type": "integer",
              "minimum": 0,
              "maximum": 10000000
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          {
            "name": "naming",
            "in": "query",
            "required": false,
            "schema": {
              "default": "all",
              "type": "string",
              "enum": [
                "all",
                "off_template",
                "follows_template"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdsCampaigns"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "ads:read"
        ]
      }
    },
    "/v1/apps/{appId}/ads/conversions": {
      "get": {
        "tags": [
          "Reklam"
        ],
        "summary": "Management API: reklamdan gelen dönüşümler",
        "description": "Kapsam `ads:read`. Panelin listesiyle aynı (07 REK-38): reklama atfedilen dönüşümler, ulaşılan en ileri aşama, opak kimlikler; kişisel veri yoktur.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `ads:read`.",
        "operationId": "managementAds.conversionList",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includeTest",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "includeInternal",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "includeBot",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "platforms",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4000
            }
          },
          {
            "name": "accountIds",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4000
            }
          },
          {
            "name": "campaignIds",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4000
            }
          },
          {
            "name": "role",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "signup",
                "login",
                "trial_start",
                "trial_end",
                "activation",
                "core_action",
                "lead",
                "demo_request",
                "contact_click",
                "checkout_start",
                "payment_failed",
                "purchase",
                "subscription_renewal",
                "refund",
                "churn",
                "referral"
              ]
            }
          },
          {
            "name": "model",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "first_touch",
                "last_touch",
                "last_non_direct",
                "linear",
                "position_based",
                "time_decay",
                "last_paid"
              ]
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "default": "ads",
              "type": "string",
              "enum": [
                "ads",
                "all"
              ]
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,512}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdConversionPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "ads:read"
        ]
      }
    },
    "/v1/apps/{appId}/analytics/segments": {
      "get": {
        "tags": [
          "Segmentler"
        ],
        "summary": "Kişi ve hesap segmentleri",
        "description": "Query API isteğinin `segmentId` ile adlandırabileceği segmentler (`subject` ile yalnız biri). Kapsam: `query:read`.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `query:read`.",
        "operationId": "managementAnalyticsSegments.list",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "subject",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "person",
                "account"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsSegmentList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "query:read"
        ]
      }
    },
    "/v1/apps/{appId}/analytics/segments/{segmentId}": {
      "get": {
        "tags": [
          "Segmentler"
        ],
        "summary": "Kişi ya da hesap segmenti",
        "description": "Analitik kişi (`person`) ya da hesap (`account`) segmenti (dalga 16; 07 YEN-18). Kurallar (en çok 20, `all` ya da `any`): özellik (`trait`: kişinin identify ya da hesabın group özelliği, olay zamanına göre en yeni değer — metin olarak büyük/küçük harf farksız `eq`, `neq`, `in`, `contains`, `starts_with`, `is_empty`, `is_not_empty`, yalnız JSON sayısına `gt`, `gte`, `lt`, `lte`), olay (`event`: iş rolü ya da olay adı, son N günde en az K kez — `has: false` ile yapmamış —, en çok 5 olay özelliği süzgeciyle; test ve bot trafiği sayılmaz, kişiye birleşen kişilerin olayları sayılır; hesapta kendi `groupId`si olan olaylar ve tek hesabı bu olan üyelerin hesapsız olayları) ve görülme (`seen`: ilk / son görülme son N günde ya da değil). Değerini profilde gizleyen özellik (kişisel ya da hassas veri sınıfı, `allow` dışı eylem) kural olamaz (`trait_personal`, `property_personal`). Segment kullanıldığı anda değerlendirilir, üye listesi saklanmaz. Kullanım: sorgunun, rapor ve bölümünün, eşik kuralının `segmentId`’si; 18. dalgadan Mailing kişi segmentinin `analytics_segment` kuralı ve Mailing metrikleri (alıcının kişisi, kullanıcı kimliğiyle) ile kampanya sonuçlarının `segmentId`’si. Kapsam: `query:read`.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `query:read`.",
        "operationId": "managementAnalyticsSegments.get",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "segmentId",
            "in": "path",
            "required": true,
            "description": "Segmentin kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsSegment"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "query:read"
        ]
      }
    },
    "/v1/apps/{appId}/analytics/segments/{segmentId}/count": {
      "post": {
        "tags": [
          "Segmentler"
        ],
        "summary": "Kişi ya da hesap segmentini say",
        "description": "Segmentin şimdi eşleştiği kişi ya da hesap sayısı ve en son görülen ilk 10’unun opak kimliği; kişisel veri dönmez. Kapsam: `query:read`.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `query:read`.",
        "operationId": "managementAnalyticsSegments.count",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "segmentId",
            "in": "path",
            "required": true,
            "description": "Segmentin kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsSegmentCount"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "query:read"
        ]
      }
    },
    "/v1/apps/{appId}/connections": {
      "get": {
        "tags": [
          "Bağlantılar"
        ],
        "summary": "Management API: bağlantılar",
        "description": "Uygulamanın bağlantıları ve sağlıkları; kapsam `ads:read`. Erişim belirteçleri ve API anahtarları sır kutusunda (AES-GCM) saklanır, hiçbir yanıtta dönmez.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `ads:read`.",
        "operationId": "managementConnections.list",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "ads:read"
        ]
      }
    },
    "/v1/apps/{appId}/event-definitions": {
      "get": {
        "tags": [
          "Olay şeması"
        ],
        "summary": "Olay tanımları",
        "description": "Management API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `management:read`.",
        "operationId": "managementSchema.list",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,512}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "draft",
                "active",
                "deprecated",
                "blocked"
              ]
            }
          },
          {
            "name": "role",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "signup",
                "login",
                "trial_start",
                "trial_end",
                "activation",
                "core_action",
                "lead",
                "demo_request",
                "contact_click",
                "checkout_start",
                "payment_failed",
                "purchase",
                "subscription_renewal",
                "refund",
                "churn",
                "referral"
              ]
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventDefinitionPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "management:read"
        ]
      },
      "post": {
        "tags": [
          "Olay şeması"
        ],
        "summary": "Olay tanımı ekle",
        "description": "Her değişiklik tanımın sürümünü bir artırır, uygulamanın şema revizyonunu ilerletir ve `schema_changes` geçmişine yazılır. `$` ile başlayan adlar sistem olaylarına ayrılmıştır; seçenekli (`enum`) tip izinli değer ister; kişisel ve hassas veri `allow` ile saklanamaz.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `management:write`.",
        "operationId": "managementSchema.create",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateEventDefinitionRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Oluşturuldu.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventDefinitionRecord"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "management:write"
        ]
      }
    },
    "/v1/apps/{appId}/event-definitions/{eventId}": {
      "get": {
        "tags": [
          "Olay şeması"
        ],
        "summary": "Olay tanımı",
        "description": "Management API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `management:read`.",
        "operationId": "managementSchema.get",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "eventId",
            "in": "path",
            "required": true,
            "description": "Olay tanımının kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventDefinitionRecord"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "management:read"
        ]
      },
      "delete": {
        "tags": [
          "Olay şeması"
        ],
        "summary": "Olay tanımını sil",
        "description": "Geçmişe silme kaydı yazılır; saklanan olaylar kalır. Kapsam: `management:write`; panelle aynı kurallar ve denetim kaydı (işlemi yapan anahtar).\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `management:write`.",
        "operationId": "managementSchema.remove",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "eventId",
            "in": "path",
            "required": true,
            "description": "Olay tanımının kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Başarılı; yanıt gövdesi yok."
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "management:write"
        ]
      },
      "patch": {
        "tags": [
          "Olay şeması"
        ],
        "summary": "Olay tanımını güncelle",
        "description": "`properties` gönderilirse listenin tamamını değiştirir (anahtarı korunan özelliğin kimliği kalır). Ad değişmez; eski adlar `aliases` ile eşlenir. Her değişiklik tanımın sürümünü bir artırır, uygulamanın şema revizyonunu ilerletir ve `schema_changes` geçmişine yazılır. `$` ile başlayan adlar sistem olaylarına ayrılmıştır; seçenekli (`enum`) tip izinli değer ister; kişisel ve hassas veri `allow` ile saklanamaz.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `management:write`.",
        "operationId": "managementSchema.update",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "eventId",
            "in": "path",
            "required": true,
            "description": "Olay tanımının kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateEventDefinitionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventDefinitionRecord"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "management:write"
        ]
      }
    },
    "/v1/apps/{appId}/event-definitions/{eventId}/json-schema": {
      "get": {
        "tags": [
          "Olay şeması"
        ],
        "summary": "Olayın JSON Schema belgesi",
        "description": "Özellikler JSON Schema (draft 2020-12) olarak; katı kipte tanımsız özellik reddedilir (`additionalProperties: false`).\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `management:read`.",
        "operationId": "managementSchema.jsonSchema",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "eventId",
            "in": "path",
            "required": true,
            "description": "Olay tanımının kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JsonSchemaDocument"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "management:read"
        ]
      }
    },
    "/v1/apps/{appId}/event-definitions/{eventId}/status": {
      "post": {
        "tags": [
          "Olay şeması"
        ],
        "summary": "Olay tanımının durumunu değiştir",
        "description": "`draft`, `active`, `deprecated` (uyarıyla kabul) ya da `blocked` (alımda reddedilir); geçmişe yazılır. Kapsam: `management:write`; panelle aynı kurallar ve denetim kaydı (işlemi yapan anahtar).\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `management:write`.",
        "operationId": "managementSchema.status",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "eventId",
            "in": "path",
            "required": true,
            "description": "Olay tanımının kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChangeEventStatusRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventDefinitionRecord"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "management:write"
        ]
      }
    },
    "/v1/apps/{appId}/forecast/scenarios": {
      "get": {
        "tags": [
          "Raporlar"
        ],
        "summary": "Tahmin senaryoları",
        "description": "Management API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `reports:read`.",
        "operationId": "managementReports.scenarios",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForecastScenarioList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "reports:read"
        ]
      }
    },
    "/v1/apps/{appId}/forecast/scenarios/{scenarioId}": {
      "get": {
        "tags": [
          "Raporlar"
        ],
        "summary": "Tahmin senaryosu",
        "description": "Management API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `reports:read`.",
        "operationId": "managementReports.scenario",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scenarioId",
            "in": "path",
            "required": true,
            "description": "Tahmin senaryosunun kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForecastScenario"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "reports:read"
        ]
      }
    },
    "/v1/apps/{appId}/funnels": {
      "get": {
        "tags": [
          "Dönüşüm"
        ],
        "summary": "Management API: huniler",
        "description": "Management API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `management:read`.",
        "operationId": "managementFunnels.list",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FunnelList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "management:read"
        ]
      }
    },
    "/v1/apps/{appId}/funnels/{funnelId}": {
      "get": {
        "tags": [
          "Dönüşüm"
        ],
        "summary": "Management API: huni tanımı",
        "description": "Management API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `management:read`.",
        "operationId": "managementFunnels.get",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "funnelId",
            "in": "path",
            "required": true,
            "description": "Huninin kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Funnel"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "management:read"
        ]
      }
    },
    "/v1/apps/{appId}/funnels/{funnelId}/results": {
      "get": {
        "tags": [
          "Dönüşüm"
        ],
        "summary": "Management API: huni sonucu",
        "description": "Panelin huni sonucu entegrasyonlar için (tazelik ve isteğe bağlı karşılaştırmayla); kapsam `query:read`. Adım: bir olay adı (`event`) ya da iş rolü (`role`) ve olay özelliği filtreleri (`eq`, `neq`, `in`, `not_in`, `contains`, `not_contains`, `starts_with`, `is_empty`, `is_not_empty`; sayısal `gt`, `gte`, `lt`, `lte`). Giriş: öznenin dönem içindeki **ilk** 1. adım olayı (uygulamanın yerel günleri). `ordered`: k. adım, (k−1). adımdan sonraki ilk k. adım olayıdır (zaman, sonra kimlik); `any_order`: girişten sonraki ilk k. adım olayıdır, diğerlerinin sırası aranmaz — yanıtta adım başına \"ulaşan\" verilir, kayıp verilmez (negatif kayıp çıkmaz). Pencere (`conversionWindow`) girişten itibaren sayılır; yoksa sınır yok. Sayım birimi: `person` (birleşmiş kimlikler tek kişi), `session`, `group` (olayın hesabı, yoksa kişinin tek hesabı). **Sayım modu** yanıtta açıkça yazar: `cohort` dönemde giren özneleri bugüne (ya da pencerenin sonuna) kadar izler (`followedUntil`); `event_date` bütün adımların dönem içinde olmasını ister. Test, iç ve bot trafiği istenmedikçe dışarıdadır. Dönüşüm süresi: adım başına önceki adımdan (yalnız `ordered`) ve girişten saniye olarak ortalama, medyan, p75, p90 ve dağılım (1 dk, 5 dk, 15 dk, 1 sa, 6 sa, 1 g, 3 g, 7 g, 14 g, 30 g, üstü). `$pageview` / `$screen` adımında `path` süzgeci olayın sayfa yolunu (`page_path`) okur (metin kuralları; sayısal işleçler eşleşmez). Yan göstergeler (`sideMetrics`, en çok 5): girenlerden girişte ya da sonrasında (pencere içinde; `event_date`'te dönem içinde) göstergenin olayı olan özne sayısı ve girenlere oranı; `without` ile yalnız **ilk** bu olaydan sonra `withinDays` gün içinde `without` olayı olmayanlar — süresi dolmamışlar `pending`.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `query:read`.",
        "operationId": "managementFunnels.run",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "funnelId",
            "in": "path",
            "required": true,
            "description": "Huninin kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "countingMode",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "event_date",
                "cohort"
              ]
            }
          },
          {
            "name": "breakdown",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "channel",
                    "source",
                    "medium",
                    "campaign",
                    "device_type",
                    "country",
                    "attributed_channel",
                    "attributed_source",
                    "attributed_campaign",
                    "os",
                    "browser",
                    "region",
                    "app_version",
                    "language",
                    "channel_group"
                  ]
                },
                {
                  "type": "string",
                  "pattern": "^property:[A-Za-z_][A-Za-z0-9_]{0,99}$"
                }
              ]
            }
          },
          {
            "name": "attributionModel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "first_touch",
                "last_touch",
                "last_non_direct",
                "linear",
                "position_based",
                "time_decay",
                "last_paid"
              ]
            }
          },
          {
            "name": "includeTest",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "includeInternal",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "includeBot",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "compare",
            "in": "query",
            "required": false,
            "schema": {
              "default": "none",
              "type": "string",
              "enum": [
                "none",
                "previous_period",
                "previous_year"
              ]
            }
          },
          {
            "name": "alignment",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "week_to_date",
                "month_to_date",
                "calendar_month",
                "quarter_to_date",
                "calendar_quarter",
                "year_to_date",
                "calendar_year"
              ]
            }
          },
          {
            "name": "series",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "day",
                "week",
                "month"
              ]
            }
          },
          {
            "name": "seriesBasis",
            "in": "query",
            "required": false,
            "schema": {
              "default": "step_date",
              "type": "string",
              "enum": [
                "step_date",
                "entry_date"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FunnelScreenResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "query:read"
        ]
      }
    },
    "/v1/apps/{appId}/funnels/{funnelId}/results/cohorts": {
      "get": {
        "tags": [
          "Dönüşüm"
        ],
        "summary": "Management API: huni kohort ısı haritası",
        "description": "Panelin kohort ısı haritası entegrasyonlar için; kapsam `query:read`. Haftalık giriş kohortları, girişten sonraki haftalara göre birikimli ulaşma, düşük örnek işareti.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `query:read`.",
        "operationId": "managementFunnels.cohorts",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "funnelId",
            "in": "path",
            "required": true,
            "description": "Huninin kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "step",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 2,
              "maximum": 10
            }
          },
          {
            "name": "weeks",
            "in": "query",
            "required": false,
            "schema": {
              "default": 8,
              "type": "integer",
              "minimum": 1,
              "maximum": 26
            }
          },
          {
            "name": "includeTest",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "includeInternal",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "includeBot",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FunnelCohorts"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "query:read"
        ]
      }
    },
    "/v1/apps/{appId}/group-traits": {
      "get": {
        "tags": [
          "Olay şeması"
        ],
        "summary": "Hesap özelliği tanımları",
        "description": "Uygulamanın hesap (group) özellik tanımları (anahtar, tür, kişisel veri sınıfı ve eylemi, iki dilde ad). Kapsam: `management:read`.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `management:read`.",
        "operationId": "managementSchema.listGroupTraits",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TraitList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "management:read"
        ]
      },
      "post": {
        "tags": [
          "Olay şeması"
        ],
        "summary": "Hesap özelliği tanımı ekle",
        "description": "Kişisel veri sınıfı (`piiClass`) ve eylemi (`piiAction`: `allow`, `hash`, `drop`, `reject`) alımda ve profillerde uygulanır. Kapsam: `management:write`; panelle aynı kurallar ve denetim kaydı (işlemi yapan anahtar).\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `management:write`.",
        "operationId": "managementSchema.createGroupTrait",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PropertyDefinitionInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Oluşturuldu.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PropertyDefinitionRecord"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "management:write"
        ]
      }
    },
    "/v1/apps/{appId}/group-traits/{propertyId}": {
      "delete": {
        "tags": [
          "Olay şeması"
        ],
        "summary": "Hesap özelliği tanımını sil",
        "description": "Saklanan değerler kalır; tanımsız özellik uygulamanın şema kipine göre işlenir. Kapsam: `management:write`; panelle aynı kurallar ve denetim kaydı (işlemi yapan anahtar).\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `management:write`.",
        "operationId": "managementSchema.deleteGroupTrait",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "propertyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Başarılı; yanıt gövdesi yok."
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "management:write"
        ]
      },
      "patch": {
        "tags": [
          "Olay şeması"
        ],
        "summary": "Hesap özelliği tanımını güncelle",
        "description": "Anahtar değişmez. Kapsam: `management:write`; panelle aynı kurallar ve denetim kaydı (işlemi yapan anahtar).\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `management:write`.",
        "operationId": "managementSchema.updateGroupTrait",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "propertyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTraitRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PropertyDefinitionRecord"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "management:write"
        ]
      }
    },
    "/v1/apps/{appId}/leads": {
      "get": {
        "tags": [
          "Talepler"
        ],
        "summary": "Management API: talepler",
        "description": "Ürünün kendi arka ofisi için talep kutusu; kapsam `leads:read`. Talep kişisel veri taşımaz: ad, telefon ve e-posta saklanmaz; olayın yalnız kişisel olmayan özellikleri (tanımı `pii_class: none` ya da tanımsız, anahtarı iletişim alanı olmayan) tutulur, kişi opak kimlikleriyle bağlanır.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `leads:read`.",
        "operationId": "managementLeads.list",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,512}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 500
            }
          },
          {
            "name": "stage",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              ]
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 500
            }
          },
          {
            "name": "assignee",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "none"
                },
                {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                }
              ]
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              ]
            }
          },
          {
            "name": "campaign",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              ]
            }
          },
          {
            "name": "overdue",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "cta",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              ]
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              ]
            }
          },
          {
            "name": "medium",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              ]
            }
          },
          {
            "name": "deviceType",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 50
            }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 2
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includeTest",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "includeInternal",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "leads:read"
        ]
      }
    },
    "/v1/apps/{appId}/leads/{leadId}": {
      "get": {
        "tags": [
          "Talepler"
        ],
        "summary": "Management API: talep",
        "description": "Management API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `leads:read`.",
        "operationId": "managementLeads.get",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "leadId",
            "in": "path",
            "required": true,
            "description": "Talebin kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadDetail"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "leads:read"
        ]
      }
    },
    "/v1/apps/{appId}/messaging/campaigns": {
      "get": {
        "tags": [
          "Mailing & SMS"
        ],
        "summary": "Kampanyalar",
        "description": "Kapsam: `messaging:read`. Sayılar metrik kataloğundandır (`email.*`, `sms.*`; raporlar, bildirim eşikleri ve Query API aynı tanımı okur). İletiler gönderildikleri zamana göre sayılır (kohort): sonradan gelen açılma gönderim gününe yazılır. Oranlar pay ve paydanın toplamından hesaplanır (açılma oranı = Σ açılan ÷ Σ teslim).\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `messaging:read`.",
        "operationId": "managementMessaging.campaignList",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,512}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "email",
                "sms"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "draft",
                "awaiting_approval",
                "scheduled",
                "sending",
                "paused",
                "sent",
                "cancelled",
                "failed"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageCampaignPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "messaging:read"
        ]
      },
      "post": {
        "tags": [
          "Mailing & SMS"
        ],
        "summary": "Kampanya oluştur",
        "description": "17. dalga (D8): panelin kurallarıyla taslak kampanya — kanal, ad, şablon ya da içerik, kitle (liste / segment), gönderen. Kapsam: `messaging:write`; denetim kaydına anahtar işlemi yapan olarak yazılır. Yanıtta kişisel veri yok.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `messaging:write`.",
        "operationId": "managementMessaging.campaignCreate",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateMessageCampaignRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Oluşturuldu.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageCampaign"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/RuleViolation"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "messaging:write"
        ]
      }
    },
    "/v1/apps/{appId}/messaging/campaigns/{campaignId}": {
      "patch": {
        "tags": [
          "Mailing & SMS"
        ],
        "summary": "Kampanyayı düzenle",
        "description": "17. dalga (D8): yalnız taslak; içerik değişince önceki test geçersiz olur. Kapsam: `messaging:write`.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `messaging:write`.",
        "operationId": "managementMessaging.campaignUpdate",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "campaignId",
            "in": "path",
            "required": true,
            "description": "Kampanyanın Postlip Metrics’teki kimliği (reklam kampanyası ya da e-posta / SMS kampanyası, uca göre).",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMessageCampaignRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageCampaign"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "messaging:write"
        ]
      }
    },
    "/v1/apps/{appId}/messaging/campaigns/{campaignId}/results": {
      "get": {
        "tags": [
          "Mailing & SMS"
        ],
        "summary": "Kampanya sonuçları",
        "description": "Kapsam: `messaging:read`; isteğe bağlı `segmentId` (18. dalga). Sayılar metrik kataloğundandır (`email.*`, `sms.*`; raporlar, bildirim eşikleri ve Query API aynı tanımı okur). İletiler gönderildikleri zamana göre sayılır (kohort): sonradan gelen açılma gönderim gününe yazılır. Oranlar pay ve paydanın toplamından hesaplanır (açılma oranı = Σ açılan ÷ Σ teslim).\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `messaging:read`.",
        "operationId": "managementMessaging.results",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "campaignId",
            "in": "path",
            "required": true,
            "description": "Kampanyanın Postlip Metrics’teki kimliği (reklam kampanyası ya da e-posta / SMS kampanyası, uca göre).",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "segmentId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignResults"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "messaging:read"
        ]
      }
    },
    "/v1/apps/{appId}/messaging/campaigns/{campaignId}/send": {
      "post": {
        "tags": [
          "Mailing & SMS"
        ],
        "summary": "Kampanyayı gönder",
        "description": "17. dalga (D8): şimdi ya da bir zamanda (`schedule`, uygulamanın saat diliminde); içeriğin gözden geçirildiği ve onay (`contentReviewed`, `confirm`) zorunlu. Uygulama onay istiyorsa kampanya onaya düşer — anahtar onaylayamaz, bir üyenin onayını bekler. Kapsam: `messaging:write`, denetim kaydıyla.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `messaging:write`.",
        "operationId": "managementMessaging.campaignSend",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "campaignId",
            "in": "path",
            "required": true,
            "description": "Kampanyanın Postlip Metrics’teki kimliği (reklam kampanyası ya da e-posta / SMS kampanyası, uca göre).",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendCampaignRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageCampaign"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/RuleViolation"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "messaging:write"
        ]
      }
    },
    "/v1/apps/{appId}/messaging/campaigns/{campaignId}/test": {
      "post": {
        "tags": [
          "Mailing & SMS"
        ],
        "summary": "Test gönder",
        "description": "17. dalga (D8): verilen adreslere (en çok birkaç) test iletisi; panelde olduğu gibi gönderimden önce gerekir. Kapsam: `messaging:write`.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `messaging:write`.",
        "operationId": "managementMessaging.campaignTest",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "campaignId",
            "in": "path",
            "required": true,
            "description": "Kampanyanın Postlip Metrics’teki kimliği (reklam kampanyası ya da e-posta / SMS kampanyası, uca göre).",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TestSendRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TestSendResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/RuleViolation"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "messaging:write"
        ]
      }
    },
    "/v1/apps/{appId}/messaging/consents": {
      "post": {
        "tags": [
          "Mailing & SMS"
        ],
        "summary": "İzni değiştir",
        "description": "Kişi kimliği, e-postası, telefonu ya da kullanıcı kimliğiyle. Hiçbir kişide olmayan bir adres için ret (`opt_out`) yine kaydedilir: adres bastırılır, kanıt kör dizinle saklanır. Kapsam: `messaging:write`.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `messaging:write`.",
        "operationId": "managementMessaging.consent",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManagementConsentRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsentResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/RuleViolation"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "messaging:write"
        ]
      }
    },
    "/v1/apps/{appId}/messaging/contacts": {
      "put": {
        "tags": [
          "Mailing & SMS"
        ],
        "summary": "Kişi ekle ya da güncelle",
        "description": "E-posta, telefon ya da uygulamanın kullanıcı kimliğiyle eşleşen kişi güncellenir, yoksa oluşturulur (kopya yok). İzinler kanıtıyla (formun adı, zaman, gerekçe). İzin kanal × uygulama başına: `none` (onay yok), `merchant` (tacir / esnaf), `opt_in` (onaylı), `opt_out` (ret). Gönderilebilir = `merchant` ya da `opt_in`, adres var, bastırma listesinde değil. Her değişiklik değiştirilemez bir kanıt kaydı yazar (kaynak, zaman, form / ekran, kim, istemci adresinin özeti — adresin kendisi değil); izin vermek (`opt_in`, `merchant`) kanıt ister. Yanıt kişisel veri yankılamaz. Kapsam: `messaging:write`.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `messaging:write`.",
        "operationId": "managementMessaging.upsert",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertContactRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpsertContactResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/RuleViolation"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "messaging:write"
        ]
      }
    },
    "/v1/apps/{appId}/messaging/contacts/erase": {
      "post": {
        "tags": [
          "Mailing & SMS"
        ],
        "summary": "Kişiyi sil (KVKK)",
        "description": "Kişi ve şifreli değerleri silinir; izin kanıtı ve bastırma kör dizinle kalır. Kapsam: `messaging:write`.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `messaging:write`.",
        "operationId": "managementMessaging.erase",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactReference"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EraseContactResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/RuleViolation"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "messaging:write"
        ]
      }
    },
    "/v1/apps/{appId}/messaging/lists": {
      "get": {
        "tags": [
          "Mailing & SMS"
        ],
        "summary": "Listeler",
        "description": "Kapsam: `messaging:read`.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `messaging:read`.",
        "operationId": "managementMessaging.lists",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactListList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "messaging:read"
        ]
      }
    },
    "/v1/apps/{appId}/messaging/lists/{listId}/members": {
      "post": {
        "tags": [
          "Mailing & SMS"
        ],
        "summary": "Liste üyeliği",
        "description": "Kişiler kimlik, e-posta, telefon ya da kullanıcı kimliğiyle eklenir / çıkarılır; bulunamayanlar sayılır. Kapsam: `messaging:write`.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `messaging:write`.",
        "operationId": "managementMessaging.members",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "listId",
            "in": "path",
            "required": true,
            "description": "Kişi listesinin kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManagementListMembersRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListMembersResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/RuleViolation"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "messaging:write"
        ]
      }
    },
    "/v1/apps/{appId}/messaging/suppressions": {
      "post": {
        "tags": [
          "Mailing & SMS"
        ],
        "summary": "Bastırma listesi",
        "description": "Bir adresi ya da numarayı bastırma listesine ekle / çıkar. Kapsam: `messaging:write`.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `messaging:write`.",
        "operationId": "managementMessaging.suppression",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManagementSuppressionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuppressionResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/RuleViolation"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "messaging:write"
        ]
      }
    },
    "/v1/apps/{appId}/persons": {
      "get": {
        "tags": [
          "Davranış"
        ],
        "summary": "Kişiler",
        "description": "Uygulamanın kişileri (birleştirilmiş kişiler hariç), son görülme ya da ilk görülme sırasıyla, imleç sayfalı. `search` bir kullanıcı kimliği, anonim kimlik ya da kişi kimliğiyle tam eşleşir; `searchMatch=prefix` ile kişi kimliğinin başıyla da (en az 6 onaltılık karakter, tireler yok sayılır; birincil anahtarda kimlik aralığı) ve 16. dalgadan kullanıcı ya da anonim kimliğin başıyla (en az 3 karakter, büyük/küçük harf duyarlı, `%` ve `_` harf olarak; desen dizini). Kimlikler opaktır; kişisel veri dönmez. Management API (dalga 16; 07 YEN-13): kapsam `persons:read`; panelle aynı saklama kuralları — kişisel ya da hassas veri tanımlı ya da eylemi `allow` olmayan özellik özetiyle döner (`hash`) ya da hiç dönmez (`drop`, `reject`: yalnız adı `withheldTraits`te), kimlikler opak; profildeki talepler yalnız anahtarda `leads:read` de varsa.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `persons:read`.",
        "operationId": "managementProfiles.personList",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,512}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "searchMatch",
            "in": "query",
            "required": false,
            "schema": {
              "default": "exact",
              "type": "string",
              "enum": [
                "exact",
                "prefix"
              ]
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "last_seen",
              "type": "string",
              "enum": [
                "last_seen",
                "first_seen"
              ]
            }
          },
          {
            "name": "includeTest",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "includeInternal",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "includeBot",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "persons:read"
        ]
      }
    },
    "/v1/apps/{appId}/persons/{personId}": {
      "get": {
        "tags": [
          "Davranış"
        ],
        "summary": "Kişi profili",
        "description": "Kimlikler (anonim ve kullanıcı kimliği; kişisel veri değil; ilk görülme olay zamanına göre), özellikler (olay zamanına göre en yeni değer; kişisel veri tanımlı özellik özetlenir — `hash` — ya da gösterilmez — `drop`, `reject`: adı `withheldTraits`te), ilk ve son görülme olay zamanına göre, ilk ve son doğrudan olmayan temas, hesaplar, ulaşılan roller, birleşme geçmişi (`merges`), son oturumlar ve olaylar, dönüşümler, `summary` (oturum, olay, dönüşüm, brüt gelir, iade, net gelir — metrik kataloğunun kurallarıyla, bütün geçmiş, olay tarihine göre), talepler (yalnız `leads.read` ile; yoksa `null`). Birleştirilmiş bir kişi istenirse yaşayan kişi döner (`requestedId` isteneni söyler); birleşen kişilerin olayları arka planda yeniden yazılmadan önce de profildedir. Management API (dalga 16; 07 YEN-13): kapsam `persons:read`; panelle aynı saklama kuralları — kişisel ya da hassas veri tanımlı ya da eylemi `allow` olmayan özellik özetiyle döner (`hash`) ya da hiç dönmez (`drop`, `reject`: yalnız adı `withheldTraits`te), kimlikler opak; profildeki talepler yalnız anahtarda `leads:read` de varsa.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `persons:read`.",
        "operationId": "managementProfiles.person",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "personId",
            "in": "path",
            "required": true,
            "description": "Kişinin kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonProfile"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "persons:read"
        ]
      }
    },
    "/v1/apps/{appId}/persons/{personId}/events": {
      "get": {
        "tags": [
          "Davranış"
        ],
        "summary": "Kişinin olay zaman çizelgesi",
        "description": "Kişinin (ve ona birleşen kişilerin) bütün olayları, yeniden eskiye, imleç sayfalı; `type` mesaj türü, `conversions=true` yalnız dönüşüm rolündeki olaylar. Management API (dalga 16; 07 YEN-13): kapsam `persons:read`; panelle aynı saklama kuralları — kişisel ya da hassas veri tanımlı ya da eylemi `allow` olmayan özellik özetiyle döner (`hash`) ya da hiç dönmez (`drop`, `reject`: yalnız adı `withheldTraits`te), kimlikler opak; profildeki talepler yalnız anahtarda `leads:read` de varsa.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `persons:read`.",
        "operationId": "managementProfiles.personEvents",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "personId",
            "in": "path",
            "required": true,
            "description": "Kişinin kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,512}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "track",
                "identify",
                "page",
                "screen",
                "group",
                "alias"
              ]
            }
          },
          {
            "name": "conversions",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonEventPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "persons:read"
        ]
      }
    },
    "/v1/apps/{appId}/privacy/deletion-requests": {
      "get": {
        "tags": [
          "Veri hakları"
        ],
        "summary": "Silme talepleri",
        "description": "Uygulamanın talepleri, yeniden eskiye, imleç sayfalı, toplamla; `status` süzgeci; kapsam `management:read`. `result` silinen satırları türüne göre sayar (sürerken o ana kadar).\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `management:read`.",
        "operationId": "managementDeletionRequests.list",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,512}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Yalnız bu durumdaki talepler.",
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "running",
                "completed",
                "failed",
                "cancelled"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletionRequestPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "management:read"
        ]
      },
      "post": {
        "tags": [
          "Veri hakları"
        ],
        "summary": "Silme talebi oluştur",
        "description": "Ürünün sunucusu, kullanıcısı unutulmak istediğinde (KVKK) talebi açar; kapsam `management:write`. Worker talebi dakikalar içinde yürütür: kişi ve ona birleşmiş bütün kişiler, kimlikleri, olayları (ve atıf satırları, webhook kopyaları), etkileşimleri, oturumları, hesap üyelikleri, talepleri, kilometre taşları ve aynı kullanıcı kimliğiyle bağlı Mailing & SMS kişisi (izin kanıtı yasa gereği kör dizinle kalır) silinir; özet tablolar kalan veriden yeniden hesaplanır. Talep başladıktan sonra alınan veri talebe girmez. Kimliğin değeri yalnız talep bitene kadar tutulur; listede son karakterleri (`subjectHint`) görünür. E-posta ya da telefon gibi görünen kimlik alımdaki gibi özetlenerek aranır. Açık talebi olan kimliğe yeni talep aynı talebi döndürür.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `management:write`.",
        "operationId": "managementDeletionRequests.create",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDeletionRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Oluşturuldu.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletionRequest"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "management:write"
        ]
      }
    },
    "/v1/apps/{appId}/privacy/deletion-requests/{requestId}": {
      "get": {
        "tags": [
          "Veri hakları"
        ],
        "summary": "Silme talebi",
        "description": "Talebin durumu ve silinenler; kapsam `management:read`. `nothingFound`: talep tamamlandı ama kimliğe ait veri yoktu.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `management:read`.",
        "operationId": "managementDeletionRequests.get",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "requestId",
            "in": "path",
            "required": true,
            "description": "Silme talebinin kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletionRequest"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "management:read"
        ]
      }
    },
    "/v1/apps/{appId}/privacy/deletion-requests/{requestId}/cancel": {
      "post": {
        "tags": [
          "Veri hakları"
        ],
        "summary": "Silme talebini iptal et",
        "description": "Yalnız bekleyen talep (409 `DELETION_REQUEST_NOT_CANCELLABLE`); kimliğin değeri silinir; kapsam `management:write`. Denetim kaydına anahtarın adıyla yazılır.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `management:write`.",
        "operationId": "managementDeletionRequests.cancel",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "requestId",
            "in": "path",
            "required": true,
            "description": "Silme talebinin kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletionRequest"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "management:write"
        ]
      }
    },
    "/v1/apps/{appId}/schema": {
      "get": {
        "tags": [
          "Olay şeması"
        ],
        "summary": "Şema paketi",
        "description": "Uygulamanın bütün olay kataloğu (`schemaBundleSchema`, formatVersion 1): her durumdaki olay tanımı, özellikleri, kişi ve hesap özellikleri, `revision`. `metrics pull` TypeScript tiplerini, alım servisi şema önbelleğini bundan üretir.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `management:read`.",
        "operationId": "managementSchema.bundle",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SchemaBundle"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "management:read"
        ]
      }
    },
    "/v1/apps/{appId}/social/accounts": {
      "get": {
        "tags": [
          "Sosyal medya"
        ],
        "summary": "Sosyal medya hesapları",
        "description": "Uygulamanın sosyal medya hesapları, yetenekleri ve tazelikleri. Kapsam: `social:read`.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `social:read`.",
        "operationId": "managementSocial.accounts",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SocialAccountList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "social:read"
        ]
      }
    },
    "/v1/apps/{appId}/social/overview": {
      "get": {
        "tags": [
          "Sosyal medya"
        ],
        "summary": "Sosyal medya özeti",
        "description": "KPI’lar ve günlük seriler. Her sayı metrik kataloğundandır (`social.<platform|all>.<metrik>`, sorgu servisi): raporlar, bildirim eşikleri ve Query API aynı tanımı okur. Oranlar pay ve paydanın toplamından hesaplanır (etkileşim oranı = Σ etkileşim ÷ Σ erişim). Tekil erişim toplanamaz: dönemin tekil erişimi (`reach`, platformun verdiği pencerelerde) ile günlük erişimlerin toplamı (`daily_reach`) ayrı metriklerdir; birden çok hesapta tekil erişim yalnız uyarıyla gösterilir. Değeri olmayan her metrik sebebini söyler (bağlı değil, izin yok, platform vermiyor, dönem sınırı, geçmiş sınırı, veri yok). Aynı metrikler Query API’de (`POST /v1/query`, `query:read`) de sorgulanır. Kapsam: `social:read`.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `social:read`.",
        "operationId": "managementSocial.overview",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "platform",
            "in": "query",
            "required": false,
            "schema": {
              "default": "all",
              "type": "string",
              "enum": [
                "all",
                "instagram",
                "facebook",
                "linkedin"
              ]
            }
          },
          {
            "name": "accountIds",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4000
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "compare",
            "in": "query",
            "required": false,
            "schema": {
              "default": "previous_period",
              "type": "string",
              "enum": [
                "none",
                "previous_period",
                "previous_year"
              ]
            }
          },
          {
            "name": "alignment",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "week_to_date",
                "month_to_date",
                "calendar_month",
                "quarter_to_date",
                "calendar_quarter",
                "year_to_date",
                "calendar_year"
              ]
            }
          },
          {
            "name": "granularity",
            "in": "query",
            "required": false,
            "schema": {
              "default": "day",
              "type": "string",
              "enum": [
                "day",
                "week",
                "month"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SocialOverview"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "social:read"
        ]
      }
    },
    "/v1/apps/{appId}/social/posts": {
      "get": {
        "tags": [
          "Sosyal medya"
        ],
        "summary": "Gönderiler",
        "description": "Eşitlenen gönderiler ve sayıları. Gönderiler yayın tarihine göre sayılır (kohort): bir gönderinin sonradan gelen etkileşimi yayın gününe yazılır. Platformda doğrudan paylaşılan gönderiler de vardır; Postlip Metrics’ten yayımlanan gönderi planlanan gönderiye bağlanır (`plannedPostId`). Kapsam: `social:read`.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `social:read`.",
        "operationId": "managementSocial.posts",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,512}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "platform",
            "in": "query",
            "required": false,
            "schema": {
              "default": "all",
              "type": "string",
              "enum": [
                "all",
                "instagram",
                "facebook",
                "linkedin"
              ]
            }
          },
          {
            "name": "accountIds",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4000
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "image",
                "carousel",
                "video",
                "reel",
                "story",
                "text",
                "link",
                "other"
              ]
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "campaign",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 120
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "newest",
              "type": "string",
              "enum": [
                "newest",
                "engagement",
                "reach"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SocialPublishedPostPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "social:read"
        ]
      }
    },
    "/v1/apps/{appId}/social/posts/{postId}": {
      "get": {
        "tags": [
          "Sosyal medya"
        ],
        "summary": "Gönderi ayrıntısı",
        "description": "Gönderinin sayıları ve zaman içindeki değişimi. Kapsam: `social:read`.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `social:read`.",
        "operationId": "managementSocial.post",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "postId",
            "in": "path",
            "required": true,
            "description": "Gönderinin ya da yazının kimliği (planlanan / eşitlenen sosyal gönderi ya da blog yazısı, uca göre).",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SocialPublishedPostDetail"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "social:read"
        ]
      }
    },
    "/v1/apps/{appId}/sources": {
      "get": {
        "tags": [
          "Kaynaklar"
        ],
        "summary": "Kaynaklar",
        "description": "Management API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `management:read`.",
        "operationId": "managementSources.list",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,512}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "disabled"
              ]
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "web",
                "ios",
                "android",
                "server",
                "other"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourcePage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "management:read"
        ]
      },
      "post": {
        "tags": [
          "Kaynaklar"
        ],
        "summary": "Kaynak ekle",
        "description": "Tür (`web`, `ios`, `android`, `server`, `other`), ortam, rıza kipi ve yakalama ayarları. Planın kaynak sınırı organizasyonun bütün uygulamalarındaki kaynakları sayar; sınıra ulaşılmışsa `403 PLAN_LIMIT_REACHED`. Anahtar ayrıca oluşturulur (`POST …/keys`). Kapsam: `management:write`; denetim kaydıyla (işlemi yapan anahtar).\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `management:write`.",
        "operationId": "managementSources.create",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSourceRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Oluşturuldu.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Source"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "management:write"
        ]
      }
    },
    "/v1/apps/{appId}/sources/{sourceId}": {
      "get": {
        "tags": [
          "Kaynaklar"
        ],
        "summary": "Kaynak",
        "description": "Management API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `management:read`.",
        "operationId": "managementSources.get",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "sourceId",
            "in": "path",
            "required": true,
            "description": "Kaynağın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Source"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "management:read"
        ]
      },
      "patch": {
        "tags": [
          "Kaynaklar"
        ],
        "summary": "Kaynağı güncelle",
        "description": "Yakalama ayarları SDK'lara uzak yapılandırma olarak sunulur; `autocapture` gönderilen anahtarları kaynağın ayarlarıyla birleştirir. Kaynak Management API ile silinmez (panelde). Kapsam: `management:write`.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `management:write`.",
        "operationId": "managementSources.update",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "sourceId",
            "in": "path",
            "required": true,
            "description": "Kaynağın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSourceRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Source"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "management:write"
        ]
      }
    },
    "/v1/apps/{appId}/sources/{sourceId}/health": {
      "get": {
        "tags": [
          "Kaynaklar"
        ],
        "summary": "Kaynak sağlığı",
        "description": "Durum, son olay ve son ret, son kütüphane; son 24 saatte kabul edilen olay, ret, örneklenmiş uyarı ve ret oranı (Σ ret ÷ (Σ olay + Σ ret)). Kapsam: `management:read`.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `management:read`.",
        "operationId": "managementSources.health",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "sourceId",
            "in": "path",
            "required": true,
            "description": "Kaynağın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceHealth"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "management:read"
        ]
      }
    },
    "/v1/apps/{appId}/sources/{sourceId}/keys": {
      "get": {
        "tags": [
          "Kaynaklar"
        ],
        "summary": "Kaynak anahtarları (maskeli)",
        "description": "Önek ve son dört karakter, kip, oluşturma, iptal ve geçiş süresi; anahtarın tamamı hiç dönmez. Kapsam: `management:write` (panelde de yalnız kaynak yöneticisi görür).\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `management:write`.",
        "operationId": "managementSources.keys",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "sourceId",
            "in": "path",
            "required": true,
            "description": "Kaynağın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceKeyList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "management:write"
        ]
      },
      "post": {
        "tags": [
          "Kaynaklar"
        ],
        "summary": "Anahtar oluştur",
        "description": "Yazma anahtarı `pk_live_…`/`pk_test_…` (SHA-256 özetiyle saklanır) ya da imza anahtarı `sk_live_…`/`sk_test_…` (sır kutusunda mühürlü). Anahtarın tamamı yalnız bu yanıtta görünür. Kapsam: `management:write`; denetim kaydıyla.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `management:write`.",
        "operationId": "managementSources.newKey",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "sourceId",
            "in": "path",
            "required": true,
            "description": "Kaynağın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSourceKeyRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Oluşturuldu.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatedSourceKey"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "management:write"
        ]
      }
    },
    "/v1/apps/{appId}/sources/{sourceId}/keys/{keyId}/revoke": {
      "post": {
        "tags": [
          "Kaynaklar"
        ],
        "summary": "Anahtarı iptal et",
        "description": "`graceMinutes` kadar daha geçerli kalır (anahtar yenilemede geçiş süresi, en çok 7 gün). Kapsam: `management:write`; denetim kaydıyla.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `management:write`.",
        "operationId": "managementSources.revoke",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "sourceId",
            "in": "path",
            "required": true,
            "description": "Kaynağın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "keyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RevokeSourceKeyRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceKey"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "management:write"
        ]
      }
    },
    "/v1/apps/{appId}/traits": {
      "get": {
        "tags": [
          "Olay şeması"
        ],
        "summary": "Kişi özelliği tanımları",
        "description": "Uygulamanın kişi (identify) özellik tanımları (anahtar, tür, kişisel veri sınıfı ve eylemi, iki dilde ad). Kapsam: `management:read`.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `management:read`.",
        "operationId": "managementSchema.listTraits",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TraitList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "management:read"
        ]
      },
      "post": {
        "tags": [
          "Olay şeması"
        ],
        "summary": "Kişi özelliği tanımı ekle",
        "description": "Kişisel veri sınıfı (`piiClass`) ve eylemi (`piiAction`: `allow`, `hash`, `drop`, `reject`) alımda ve profillerde uygulanır. Kapsam: `management:write`; panelle aynı kurallar ve denetim kaydı (işlemi yapan anahtar).\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `management:write`.",
        "operationId": "managementSchema.createTrait",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PropertyDefinitionInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Oluşturuldu.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PropertyDefinitionRecord"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "management:write"
        ]
      }
    },
    "/v1/apps/{appId}/traits/{propertyId}": {
      "delete": {
        "tags": [
          "Olay şeması"
        ],
        "summary": "Kişi özelliği tanımını sil",
        "description": "Saklanan değerler kalır; tanımsız özellik uygulamanın şema kipine göre işlenir. Kapsam: `management:write`; panelle aynı kurallar ve denetim kaydı (işlemi yapan anahtar).\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `management:write`.",
        "operationId": "managementSchema.deleteTrait",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "propertyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Başarılı; yanıt gövdesi yok."
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "management:write"
        ]
      },
      "patch": {
        "tags": [
          "Olay şeması"
        ],
        "summary": "Kişi özelliği tanımını güncelle",
        "description": "Anahtar değişmez. Kapsam: `management:write`; panelle aynı kurallar ve denetim kaydı (işlemi yapan anahtar).\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `management:write`.",
        "operationId": "managementSchema.updateTrait",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "propertyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTraitRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PropertyDefinitionRecord"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "management:write"
        ]
      }
    },
    "/v1/health": {
      "get": {
        "tags": [
          "Sağlık"
        ],
        "summary": "Sağlık",
        "description": "Herkese açık: kimlik gerekmez.",
        "operationId": "health.health",
        "security": [],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "const": "ok"
                    },
                    "database": {
                      "type": "string",
                      "const": "ok"
                    }
                  },
                  "required": [
                    "status",
                    "database"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "public"
      }
    },
    "/v1/invitations": {
      "get": {
        "tags": [
          "Organizasyon"
        ],
        "summary": "Davetler",
        "description": "Bekleyen, kabul edilen, süresi dolan ve iptal edilen davetler. Kapsam: `management:read`.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `management:read`.",
        "operationId": "managementTeam.invitations",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,512}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "accepted",
                "revoked",
                "expired"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "management:read"
        ]
      },
      "post": {
        "tags": [
          "Organizasyon"
        ],
        "summary": "Üye davet et",
        "description": "Adrese yedi gün geçerli bir davet e-postası gider (davet edenin adı yazmaz). Anahtar yöneticinin (`admin`) haklarıyla davet eder: sahip rolü ve yöneticinin vermediği izinli rol verilemez (`ROLE_NOT_GRANTABLE`), uygulama kapsamı anahtarınkini aşamaz (`APP_SCOPE_TOO_WIDE`); etkin üye yeniden davet edilmez, adresin bekleyen davetleri yenisiyle değişir; planın üye sınırı (etkin üyeler ve bekleyen davetler) `403 PLAN_LIMIT_REACHED`. Kapsam: `management:write`; denetim kaydıyla.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `management:write`.",
        "operationId": "managementTeam.invite",
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInvitationRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Oluşturuldu.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invitation"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "management:write"
        ]
      }
    },
    "/v1/members": {
      "get": {
        "tags": [
          "Organizasyon"
        ],
        "summary": "Üyeler",
        "description": "Organizasyonun üyeleri (panelde `members.manage` ile görülen liste: ad, e-posta, rol, uygulama kapsamı, durum, son giriş, iki adımlı doğrulama). Kapsam: `management:read`.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `management:read`.",
        "operationId": "managementTeam.members",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,512}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "disabled"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemberPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "management:read"
        ]
      }
    },
    "/v1/query": {
      "post": {
        "tags": [
          "Ölçüm"
        ],
        "summary": "Query API: metrik sorgusu",
        "description": "Panelin metrik sorgusu entegrasyonlar için: `Authorization: Bearer mk_…`, kapsam `query:read`, uygulama gövdede (`appId`); anahtarın uygulama kapsamı dışındaki uygulama bulunamaz (404). Tarih aralığı uygulamanın saat dilimindeki **yerel tarihlerdir** (iki uç dahil; günler yaz saati geçişinde 23 ya da 25 saat sürer). Test, iç ve bot trafiği `include` ile açıkça istenmedikçe dışarıdadır. Oranlar pay ve paydanın toplamından hesaplanır (oranların ortalaması alınmaz); tekil metrikler (ziyaretçi) her satır ve dönem için yeniden sayılır, toplanmaz. Paydası 0 olan oran ve ölçüm başlamadan önceki dönem `null` döner (0 değil). Karşılaştırma: `previous_period` eşit uzunlukta önceki dönem (tam takvim ayı → önceki ay, ay başından bugüne → önceki ayın aynı günleri), `previous_year` aynı tarihler bir yıl önce, `custom` + `compareRange`; zaman kovaları sırayla eşlenir. Değişim (`deltas`): önceki değer 0 ya da metriğin tabanının altındaysa yüzde verilmez (`mode: \"absolute\"`, `reason: \"zero_base\" | \"small_base\"`), oranlarda puan (`mode: \"points\"`), ölçüm öncesi karşılaştırma `comparable: false`. `meta`: saat dilimi, veri tazeliği (işleme izleme noktası), her metriğin sayım modu (`event_date`) ve kaynağı (`rollup` | `raw` | `none`), uyarılar (desteklenmeyen boyut/filtre, kesilen satırlar). Özet tablolar ile ham tablolar aynı sayıyı verir; servis hangisini okuyacağına kendisi karar verir. Dalga 16: her metriğin katalog etiketi isteğin dilinde `metrics[].label`’da (rollü metrikte rolle: «Dönüşen kişi · Kayıt»; `custom:` için uygulamanın verdiği ad); `definitions` (en çok 5) kaydedilmemiş metrik tanımlarını taslak olarak taşır — `custom:<anahtar>` önce taslağa, sonra kayıtlı tanıma çözülür (önizleme; hiçbir şey saklanmaz, aynı anahtarlı kayıtlı tanımı gölgeler); türler kayıtlı tanımınkiler, artı `unique_accounts` (olayı yapan farklı hesap). `segmentId` uygulamanın bir kişi ya da hesap segmentini (`…/analytics/segments`) adlandırır: kişilerin olguları — oturum, olay, etkileşim, sayfa ayrılışı, kredili dönüşüm — segmentin üyelerine daralır (hesap segmentinde hesapların olayları ve üyelerinin oturumları); reklam, sosyal, Search Console, GA4, bütçe ve ileti metrikleri `segment` için `FILTER_NOT_AVAILABLE` der; segmentli sorgu her zaman ham tablolardan okunur, `meta.segment` segmentin adını taşır.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `query:read`.",
        "operationId": "queryApi.query",
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QueryApiRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsQueryResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "query:read"
        ]
      }
    },
    "/v1/query/catalogue": {
      "get": {
        "tags": [
          "Ölçüm"
        ],
        "summary": "Query API: metrik kataloğu",
        "description": "Uygulamanın metrik ve boyut kataloğu (`Accept-Language` dilinde etiketlerle). Kapsam `query:read`.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `query:read`.",
        "operationId": "queryApi.getCatalogue",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsCatalogue"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "query:read"
        ]
      }
    },
    "/v1/reports": {
      "get": {
        "tags": [
          "Raporlar"
        ],
        "summary": "Raporlar",
        "description": "Anahtarın uygulama kapsamındaki raporlar. Kapsam: `reports:read`.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `reports:read`.",
        "operationId": "managementReports.list",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,512}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "appId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "reports:read"
        ]
      }
    },
    "/v1/reports/{reportId}": {
      "get": {
        "tags": [
          "Raporlar"
        ],
        "summary": "Rapor",
        "description": "Management API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `reports:read`.",
        "operationId": "managementReports.get",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "reportId",
            "in": "path",
            "required": true,
            "description": "Raporun kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "reports:read"
        ]
      }
    },
    "/v1/reports/{reportId}/snapshots": {
      "get": {
        "tags": [
          "Raporlar"
        ],
        "summary": "Rapor çıktıları",
        "description": "Management API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `reports:read`.",
        "operationId": "managementReports.snapshots",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "reportId",
            "in": "path",
            "required": true,
            "description": "Raporun kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,512}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportSnapshotPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "reports:read"
        ]
      }
    },
    "/v1/reports/{reportId}/snapshots/{snapshotId}": {
      "get": {
        "tags": [
          "Raporlar"
        ],
        "summary": "Rapor çıktısı",
        "description": "Donmuş sayılar: her bölümün sorgu servisi yanıtları, tazelik, AI özeti. Her sayı sorgu servisinin (metrik kataloğu) yanıtıdır: bölümün kendi formülü yoktur; oranlar pay ve paydanın toplamından, her sonuç sayım modunu (`event_date` / `cohort`) söyler.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `reports:read`.",
        "operationId": "managementReports.snapshot",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "reportId",
            "in": "path",
            "required": true,
            "description": "Raporun kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "snapshotId",
            "in": "path",
            "required": true,
            "description": "Rapor çıktısının kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportSnapshot"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "reports:read"
        ]
      }
    },
    "/v1/reports/{reportId}/snapshots/{snapshotId}/pdf": {
      "get": {
        "tags": [
          "Raporlar"
        ],
        "summary": "PDF indir",
        "description": "Management API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `reports:read`.",
        "operationId": "managementReports.pdf",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "reportId",
            "in": "path",
            "required": true,
            "description": "Raporun kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "snapshotId",
            "in": "path",
            "required": true,
            "description": "Rapor çıktısının kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Rapor çıktısının PDF’i (sunucuda çizilir: kapak, içindekiler, vektör grafikler, sayfa numaraları).",
            "headers": {
              "Content-Disposition": {
                "description": "attachment; filename=\"…\"",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "reports:read"
        ]
      }
    },
    "/v1/roles": {
      "get": {
        "tags": [
          "Organizasyon"
        ],
        "summary": "Roller",
        "description": "Yerleşik ve organizasyonun rolleri, izinleriyle (davet için `roleId`). Kapsam: `management:read`.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `management:read`.",
        "operationId": "managementTeam.roles",
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoleList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "management:read"
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "AccountEvent": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "at": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "type": {
            "type": "string",
            "enum": [
              "track",
              "page",
              "screen",
              "identify",
              "group",
              "alias"
            ]
          },
          "eventName": {
            "type": "string"
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "conversion": {
            "type": "boolean"
          },
          "revenue": {
            "type": [
              "number",
              "null"
            ]
          },
          "path": {
            "type": [
              "string",
              "null"
            ]
          },
          "sessionId": {
            "type": [
              "string",
              "null"
            ]
          },
          "properties": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "personId": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Id"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "at",
          "type",
          "eventName",
          "roles",
          "conversion",
          "revenue",
          "path",
          "sessionId",
          "properties",
          "personId"
        ],
        "additionalProperties": false
      },
      "AccountEventPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountEvent"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "items",
          "nextCursor"
        ],
        "additionalProperties": false
      },
      "AccountMember": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "userId": {
            "type": [
              "string",
              "null"
            ]
          },
          "firstSeenAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "lastSeenAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "firstChannel": {
            "type": [
              "string",
              "null"
            ]
          },
          "eventCount": {
            "type": "integer"
          },
          "sessionCount": {
            "type": "integer"
          },
          "isTest": {
            "type": "boolean"
          },
          "isInternal": {
            "type": "boolean"
          },
          "isBot": {
            "type": "boolean"
          },
          "joinedAt": {
            "$ref": "#/components/schemas/Timestamp"
          }
        },
        "required": [
          "id",
          "userId",
          "firstSeenAt",
          "lastSeenAt",
          "firstChannel",
          "eventCount",
          "sessionCount",
          "isTest",
          "isInternal",
          "joinedAt"
        ],
        "additionalProperties": false
      },
      "AccountMemberPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountMember"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "total": {
            "type": "integer"
          }
        },
        "required": [
          "items",
          "nextCursor",
          "total"
        ],
        "additionalProperties": false
      },
      "AccountPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountSummary"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "total": {
            "type": "integer"
          }
        },
        "required": [
          "items",
          "nextCursor",
          "total"
        ],
        "additionalProperties": false
      },
      "AccountProfile": {
        "type": "object",
        "properties": {
          "account": {
            "$ref": "#/components/schemas/AccountSummary"
          },
          "summary": {
            "type": "object",
            "properties": {
              "members": {
                "type": "integer"
              },
              "sessions": {
                "type": "integer"
              },
              "events": {
                "type": "integer"
              },
              "conversions": {
                "type": "integer"
              },
              "revenue": {
                "type": "number"
              },
              "refunds": {
                "type": "number"
              },
              "netRevenue": {
                "type": "number"
              },
              "currency": {
                "type": "string"
              },
              "leads": {
                "type": [
                  "integer",
                  "null"
                ]
              }
            },
            "required": [
              "members",
              "sessions",
              "events",
              "conversions",
              "revenue",
              "refunds",
              "netRevenue",
              "currency",
              "leads"
            ],
            "additionalProperties": false
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "members": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountMember"
            }
          },
          "sessions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SessionSummary"
            }
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountEvent"
            }
          },
          "conversions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PersonConversion"
            }
          },
          "leads": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/PersonLead"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "withheldTraits": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "account",
          "summary",
          "roles",
          "members",
          "sessions",
          "events",
          "conversions",
          "leads",
          "withheldTraits"
        ],
        "additionalProperties": false
      },
      "AccountSummary": {
        "type": "object",
        "properties": {
          "groupId": {
            "type": "string"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "traits": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "memberCount": {
            "type": "integer"
          },
          "firstSeenAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "lastSeenAt": {
            "$ref": "#/components/schemas/Timestamp"
          }
        },
        "required": [
          "groupId",
          "name",
          "traits",
          "memberCount",
          "firstSeenAt",
          "lastSeenAt"
        ],
        "additionalProperties": false
      },
      "AdAccount": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "platform": {
            "type": "string"
          },
          "externalId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "timezone": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "disconnected"
            ]
          },
          "connectionId": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Id"
              },
              {
                "type": "null"
              }
            ]
          },
          "lastSyncedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Timestamp"
              },
              {
                "type": "null"
              }
            ]
          },
          "link": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "platform",
          "externalId",
          "name",
          "currency",
          "timezone",
          "status",
          "connectionId",
          "lastSyncedAt",
          "link"
        ],
        "additionalProperties": false
      },
      "AdAccountList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AdAccount"
            }
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": false
      },
      "AdBudget": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number"
          },
          "type": {
            "type": "string",
            "enum": [
              "daily",
              "lifetime"
            ]
          },
          "level": {
            "type": "string",
            "enum": [
              "campaign",
              "ad_group",
              "campaign_group"
            ]
          },
          "currency": {
            "type": "string"
          }
        },
        "required": [
          "amount",
          "type",
          "level",
          "currency"
        ],
        "additionalProperties": false
      },
      "AdCampaign": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "platform": {
            "type": "string"
          },
          "accountId": {
            "$ref": "#/components/schemas/Id"
          },
          "accountName": {
            "type": "string"
          },
          "externalId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "paused",
              "ended",
              "removed",
              "pending",
              "unknown"
            ]
          },
          "platformStatus": {
            "type": [
              "string",
              "null"
            ]
          },
          "objective": {
            "type": "string",
            "enum": [
              "awareness",
              "traffic",
              "engagement",
              "leads",
              "sales",
              "app_promotion",
              "video_views",
              "search",
              "other"
            ]
          },
          "platformObjective": {
            "type": [
              "string",
              "null"
            ]
          },
          "channelType": {
            "type": [
              "string",
              "null"
            ]
          },
          "budget": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AdBudget"
              },
              {
                "type": "null"
              }
            ]
          },
          "startDate": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LocalDate"
              },
              {
                "type": "null"
              }
            ]
          },
          "endDate": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LocalDate"
              },
              {
                "type": "null"
              }
            ]
          },
          "campaignGroup": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "externalId": {
                    "type": "string"
                  },
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "externalId",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "hasVideo": {
            "type": "boolean"
          },
          "adGroups": {
            "type": "integer"
          },
          "ads": {
            "type": "integer"
          },
          "link": {
            "type": [
              "string",
              "null"
            ]
          },
          "namingIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NamingIssue"
            }
          }
        },
        "required": [
          "id",
          "platform",
          "accountId",
          "accountName",
          "externalId",
          "name",
          "status",
          "platformStatus",
          "objective",
          "platformObjective",
          "channelType",
          "budget",
          "startDate",
          "endDate",
          "campaignGroup",
          "hasVideo",
          "adGroups",
          "ads",
          "link"
        ],
        "additionalProperties": false
      },
      "AdConversion": {
        "type": "object",
        "properties": {
          "eventId": {
            "$ref": "#/components/schemas/Id"
          },
          "occurredAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "role": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "signup",
                  "login",
                  "trial_start",
                  "trial_end",
                  "activation",
                  "core_action",
                  "lead",
                  "demo_request",
                  "contact_click",
                  "checkout_start",
                  "payment_failed",
                  "purchase",
                  "subscription_renewal",
                  "refund",
                  "churn",
                  "referral"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "furthestRole": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "signup",
                  "login",
                  "trial_start",
                  "trial_end",
                  "activation",
                  "core_action",
                  "lead",
                  "demo_request",
                  "contact_click",
                  "checkout_start",
                  "payment_failed",
                  "purchase",
                  "subscription_renewal",
                  "refund",
                  "churn",
                  "referral"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "sold": {
            "type": "boolean"
          },
          "accountId": {
            "type": [
              "string",
              "null"
            ]
          },
          "personId": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Id"
              },
              {
                "type": "null"
              }
            ]
          },
          "channel": {
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "type": [
              "string",
              "null"
            ]
          },
          "medium": {
            "type": [
              "string",
              "null"
            ]
          },
          "platform": {
            "type": [
              "string",
              "null"
            ]
          },
          "adAccountId": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Id"
              },
              {
                "type": "null"
              }
            ]
          },
          "campaignId": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Id"
              },
              {
                "type": "null"
              }
            ]
          },
          "campaignName": {
            "type": [
              "string",
              "null"
            ]
          },
          "utmCampaign": {
            "type": [
              "string",
              "null"
            ]
          },
          "adId": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Id"
              },
              {
                "type": "null"
              }
            ]
          },
          "adName": {
            "type": [
              "string",
              "null"
            ]
          },
          "landingPage": {
            "type": [
              "string",
              "null"
            ]
          },
          "resolution": {
            "type": "string",
            "enum": [
              "click_id",
              "campaign_id",
              "utm_name",
              "unknown"
            ]
          },
          "model": {
            "type": "string",
            "enum": [
              "first_touch",
              "last_touch",
              "last_non_direct",
              "linear",
              "position_based",
              "time_decay",
              "last_paid"
            ]
          },
          "weight": {
            "type": "number"
          },
          "isTest": {
            "type": "boolean"
          },
          "lastClick": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LeadLastClick"
              },
              {
                "type": "null"
              }
            ]
          },
          "placement": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "eventId",
          "occurredAt",
          "role",
          "furthestRole",
          "sold",
          "accountId",
          "personId",
          "channel",
          "source",
          "medium",
          "platform",
          "adAccountId",
          "campaignId",
          "campaignName",
          "utmCampaign",
          "adId",
          "adName",
          "landingPage",
          "resolution",
          "model",
          "weight",
          "isTest"
        ],
        "additionalProperties": false
      },
      "AdConversionPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AdConversion"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "total": {
            "type": "integer"
          },
          "conversions": {
            "type": "integer"
          },
          "sold": {
            "type": "integer"
          },
          "model": {
            "type": "string",
            "enum": [
              "first_touch",
              "last_touch",
              "last_non_direct",
              "linear",
              "position_based",
              "time_decay",
              "last_paid"
            ]
          },
          "conversionRoles": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "signup",
                "login",
                "trial_start",
                "trial_end",
                "activation",
                "core_action",
                "lead",
                "demo_request",
                "contact_click",
                "checkout_start",
                "payment_failed",
                "purchase",
                "subscription_renewal",
                "refund",
                "churn",
                "referral"
              ]
            }
          },
          "countingMode": {
            "type": "string",
            "const": "event_date"
          }
        },
        "required": [
          "items",
          "nextCursor",
          "total",
          "conversions",
          "sold",
          "model",
          "conversionRoles",
          "countingMode"
        ],
        "additionalProperties": false
      },
      "AdConversionsListOptions": {
        "type": "object",
        "properties": {
          "groupBy": {
            "default": "account",
            "type": "string",
            "enum": [
              "account",
              "conversion"
            ]
          },
          "scope": {
            "default": "ads",
            "type": "string",
            "enum": [
              "ads",
              "all"
            ]
          },
          "roles": {
            "maxItems": 8,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "signup",
                "login",
                "trial_start",
                "trial_end",
                "activation",
                "core_action",
                "lead",
                "demo_request",
                "contact_click",
                "checkout_start",
                "payment_failed",
                "purchase",
                "subscription_renewal",
                "refund",
                "churn",
                "referral"
              ]
            }
          }
        },
        "required": [
          "groupBy",
          "scope"
        ],
        "additionalProperties": false
      },
      "AdConversionsListSection": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40,
            "pattern": "^[a-z0-9][a-z0-9_-]{0,39}$"
          },
          "title": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "size": {
            "type": "string",
            "enum": [
              "kpi",
              "half",
              "full"
            ]
          },
          "type": {
            "type": "string",
            "const": "ad_conversions_list"
          },
          "groupBy": {
            "default": "account",
            "type": "string",
            "enum": [
              "account",
              "conversion"
            ]
          },
          "scope": {
            "default": "ads",
            "type": "string",
            "enum": [
              "ads",
              "all"
            ]
          },
          "roles": {
            "maxItems": 8,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "signup",
                "login",
                "trial_start",
                "trial_end",
                "activation",
                "core_action",
                "lead",
                "demo_request",
                "contact_click",
                "checkout_start",
                "payment_failed",
                "purchase",
                "subscription_renewal",
                "refund",
                "churn",
                "referral"
              ]
            }
          },
          "platforms": {
            "default": [],
            "maxItems": 10,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 50
            }
          },
          "limit": {
            "default": 25,
            "type": "integer",
            "minimum": 1,
            "maximum": 50
          }
        },
        "required": [
          "type",
          "groupBy",
          "scope",
          "platforms",
          "limit"
        ],
        "additionalProperties": false
      },
      "AdFunnelSection": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40,
            "pattern": "^[a-z0-9][a-z0-9_-]{0,39}$"
          },
          "title": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "size": {
            "type": "string",
            "enum": [
              "kpi",
              "half",
              "full"
            ]
          },
          "type": {
            "type": "string",
            "const": "ad_funnel"
          },
          "roles": {
            "maxItems": 4,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "signup",
                "login",
                "trial_start",
                "trial_end",
                "activation",
                "core_action",
                "lead",
                "demo_request",
                "contact_click",
                "checkout_start",
                "payment_failed",
                "purchase",
                "subscription_renewal",
                "refund",
                "churn",
                "referral"
              ]
            }
          },
          "platforms": {
            "default": [],
            "maxItems": 10,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 50
            }
          }
        },
        "required": [
          "type",
          "platforms"
        ],
        "additionalProperties": false
      },
      "AdsBudget": {
        "type": "object",
        "properties": {
          "month": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "daysInMonth": {
            "type": "integer"
          },
          "daysElapsed": {
            "type": "integer"
          },
          "tolerance": {
            "type": "number"
          },
          "total": {
            "$ref": "#/components/schemas/BudgetPacing"
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BudgetPacing"
            }
          },
          "plans": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BudgetPlan"
            }
          },
          "cumulative": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "day": {
                  "$ref": "#/components/schemas/LocalDate"
                },
                "spend": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "cumulative": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "plan": {
                  "type": [
                    "number",
                    "null"
                  ]
                }
              },
              "required": [
                "day",
                "spend",
                "cumulative",
                "plan"
              ],
              "additionalProperties": false
            }
          },
          "campaigns": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "campaign": {
                  "$ref": "#/components/schemas/AdCampaign"
                },
                "last7DaysSpend": {
                  "type": "number"
                },
                "dailyAverage": {
                  "type": "number"
                },
                "budgetUse": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "lastDataDay": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/LocalDate"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "campaign",
                "last7DaysSpend",
                "dailyAverage",
                "budgetUse",
                "lastDataDay"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "month",
          "currency",
          "daysInMonth",
          "daysElapsed",
          "tolerance",
          "total",
          "lines",
          "plans",
          "cumulative",
          "campaigns"
        ],
        "additionalProperties": false
      },
      "AdsCampaigns": {
        "type": "object",
        "properties": {
          "metrics": {
            "$ref": "#/components/schemas/AnalyticsQueryResult"
          },
          "campaigns": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AdCampaign"
            }
          },
          "unmatched": {
            "$ref": "#/components/schemas/AnalyticsQueryResult"
          },
          "counts": {
            "type": "object",
            "properties": {
              "active": {
                "type": "integer"
              },
              "paused": {
                "type": "integer"
              },
              "ended": {
                "type": "integer"
              },
              "all": {
                "type": "integer"
              }
            },
            "required": [
              "active",
              "paused",
              "ended",
              "all"
            ],
            "additionalProperties": false
          },
          "naming": {
            "type": "object",
            "properties": {
              "hasTemplate": {
                "type": "boolean"
              },
              "offTemplate": {
                "type": "integer"
              },
              "followsTemplate": {
                "type": "integer"
              }
            },
            "required": [
              "hasTemplate",
              "offTemplate",
              "followsTemplate"
            ],
            "additionalProperties": false
          },
          "conversionRoles": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "signup",
                "login",
                "trial_start",
                "trial_end",
                "activation",
                "core_action",
                "lead",
                "demo_request",
                "contact_click",
                "checkout_start",
                "payment_failed",
                "purchase",
                "subscription_renewal",
                "refund",
                "churn",
                "referral"
              ]
            }
          },
          "originalSpend": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "$ref": "#/components/schemas/OriginalSpend"
            }
          },
          "conversionRates": {
            "type": "object",
            "properties": {
              "minClicks": {
                "type": "integer"
              },
              "items": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "campaignId": {
                      "$ref": "#/components/schemas/Id"
                    },
                    "adClicks": {
                      "type": "number"
                    },
                    "adConversions": {
                      "type": "number"
                    },
                    "rate": {
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "campaignId",
                    "adClicks",
                    "adConversions",
                    "rate"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "minClicks",
              "items"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "metrics",
          "campaigns",
          "unmatched",
          "counts",
          "conversionRoles"
        ],
        "additionalProperties": false
      },
      "AdsTableSection": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40,
            "pattern": "^[a-z0-9][a-z0-9_-]{0,39}$"
          },
          "title": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "size": {
            "type": "string",
            "enum": [
              "kpi",
              "half",
              "full"
            ]
          },
          "type": {
            "type": "string",
            "const": "ads_table"
          },
          "level": {
            "default": "campaign",
            "type": "string",
            "enum": [
              "platform",
              "account",
              "campaign",
              "ad_group",
              "ad"
            ]
          },
          "metrics": {
            "minItems": 1,
            "maxItems": 8,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 101,
              "pattern": "^(?:[a-z][a-z0-9_]{0,49}(?::[a-z][a-z0-9_]{0,49})?|social\\.[a-z][a-z0-9_]{0,19}\\.[a-z][a-z0-9_]{0,49}|(?:email|sms)\\.[a-z][a-z0-9_]{0,49})$"
            }
          },
          "platforms": {
            "default": [],
            "maxItems": 10,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 50
            }
          },
          "limit": {
            "default": 15,
            "type": "integer",
            "minimum": 1,
            "maximum": 50
          },
          "conversions": {
            "$ref": "#/components/schemas/AdConversionsListOptions"
          }
        },
        "required": [
          "type",
          "level",
          "platforms",
          "limit"
        ],
        "additionalProperties": false
      },
      "AiSummary": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "disabled",
              "not_configured",
              "pending",
              "ready",
              "failed"
            ]
          },
          "locale": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "tr",
                  "en"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "text": {
            "type": [
              "string",
              "null"
            ]
          },
          "model": {
            "type": [
              "string",
              "null"
            ]
          },
          "generatedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Timestamp"
              },
              {
                "type": "null"
              }
            ]
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "status",
          "locale",
          "text",
          "model",
          "generatedAt",
          "error"
        ],
        "additionalProperties": false
      },
      "AlertRecipients": {
        "type": "object",
        "properties": {
          "inApp": {
            "default": true,
            "type": "boolean"
          },
          "userIds": {
            "default": [],
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          },
          "emails": {
            "default": [],
            "maxItems": 20,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 320
            }
          },
          "channelIds": {
            "default": [],
            "maxItems": 10,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          },
          "webPushUserIds": {
            "default": [],
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          }
        }
      },
      "AnalyticsCatalogue": {
        "type": "object",
        "properties": {
          "metrics": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CatalogueMetric"
            }
          },
          "dimensions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CatalogueDimension"
            }
          },
          "roles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LabelledValue"
            }
          },
          "conversionRoles": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "signup",
                "login",
                "trial_start",
                "trial_end",
                "activation",
                "core_action",
                "lead",
                "demo_request",
                "contact_click",
                "checkout_start",
                "payment_failed",
                "purchase",
                "subscription_renewal",
                "refund",
                "churn",
                "referral"
              ]
            }
          },
          "compareModes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "none",
                "previous_period",
                "previous_year",
                "custom"
              ]
            }
          },
          "filterOperators": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "eq",
                "neq",
                "in",
                "not_in",
                "contains",
                "not_contains",
                "starts_with",
                "is_empty",
                "is_not_empty"
              ]
            }
          },
          "attributionModels": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string",
                  "enum": [
                    "first_touch",
                    "last_touch",
                    "last_non_direct",
                    "linear",
                    "position_based",
                    "time_decay",
                    "last_paid"
                  ]
                },
                "label": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                }
              },
              "required": [
                "key",
                "label",
                "description"
              ],
              "additionalProperties": false
            }
          },
          "defaultAttributionModel": {
            "type": "string",
            "enum": [
              "first_touch",
              "last_touch",
              "last_non_direct",
              "linear",
              "position_based",
              "time_decay",
              "last_paid"
            ]
          },
          "attributionWindowDays": {
            "type": "integer"
          },
          "revenueBasis": {
            "type": "string",
            "enum": [
              "gross",
              "net"
            ]
          },
          "pricesIncludeTax": {
            "type": "boolean"
          }
        },
        "required": [
          "metrics",
          "dimensions",
          "roles",
          "conversionRoles",
          "compareModes",
          "filterOperators",
          "attributionModels",
          "defaultAttributionModel",
          "attributionWindowDays"
        ],
        "additionalProperties": false
      },
      "AnalyticsQueryResult": {
        "type": "object",
        "properties": {
          "metrics": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QueryMetricMeta"
            }
          },
          "dimensions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QueryRow"
            }
          },
          "totals": {
            "type": "object",
            "properties": {
              "values": {
                "$ref": "#/components/schemas/QueryValues"
              },
              "deltas": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/QueryDeltas"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "values",
              "deltas"
            ],
            "additionalProperties": false
          },
          "comparison": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "dateRange": {
                    "type": "object",
                    "properties": {
                      "from": {
                        "$ref": "#/components/schemas/LocalDate"
                      },
                      "to": {
                        "$ref": "#/components/schemas/LocalDate"
                      }
                    },
                    "required": [
                      "from",
                      "to"
                    ],
                    "additionalProperties": false
                  },
                  "comparable": {
                    "type": "boolean"
                  },
                  "totals": {
                    "$ref": "#/components/schemas/QueryValues"
                  }
                },
                "required": [
                  "dateRange",
                  "comparable",
                  "totals"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "meta": {
            "$ref": "#/components/schemas/QueryMeta"
          }
        },
        "required": [
          "metrics",
          "dimensions",
          "rows",
          "totals",
          "comparison",
          "meta"
        ],
        "additionalProperties": false
      },
      "AnalyticsSegment": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "subject": {
            "type": "string",
            "enum": [
              "person",
              "account"
            ]
          },
          "rules": {
            "type": "object",
            "properties": {
              "match": {
                "type": "string",
                "enum": [
                  "all",
                  "any"
                ]
              },
              "conditions": {
                "type": "array",
                "items": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {}
                }
              }
            },
            "required": [
              "match",
              "conditions"
            ],
            "additionalProperties": false
          },
          "lastCount": {
            "type": [
              "integer",
              "null"
            ]
          },
          "lastCountedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Timestamp"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdBy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Id"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/Timestamp"
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "subject",
          "rules",
          "lastCount",
          "lastCountedAt",
          "createdBy",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "AnalyticsSegmentCount": {
        "type": "object",
        "properties": {
          "subject": {
            "type": "string",
            "enum": [
              "person",
              "account"
            ]
          },
          "count": {
            "type": "integer"
          },
          "sample": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "readsEvents": {
            "type": "boolean"
          }
        },
        "required": [
          "subject",
          "count",
          "sample",
          "readsEvents"
        ],
        "additionalProperties": false
      },
      "AnalyticsSegmentList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalyticsSegment"
            }
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": false
      },
      "App": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "websiteUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "iconUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "timezone": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "schemaMode": {
            "type": "string",
            "enum": [
              "strict",
              "lenient",
              "discover"
            ]
          },
          "schemaRevision": {
            "type": "integer",
            "minimum": 0
          },
          "attributionModel": {
            "type": "string",
            "enum": [
              "first_touch",
              "last_touch",
              "last_non_direct",
              "linear",
              "position_based",
              "time_decay",
              "last_paid"
            ]
          },
          "attributionWindowDays": {
            "type": "integer"
          },
          "conversionRoles": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "signup",
                "login",
                "trial_start",
                "trial_end",
                "activation",
                "core_action",
                "lead",
                "demo_request",
                "contact_click",
                "checkout_start",
                "payment_failed",
                "purchase",
                "subscription_renewal",
                "refund",
                "churn",
                "referral"
              ]
            }
          },
          "leadContactClicks": {
            "type": "boolean"
          },
          "retention": {
            "$ref": "#/components/schemas/AppRetention"
          },
          "internalIpRanges": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "internalCookie": {
            "type": [
              "string",
              "null"
            ]
          },
          "revenueBasis": {
            "type": "string",
            "enum": [
              "gross",
              "net"
            ]
          },
          "pricesIncludeTax": {
            "type": "boolean"
          },
          "overviewTiles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OverviewTile"
            }
          },
          "adsKpis": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "modules": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "ads",
                "social",
                "messaging",
                "content",
                "leads",
                "behavior"
              ]
            }
          },
          "defaultAlertRecipients": {
            "$ref": "#/components/schemas/AppAlertRecipients"
          },
          "searchBrandTerms": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "defaultOverviewTiles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OverviewTile"
            }
          },
          "defaultAdsKpis": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "archived"
            ]
          },
          "createdAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/Timestamp"
          }
        },
        "required": [
          "id",
          "slug",
          "name",
          "description",
          "websiteUrl",
          "iconUrl",
          "timezone",
          "currency",
          "schemaMode",
          "schemaRevision",
          "attributionModel",
          "attributionWindowDays",
          "conversionRoles",
          "leadContactClicks",
          "retention",
          "internalIpRanges",
          "internalCookie",
          "status",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "AppAlertRecipients": {
        "type": "object",
        "properties": {
          "inApp": {
            "type": "boolean"
          },
          "userIds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Id"
            }
          },
          "emails": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "channelIds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Id"
            }
          },
          "webPushUserIds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Id"
            }
          }
        },
        "required": [
          "inApp",
          "userIds",
          "emails",
          "channelIds"
        ],
        "additionalProperties": false
      },
      "AppPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/App"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "items",
          "nextCursor"
        ],
        "additionalProperties": false
      },
      "AppRetention": {
        "type": "object",
        "properties": {
          "eventsMonths": {
            "type": "integer"
          },
          "interactionsMonths": {
            "type": "integer"
          },
          "sessionsMonths": {
            "type": "integer"
          }
        },
        "required": [
          "eventsMonths",
          "interactionsMonths",
          "sessionsMonths"
        ],
        "additionalProperties": false
      },
      "AttributedTouch": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": [
              "string",
              "null"
            ]
          },
          "at": {
            "type": [
              "string",
              "null"
            ]
          },
          "channel": {
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "type": [
              "string",
              "null"
            ]
          },
          "medium": {
            "type": [
              "string",
              "null"
            ]
          },
          "campaign": {
            "type": [
              "string",
              "null"
            ]
          },
          "resolution": {
            "type": "string",
            "enum": [
              "click_id",
              "campaign_id",
              "utm_name",
              "unknown"
            ]
          },
          "weight": {
            "type": "number"
          }
        },
        "required": [
          "sessionId",
          "at",
          "channel",
          "source",
          "medium",
          "campaign",
          "resolution",
          "weight"
        ],
        "additionalProperties": false
      },
      "AttributionSection": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40,
            "pattern": "^[a-z0-9][a-z0-9_-]{0,39}$"
          },
          "title": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "size": {
            "type": "string",
            "enum": [
              "kpi",
              "half",
              "full"
            ]
          },
          "type": {
            "type": "string",
            "const": "attribution"
          },
          "metric": {
            "default": "conversions",
            "type": "string",
            "minLength": 1,
            "maxLength": 101,
            "pattern": "^(?:[a-z][a-z0-9_]{0,49}(?::[a-z][a-z0-9_]{0,49})?|social\\.[a-z][a-z0-9_]{0,19}\\.[a-z][a-z0-9_]{0,49}|(?:email|sms)\\.[a-z][a-z0-9_]{0,49})$"
          },
          "dimension": {
            "default": "attributed_channel",
            "type": "string",
            "enum": [
              "attributed_channel",
              "attributed_source",
              "attributed_medium",
              "attributed_campaign"
            ]
          },
          "models": {
            "default": [
              "first_touch",
              "last_touch",
              "last_non_direct",
              "linear",
              "position_based",
              "time_decay",
              "last_paid"
            ],
            "minItems": 2,
            "maxItems": 7,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "first_touch",
                "last_touch",
                "last_non_direct",
                "linear",
                "position_based",
                "time_decay",
                "last_paid"
              ]
            }
          },
          "limit": {
            "default": 8,
            "type": "integer",
            "minimum": 1,
            "maximum": 20
          }
        },
        "required": [
          "type",
          "metric",
          "dimension",
          "models",
          "limit"
        ],
        "additionalProperties": false
      },
      "Autocapture": {
        "type": "object",
        "properties": {
          "pageviews": {
            "type": "boolean"
          },
          "pageleave": {
            "type": "boolean"
          },
          "clicks": {
            "type": "boolean"
          },
          "rageClicks": {
            "type": "boolean"
          },
          "deadClicks": {
            "type": "boolean"
          },
          "scroll": {
            "type": "boolean"
          },
          "errors": {
            "type": "boolean"
          },
          "forms": {
            "type": "boolean"
          },
          "layout": {
            "type": "boolean"
          },
          "outboundLinks": {
            "type": "boolean"
          },
          "downloads": {
            "type": "boolean"
          },
          "webVitals": {
            "type": "boolean"
          }
        },
        "required": [
          "pageviews",
          "pageleave",
          "clicks",
          "rageClicks",
          "deadClicks",
          "scroll",
          "errors",
          "forms",
          "layout",
          "outboundLinks",
          "downloads",
          "webVitals"
        ],
        "additionalProperties": false
      },
      "BudgetPacing": {
        "type": "object",
        "properties": {
          "platform": {
            "type": [
              "string",
              "null"
            ]
          },
          "adAccountId": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Id"
              },
              {
                "type": "null"
              }
            ]
          },
          "budget": {
            "type": [
              "number",
              "null"
            ]
          },
          "spent": {
            "type": "number"
          },
          "remaining": {
            "type": [
              "number",
              "null"
            ]
          },
          "used": {
            "type": [
              "number",
              "null"
            ]
          },
          "expectedToDate": {
            "type": [
              "number",
              "null"
            ]
          },
          "dailyAverage": {
            "type": "number"
          },
          "requiredDaily": {
            "type": [
              "number",
              "null"
            ]
          },
          "forecast": {
            "type": "number"
          },
          "forecastRatio": {
            "type": [
              "number",
              "null"
            ]
          },
          "activeDailyBudgets": {
            "type": "number"
          },
          "state": {
            "type": "string",
            "enum": [
              "on_track",
              "over",
              "behind",
              "no_budget"
            ]
          }
        },
        "required": [
          "platform",
          "adAccountId",
          "budget",
          "spent",
          "remaining",
          "used",
          "expectedToDate",
          "dailyAverage",
          "requiredDaily",
          "forecast",
          "forecastRatio",
          "activeDailyBudgets",
          "state"
        ],
        "additionalProperties": false
      },
      "BudgetPlan": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "month": {
            "type": "string"
          },
          "platform": {
            "type": [
              "string",
              "null"
            ]
          },
          "adAccountId": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Id"
              },
              {
                "type": "null"
              }
            ]
          },
          "amount": {
            "type": "number"
          },
          "currency": {
            "type": "string"
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "createdBy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Id"
              },
              {
                "type": "null"
              }
            ]
          },
          "supersededAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Timestamp"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "month",
          "platform",
          "adAccountId",
          "amount",
          "currency",
          "note",
          "createdAt",
          "createdBy",
          "supersededAt"
        ],
        "additionalProperties": false
      },
      "CampaignCounts": {
        "type": "object",
        "properties": {
          "recipients": {
            "type": "integer"
          },
          "queued": {
            "type": "integer"
          },
          "sending": {
            "type": "integer"
          },
          "sent": {
            "type": "integer"
          },
          "delivered": {
            "type": "integer"
          },
          "failed": {
            "type": "integer"
          },
          "bounced": {
            "type": "integer"
          },
          "unknown": {
            "type": "integer"
          },
          "skipped": {
            "type": "integer"
          },
          "opened": {
            "type": "integer"
          },
          "clicked": {
            "type": "integer"
          },
          "complained": {
            "type": "integer"
          },
          "unsubscribed": {
            "type": "integer"
          }
        },
        "required": [
          "recipients",
          "queued",
          "sending",
          "sent",
          "delivered",
          "failed",
          "bounced",
          "unknown",
          "skipped",
          "opened",
          "clicked",
          "complained",
          "unsubscribed"
        ],
        "additionalProperties": false
      },
      "CampaignResults": {
        "type": "object",
        "properties": {
          "campaignId": {
            "$ref": "#/components/schemas/Id"
          },
          "channel": {
            "type": "string",
            "enum": [
              "email",
              "sms"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "awaiting_approval",
              "scheduled",
              "sending",
              "paused",
              "sent",
              "cancelled",
              "failed"
            ]
          },
          "counts": {
            "$ref": "#/components/schemas/CampaignCounts"
          },
          "metrics": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": [
                "number",
                "null"
              ]
            }
          },
          "progress": {
            "type": [
              "number",
              "null"
            ]
          },
          "utm": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string"
              },
              "medium": {
                "type": "string"
              },
              "campaign": {
                "type": "string"
              }
            },
            "required": [
              "source",
              "medium",
              "campaign"
            ],
            "additionalProperties": false
          },
          "traffic": {
            "type": "object",
            "properties": {
              "from": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/LocalDate"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "to": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/LocalDate"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "sessions": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "conversions": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "conversionsByRole": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "type": [
                    "number",
                    "null"
                  ]
                }
              },
              "revenue": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "countingMode": {
                "type": "string",
                "const": "event_date"
              }
            },
            "required": [
              "from",
              "to",
              "sessions",
              "conversions",
              "conversionsByRole",
              "revenue",
              "countingMode"
            ],
            "additionalProperties": false
          },
          "countingMode": {
            "type": "string",
            "const": "cohort"
          },
          "unavailable": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "object",
              "properties": {
                "reason": {
                  "type": "string",
                  "enum": [
                    "not_started",
                    "no_denominator",
                    "no_data"
                  ]
                },
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "reason",
                "message"
              ],
              "additionalProperties": false
            }
          },
          "segment": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "$ref": "#/components/schemas/Id"
                  },
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "campaignId",
          "channel",
          "status",
          "counts",
          "metrics",
          "progress",
          "utm",
          "traffic",
          "countingMode",
          "unavailable"
        ],
        "additionalProperties": false
      },
      "CatalogueDimension": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "time",
              "category"
            ]
          },
          "values": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/LabelledValue"
                }
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "key",
          "label",
          "description",
          "kind",
          "values"
        ],
        "additionalProperties": false
      },
      "CatalogueMetric": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "unit": {
            "type": "string",
            "enum": [
              "count",
              "duration_ms",
              "percent",
              "currency",
              "ratio",
              "number"
            ]
          },
          "goodDirection": {
            "type": "string",
            "enum": [
              "higher",
              "lower",
              "neutral"
            ]
          },
          "aggregation": {
            "type": "string",
            "enum": [
              "sum",
              "distinct",
              "ratio",
              "last"
            ]
          },
          "countingMode": {
            "type": "string",
            "enum": [
              "event_date",
              "cohort"
            ]
          },
          "formula": {
            "type": "object",
            "properties": {
              "numerator": {
                "type": "string"
              },
              "denominator": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "scale": {
                "type": "number"
              }
            },
            "required": [
              "numerator",
              "denominator",
              "scale"
            ],
            "additionalProperties": false
          },
          "tables": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "dimensions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "parameter": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "role"
                  },
                  "values": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/LabelledValue"
                    }
                  }
                },
                "required": [
                  "name",
                  "values"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "custom": {
            "type": "boolean"
          },
          "definitionId": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Id"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "key",
          "label",
          "description",
          "unit",
          "goodDirection",
          "aggregation",
          "countingMode",
          "formula",
          "tables",
          "dimensions",
          "parameter",
          "custom",
          "definitionId"
        ],
        "additionalProperties": false
      },
      "ChangeEventStatusRequest": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "active",
              "deprecated",
              "blocked"
            ]
          }
        },
        "required": [
          "status"
        ]
      },
      "Connection": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "provider": {
            "type": "string",
            "enum": [
              "google_ads",
              "meta_ads",
              "linkedin_ads",
              "tiktok_ads",
              "yandex_direct",
              "chatgpt_ads",
              "ga4",
              "search_console",
              "manual_import",
              "instagram",
              "facebook_pages",
              "linkedin_pages"
            ]
          },
          "kind": {
            "type": "string",
            "enum": [
              "ads",
              "analytics",
              "search_console",
              "social"
            ]
          },
          "authType": {
            "type": "string",
            "enum": [
              "oauth2",
              "api_key",
              "none"
            ]
          },
          "mode": {
            "type": "string",
            "enum": [
              "live",
              "fake"
            ]
          },
          "label": {
            "type": [
              "string",
              "null"
            ]
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "syncIntervalMinutes": {
            "type": "integer"
          },
          "lookbackDays": {
            "type": "integer"
          },
          "backfillDays": {
            "type": "integer"
          },
          "health": {
            "$ref": "#/components/schemas/ConnectionHealth"
          },
          "accounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConnectionAccount"
            }
          },
          "createdAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/Timestamp"
          }
        },
        "required": [
          "id",
          "provider",
          "kind",
          "authType",
          "mode",
          "label",
          "scopes",
          "syncIntervalMinutes",
          "lookbackDays",
          "backfillDays",
          "health",
          "accounts",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "ConnectionAccount": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "kind": {
            "type": "string",
            "enum": [
              "ad_account",
              "ga4_property",
              "search_console_site",
              "social_account"
            ]
          },
          "externalId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "currency": {
            "type": [
              "string",
              "null"
            ]
          },
          "timezone": {
            "type": [
              "string",
              "null"
            ]
          },
          "platformStatus": {
            "type": [
              "string",
              "null"
            ]
          },
          "selected": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "kind",
          "externalId",
          "name",
          "currency",
          "timezone",
          "platformStatus",
          "selected"
        ],
        "additionalProperties": false
      },
      "ConnectionHealth": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "active",
              "needs_reauth",
              "error",
              "rate_limited",
              "paused"
            ]
          },
          "lastSuccessAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Timestamp"
              },
              {
                "type": "null"
              }
            ]
          },
          "lastRunAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Timestamp"
              },
              {
                "type": "null"
              }
            ]
          },
          "lastRunStatus": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "running",
                  "succeeded",
                  "partial",
                  "failed",
                  "rate_limited"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "lastError": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ConnectorError"
              },
              {
                "type": "null"
              }
            ]
          },
          "consecutiveFailures": {
            "type": "integer"
          },
          "nextRunAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Timestamp"
              },
              {
                "type": "null"
              }
            ]
          },
          "syncedUntil": {
            "type": [
              "string",
              "null"
            ]
          },
          "tokenExpiresAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Timestamp"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "status",
          "lastSuccessAt",
          "lastRunAt",
          "lastRunStatus",
          "lastError",
          "consecutiveFailures",
          "nextRunAt",
          "syncedUntil",
          "tokenExpiresAt"
        ],
        "additionalProperties": false
      },
      "ConnectionList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Connection"
            }
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": false
      },
      "ConnectorError": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "auth_failed",
              "permission_missing",
              "rate_limited",
              "provider_error",
              "network_error",
              "timeout",
              "invalid_response",
              "not_configured",
              "secret_unavailable"
            ]
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "additionalProperties": false
      },
      "ConsentChange": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "none",
              "merchant",
              "opt_in",
              "opt_out"
            ]
          },
          "reason": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          },
          "evidence": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1000
              },
              {
                "type": "null"
              }
            ]
          },
          "form": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          }
        },
        "required": [
          "kind"
        ]
      },
      "ConsentResult": {
        "type": "object",
        "properties": {
          "contactId": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Id"
              },
              {
                "type": "null"
              }
            ]
          },
          "kind": {
            "type": "string",
            "enum": [
              "none",
              "merchant",
              "opt_in",
              "opt_out"
            ]
          }
        },
        "required": [
          "contactId",
          "kind"
        ],
        "additionalProperties": false
      },
      "ContactList": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "contacts": {
            "type": "integer"
          },
          "emailSendable": {
            "type": "integer"
          },
          "smsSendable": {
            "type": "integer"
          },
          "createdBy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Id"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/Timestamp"
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "contacts",
          "emailSendable",
          "smsSendable",
          "createdBy",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "ContactListList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactList"
            }
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": false
      },
      "ContactReference": {
        "type": "object",
        "properties": {
          "contactId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "email": {
            "type": "string",
            "maxLength": 320
          },
          "phone": {
            "type": "string",
            "maxLength": 40
          },
          "userId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      },
      "ContentCalendarSection": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40,
            "pattern": "^[a-z0-9][a-z0-9_-]{0,39}$"
          },
          "title": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "size": {
            "type": "string",
            "enum": [
              "kpi",
              "half",
              "full"
            ]
          },
          "type": {
            "type": "string",
            "const": "content_calendar"
          },
          "sources": {
            "default": [
              "social",
              "blog"
            ],
            "minItems": 1,
            "maxItems": 2,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "social",
                "blog"
              ]
            }
          },
          "platforms": {
            "default": [],
            "maxItems": 3,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "instagram",
                "facebook",
                "linkedin"
              ]
            }
          },
          "limit": {
            "default": 50,
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          }
        },
        "required": [
          "type",
          "sources",
          "platforms",
          "limit"
        ],
        "additionalProperties": false
      },
      "CreateAppRequest": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string",
            "minLength": 1,
            "maxLength": 50,
            "pattern": "^[a-z0-9](?:[a-z0-9-]{0,48}[a-z0-9])?$"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ]
          },
          "websiteUrl": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ]
          },
          "iconUrl": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ]
          },
          "timezone": {
            "type": "string",
            "maxLength": 64
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "schemaMode": {
            "default": "lenient",
            "type": "string",
            "enum": [
              "strict",
              "lenient",
              "discover"
            ]
          },
          "attributionModel": {
            "default": "last_non_direct",
            "type": "string",
            "enum": [
              "first_touch",
              "last_touch",
              "last_non_direct",
              "linear",
              "position_based",
              "time_decay",
              "last_paid"
            ]
          },
          "attributionWindowDays": {
            "default": 90,
            "type": "integer",
            "minimum": 1,
            "maximum": 365
          },
          "conversionRoles": {
            "default": [
              "signup",
              "trial_start",
              "lead",
              "demo_request",
              "purchase"
            ],
            "minItems": 1,
            "maxItems": 16,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "signup",
                "login",
                "trial_start",
                "trial_end",
                "activation",
                "core_action",
                "lead",
                "demo_request",
                "contact_click",
                "checkout_start",
                "payment_failed",
                "purchase",
                "subscription_renewal",
                "refund",
                "churn",
                "referral"
              ]
            }
          },
          "leadContactClicks": {
            "default": false,
            "type": "boolean"
          },
          "retention": {
            "type": "object",
            "properties": {
              "eventsMonths": {
                "type": "integer",
                "minimum": 1,
                "maximum": 120
              },
              "interactionsMonths": {
                "type": "integer",
                "minimum": 1,
                "maximum": 60
              },
              "sessionsMonths": {
                "type": "integer",
                "minimum": 1,
                "maximum": 120
              }
            },
            "required": [
              "eventsMonths",
              "interactionsMonths",
              "sessionsMonths"
            ]
          },
          "internalIpRanges": {
            "default": [],
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 43,
              "pattern": "^(?:(?:\\d{1,3}\\.){3}\\d{1,3}(?:\\/\\d{1,2})?|[0-9A-Fa-f:]{2,39}(?:\\/\\d{1,3})?)$"
            }
          },
          "internalCookie": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ]
          },
          "revenueBasis": {
            "default": "gross",
            "type": "string",
            "enum": [
              "gross",
              "net"
            ]
          },
          "pricesIncludeTax": {
            "default": true,
            "type": "boolean"
          },
          "overviewTiles": {
            "default": [],
            "maxItems": 12,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OverviewTileRequest"
            }
          },
          "adsKpis": {
            "default": [],
            "maxItems": 12,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 101,
              "pattern": "^(?:[a-z][a-z0-9_]{0,49}(?::[a-z][a-z0-9_]{0,49})?|social\\.[a-z][a-z0-9_]{0,19}\\.[a-z][a-z0-9_]{0,49}|(?:email|sms)\\.[a-z][a-z0-9_]{0,49})$"
            }
          },
          "modules": {
            "default": [
              "ads",
              "social",
              "messaging",
              "content",
              "leads",
              "behavior"
            ],
            "maxItems": 6,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "ads",
                "social",
                "messaging",
                "content",
                "leads",
                "behavior"
              ]
            }
          },
          "defaultAlertRecipients": {
            "$ref": "#/components/schemas/AlertRecipients"
          },
          "searchBrandTerms": {
            "default": [],
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 2,
              "maxLength": 100
            }
          }
        },
        "required": [
          "slug",
          "name"
        ]
      },
      "CreateDeletionRequest": {
        "type": "object",
        "properties": {
          "subjectKind": {
            "type": "string",
            "enum": [
              "user_id",
              "anonymous_id",
              "person_id"
            ],
            "description": "Kimliğin türü: ürünün kullanıcı kimliği (`user_id`), SDK'nın anonim kimliği (`anonymous_id`) ya da Postlip Metrics'in kişi kimliği (`person_id`)."
          },
          "subjectValue": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Kimliğin değeri (en çok 200 karakter). E-posta ya da telefon gibi görünen kimlik alımdaki gibi özetlenerek aranır; değer talep bitene kadar tutulur."
          },
          "note": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ],
            "description": "Neden (talep numarası, başvurunun kanalı); kişisel veri yazmayın. En çok 500 karakter."
          }
        },
        "required": [
          "subjectKind",
          "subjectValue"
        ]
      },
      "CreateEventDefinitionRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "displayName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ]
          },
          "category": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ]
          },
          "roles": {
            "default": [],
            "maxItems": 16,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "signup",
                "login",
                "trial_start",
                "trial_end",
                "activation",
                "core_action",
                "lead",
                "demo_request",
                "contact_click",
                "checkout_start",
                "payment_failed",
                "purchase",
                "subscription_renewal",
                "refund",
                "churn",
                "referral"
              ]
            }
          },
          "status": {
            "default": "active",
            "type": "string",
            "enum": [
              "draft",
              "active",
              "deprecated",
              "blocked"
            ]
          },
          "aliases": {
            "default": [],
            "maxItems": 20,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          "properties": {
            "maxItems": 200,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PropertyDefinitionInput"
            }
          },
          "displayNames": {
            "$ref": "#/components/schemas/LocalizedNames"
          }
        },
        "required": [
          "name",
          "displayName"
        ]
      },
      "CreateInvitationRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "minLength": 1,
            "maxLength": 320
          },
          "roleId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "appScope": {
            "default": "all",
            "type": "string",
            "enum": [
              "all",
              "selected"
            ]
          },
          "appIds": {
            "default": [],
            "maxItems": 200,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          }
        },
        "required": [
          "email",
          "roleId"
        ]
      },
      "CreateMessageCampaignRequest": {
        "type": "object",
        "properties": {
          "channel": {
            "type": "string",
            "enum": [
              "email",
              "sms"
            ]
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "templateId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "templateKey": {
            "type": "string",
            "maxLength": 80
          },
          "subject": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "preheader": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "body": {
            "type": "string",
            "maxLength": 20000
          },
          "senderId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              {
                "type": "null"
              }
            ]
          },
          "audience": {
            "type": "object",
            "properties": {
              "listIds": {
                "default": [],
                "maxItems": 20,
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                }
              },
              "segmentId": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          },
          "locale": {
            "type": "string",
            "enum": [
              "tr",
              "en"
            ]
          },
          "throttlePerMinute": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 100000
              },
              {
                "type": "null"
              }
            ]
          },
          "utmSource": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          }
        },
        "required": [
          "channel",
          "name"
        ]
      },
      "CreateSourceKeyRequest": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "write",
              "signing"
            ]
          },
          "mode": {
            "default": "live",
            "type": "string",
            "enum": [
              "live",
              "test"
            ]
          }
        },
        "required": [
          "kind"
        ]
      },
      "CreateSourceRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "kind": {
            "type": "string",
            "enum": [
              "web",
              "ios",
              "android",
              "server",
              "other"
            ]
          },
          "environment": {
            "default": "production",
            "type": "string",
            "enum": [
              "production",
              "staging",
              "development"
            ]
          },
          "requireSignature": {
            "default": false,
            "type": "boolean"
          },
          "allowedOrigins": {
            "default": [],
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 300,
              "pattern": "^https?:\\/\\/(?:\\*\\.)?[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)*(?::\\d{1,5})?$"
            }
          },
          "consentMode": {
            "default": "required",
            "type": "string",
            "enum": [
              "required",
              "implied",
              "none"
            ]
          },
          "excludedPaths": {
            "default": [],
            "maxItems": 200,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 300,
              "pattern": "^\\/[^\\s?#]{0,299}$"
            }
          },
          "maskSelectors": {
            "default": [],
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 300
            }
          },
          "ignoreSelectors": {
            "default": [],
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 300
            }
          },
          "stripQueryParams": {
            "default": [],
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100,
              "pattern": "^[A-Za-z0-9_.\\-[\\]]{1,100}$"
            }
          },
          "sessionTimeoutMinutes": {
            "default": 30,
            "type": "integer",
            "minimum": 5,
            "maximum": 240
          },
          "interactionSampleRate": {
            "default": 1,
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "autocapture": {
            "default": {},
            "type": "object",
            "properties": {
              "pageviews": {
                "type": "boolean"
              },
              "pageleave": {
                "type": "boolean"
              },
              "clicks": {
                "type": "boolean"
              },
              "rageClicks": {
                "type": "boolean"
              },
              "deadClicks": {
                "type": "boolean"
              },
              "scroll": {
                "type": "boolean"
              },
              "errors": {
                "type": "boolean"
              },
              "forms": {
                "type": "boolean"
              },
              "layout": {
                "type": "boolean"
              },
              "outboundLinks": {
                "type": "boolean"
              },
              "downloads": {
                "type": "boolean"
              },
              "webVitals": {
                "type": "boolean"
              }
            }
          },
          "dataLayerEvents": {
            "default": [],
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        },
        "required": [
          "name",
          "kind"
        ]
      },
      "CreatedSourceKey": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "kind": {
            "type": "string",
            "enum": [
              "write",
              "signing"
            ]
          },
          "mode": {
            "type": "string",
            "enum": [
              "live",
              "test"
            ]
          },
          "maskedKey": {
            "type": "string"
          },
          "displayPrefix": {
            "type": "string"
          },
          "last4": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "active",
              "expiring",
              "revoked"
            ]
          },
          "revokedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Timestamp"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdBy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Id"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "key": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "kind",
          "mode",
          "maskedKey",
          "displayPrefix",
          "last4",
          "state",
          "revokedAt",
          "createdBy",
          "createdAt",
          "key"
        ],
        "additionalProperties": false
      },
      "DateRange": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string"
          },
          "to": {
            "type": "string"
          },
          "alignment": {
            "type": "string",
            "enum": [
              "week_to_date",
              "month_to_date",
              "calendar_month",
              "quarter_to_date",
              "calendar_quarter",
              "year_to_date",
              "calendar_year"
            ]
          }
        },
        "required": [
          "from",
          "to"
        ]
      },
      "DeletionRequest": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "appId": {
            "$ref": "#/components/schemas/Id"
          },
          "subjectKind": {
            "type": "string",
            "enum": [
              "user_id",
              "anonymous_id",
              "person_id"
            ],
            "description": "Kimliğin türü (`user_id`, `anonymous_id`, `person_id`)."
          },
          "subjectHint": {
            "type": "string",
            "description": "Kimliğin son karakterleri («…7c1e»); değerin kendisi hiçbir zaman dönmez."
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "running",
              "completed",
              "failed",
              "cancelled"
            ],
            "description": "`pending` sırada, `running` yürütülüyor, `completed` bitti, `failed` üç denemeden sonra başarısız (`errorCode`), `cancelled` iptal edildi."
          },
          "note": {
            "description": "Talebi açanın notu.",
            "type": [
              "string",
              "null"
            ]
          },
          "requestedVia": {
            "type": "string",
            "enum": [
              "panel",
              "api"
            ],
            "description": "Talebin geldiği yer: panel ya da Management API."
          },
          "requestedBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "$ref": "#/components/schemas/Id"
                  },
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "Talebi açan üye (adı üye dizininden); API anahtarıyla açıldıysa `null`."
          },
          "result": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "integer"
            },
            "description": "Silinen satırlar türüne göre (`events`, `sessions`, `persons`, `identities`, `interactions`, `accountMemberships`, `attributions`, `leads`, `milestones`, `deliveries`, `contacts`); sürerken o ana kadar."
          },
          "errorCode": {
            "description": "Başarısız talebin hata kodu.",
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "startedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Timestamp"
              },
              {
                "type": "null"
              }
            ],
            "description": "Worker'ın talebi ilk aldığı an; bu andan sonra alınan veri talebe girmez."
          },
          "completedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Timestamp"
              },
              {
                "type": "null"
              }
            ],
            "description": "Talebin bittiği ya da iptal edildiği an."
          },
          "nothingFound": {
            "type": "boolean",
            "description": "Talep tamamlandı ama kimliğe ait veri yoktu."
          }
        },
        "required": [
          "id",
          "appId",
          "subjectKind",
          "subjectHint",
          "status",
          "note",
          "requestedVia",
          "requestedBy",
          "result",
          "errorCode",
          "createdAt",
          "startedAt",
          "completedAt",
          "nothingFound"
        ],
        "additionalProperties": false
      },
      "DeletionRequestPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DeletionRequest"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "total": {
            "type": "integer"
          }
        },
        "required": [
          "items",
          "nextCursor",
          "total"
        ],
        "additionalProperties": false
      },
      "DraftMetricDefinition": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "minLength": 1,
            "maxLength": 50,
            "pattern": "^[a-z][a-z0-9_]{1,49}$"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "kind": {
            "type": "string",
            "enum": [
              "event_count",
              "unique_persons",
              "property_sum",
              "property_average",
              "ratio",
              "unique_accounts"
            ]
          },
          "eventName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "role": {
            "type": "string",
            "enum": [
              "signup",
              "login",
              "trial_start",
              "trial_end",
              "activation",
              "core_action",
              "lead",
              "demo_request",
              "contact_click",
              "checkout_start",
              "payment_failed",
              "purchase",
              "subscription_renewal",
              "refund",
              "churn",
              "referral"
            ]
          },
          "property": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,99}$"
          },
          "filters": {
            "default": [],
            "maxItems": 10,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QueryFilterInput"
            }
          },
          "numerator": {
            "type": "string",
            "minLength": 1,
            "maxLength": 101,
            "pattern": "^(?:[a-z][a-z0-9_]{0,49}(?::[a-z][a-z0-9_]{0,49})?|social\\.[a-z][a-z0-9_]{0,19}\\.[a-z][a-z0-9_]{0,49}|(?:email|sms)\\.[a-z][a-z0-9_]{0,49})$"
          },
          "denominator": {
            "type": "string",
            "minLength": 1,
            "maxLength": 101,
            "pattern": "^(?:[a-z][a-z0-9_]{0,49}(?::[a-z][a-z0-9_]{0,49})?|social\\.[a-z][a-z0-9_]{0,19}\\.[a-z][a-z0-9_]{0,49}|(?:email|sms)\\.[a-z][a-z0-9_]{0,49})$"
          },
          "unit": {
            "type": "string",
            "enum": [
              "count",
              "duration_ms",
              "percent",
              "currency",
              "ratio",
              "number"
            ]
          },
          "goodDirection": {
            "default": "higher",
            "type": "string",
            "enum": [
              "higher",
              "lower",
              "neutral"
            ]
          }
        },
        "required": [
          "key",
          "kind"
        ]
      },
      "EraseContactResult": {
        "type": "object",
        "properties": {
          "erased": {
            "type": "integer"
          }
        },
        "required": [
          "erased"
        ],
        "additionalProperties": false
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "fields": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "details": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {}
              },
              "retryAfterSeconds": {
                "type": "integer"
              },
              "traceId": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message",
              "traceId"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false
      },
      "EventDefinition": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "pattern": "^(?!\\$)[^\\s\\x00-\\x1f][^\\x00-\\x1f]{0,199}$"
          },
          "displayName": {
            "type": "string",
            "maxLength": 200
          },
          "description": {
            "type": "string",
            "maxLength": 2000
          },
          "category": {
            "type": "string",
            "maxLength": 100
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "signup",
                "login",
                "trial_start",
                "trial_end",
                "activation",
                "core_action",
                "lead",
                "demo_request",
                "contact_click",
                "checkout_start",
                "payment_failed",
                "purchase",
                "subscription_renewal",
                "refund",
                "churn",
                "referral"
              ]
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "active",
              "deprecated",
              "blocked"
            ]
          },
          "aliases": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "properties": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PropertyDefinition"
            }
          }
        },
        "required": [
          "name",
          "displayName",
          "roles",
          "status",
          "version",
          "properties"
        ],
        "additionalProperties": false
      },
      "EventDefinitionPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EventDefinitionSummary"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "items",
          "nextCursor"
        ],
        "additionalProperties": false
      },
      "EventDefinitionRecord": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "appId": {
            "$ref": "#/components/schemas/Id"
          },
          "name": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "displayNames": {
            "$ref": "#/components/schemas/LocalizedNamesRecord"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "category": {
            "type": [
              "string",
              "null"
            ]
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "signup",
                "login",
                "trial_start",
                "trial_end",
                "activation",
                "core_action",
                "lead",
                "demo_request",
                "contact_click",
                "checkout_start",
                "payment_failed",
                "purchase",
                "subscription_renewal",
                "refund",
                "churn",
                "referral"
              ]
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "active",
              "deprecated",
              "blocked"
            ]
          },
          "aliases": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "propertyCount": {
            "type": "integer",
            "minimum": 0
          },
          "createdAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "properties": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PropertyDefinitionRecord"
            }
          }
        },
        "required": [
          "id",
          "appId",
          "name",
          "displayName",
          "description",
          "category",
          "roles",
          "status",
          "aliases",
          "version",
          "propertyCount",
          "createdAt",
          "updatedAt",
          "properties"
        ],
        "additionalProperties": false
      },
      "EventDefinitionSummary": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "appId": {
            "$ref": "#/components/schemas/Id"
          },
          "name": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "displayNames": {
            "$ref": "#/components/schemas/LocalizedNamesRecord"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "category": {
            "type": [
              "string",
              "null"
            ]
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "signup",
                "login",
                "trial_start",
                "trial_end",
                "activation",
                "core_action",
                "lead",
                "demo_request",
                "contact_click",
                "checkout_start",
                "payment_failed",
                "purchase",
                "subscription_renewal",
                "refund",
                "churn",
                "referral"
              ]
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "active",
              "deprecated",
              "blocked"
            ]
          },
          "aliases": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "propertyCount": {
            "type": "integer",
            "minimum": 0
          },
          "createdAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/Timestamp"
          }
        },
        "required": [
          "id",
          "appId",
          "name",
          "displayName",
          "description",
          "category",
          "roles",
          "status",
          "aliases",
          "version",
          "propertyCount",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "ForecastAllocation": {
        "type": "object",
        "properties": {
          "monthlyBudget": {
            "type": "number"
          },
          "channels": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "platform": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "current": {
                  "type": "number"
                },
                "suggested": {
                  "type": "number"
                },
                "change": {
                  "type": "number"
                },
                "marginalCpaCurrent": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "marginalCpaSuggested": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bound": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "min",
                        "max"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "platform",
                "label",
                "current",
                "suggested",
                "change",
                "marginalCpaCurrent",
                "marginalCpaSuggested",
                "bound"
              ],
              "additionalProperties": false
            }
          },
          "paidCurrent": {
            "type": "number"
          },
          "paidSuggested": {
            "type": "number"
          },
          "gain": {
            "type": "number"
          }
        },
        "required": [
          "monthlyBudget",
          "channels",
          "paidCurrent",
          "paidSuggested",
          "gain"
        ],
        "additionalProperties": false
      },
      "ForecastBand": {
        "type": "object",
        "properties": {
          "p10": {
            "type": "number"
          },
          "p50": {
            "type": "number"
          },
          "p90": {
            "type": "number"
          }
        },
        "required": [
          "p10",
          "p50",
          "p90"
        ],
        "additionalProperties": false
      },
      "ForecastBudget": {
        "type": "object",
        "properties": {
          "platform": {
            "type": "string",
            "minLength": 1,
            "maxLength": 50
          },
          "monthly": {
            "type": "number",
            "minimum": 0,
            "maximum": 10000000000
          },
          "change": {
            "type": "number",
            "minimum": -1,
            "maximum": 10
          }
        },
        "required": [
          "platform"
        ],
        "additionalProperties": false
      },
      "ForecastChannelBasis": {
        "type": "object",
        "properties": {
          "platform": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "ok",
              "insufficient_history",
              "no_spend"
            ]
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "spend": {
            "type": "number"
          },
          "conversions": {
            "type": "number"
          },
          "spendPerDay": {
            "type": "number"
          },
          "conversionsPerDay": {
            "type": "number"
          },
          "cpa": {
            "type": [
              "number",
              "null"
            ]
          },
          "elasticity": {
            "type": [
              "number",
              "null"
            ]
          },
          "elasticitySource": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "estimated",
                  "assumed",
                  "fixed"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "rSquared": {
            "type": [
              "number",
              "null"
            ]
          },
          "weeks": {
            "type": "integer"
          },
          "weeksWithSpend": {
            "type": "integer"
          },
          "maxSpendPerDay": {
            "type": "number"
          },
          "plannedMonthlyBudget": {
            "type": [
              "number",
              "null"
            ]
          },
          "marginalCpa": {
            "type": [
              "number",
              "null"
            ]
          }
        },
        "required": [
          "platform",
          "label",
          "status",
          "reason",
          "spend",
          "conversions",
          "spendPerDay",
          "conversionsPerDay",
          "cpa",
          "elasticity",
          "elasticitySource",
          "rSquared",
          "weeks",
          "weeksWithSpend",
          "maxSpendPerDay",
          "plannedMonthlyBudget",
          "marginalCpa"
        ],
        "additionalProperties": false
      },
      "ForecastInputs": {
        "type": "object",
        "properties": {
          "horizonMonths": {
            "default": 6,
            "type": "integer",
            "minimum": 1,
            "maximum": 12
          },
          "basisDays": {
            "default": 90,
            "type": "integer",
            "minimum": 28,
            "maximum": 365
          },
          "funnelId": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              {
                "type": "null"
              }
            ]
          },
          "role": {
            "type": "string",
            "enum": [
              "signup",
              "login",
              "trial_start",
              "trial_end",
              "activation",
              "core_action",
              "lead",
              "demo_request",
              "contact_click",
              "checkout_start",
              "payment_failed",
              "purchase",
              "subscription_renewal",
              "refund",
              "churn",
              "referral"
            ]
          },
          "budgets": {
            "default": [],
            "maxItems": 20,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ForecastBudget"
            }
          },
          "totalMonthlyBudget": {
            "type": "number",
            "minimum": 0,
            "maximum": 10000000000
          },
          "elasticityMode": {
            "default": "estimate",
            "type": "string",
            "enum": [
              "estimate",
              "fixed"
            ]
          },
          "elasticity": {
            "default": 0.75,
            "type": "number",
            "minimum": 0.05,
            "maximum": 1
          },
          "scenarios": {
            "default": [
              {
                "key": "bad",
                "label": null,
                "costMultiplier": 1.25,
                "conversionMultiplier": 0.85,
                "organicMultiplier": 0.5
              },
              {
                "key": "realistic",
                "label": null,
                "costMultiplier": 1,
                "conversionMultiplier": 1,
                "organicMultiplier": 1
              },
              {
                "key": "good",
                "label": null,
                "costMultiplier": 0.85,
                "conversionMultiplier": 1.12,
                "organicMultiplier": 1.4
              }
            ],
            "minItems": 1,
            "maxItems": 5,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ForecastScenarioParams"
            }
          },
          "goalMonthlyConversions": {
            "type": "number",
            "minimum": 0,
            "maximum": 1000000000
          },
          "includeOrganic": {
            "default": true,
            "type": "boolean"
          },
          "attributionModel": {
            "type": "string",
            "enum": [
              "first_touch",
              "last_touch",
              "last_non_direct",
              "linear",
              "position_based",
              "time_decay",
              "last_paid"
            ]
          },
          "seasonality": {
            "type": "boolean"
          }
        },
        "required": [
          "horizonMonths",
          "basisDays",
          "funnelId",
          "budgets",
          "elasticityMode",
          "elasticity",
          "scenarios",
          "includeOrganic"
        ],
        "additionalProperties": false
      },
      "ForecastLag": {
        "type": "object",
        "properties": {
          "p50Days": {
            "type": [
              "number",
              "null"
            ]
          },
          "p75Days": {
            "type": [
              "number",
              "null"
            ]
          },
          "p90Days": {
            "type": [
              "number",
              "null"
            ]
          },
          "distribution": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "upToDays": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "share": {
                  "type": "number"
                }
              },
              "required": [
                "upToDays",
                "share"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "p50Days",
          "p75Days",
          "p90Days",
          "distribution"
        ],
        "additionalProperties": false
      },
      "ForecastMonth": {
        "type": "object",
        "properties": {
          "month": {
            "type": "string"
          },
          "days": {
            "type": "integer"
          },
          "budget": {
            "type": "number"
          },
          "budgetByPlatform": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "number"
            }
          },
          "paid": {
            "$ref": "#/components/schemas/ForecastBand"
          },
          "organic": {
            "$ref": "#/components/schemas/ForecastBand"
          },
          "total": {
            "$ref": "#/components/schemas/ForecastBand"
          },
          "steps": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "role": {
                  "type": "string",
                  "enum": [
                    "signup",
                    "login",
                    "trial_start",
                    "trial_end",
                    "activation",
                    "core_action",
                    "lead",
                    "demo_request",
                    "contact_click",
                    "checkout_start",
                    "payment_failed",
                    "purchase",
                    "subscription_renewal",
                    "refund",
                    "churn",
                    "referral"
                  ]
                },
                "value": {
                  "$ref": "#/components/schemas/ForecastBand"
                }
              },
              "required": [
                "role",
                "value"
              ],
              "additionalProperties": false
            }
          },
          "revenue": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ForecastBand"
              },
              {
                "type": "null"
              }
            ]
          },
          "cpa": {
            "type": [
              "number",
              "null"
            ]
          },
          "cac": {
            "type": [
              "number",
              "null"
            ]
          }
        },
        "required": [
          "month",
          "days",
          "budget",
          "budgetByPlatform",
          "paid",
          "organic",
          "total",
          "steps",
          "revenue",
          "cpa",
          "cac"
        ],
        "additionalProperties": false
      },
      "ForecastResult": {
        "type": "object",
        "properties": {
          "appId": {
            "$ref": "#/components/schemas/Id"
          },
          "currency": {
            "type": "string"
          },
          "timezone": {
            "type": "string"
          },
          "generatedAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "method": {
            "type": "object",
            "properties": {
              "key": {
                "type": "string",
                "const": "log_log_bootstrap"
              },
              "description": {
                "type": "string"
              },
              "assumptions": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "key",
              "description",
              "assumptions"
            ],
            "additionalProperties": false
          },
          "basis": {
            "type": "object",
            "properties": {
              "from": {
                "$ref": "#/components/schemas/LocalDate"
              },
              "to": {
                "$ref": "#/components/schemas/LocalDate"
              },
              "days": {
                "type": "integer"
              },
              "role": {
                "type": "string",
                "enum": [
                  "signup",
                  "login",
                  "trial_start",
                  "trial_end",
                  "activation",
                  "core_action",
                  "lead",
                  "demo_request",
                  "contact_click",
                  "checkout_start",
                  "payment_failed",
                  "purchase",
                  "subscription_renewal",
                  "refund",
                  "churn",
                  "referral"
                ]
              },
              "attributionModel": {
                "type": "string",
                "enum": [
                  "first_touch",
                  "last_touch",
                  "last_non_direct",
                  "linear",
                  "position_based",
                  "time_decay",
                  "last_paid"
                ]
              },
              "countingModes": {
                "type": "object",
                "properties": {
                  "channels": {
                    "type": "string",
                    "enum": [
                      "event_date",
                      "cohort"
                    ]
                  },
                  "steps": {
                    "type": "string",
                    "enum": [
                      "event_date",
                      "cohort"
                    ]
                  }
                },
                "required": [
                  "channels",
                  "steps"
                ],
                "additionalProperties": false
              },
              "channels": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ForecastChannelBasis"
                }
              },
              "organic": {
                "type": "object",
                "properties": {
                  "conversions": {
                    "type": "number"
                  },
                  "perDay": {
                    "type": "number"
                  },
                  "trendPerMonth": {
                    "type": [
                      "number",
                      "null"
                    ]
                  }
                },
                "required": [
                  "conversions",
                  "perDay",
                  "trendPerMonth"
                ],
                "additionalProperties": false
              },
              "steps": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": "string",
                      "enum": [
                        "signup",
                        "login",
                        "trial_start",
                        "trial_end",
                        "activation",
                        "core_action",
                        "lead",
                        "demo_request",
                        "contact_click",
                        "checkout_start",
                        "payment_failed",
                        "purchase",
                        "subscription_renewal",
                        "refund",
                        "churn",
                        "referral"
                      ]
                    },
                    "rate": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "lagDays": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "lag": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/ForecastLag"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "role",
                    "rate",
                    "lagDays"
                  ],
                  "additionalProperties": false
                }
              },
              "revenuePerConversion": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "elasticityPrior": {
                "type": "number"
              },
              "seasonality": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ForecastSeasonality"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "unforecastable": {
                "type": "object",
                "properties": {
                  "spend": {
                    "type": "number"
                  },
                  "share": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "platforms": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "spend",
                  "share",
                  "platforms"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "from",
              "to",
              "days",
              "role",
              "attributionModel",
              "countingModes",
              "channels",
              "organic",
              "steps",
              "revenuePerConversion",
              "elasticityPrior"
            ],
            "additionalProperties": false
          },
          "scenarios": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ForecastScenarioResult"
            }
          },
          "goal": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "monthlyConversions": {
                    "type": "number"
                  },
                  "monthlyBudget": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "scale": {
                    "type": [
                      "number",
                      "null"
                    ]
                  }
                },
                "required": [
                  "monthlyConversions",
                  "monthlyBudget",
                  "scale"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "allocation": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ForecastAllocation"
              },
              {
                "type": "null"
              }
            ]
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "enum": [
                    "EXTRAPOLATION",
                    "ELASTICITY_ASSUMED",
                    "NO_TREND",
                    "STEP_RATES_UNKNOWN",
                    "NEW_CHANNEL",
                    "GOAL_UNREACHABLE",
                    "DATA_DELAYED",
                    "SEASONALITY_OFF",
                    "UNFORECASTABLE_SPEND"
                  ]
                },
                "message": {
                  "type": "string"
                },
                "platform": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "code",
                "message",
                "platform"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "appId",
          "currency",
          "timezone",
          "generatedAt",
          "method",
          "basis",
          "scenarios",
          "goal",
          "warnings"
        ],
        "additionalProperties": false
      },
      "ForecastScenario": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "appId": {
            "$ref": "#/components/schemas/Id"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "inputs": {
            "$ref": "#/components/schemas/ForecastInputs"
          },
          "result": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ForecastResult"
              },
              {
                "type": "null"
              }
            ]
          },
          "computedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Timestamp"
              },
              {
                "type": "null"
              }
            ]
          },
          "actuals": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "month": {
                      "type": "string"
                    },
                    "complete": {
                      "type": "boolean"
                    },
                    "spend": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "paid": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "total": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "forecastPaid": {
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "month",
                    "complete",
                    "spend",
                    "paid",
                    "total",
                    "forecastPaid"
                  ],
                  "additionalProperties": false
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "createdBy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Id"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/Timestamp"
          }
        },
        "required": [
          "id",
          "appId",
          "name",
          "description",
          "inputs",
          "result",
          "computedAt",
          "actuals",
          "createdBy",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "ForecastScenarioList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "$ref": "#/components/schemas/Id"
                },
                "appId": {
                  "$ref": "#/components/schemas/Id"
                },
                "name": {
                  "type": "string"
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "inputs": {
                  "$ref": "#/components/schemas/ForecastInputs"
                },
                "computedAt": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/Timestamp"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "createdBy": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/Id"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "createdAt": {
                  "$ref": "#/components/schemas/Timestamp"
                },
                "updatedAt": {
                  "$ref": "#/components/schemas/Timestamp"
                }
              },
              "required": [
                "id",
                "appId",
                "name",
                "description",
                "inputs",
                "computedAt",
                "createdBy",
                "createdAt",
                "updatedAt"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": false
      },
      "ForecastScenarioParams": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "minLength": 1,
            "maxLength": 30,
            "pattern": "^[a-z][a-z0-9_]{0,29}$"
          },
          "label": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ]
          },
          "costMultiplier": {
            "type": "number",
            "minimum": 0.1,
            "maximum": 5
          },
          "conversionMultiplier": {
            "type": "number",
            "minimum": 0.1,
            "maximum": 5
          },
          "organicMultiplier": {
            "type": "number",
            "minimum": 0,
            "maximum": 5
          }
        },
        "required": [
          "key",
          "costMultiplier",
          "conversionMultiplier",
          "organicMultiplier"
        ],
        "additionalProperties": false
      },
      "ForecastScenarioResult": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "costMultiplier": {
            "type": "number"
          },
          "conversionMultiplier": {
            "type": "number"
          },
          "organicMultiplier": {
            "type": "number"
          },
          "months": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ForecastMonth"
            }
          },
          "totals": {
            "type": "object",
            "properties": {
              "budget": {
                "type": "number"
              },
              "paid": {
                "$ref": "#/components/schemas/ForecastBand"
              },
              "organic": {
                "$ref": "#/components/schemas/ForecastBand"
              },
              "total": {
                "$ref": "#/components/schemas/ForecastBand"
              },
              "steps": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": "string",
                      "enum": [
                        "signup",
                        "login",
                        "trial_start",
                        "trial_end",
                        "activation",
                        "core_action",
                        "lead",
                        "demo_request",
                        "contact_click",
                        "checkout_start",
                        "payment_failed",
                        "purchase",
                        "subscription_renewal",
                        "refund",
                        "churn",
                        "referral"
                      ]
                    },
                    "value": {
                      "$ref": "#/components/schemas/ForecastBand"
                    }
                  },
                  "required": [
                    "role",
                    "value"
                  ],
                  "additionalProperties": false
                }
              },
              "revenue": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ForecastBand"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "cpa": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "cac": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "cacRole": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "signup",
                      "login",
                      "trial_start",
                      "trial_end",
                      "activation",
                      "core_action",
                      "lead",
                      "demo_request",
                      "contact_click",
                      "checkout_start",
                      "payment_failed",
                      "purchase",
                      "subscription_renewal",
                      "refund",
                      "churn",
                      "referral"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "budget",
              "paid",
              "organic",
              "total",
              "steps",
              "revenue"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "key",
          "label",
          "costMultiplier",
          "conversionMultiplier",
          "organicMultiplier",
          "months",
          "totals"
        ],
        "additionalProperties": false
      },
      "ForecastSeasonality": {
        "type": "object",
        "properties": {
          "weekday": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "number"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "month": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "number"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "historyDays": {
            "type": "integer"
          },
          "conversions": {
            "type": "number"
          },
          "minimum": {
            "type": "object",
            "properties": {
              "weekdayDays": {
                "type": "integer"
              },
              "months": {
                "type": "integer"
              },
              "conversions": {
                "type": "integer"
              }
            },
            "required": [
              "weekdayDays",
              "months",
              "conversions"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "weekday",
          "month",
          "historyDays",
          "conversions",
          "minimum"
        ],
        "additionalProperties": false
      },
      "ForecastSection": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40,
            "pattern": "^[a-z0-9][a-z0-9_-]{0,39}$"
          },
          "title": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "size": {
            "type": "string",
            "enum": [
              "kpi",
              "half",
              "full"
            ]
          },
          "type": {
            "type": "string",
            "const": "forecast"
          },
          "scenarioId": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              {
                "type": "null"
              }
            ]
          },
          "horizonMonths": {
            "default": 3,
            "type": "integer",
            "minimum": 1,
            "maximum": 12
          },
          "scenario": {
            "default": "realistic",
            "type": "string",
            "minLength": 1,
            "maxLength": 30,
            "pattern": "^[a-z][a-z0-9_]{0,29}$"
          }
        },
        "required": [
          "type",
          "scenarioId",
          "horizonMonths",
          "scenario"
        ],
        "additionalProperties": false
      },
      "Funnel": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FunnelStepRecord"
            }
          },
          "order": {
            "type": "string",
            "enum": [
              "ordered",
              "any_order"
            ]
          },
          "countBy": {
            "type": "string",
            "enum": [
              "person",
              "session",
              "group"
            ]
          },
          "conversionWindow": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "integer"
                  },
                  "unit": {
                    "type": "string",
                    "enum": [
                      "minutes",
                      "hours",
                      "days"
                    ]
                  }
                },
                "required": [
                  "value",
                  "unit"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "countingMode": {
            "type": "string",
            "enum": [
              "event_date",
              "cohort"
            ]
          },
          "isDefault": {
            "type": "boolean"
          },
          "sideMetrics": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FunnelSideMetricRecord"
            }
          },
          "createdBy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Id"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/Timestamp"
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "steps",
          "order",
          "countBy",
          "conversionWindow",
          "countingMode",
          "isDefault",
          "createdBy",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "FunnelBreakdownRow": {
        "type": "object",
        "properties": {
          "value": {
            "type": [
              "string",
              "null"
            ]
          },
          "steps": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "count": {
                  "type": "integer"
                },
                "ofFirst": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ofPrevious": {
                  "type": [
                    "number",
                    "null"
                  ]
                }
              },
              "required": [
                "count",
                "ofFirst",
                "ofPrevious"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "value",
          "steps"
        ],
        "additionalProperties": false
      },
      "FunnelCohorts": {
        "type": "object",
        "properties": {
          "funnel": {
            "type": "object",
            "properties": {
              "id": {
                "$ref": "#/components/schemas/Id"
              },
              "name": {
                "type": "string"
              },
              "countBy": {
                "type": "string",
                "enum": [
                  "person",
                  "session",
                  "group"
                ]
              }
            },
            "required": [
              "id",
              "name",
              "countBy"
            ],
            "additionalProperties": false
          },
          "basis": {
            "type": "string",
            "const": "entry_week"
          },
          "countingMode": {
            "type": "string",
            "const": "cohort"
          },
          "dateRange": {
            "type": "object",
            "properties": {
              "from": {
                "$ref": "#/components/schemas/LocalDate"
              },
              "to": {
                "$ref": "#/components/schemas/LocalDate"
              }
            },
            "required": [
              "from",
              "to"
            ],
            "additionalProperties": false
          },
          "timezone": {
            "type": "string"
          },
          "followedUntil": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "step": {
            "type": "integer"
          },
          "weeks": {
            "type": "integer"
          },
          "minSubjects": {
            "type": "integer"
          },
          "include": {
            "type": "object",
            "properties": {
              "test": {
                "type": "boolean"
              },
              "internal": {
                "type": "boolean"
              },
              "bot": {
                "type": "boolean"
              }
            },
            "required": [
              "test",
              "internal",
              "bot"
            ],
            "additionalProperties": false
          },
          "cohorts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "week": {
                  "$ref": "#/components/schemas/LocalDate"
                },
                "start": {
                  "$ref": "#/components/schemas/LocalDate"
                },
                "end": {
                  "$ref": "#/components/schemas/LocalDate"
                },
                "entered": {
                  "type": "integer"
                },
                "lowSample": {
                  "type": "boolean"
                },
                "cells": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "week": {
                        "type": "integer"
                      },
                      "reached": {
                        "type": "integer"
                      },
                      "rate": {
                        "type": [
                          "number",
                          "null"
                        ]
                      },
                      "complete": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "week",
                      "reached",
                      "rate",
                      "complete"
                    ],
                    "additionalProperties": false
                  }
                }
              },
              "required": [
                "week",
                "start",
                "end",
                "entered",
                "lowSample",
                "cells"
              ],
              "additionalProperties": false
            }
          },
          "total": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "week": {
                  "type": "integer"
                },
                "entered": {
                  "type": "integer"
                },
                "reached": {
                  "type": "integer"
                },
                "rate": {
                  "type": [
                    "number",
                    "null"
                  ]
                }
              },
              "required": [
                "week",
                "entered",
                "reached",
                "rate"
              ],
              "additionalProperties": false
            }
          },
          "freshness": {
            "$ref": "#/components/schemas/QueryFreshness"
          },
          "generatedAt": {
            "$ref": "#/components/schemas/Timestamp"
          }
        },
        "required": [
          "funnel",
          "basis",
          "countingMode",
          "dateRange",
          "timezone",
          "followedUntil",
          "step",
          "weeks",
          "minSubjects",
          "include",
          "cohorts",
          "total",
          "generatedAt"
        ],
        "additionalProperties": false
      },
      "FunnelList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Funnel"
            }
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": false
      },
      "FunnelResult": {
        "type": "object",
        "properties": {
          "funnel": {
            "type": "object",
            "properties": {
              "id": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/Id"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "order": {
                "type": "string",
                "enum": [
                  "ordered",
                  "any_order"
                ]
              },
              "countBy": {
                "type": "string",
                "enum": [
                  "person",
                  "session",
                  "group"
                ]
              },
              "conversionWindow": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "value": {
                        "type": "integer"
                      },
                      "unit": {
                        "type": "string",
                        "enum": [
                          "minutes",
                          "hours",
                          "days"
                        ]
                      }
                    },
                    "required": [
                      "value",
                      "unit"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "id",
              "name",
              "order",
              "countBy",
              "conversionWindow"
            ],
            "additionalProperties": false
          },
          "countingMode": {
            "type": "string",
            "enum": [
              "event_date",
              "cohort"
            ]
          },
          "dateRange": {
            "type": "object",
            "properties": {
              "from": {
                "$ref": "#/components/schemas/LocalDate"
              },
              "to": {
                "$ref": "#/components/schemas/LocalDate"
              }
            },
            "required": [
              "from",
              "to"
            ],
            "additionalProperties": false
          },
          "timezone": {
            "type": "string"
          },
          "followedUntil": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "include": {
            "type": "object",
            "properties": {
              "test": {
                "type": "boolean"
              },
              "internal": {
                "type": "boolean"
              },
              "bot": {
                "type": "boolean"
              }
            },
            "required": [
              "test",
              "internal",
              "bot"
            ],
            "additionalProperties": false
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FunnelStepResult"
            }
          },
          "breakdown": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "dimension": {
                    "type": "string",
                    "enum": [
                      "channel",
                      "source",
                      "medium",
                      "campaign",
                      "device_type",
                      "country",
                      "attributed_channel",
                      "attributed_source",
                      "attributed_campaign",
                      "os",
                      "browser",
                      "region",
                      "app_version",
                      "language",
                      "channel_group"
                    ]
                  },
                  "attributionModel": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "first_touch",
                          "last_touch",
                          "last_non_direct",
                          "linear",
                          "position_based",
                          "time_decay",
                          "last_paid"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "rows": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/FunnelBreakdownRow"
                    }
                  },
                  "others": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "integer"
                        }
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "dimension",
                  "attributionModel",
                  "rows",
                  "others"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "extraBreakdown": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "dimension": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "channel",
                          "source",
                          "medium",
                          "campaign",
                          "device_type",
                          "country",
                          "attributed_channel",
                          "attributed_source",
                          "attributed_campaign",
                          "os",
                          "browser",
                          "region",
                          "app_version",
                          "language",
                          "channel_group"
                        ]
                      },
                      {
                        "type": "string",
                        "enum": [
                          "os",
                          "browser",
                          "region",
                          "app_version",
                          "language",
                          "channel_group"
                        ]
                      },
                      {
                        "type": "string",
                        "pattern": "^property:[\\s\\S]{0,}$"
                      }
                    ]
                  },
                  "attributionModel": {
                    "type": "null"
                  },
                  "rows": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/FunnelBreakdownRow"
                    }
                  },
                  "others": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "integer"
                        }
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "dimension",
                  "attributionModel",
                  "rows",
                  "others"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "enum": [
                    "ATTRIBUTION_NOT_CONVERSION",
                    "BREAKDOWN_TRUNCATED"
                  ]
                },
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "code",
                "message"
              ],
              "additionalProperties": false
            }
          },
          "series": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FunnelSeries"
              },
              {
                "type": "null"
              }
            ]
          },
          "sideMetrics": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FunnelSideMetricResult"
            }
          },
          "generatedAt": {
            "$ref": "#/components/schemas/Timestamp"
          }
        },
        "required": [
          "funnel",
          "countingMode",
          "dateRange",
          "timezone",
          "followedUntil",
          "include",
          "steps",
          "breakdown",
          "warnings",
          "generatedAt"
        ],
        "additionalProperties": false
      },
      "FunnelScreenResult": {
        "type": "object",
        "properties": {
          "funnel": {
            "type": "object",
            "properties": {
              "id": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/Id"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "order": {
                "type": "string",
                "enum": [
                  "ordered",
                  "any_order"
                ]
              },
              "countBy": {
                "type": "string",
                "enum": [
                  "person",
                  "session",
                  "group"
                ]
              },
              "conversionWindow": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "value": {
                        "type": "integer"
                      },
                      "unit": {
                        "type": "string",
                        "enum": [
                          "minutes",
                          "hours",
                          "days"
                        ]
                      }
                    },
                    "required": [
                      "value",
                      "unit"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "id",
              "name",
              "order",
              "countBy",
              "conversionWindow"
            ],
            "additionalProperties": false
          },
          "countingMode": {
            "type": "string",
            "enum": [
              "event_date",
              "cohort"
            ]
          },
          "dateRange": {
            "type": "object",
            "properties": {
              "from": {
                "$ref": "#/components/schemas/LocalDate"
              },
              "to": {
                "$ref": "#/components/schemas/LocalDate"
              }
            },
            "required": [
              "from",
              "to"
            ],
            "additionalProperties": false
          },
          "timezone": {
            "type": "string"
          },
          "followedUntil": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "include": {
            "type": "object",
            "properties": {
              "test": {
                "type": "boolean"
              },
              "internal": {
                "type": "boolean"
              },
              "bot": {
                "type": "boolean"
              }
            },
            "required": [
              "test",
              "internal",
              "bot"
            ],
            "additionalProperties": false
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FunnelStepResult"
            }
          },
          "breakdown": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "dimension": {
                    "type": "string",
                    "enum": [
                      "channel",
                      "source",
                      "medium",
                      "campaign",
                      "device_type",
                      "country",
                      "attributed_channel",
                      "attributed_source",
                      "attributed_campaign",
                      "os",
                      "browser",
                      "region",
                      "app_version",
                      "language",
                      "channel_group"
                    ]
                  },
                  "attributionModel": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "first_touch",
                          "last_touch",
                          "last_non_direct",
                          "linear",
                          "position_based",
                          "time_decay",
                          "last_paid"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "rows": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/FunnelBreakdownRow"
                    }
                  },
                  "others": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "integer"
                        }
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "dimension",
                  "attributionModel",
                  "rows",
                  "others"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "extraBreakdown": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "dimension": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "channel",
                          "source",
                          "medium",
                          "campaign",
                          "device_type",
                          "country",
                          "attributed_channel",
                          "attributed_source",
                          "attributed_campaign",
                          "os",
                          "browser",
                          "region",
                          "app_version",
                          "language",
                          "channel_group"
                        ]
                      },
                      {
                        "type": "string",
                        "enum": [
                          "os",
                          "browser",
                          "region",
                          "app_version",
                          "language",
                          "channel_group"
                        ]
                      },
                      {
                        "type": "string",
                        "pattern": "^property:[\\s\\S]{0,}$"
                      }
                    ]
                  },
                  "attributionModel": {
                    "type": "null"
                  },
                  "rows": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/FunnelBreakdownRow"
                    }
                  },
                  "others": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "integer"
                        }
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "dimension",
                  "attributionModel",
                  "rows",
                  "others"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "enum": [
                    "ATTRIBUTION_NOT_CONVERSION",
                    "BREAKDOWN_TRUNCATED"
                  ]
                },
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "code",
                "message"
              ],
              "additionalProperties": false
            }
          },
          "series": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FunnelSeries"
              },
              {
                "type": "null"
              }
            ]
          },
          "sideMetrics": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FunnelSideMetricResult"
            }
          },
          "generatedAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "freshness": {
            "$ref": "#/components/schemas/QueryFreshness"
          },
          "comparison": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "dateRange": {
                    "type": "object",
                    "properties": {
                      "from": {
                        "$ref": "#/components/schemas/LocalDate"
                      },
                      "to": {
                        "$ref": "#/components/schemas/LocalDate"
                      }
                    },
                    "required": [
                      "from",
                      "to"
                    ],
                    "additionalProperties": false
                  },
                  "comparable": {
                    "type": "boolean"
                  },
                  "steps": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "index": {
                          "type": "integer"
                        },
                        "count": {
                          "type": "integer"
                        },
                        "ofFirst": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "ofPrevious": {
                          "type": [
                            "number",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "index",
                        "count",
                        "ofFirst",
                        "ofPrevious"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "dateRange",
                  "comparable",
                  "steps"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "funnel",
          "countingMode",
          "dateRange",
          "timezone",
          "followedUntil",
          "include",
          "steps",
          "breakdown",
          "warnings",
          "generatedAt",
          "freshness",
          "comparison"
        ],
        "additionalProperties": false
      },
      "FunnelSection": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40,
            "pattern": "^[a-z0-9][a-z0-9_-]{0,39}$"
          },
          "title": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "size": {
            "type": "string",
            "enum": [
              "kpi",
              "half",
              "full"
            ]
          },
          "type": {
            "type": "string",
            "const": "funnel"
          },
          "funnelId": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              {
                "type": "null"
              }
            ]
          },
          "countingMode": {
            "type": "string",
            "enum": [
              "event_date",
              "cohort"
            ]
          },
          "breakdown": {
            "type": "string",
            "enum": [
              "channel",
              "source",
              "medium",
              "campaign",
              "device_type",
              "country",
              "attributed_channel",
              "attributed_source",
              "attributed_campaign",
              "os",
              "browser",
              "region",
              "app_version",
              "language",
              "channel_group"
            ]
          }
        },
        "required": [
          "type",
          "funnelId"
        ],
        "additionalProperties": false
      },
      "FunnelSeries": {
        "type": "object",
        "properties": {
          "granularity": {
            "type": "string",
            "enum": [
              "day",
              "week",
              "month"
            ]
          },
          "basis": {
            "type": "string",
            "enum": [
              "step_date",
              "entry_date"
            ]
          },
          "points": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "date": {
                  "$ref": "#/components/schemas/LocalDate"
                },
                "start": {
                  "$ref": "#/components/schemas/LocalDate"
                },
                "end": {
                  "$ref": "#/components/schemas/LocalDate"
                },
                "steps": {
                  "type": "array",
                  "items": {
                    "type": "integer"
                  }
                },
                "complete": {
                  "type": "boolean"
                },
                "beforeTracking": {
                  "type": "boolean"
                }
              },
              "required": [
                "date",
                "start",
                "end",
                "steps"
              ],
              "additionalProperties": false
            }
          },
          "afterRange": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          }
        },
        "required": [
          "granularity",
          "basis",
          "points",
          "afterRange"
        ],
        "additionalProperties": false
      },
      "FunnelSideMetricRecord": {
        "type": "object",
        "properties": {
          "event": {
            "type": [
              "string",
              "null"
            ]
          },
          "role": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "signup",
                  "login",
                  "trial_start",
                  "trial_end",
                  "activation",
                  "core_action",
                  "lead",
                  "demo_request",
                  "contact_click",
                  "checkout_start",
                  "payment_failed",
                  "purchase",
                  "subscription_renewal",
                  "refund",
                  "churn",
                  "referral"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "filters": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PropertyFilterRecord"
            }
          },
          "label": {
            "type": [
              "string",
              "null"
            ]
          },
          "without": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "event": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "role": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "signup",
                          "login",
                          "trial_start",
                          "trial_end",
                          "activation",
                          "core_action",
                          "lead",
                          "demo_request",
                          "contact_click",
                          "checkout_start",
                          "payment_failed",
                          "purchase",
                          "subscription_renewal",
                          "refund",
                          "churn",
                          "referral"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "filters": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/PropertyFilterRecord"
                    }
                  },
                  "withinDays": {
                    "type": "integer"
                  }
                },
                "required": [
                  "event",
                  "role",
                  "filters",
                  "withinDays"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "event",
          "role",
          "filters",
          "label",
          "without"
        ],
        "additionalProperties": false
      },
      "FunnelSideMetricResult": {
        "type": "object",
        "properties": {
          "index": {
            "type": "integer"
          },
          "label": {
            "type": [
              "string",
              "null"
            ]
          },
          "event": {
            "type": [
              "string",
              "null"
            ]
          },
          "role": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "signup",
                  "login",
                  "trial_start",
                  "trial_end",
                  "activation",
                  "core_action",
                  "lead",
                  "demo_request",
                  "contact_click",
                  "checkout_start",
                  "payment_failed",
                  "purchase",
                  "subscription_renewal",
                  "refund",
                  "churn",
                  "referral"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "count": {
            "type": "integer"
          },
          "ofEntered": {
            "type": [
              "number",
              "null"
            ]
          },
          "pending": {
            "type": [
              "integer",
              "null"
            ]
          },
          "withinDays": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "index",
          "label",
          "event",
          "role",
          "count",
          "ofEntered",
          "pending",
          "withinDays"
        ],
        "additionalProperties": false
      },
      "FunnelStepRecord": {
        "type": "object",
        "properties": {
          "event": {
            "type": [
              "string",
              "null"
            ]
          },
          "role": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "signup",
                  "login",
                  "trial_start",
                  "trial_end",
                  "activation",
                  "core_action",
                  "lead",
                  "demo_request",
                  "contact_click",
                  "checkout_start",
                  "payment_failed",
                  "purchase",
                  "subscription_renewal",
                  "refund",
                  "churn",
                  "referral"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "filters": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PropertyFilterRecord"
            }
          },
          "label": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "event",
          "role",
          "filters",
          "label"
        ],
        "additionalProperties": false
      },
      "FunnelStepResult": {
        "type": "object",
        "properties": {
          "index": {
            "type": "integer"
          },
          "label": {
            "type": [
              "string",
              "null"
            ]
          },
          "event": {
            "type": [
              "string",
              "null"
            ]
          },
          "role": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "signup",
                  "login",
                  "trial_start",
                  "trial_end",
                  "activation",
                  "core_action",
                  "lead",
                  "demo_request",
                  "contact_click",
                  "checkout_start",
                  "payment_failed",
                  "purchase",
                  "subscription_renewal",
                  "refund",
                  "churn",
                  "referral"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "count": {
            "type": "integer"
          },
          "ofFirst": {
            "type": [
              "number",
              "null"
            ]
          },
          "ofPrevious": {
            "type": [
              "number",
              "null"
            ]
          },
          "dropOff": {
            "type": [
              "integer",
              "null"
            ]
          },
          "timeFromPrevious": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TimeToConvert"
              },
              {
                "type": "null"
              }
            ]
          },
          "timeFromFirst": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TimeToConvert"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "index",
          "label",
          "event",
          "role",
          "count",
          "ofFirst",
          "ofPrevious",
          "dropOff",
          "timeFromPrevious",
          "timeFromFirst"
        ],
        "additionalProperties": false
      },
      "Id": {
        "type": "string",
        "format": "uuid",
        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
      },
      "Invitation": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "email": {
            "type": "string"
          },
          "role": {
            "$ref": "#/components/schemas/RoleSummary"
          },
          "appScope": {
            "type": "string",
            "enum": [
              "all",
              "selected"
            ]
          },
          "appIds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Id"
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "accepted",
              "revoked",
              "expired"
            ]
          },
          "invitedBy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Id"
              },
              {
                "type": "null"
              }
            ]
          },
          "expiresAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "acceptedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Timestamp"
              },
              {
                "type": "null"
              }
            ]
          },
          "revokedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Timestamp"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "$ref": "#/components/schemas/Timestamp"
          }
        },
        "required": [
          "id",
          "email",
          "role",
          "appScope",
          "appIds",
          "status",
          "invitedBy",
          "expiresAt",
          "acceptedAt",
          "revokedAt",
          "createdAt"
        ],
        "additionalProperties": false
      },
      "InvitationPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Invitation"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "items",
          "nextCursor"
        ],
        "additionalProperties": false
      },
      "JsonSchemaDocument": {
        "type": "object",
        "propertyNames": {
          "type": "string"
        },
        "additionalProperties": {}
      },
      "KpiSection": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40,
            "pattern": "^[a-z0-9][a-z0-9_-]{0,39}$"
          },
          "title": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "size": {
            "type": "string",
            "enum": [
              "kpi",
              "half",
              "full"
            ]
          },
          "type": {
            "type": "string",
            "const": "kpi"
          },
          "metric": {
            "type": "string",
            "minLength": 1,
            "maxLength": 101,
            "pattern": "^(?:[a-z][a-z0-9_]{0,49}(?::[a-z][a-z0-9_]{0,49})?|social\\.[a-z][a-z0-9_]{0,19}\\.[a-z][a-z0-9_]{0,49}|(?:email|sms)\\.[a-z][a-z0-9_]{0,49})$"
          },
          "spark": {
            "default": true,
            "type": "boolean"
          },
          "filters": {
            "default": [],
            "maxItems": 10,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QueryFilter"
            }
          },
          "segmentId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "type",
          "metric",
          "spark",
          "filters"
        ],
        "additionalProperties": false
      },
      "LabelledValue": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "description": {
            "type": "string"
          }
        },
        "required": [
          "key",
          "label"
        ],
        "additionalProperties": false
      },
      "Lead": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "kind": {
            "type": "string",
            "enum": [
              "demo_request",
              "lead",
              "contact_click"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "new",
              "contacted",
              "qualified",
              "won",
              "lost",
              "spam"
            ]
          },
          "stage": {
            "type": "string"
          },
          "dueAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Timestamp"
              },
              {
                "type": "null"
              }
            ]
          },
          "overdue": {
            "type": "boolean"
          },
          "statusReason": {
            "type": [
              "string",
              "null"
            ]
          },
          "assignee": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LeadAssignee"
              },
              {
                "type": "null"
              }
            ]
          },
          "eventId": {
            "$ref": "#/components/schemas/Id"
          },
          "eventName": {
            "type": "string"
          },
          "occurredAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "personId": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Id"
              },
              {
                "type": "null"
              }
            ]
          },
          "userId": {
            "type": [
              "string",
              "null"
            ]
          },
          "groupId": {
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "$ref": "#/components/schemas/LeadSource"
          },
          "attribution": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LeadAttribution"
              },
              {
                "type": "null"
              }
            ]
          },
          "lastClick": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LeadLastClick"
              },
              {
                "type": "null"
              }
            ]
          },
          "properties": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "isTest": {
            "type": "boolean"
          },
          "isInternal": {
            "type": "boolean"
          },
          "noteCount": {
            "type": "integer"
          },
          "statusChangedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Timestamp"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/Timestamp"
          }
        },
        "required": [
          "id",
          "kind",
          "status",
          "statusReason",
          "assignee",
          "eventId",
          "eventName",
          "occurredAt",
          "personId",
          "userId",
          "groupId",
          "source",
          "attribution",
          "properties",
          "isTest",
          "isInternal",
          "noteCount",
          "statusChangedAt",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "LeadAssignee": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "additionalProperties": false
      },
      "LeadAttribution": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "enum": [
              "first_touch",
              "last_touch",
              "last_non_direct",
              "linear",
              "position_based",
              "time_decay",
              "last_paid"
            ]
          },
          "windowDays": {
            "type": "integer"
          },
          "firstTouch": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AttributedTouch"
              },
              {
                "type": "null"
              }
            ]
          },
          "lastTouch": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AttributedTouch"
              },
              {
                "type": "null"
              }
            ]
          },
          "lastNonDirect": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AttributedTouch"
              },
              {
                "type": "null"
              }
            ]
          },
          "method": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "consent",
                  "same_visit"
                ]
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "model",
          "windowDays",
          "firstTouch",
          "lastTouch",
          "lastNonDirect"
        ],
        "additionalProperties": false
      },
      "LeadDetail": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "kind": {
            "type": "string",
            "enum": [
              "demo_request",
              "lead",
              "contact_click"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "new",
              "contacted",
              "qualified",
              "won",
              "lost",
              "spam"
            ]
          },
          "stage": {
            "type": "string"
          },
          "dueAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Timestamp"
              },
              {
                "type": "null"
              }
            ]
          },
          "overdue": {
            "type": "boolean"
          },
          "statusReason": {
            "type": [
              "string",
              "null"
            ]
          },
          "assignee": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LeadAssignee"
              },
              {
                "type": "null"
              }
            ]
          },
          "eventId": {
            "$ref": "#/components/schemas/Id"
          },
          "eventName": {
            "type": "string"
          },
          "occurredAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "personId": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Id"
              },
              {
                "type": "null"
              }
            ]
          },
          "userId": {
            "type": [
              "string",
              "null"
            ]
          },
          "groupId": {
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "$ref": "#/components/schemas/LeadSource"
          },
          "attribution": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LeadAttribution"
              },
              {
                "type": "null"
              }
            ]
          },
          "lastClick": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LeadLastClick"
              },
              {
                "type": "null"
              }
            ]
          },
          "properties": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "isTest": {
            "type": "boolean"
          },
          "isInternal": {
            "type": "boolean"
          },
          "noteCount": {
            "type": "integer"
          },
          "statusChangedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Timestamp"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "notes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LeadNote"
            }
          },
          "statusHistory": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LeadStatusChange"
            }
          }
        },
        "required": [
          "id",
          "kind",
          "status",
          "statusReason",
          "assignee",
          "eventId",
          "eventName",
          "occurredAt",
          "personId",
          "userId",
          "groupId",
          "source",
          "attribution",
          "properties",
          "isTest",
          "isInternal",
          "noteCount",
          "statusChangedAt",
          "createdAt",
          "updatedAt",
          "notes",
          "statusHistory"
        ],
        "additionalProperties": false
      },
      "LeadLastClick": {
        "type": "object",
        "properties": {
          "at": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "path": {
            "type": [
              "string",
              "null"
            ]
          },
          "selector": {
            "type": [
              "string",
              "null"
            ]
          },
          "label": {
            "type": [
              "string",
              "null"
            ]
          },
          "kind": {
            "type": [
              "string",
              "null"
            ]
          },
          "section": {
            "type": [
              "string",
              "null"
            ]
          },
          "contact": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "phone",
                  "whatsapp",
                  "email"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "tag": {
            "type": [
              "string",
              "null"
            ]
          },
          "href": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "at",
          "path",
          "selector",
          "label",
          "kind",
          "section",
          "contact"
        ],
        "additionalProperties": false
      },
      "LeadNote": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "body": {
            "type": "string"
          },
          "author": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LeadAssignee"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "editedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Timestamp"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "body",
          "author",
          "createdAt",
          "editedAt"
        ],
        "additionalProperties": false
      },
      "LeadPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Lead"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "total": {
            "type": "integer"
          },
          "counts": {
            "type": "object",
            "propertyNames": {
              "type": "string",
              "enum": [
                "new",
                "contacted",
                "qualified",
                "won",
                "lost",
                "spam"
              ]
            },
            "additionalProperties": {
              "type": "integer"
            },
            "required": [
              "new",
              "contacted",
              "qualified",
              "won",
              "lost",
              "spam"
            ]
          },
          "stageCounts": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "integer"
            }
          },
          "overdue": {
            "type": "integer"
          }
        },
        "required": [
          "items",
          "nextCursor",
          "total",
          "counts"
        ],
        "additionalProperties": false
      },
      "LeadSource": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": [
              "string",
              "null"
            ]
          },
          "channel": {
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "type": [
              "string",
              "null"
            ]
          },
          "medium": {
            "type": [
              "string",
              "null"
            ]
          },
          "campaign": {
            "type": [
              "string",
              "null"
            ]
          },
          "referrerHost": {
            "type": [
              "string",
              "null"
            ]
          },
          "entryPath": {
            "type": [
              "string",
              "null"
            ]
          },
          "pagePath": {
            "type": [
              "string",
              "null"
            ]
          },
          "deviceType": {
            "type": [
              "string",
              "null"
            ]
          },
          "country": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "sessionId",
          "channel",
          "source",
          "medium",
          "campaign",
          "referrerHost",
          "entryPath",
          "pagePath",
          "deviceType",
          "country"
        ],
        "additionalProperties": false
      },
      "LeadStatusChange": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "from": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "new",
                  "contacted",
                  "qualified",
                  "won",
                  "lost",
                  "spam"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "to": {
            "type": "string",
            "enum": [
              "new",
              "contacted",
              "qualified",
              "won",
              "lost",
              "spam"
            ]
          },
          "fromStage": {
            "type": [
              "string",
              "null"
            ]
          },
          "toStage": {
            "type": [
              "string",
              "null"
            ]
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "changedBy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LeadAssignee"
              },
              {
                "type": "null"
              }
            ]
          },
          "changedAt": {
            "$ref": "#/components/schemas/Timestamp"
          }
        },
        "required": [
          "id",
          "from",
          "to",
          "reason",
          "changedBy",
          "changedAt"
        ],
        "additionalProperties": false
      },
      "ListMembersResult": {
        "type": "object",
        "properties": {
          "added": {
            "type": "integer"
          },
          "removed": {
            "type": "integer"
          },
          "notFound": {
            "type": "integer"
          }
        },
        "required": [
          "added",
          "removed",
          "notFound"
        ],
        "additionalProperties": false
      },
      "LocalDate": {
        "type": "string",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
      },
      "LocalizedNames": {
        "type": "object",
        "properties": {
          "tr": {
            "type": "string",
            "maxLength": 200
          },
          "en": {
            "type": "string",
            "maxLength": 200
          }
        }
      },
      "LocalizedNamesRecord": {
        "type": "object",
        "properties": {
          "tr": {
            "type": [
              "string",
              "null"
            ]
          },
          "en": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "tr",
          "en"
        ],
        "additionalProperties": false
      },
      "ManagementConsentRequest": {
        "type": "object",
        "properties": {
          "contactId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "email": {
            "type": "string",
            "maxLength": 320
          },
          "phone": {
            "type": "string",
            "maxLength": 40
          },
          "userId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "channel": {
            "type": "string",
            "enum": [
              "email",
              "sms"
            ]
          },
          "kind": {
            "type": "string",
            "enum": [
              "none",
              "merchant",
              "opt_in",
              "opt_out"
            ]
          },
          "reason": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          },
          "evidence": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1000
              },
              {
                "type": "null"
              }
            ]
          },
          "form": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          }
        },
        "required": [
          "channel",
          "kind"
        ]
      },
      "ManagementListMembersRequest": {
        "type": "object",
        "properties": {
          "add": {
            "default": [],
            "maxItems": 1000,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactReference"
            }
          },
          "remove": {
            "default": [],
            "maxItems": 1000,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactReference"
            }
          }
        }
      },
      "ManagementSuppressionRequest": {
        "type": "object",
        "properties": {
          "channel": {
            "type": "string",
            "enum": [
              "email",
              "sms"
            ]
          },
          "email": {
            "type": "string",
            "maxLength": 320
          },
          "phone": {
            "type": "string",
            "maxLength": 40
          },
          "action": {
            "default": "add",
            "type": "string",
            "enum": [
              "add",
              "remove"
            ]
          },
          "reason": {
            "default": "manual",
            "type": "string",
            "enum": [
              "hard_bounce",
              "complaint",
              "unsubscribe",
              "manual",
              "invalid_address"
            ]
          }
        },
        "required": [
          "channel"
        ]
      },
      "Member": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "user": {
            "type": "object",
            "properties": {
              "id": {
                "$ref": "#/components/schemas/Id"
              },
              "email": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "email",
              "name"
            ],
            "additionalProperties": false
          },
          "role": {
            "$ref": "#/components/schemas/RoleSummary"
          },
          "appScope": {
            "type": "string",
            "enum": [
              "all",
              "selected"
            ]
          },
          "appIds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Id"
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "disabled"
            ]
          },
          "invitedBy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Id"
              },
              {
                "type": "null"
              }
            ]
          },
          "lastSignInAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Timestamp"
              },
              {
                "type": "null"
              }
            ]
          },
          "twoFactorEnabled": {
            "type": "boolean"
          },
          "createdAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/Timestamp"
          }
        },
        "required": [
          "id",
          "user",
          "role",
          "appScope",
          "appIds",
          "status",
          "invitedBy",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "MemberPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Member"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "items",
          "nextCursor"
        ],
        "additionalProperties": false
      },
      "MessageCampaign": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "channel": {
            "type": "string",
            "enum": [
              "email",
              "sms"
            ]
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "utm": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string"
              },
              "medium": {
                "type": "string"
              },
              "campaign": {
                "type": "string"
              }
            },
            "required": [
              "source",
              "medium",
              "campaign"
            ],
            "additionalProperties": false
          },
          "templateId": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Id"
              },
              {
                "type": "null"
              }
            ]
          },
          "subject": {
            "type": [
              "string",
              "null"
            ]
          },
          "preheader": {
            "type": [
              "string",
              "null"
            ]
          },
          "body": {
            "type": "string"
          },
          "senderId": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Id"
              },
              {
                "type": "null"
              }
            ]
          },
          "audience": {
            "type": "object",
            "properties": {
              "listIds": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Id"
                }
              },
              "segmentId": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/Id"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "listIds",
              "segmentId"
            ],
            "additionalProperties": false
          },
          "locale": {
            "type": "string",
            "enum": [
              "tr",
              "en"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "awaiting_approval",
              "scheduled",
              "sending",
              "paused",
              "sent",
              "cancelled",
              "failed"
            ]
          },
          "schedule": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "date": {
                    "$ref": "#/components/schemas/LocalDate"
                  },
                  "time": {
                    "type": "string"
                  },
                  "timezone": {
                    "type": "string"
                  },
                  "at": {
                    "$ref": "#/components/schemas/Timestamp"
                  }
                },
                "required": [
                  "date",
                  "time",
                  "timezone",
                  "at"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "start": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "at": {
                    "$ref": "#/components/schemas/Timestamp"
                  },
                  "immediate": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "at",
                  "immediate"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "throttlePerMinute": {
            "type": [
              "integer",
              "null"
            ]
          },
          "confirmation": {
            "type": "object",
            "properties": {
              "testSentAt": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/Timestamp"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "testSentBy": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/Id"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "testCurrent": {
                "type": "boolean"
              },
              "confirmedAt": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/Timestamp"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "confirmedBy": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/Id"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "testSentAt",
              "testSentBy",
              "testCurrent",
              "confirmedAt",
              "confirmedBy"
            ],
            "additionalProperties": false
          },
          "approval": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "pending",
                      "approved",
                      "rejected",
                      "withdrawn"
                    ]
                  },
                  "requestedBy": {
                    "anyOf": [
                      {
                        "$ref": "#/components/schemas/Id"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "requestedAt": {
                    "$ref": "#/components/schemas/Timestamp"
                  },
                  "decidedBy": {
                    "anyOf": [
                      {
                        "$ref": "#/components/schemas/Id"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "decidedAt": {
                    "anyOf": [
                      {
                        "$ref": "#/components/schemas/Timestamp"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "note": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "status",
                  "requestedBy",
                  "requestedAt",
                  "decidedBy",
                  "decidedAt",
                  "note"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "counts": {
            "$ref": "#/components/schemas/CampaignCounts"
          },
          "skippedByReason": {
            "type": "object",
            "propertyNames": {
              "type": "string",
              "enum": [
                "no_consent",
                "opted_out",
                "suppressed",
                "no_address",
                "landline_only",
                "duplicate",
                "iys_refused",
                "render_failed"
              ]
            },
            "additionalProperties": {
              "type": "integer"
            },
            "required": [
              "no_consent",
              "opted_out",
              "suppressed",
              "no_address",
              "landline_only",
              "duplicate",
              "iys_refused",
              "render_failed"
            ]
          },
          "progress": {
            "type": [
              "number",
              "null"
            ]
          },
          "errorCode": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdBy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Id"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "startedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Timestamp"
              },
              {
                "type": "null"
              }
            ]
          },
          "finishedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Timestamp"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "channel",
          "name",
          "slug",
          "utm",
          "templateId",
          "subject",
          "preheader",
          "body",
          "senderId",
          "audience",
          "locale",
          "status",
          "schedule",
          "start",
          "throttlePerMinute",
          "confirmation",
          "approval",
          "counts",
          "skippedByReason",
          "progress",
          "errorCode",
          "createdBy",
          "createdAt",
          "updatedAt",
          "startedAt",
          "finishedAt"
        ],
        "additionalProperties": false
      },
      "MessageCampaignPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MessageCampaign"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "total": {
            "type": "integer"
          }
        },
        "required": [
          "items",
          "nextCursor",
          "total"
        ],
        "additionalProperties": false
      },
      "MessagingLocalTime": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string"
          },
          "time": {
            "type": "string",
            "minLength": 5,
            "maxLength": 5,
            "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
          }
        },
        "required": [
          "date",
          "time"
        ]
      },
      "NamingIssue": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "missing_prefix",
              "too_few_parts",
              "too_many_parts",
              "empty_part",
              "value_not_allowed",
              "invalid_date",
              "too_long",
              "invalid_characters",
              "test_in_live_name"
            ]
          },
          "severity": {
            "type": "string",
            "enum": [
              "error",
              "warning"
            ]
          },
          "token": {
            "type": [
              "string",
              "null"
            ]
          },
          "position": {
            "type": [
              "integer",
              "null"
            ]
          },
          "value": {
            "type": [
              "string",
              "null"
            ]
          },
          "expected": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "code",
          "severity",
          "token",
          "position",
          "value",
          "expected"
        ],
        "additionalProperties": false
      },
      "NoteSection": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40,
            "pattern": "^[a-z0-9][a-z0-9_-]{0,39}$"
          },
          "title": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "size": {
            "type": "string",
            "enum": [
              "kpi",
              "half",
              "full"
            ]
          },
          "type": {
            "type": "string",
            "const": "note"
          },
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4000
          },
          "format": {
            "type": "string",
            "enum": [
              "plain",
              "markdown"
            ]
          }
        },
        "required": [
          "type",
          "text"
        ],
        "additionalProperties": false
      },
      "OriginalSpend": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number"
          },
          "currency": {
            "type": "string"
          }
        },
        "required": [
          "amount",
          "currency"
        ],
        "additionalProperties": false
      },
      "OverviewTile": {
        "type": "object",
        "properties": {
          "metric": {
            "type": "string"
          },
          "breakdown": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "metric",
          "breakdown"
        ],
        "additionalProperties": false
      },
      "OverviewTileRequest": {
        "type": "object",
        "properties": {
          "metric": {
            "type": "string",
            "minLength": 1,
            "maxLength": 101,
            "pattern": "^(?:[a-z][a-z0-9_]{0,49}(?::[a-z][a-z0-9_]{0,49})?|social\\.[a-z][a-z0-9_]{0,19}\\.[a-z][a-z0-9_]{0,49}|(?:email|sms)\\.[a-z][a-z0-9_]{0,49})$"
          },
          "breakdown": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 120,
                "pattern": "^(?:[a-z][a-z_]{1,30}|property:[A-Za-z_][A-Za-z0-9_]{0,99})$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "metric"
        ]
      },
      "PersonConversion": {
        "type": "object",
        "properties": {
          "eventId": {
            "$ref": "#/components/schemas/Id"
          },
          "at": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "eventName": {
            "type": "string"
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "revenue": {
            "type": [
              "number",
              "null"
            ]
          },
          "sessionId": {
            "type": [
              "string",
              "null"
            ]
          },
          "channel": {
            "type": [
              "string",
              "null"
            ]
          },
          "lastClick": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "eventId",
          "at",
          "eventName",
          "roles",
          "revenue",
          "sessionId",
          "channel"
        ],
        "additionalProperties": false
      },
      "PersonEvent": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "at": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "type": {
            "type": "string",
            "enum": [
              "track",
              "page",
              "screen",
              "identify",
              "group",
              "alias"
            ]
          },
          "eventName": {
            "type": "string"
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "conversion": {
            "type": "boolean"
          },
          "revenue": {
            "type": [
              "number",
              "null"
            ]
          },
          "path": {
            "type": [
              "string",
              "null"
            ]
          },
          "sessionId": {
            "type": [
              "string",
              "null"
            ]
          },
          "properties": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "required": [
          "id",
          "at",
          "type",
          "eventName",
          "roles",
          "conversion",
          "revenue",
          "path",
          "sessionId",
          "properties"
        ],
        "additionalProperties": false
      },
      "PersonEventPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PersonEvent"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "items",
          "nextCursor"
        ],
        "additionalProperties": false
      },
      "PersonLead": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "kind": {
            "type": "string",
            "enum": [
              "demo_request",
              "lead",
              "contact_click"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "new",
              "contacted",
              "qualified",
              "won",
              "lost",
              "spam"
            ]
          },
          "eventName": {
            "type": "string"
          },
          "eventAt": {
            "$ref": "#/components/schemas/Timestamp"
          }
        },
        "required": [
          "id",
          "kind",
          "status",
          "eventName",
          "eventAt"
        ],
        "additionalProperties": false
      },
      "PersonMerge": {
        "type": "object",
        "properties": {
          "personId": {
            "$ref": "#/components/schemas/Id"
          },
          "reason": {
            "type": "string",
            "enum": [
              "identify",
              "alias",
              "manual"
            ]
          },
          "mergedAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "rewritten": {
            "type": "boolean"
          }
        },
        "required": [
          "personId",
          "reason",
          "mergedAt",
          "rewritten"
        ],
        "additionalProperties": false
      },
      "PersonPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PersonSummary"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "total": {
            "type": "integer"
          }
        },
        "required": [
          "items",
          "nextCursor"
        ],
        "additionalProperties": false
      },
      "PersonProfile": {
        "type": "object",
        "properties": {
          "requestedId": {
            "$ref": "#/components/schemas/Id"
          },
          "person": {
            "type": "object",
            "properties": {
              "id": {
                "$ref": "#/components/schemas/Id"
              },
              "userId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "traits": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {}
              },
              "firstSeenAt": {
                "$ref": "#/components/schemas/Timestamp"
              },
              "lastSeenAt": {
                "$ref": "#/components/schemas/Timestamp"
              },
              "firstChannel": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "firstTouch": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/PersonTouch"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "lastNonDirectTouch": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/PersonTouch"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "eventCount": {
                "type": "integer"
              },
              "sessionCount": {
                "type": "integer"
              },
              "isTest": {
                "type": "boolean"
              },
              "isInternal": {
                "type": "boolean"
              },
              "mergedFrom": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Id"
                }
              }
            },
            "required": [
              "id",
              "userId",
              "traits",
              "firstSeenAt",
              "lastSeenAt",
              "firstChannel",
              "firstTouch",
              "lastNonDirectTouch",
              "eventCount",
              "sessionCount",
              "isTest",
              "isInternal",
              "mergedFrom"
            ],
            "additionalProperties": false
          },
          "identities": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "anonymous_id",
                    "user_id"
                  ]
                },
                "value": {
                  "type": "string"
                },
                "firstSeenAt": {
                  "$ref": "#/components/schemas/Timestamp"
                }
              },
              "required": [
                "kind",
                "value",
                "firstSeenAt"
              ],
              "additionalProperties": false
            }
          },
          "groups": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "groupId": {
                  "type": "string"
                },
                "traits": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {}
                },
                "memberCount": {
                  "type": "integer"
                },
                "firstSeenAt": {
                  "$ref": "#/components/schemas/Timestamp"
                },
                "lastSeenAt": {
                  "$ref": "#/components/schemas/Timestamp"
                }
              },
              "required": [
                "groupId",
                "traits",
                "memberCount",
                "firstSeenAt",
                "lastSeenAt"
              ],
              "additionalProperties": false
            }
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sessions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SessionSummary"
            }
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PersonEvent"
            }
          },
          "summary": {
            "type": "object",
            "properties": {
              "sessions": {
                "type": "integer"
              },
              "events": {
                "type": "integer"
              },
              "conversions": {
                "type": "integer"
              },
              "revenue": {
                "type": "number"
              },
              "refunds": {
                "type": "number"
              },
              "netRevenue": {
                "type": "number"
              },
              "currency": {
                "type": "string"
              },
              "leads": {
                "type": [
                  "integer",
                  "null"
                ]
              }
            },
            "required": [
              "sessions",
              "events",
              "conversions",
              "revenue",
              "refunds",
              "netRevenue",
              "currency",
              "leads"
            ],
            "additionalProperties": false
          },
          "conversions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PersonConversion"
            }
          },
          "leads": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/PersonLead"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "merges": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PersonMerge"
            }
          },
          "withheldTraits": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "requestedId",
          "person",
          "identities",
          "groups",
          "roles",
          "sessions",
          "events"
        ],
        "additionalProperties": false
      },
      "PersonSummary": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "userId": {
            "type": [
              "string",
              "null"
            ]
          },
          "firstSeenAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "lastSeenAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "firstChannel": {
            "type": [
              "string",
              "null"
            ]
          },
          "eventCount": {
            "type": "integer"
          },
          "sessionCount": {
            "type": "integer"
          },
          "isTest": {
            "type": "boolean"
          },
          "isInternal": {
            "type": "boolean"
          },
          "isBot": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "userId",
          "firstSeenAt",
          "lastSeenAt",
          "firstChannel",
          "eventCount",
          "sessionCount",
          "isTest",
          "isInternal"
        ],
        "additionalProperties": false
      },
      "PersonTouch": {
        "type": "object",
        "propertyNames": {
          "type": "string"
        },
        "additionalProperties": {}
      },
      "PropertyDefinition": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,99}$"
          },
          "type": {
            "type": "string",
            "enum": [
              "string",
              "number",
              "integer",
              "boolean",
              "datetime",
              "money",
              "currency",
              "enum",
              "object",
              "array"
            ]
          },
          "itemType": {
            "type": "string",
            "enum": [
              "string",
              "number",
              "integer",
              "boolean",
              "datetime",
              "money",
              "currency",
              "enum",
              "object",
              "array"
            ]
          },
          "required": {
            "type": "boolean"
          },
          "description": {
            "type": "string",
            "maxLength": 1000
          },
          "piiClass": {
            "type": "string",
            "enum": [
              "none",
              "pseudonymous",
              "personal",
              "sensitive"
            ]
          },
          "piiAction": {
            "type": "string",
            "enum": [
              "allow",
              "hash",
              "drop",
              "reject"
            ]
          },
          "enumValues": {
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 200
            }
          },
          "maxLength": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 10000
          },
          "minimum": {
            "type": "number"
          },
          "maximum": {
            "type": "number"
          },
          "example": {}
        },
        "required": [
          "key",
          "type",
          "required",
          "piiClass",
          "piiAction"
        ],
        "additionalProperties": false
      },
      "PropertyDefinitionInput": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,99}$"
          },
          "type": {
            "type": "string",
            "enum": [
              "string",
              "number",
              "integer",
              "boolean",
              "datetime",
              "money",
              "currency",
              "enum",
              "object",
              "array"
            ]
          },
          "itemType": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "string",
                  "number",
                  "integer",
                  "boolean",
                  "datetime",
                  "money",
                  "currency",
                  "enum",
                  "object",
                  "array"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "required": {
            "default": false,
            "type": "boolean"
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1000
              },
              {
                "type": "null"
              }
            ]
          },
          "piiClass": {
            "default": "none",
            "type": "string",
            "enum": [
              "none",
              "pseudonymous",
              "personal",
              "sensitive"
            ]
          },
          "piiAction": {
            "default": "allow",
            "type": "string",
            "enum": [
              "allow",
              "hash",
              "drop",
              "reject"
            ]
          },
          "enumValues": {
            "anyOf": [
              {
                "maxItems": 500,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "maxLength": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 10000
              },
              {
                "type": "null"
              }
            ]
          },
          "minimum": {
            "type": [
              "number",
              "null"
            ]
          },
          "maximum": {
            "type": [
              "number",
              "null"
            ]
          },
          "example": {},
          "displayNames": {
            "$ref": "#/components/schemas/LocalizedNames"
          }
        },
        "required": [
          "key",
          "type"
        ]
      },
      "PropertyDefinitionRecord": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "scope": {
            "type": "string",
            "enum": [
              "event",
              "trait",
              "group_trait"
            ]
          },
          "key": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "string",
              "number",
              "integer",
              "boolean",
              "datetime",
              "money",
              "currency",
              "enum",
              "object",
              "array"
            ]
          },
          "itemType": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "string",
                  "number",
                  "integer",
                  "boolean",
                  "datetime",
                  "money",
                  "currency",
                  "enum",
                  "object",
                  "array"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "required": {
            "type": "boolean"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "piiClass": {
            "type": "string",
            "enum": [
              "none",
              "pseudonymous",
              "personal",
              "sensitive"
            ]
          },
          "piiAction": {
            "type": "string",
            "enum": [
              "allow",
              "hash",
              "drop",
              "reject"
            ]
          },
          "enumValues": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "maxLength": {
            "type": [
              "integer",
              "null"
            ]
          },
          "minimum": {
            "type": [
              "number",
              "null"
            ]
          },
          "maximum": {
            "type": [
              "number",
              "null"
            ]
          },
          "example": {},
          "sortOrder": {
            "type": "integer"
          },
          "displayNames": {
            "$ref": "#/components/schemas/LocalizedNamesRecord"
          },
          "createdAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/Timestamp"
          }
        },
        "required": [
          "id",
          "scope",
          "key",
          "type",
          "itemType",
          "required",
          "description",
          "piiClass",
          "piiAction",
          "enumValues",
          "maxLength",
          "minimum",
          "maximum",
          "example",
          "sortOrder",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "PropertyFilterRecord": {
        "type": "object",
        "properties": {
          "property": {
            "type": "string"
          },
          "op": {
            "type": "string",
            "enum": [
              "eq",
              "neq",
              "in",
              "not_in",
              "contains",
              "not_contains",
              "starts_with",
              "is_empty",
              "is_not_empty",
              "gt",
              "gte",
              "lt",
              "lte"
            ]
          },
          "value": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "number"
                  },
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "property",
          "op",
          "value"
        ],
        "additionalProperties": false
      },
      "QueryApiRequest": {
        "type": "object",
        "properties": {
          "appId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "metrics": {
            "minItems": 1,
            "maxItems": 20,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 101,
              "pattern": "^(?:[a-z][a-z0-9_]{0,49}(?::[a-z][a-z0-9_]{0,49})?|social\\.[a-z][a-z0-9_]{0,19}\\.[a-z][a-z0-9_]{0,49}|(?:email|sms)\\.[a-z][a-z0-9_]{0,49})$"
            }
          },
          "dimensions": {
            "default": [],
            "maxItems": 3,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120,
              "pattern": "^(?:[a-z][a-z_]{1,30}|property:[A-Za-z_][A-Za-z0-9_]{0,99})$"
            }
          },
          "filters": {
            "default": [],
            "maxItems": 20,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QueryFilterInput"
            }
          },
          "dateRange": {
            "$ref": "#/components/schemas/DateRange"
          },
          "compare": {
            "default": "none",
            "type": "string",
            "enum": [
              "none",
              "previous_period",
              "previous_year",
              "custom"
            ]
          },
          "compareRange": {
            "$ref": "#/components/schemas/DateRange"
          },
          "include": {
            "default": {
              "test": false,
              "internal": false,
              "bot": false
            },
            "$ref": "#/components/schemas/TrafficInclude"
          },
          "granularity": {
            "type": "string",
            "enum": [
              "day",
              "week",
              "month"
            ]
          },
          "attributionModel": {
            "type": "string",
            "enum": [
              "first_touch",
              "last_touch",
              "last_non_direct",
              "linear",
              "position_based",
              "time_decay",
              "last_paid"
            ]
          },
          "orderBy": {
            "type": "object",
            "properties": {
              "metric": {
                "type": "string",
                "minLength": 1,
                "maxLength": 101,
                "pattern": "^(?:[a-z][a-z0-9_]{0,49}(?::[a-z][a-z0-9_]{0,49})?|social\\.[a-z][a-z0-9_]{0,19}\\.[a-z][a-z0-9_]{0,49}|(?:email|sms)\\.[a-z][a-z0-9_]{0,49})$"
              },
              "direction": {
                "default": "desc",
                "type": "string",
                "enum": [
                  "asc",
                  "desc"
                ]
              }
            },
            "required": [
              "metric"
            ]
          },
          "limit": {
            "default": 1000,
            "type": "integer",
            "minimum": 1,
            "maximum": 10000
          },
          "segmentId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "definitions": {
            "maxItems": 5,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DraftMetricDefinition"
            }
          }
        },
        "required": [
          "appId",
          "metrics",
          "dateRange"
        ]
      },
      "QueryBucket": {
        "type": "object",
        "properties": {
          "start": {
            "$ref": "#/components/schemas/LocalDate"
          },
          "end": {
            "$ref": "#/components/schemas/LocalDate"
          },
          "days": {
            "type": "integer"
          },
          "complete": {
            "type": "boolean"
          },
          "beforeTracking": {
            "type": "boolean"
          }
        },
        "required": [
          "start",
          "end",
          "days",
          "complete",
          "beforeTracking"
        ],
        "additionalProperties": false
      },
      "QueryDelta": {
        "type": "object",
        "properties": {
          "previous": {
            "type": [
              "number",
              "null"
            ]
          },
          "absolute": {
            "type": [
              "number",
              "null"
            ]
          },
          "relative": {
            "type": [
              "number",
              "null"
            ]
          },
          "mode": {
            "type": "string",
            "enum": [
              "relative",
              "absolute",
              "points"
            ]
          },
          "direction": {
            "type": "string",
            "enum": [
              "up",
              "down",
              "flat"
            ]
          },
          "tone": {
            "type": "string",
            "enum": [
              "positive",
              "negative",
              "neutral"
            ]
          },
          "comparable": {
            "type": "boolean"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "zero_base",
                  "small_base",
                  "not_comparable",
                  "no_value"
                ]
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "previous",
          "absolute",
          "relative",
          "mode",
          "direction",
          "tone",
          "comparable",
          "reason"
        ],
        "additionalProperties": false
      },
      "QueryDeltas": {
        "type": "object",
        "propertyNames": {
          "type": "string"
        },
        "additionalProperties": {
          "$ref": "#/components/schemas/QueryDelta"
        }
      },
      "QueryFilter": {
        "type": "object",
        "properties": {
          "dimension": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "pattern": "^(?:[a-z][a-z_]{1,30}|property:[A-Za-z_][A-Za-z0-9_]{0,99})$"
          },
          "op": {
            "type": "string",
            "enum": [
              "eq",
              "neq",
              "in",
              "not_in",
              "contains",
              "not_contains",
              "starts_with",
              "is_empty",
              "is_not_empty"
            ]
          },
          "value": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "minItems": 1,
                "maxItems": 100,
                "type": "array",
                "items": {
                  "type": "string",
                  "maxLength": 500
                }
              }
            ]
          }
        },
        "required": [
          "dimension",
          "op"
        ],
        "additionalProperties": false
      },
      "QueryFilterInput": {
        "type": "object",
        "properties": {
          "dimension": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "pattern": "^(?:[a-z][a-z_]{1,30}|property:[A-Za-z_][A-Za-z0-9_]{0,99})$"
          },
          "op": {
            "type": "string",
            "enum": [
              "eq",
              "neq",
              "in",
              "not_in",
              "contains",
              "not_contains",
              "starts_with",
              "is_empty",
              "is_not_empty"
            ]
          },
          "value": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "minItems": 1,
                "maxItems": 100,
                "type": "array",
                "items": {
                  "type": "string",
                  "maxLength": 500
                }
              }
            ]
          }
        },
        "required": [
          "dimension",
          "op"
        ]
      },
      "QueryFilterRecord": {
        "type": "object",
        "properties": {
          "dimension": {
            "type": "string"
          },
          "op": {
            "type": "string",
            "enum": [
              "eq",
              "neq",
              "in",
              "not_in",
              "contains",
              "not_contains",
              "starts_with",
              "is_empty",
              "is_not_empty"
            ]
          },
          "value": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "dimension",
          "op",
          "value"
        ],
        "additionalProperties": false
      },
      "QueryFreshness": {
        "type": "object",
        "properties": {
          "processedUntil": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Timestamp"
              },
              {
                "type": "null"
              }
            ]
          },
          "lastEventReceivedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Timestamp"
              },
              {
                "type": "null"
              }
            ]
          },
          "upToDate": {
            "type": "boolean"
          },
          "updatedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Timestamp"
              },
              {
                "type": "null"
              }
            ]
          },
          "pendingRollupDays": {
            "type": "integer"
          }
        },
        "required": [
          "processedUntil",
          "lastEventReceivedAt",
          "upToDate",
          "updatedAt",
          "pendingRollupDays"
        ],
        "additionalProperties": false
      },
      "QueryMeta": {
        "type": "object",
        "properties": {
          "appId": {
            "$ref": "#/components/schemas/Id"
          },
          "timezone": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "dateRange": {
            "type": "object",
            "properties": {
              "from": {
                "$ref": "#/components/schemas/LocalDate"
              },
              "to": {
                "$ref": "#/components/schemas/LocalDate"
              }
            },
            "required": [
              "from",
              "to"
            ],
            "additionalProperties": false
          },
          "compare": {
            "type": "string",
            "enum": [
              "none",
              "previous_period",
              "previous_year",
              "custom"
            ]
          },
          "comparisonRange": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "from": {
                    "$ref": "#/components/schemas/LocalDate"
                  },
                  "to": {
                    "$ref": "#/components/schemas/LocalDate"
                  }
                },
                "required": [
                  "from",
                  "to"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "include": {
            "type": "object",
            "properties": {
              "test": {
                "type": "boolean"
              },
              "internal": {
                "type": "boolean"
              },
              "bot": {
                "type": "boolean"
              }
            },
            "required": [
              "test",
              "internal",
              "bot"
            ],
            "additionalProperties": false
          },
          "trackingStartedOn": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LocalDate"
              },
              {
                "type": "null"
              }
            ]
          },
          "freshness": {
            "$ref": "#/components/schemas/QueryFreshness"
          },
          "countingModes": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string",
              "enum": [
                "event_date",
                "cohort"
              ]
            }
          },
          "sources": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string",
              "enum": [
                "rollup",
                "raw",
                "none"
              ]
            }
          },
          "conversionRoles": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "signup",
                "login",
                "trial_start",
                "trial_end",
                "activation",
                "core_action",
                "lead",
                "demo_request",
                "contact_click",
                "checkout_start",
                "payment_failed",
                "purchase",
                "subscription_renewal",
                "refund",
                "churn",
                "referral"
              ]
            }
          },
          "attribution": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string",
                    "enum": [
                      "first_touch",
                      "last_touch",
                      "last_non_direct",
                      "linear",
                      "position_based",
                      "time_decay",
                      "last_paid"
                    ]
                  },
                  "windowDays": {
                    "type": "integer"
                  }
                },
                "required": [
                  "model",
                  "windowDays"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QueryWarning"
            }
          },
          "truncated": {
            "type": "boolean"
          },
          "generatedAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "segment": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "$ref": "#/components/schemas/Id"
                  },
                  "name": {
                    "type": "string"
                  },
                  "subject": {
                    "type": "string",
                    "enum": [
                      "person",
                      "account"
                    ]
                  }
                },
                "required": [
                  "id",
                  "name",
                  "subject"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "appId",
          "timezone",
          "currency",
          "dateRange",
          "compare",
          "comparisonRange",
          "include",
          "trackingStartedOn",
          "freshness",
          "countingModes",
          "sources",
          "conversionRoles",
          "attribution",
          "warnings",
          "truncated",
          "generatedAt"
        ],
        "additionalProperties": false
      },
      "QueryMetricMeta": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "unit": {
            "type": "string",
            "enum": [
              "count",
              "duration_ms",
              "percent",
              "currency",
              "ratio",
              "number"
            ]
          },
          "goodDirection": {
            "type": "string",
            "enum": [
              "higher",
              "lower",
              "neutral"
            ]
          },
          "aggregation": {
            "type": "string",
            "enum": [
              "sum",
              "distinct",
              "ratio",
              "last"
            ]
          },
          "countingMode": {
            "type": "string",
            "enum": [
              "event_date",
              "cohort"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "rollup",
              "raw",
              "none"
            ]
          },
          "label": {
            "type": "string"
          }
        },
        "required": [
          "key",
          "unit",
          "goodDirection",
          "aggregation",
          "countingMode",
          "source"
        ],
        "additionalProperties": false
      },
      "QueryRow": {
        "type": "object",
        "properties": {
          "dimensions": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "values": {
            "$ref": "#/components/schemas/QueryValues"
          },
          "bucket": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/QueryBucket"
              },
              {
                "type": "null"
              }
            ]
          },
          "previous": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/QueryValues"
              },
              {
                "type": "null"
              }
            ]
          },
          "previousBucket": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "start": {
                    "$ref": "#/components/schemas/LocalDate"
                  },
                  "end": {
                    "$ref": "#/components/schemas/LocalDate"
                  }
                },
                "required": [
                  "start",
                  "end"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "deltas": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/QueryDeltas"
              },
              {
                "type": "null"
              }
            ]
          },
          "shares": {
            "$ref": "#/components/schemas/QueryValues"
          }
        },
        "required": [
          "dimensions",
          "values",
          "bucket",
          "previous",
          "previousBucket",
          "deltas"
        ],
        "additionalProperties": false
      },
      "QueryValues": {
        "type": "object",
        "propertyNames": {
          "type": "string"
        },
        "additionalProperties": {
          "type": [
            "number",
            "null"
          ]
        }
      },
      "QueryWarning": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "DIMENSION_NOT_AVAILABLE",
              "FILTER_NOT_AVAILABLE",
              "COMPARISON_BEFORE_TRACKING",
              "RANGE_BEFORE_TRACKING",
              "ROWS_TRUNCATED",
              "ROLLUP_PENDING",
              "ATTRIBUTION_PENDING",
              "CURRENCY_PENDING",
              "SOCIAL_METRIC_NOT_PROVIDED",
              "SOCIAL_PERIOD_NOT_AVAILABLE",
              "SOCIAL_HISTORY_LIMITED",
              "SOCIAL_PERMISSION_MISSING",
              "SOCIAL_NOT_CONNECTED",
              "SOCIAL_NOT_ADDITIVE",
              "GA4_NOT_CONNECTED",
              "SEARCH_CONSOLE_NOT_CONNECTED"
            ]
          },
          "message": {
            "type": "string"
          },
          "metric": {
            "type": [
              "string",
              "null"
            ]
          },
          "dimension": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "code",
          "message",
          "metric",
          "dimension"
        ],
        "additionalProperties": false
      },
      "Report": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "appIds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Id"
            }
          },
          "apps": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "$ref": "#/components/schemas/Id"
                },
                "slug": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "timezone": {
                  "type": "string"
                },
                "currency": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "slug",
                "name",
                "timezone",
                "currency"
              ],
              "additionalProperties": false
            }
          },
          "sections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReportSection"
            }
          },
          "period": {
            "$ref": "#/components/schemas/ReportPeriod"
          },
          "compare": {
            "type": "string",
            "enum": [
              "none",
              "previous_period",
              "previous_year"
            ]
          },
          "filters": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QueryFilterRecord"
            }
          },
          "segmentId": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Id"
              },
              {
                "type": "null"
              }
            ]
          },
          "include": {
            "type": "object",
            "properties": {
              "test": {
                "type": "boolean"
              },
              "internal": {
                "type": "boolean"
              },
              "bot": {
                "type": "boolean"
              }
            },
            "required": [
              "test",
              "internal",
              "bot"
            ],
            "additionalProperties": false
          },
          "attributionModel": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "first_touch",
                  "last_touch",
                  "last_non_direct",
                  "linear",
                  "position_based",
                  "time_decay",
                  "last_paid"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "locale": {
            "type": "string",
            "enum": [
              "tr",
              "en"
            ]
          },
          "timezone": {
            "type": "string"
          },
          "subtitle": {
            "type": [
              "string",
              "null"
            ]
          },
          "templateKey": {
            "type": [
              "string",
              "null"
            ]
          },
          "lastSnapshot": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "$ref": "#/components/schemas/Id"
                  },
                  "generatedAt": {
                    "$ref": "#/components/schemas/Timestamp"
                  },
                  "from": {
                    "$ref": "#/components/schemas/LocalDate"
                  },
                  "to": {
                    "$ref": "#/components/schemas/LocalDate"
                  }
                },
                "required": [
                  "id",
                  "generatedAt",
                  "from",
                  "to"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "schedules": {
            "type": "integer"
          },
          "shareLinks": {
            "type": "object",
            "properties": {
              "active": {
                "type": "integer"
              },
              "total": {
                "type": "integer"
              }
            },
            "required": [
              "active",
              "total"
            ],
            "additionalProperties": false
          },
          "createdBy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Id"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/Timestamp"
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "appIds",
          "apps",
          "sections",
          "period",
          "compare",
          "filters",
          "include",
          "attributionModel",
          "locale",
          "timezone",
          "subtitle",
          "templateKey",
          "lastSnapshot",
          "schedules",
          "shareLinks",
          "createdBy",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "ReportCalendar": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReportCalendarItem"
            }
          },
          "total": {
            "type": "integer"
          },
          "counts": {
            "type": "object",
            "properties": {
              "published": {
                "type": "integer"
              },
              "planned": {
                "type": "integer"
              },
              "blog": {
                "type": "integer"
              }
            },
            "required": [
              "published",
              "planned",
              "blog"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "items",
          "total",
          "counts"
        ],
        "additionalProperties": false
      },
      "ReportCalendarItem": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "social_planned",
              "social_direct",
              "blog"
            ]
          },
          "postId": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Id"
              },
              {
                "type": "null"
              }
            ]
          },
          "date": {
            "$ref": "#/components/schemas/LocalDate"
          },
          "time": {
            "type": "string"
          },
          "at": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "platform": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string"
          },
          "format": {
            "type": [
              "string",
              "null"
            ]
          },
          "excerpt": {
            "type": "string"
          },
          "permalink": {
            "type": [
              "string",
              "null"
            ]
          },
          "campaignKey": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "kind",
          "postId",
          "date",
          "time",
          "at",
          "platform",
          "status",
          "format",
          "excerpt",
          "permalink",
          "campaignKey"
        ],
        "additionalProperties": false
      },
      "ReportForecast": {
        "type": "object",
        "properties": {
          "scenario": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "anyOf": [
                      {
                        "$ref": "#/components/schemas/Id"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "name": {
                    "type": "string"
                  },
                  "computedAt": {
                    "anyOf": [
                      {
                        "$ref": "#/components/schemas/Timestamp"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "id",
                  "name",
                  "computedAt"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "result": {
            "$ref": "#/components/schemas/ForecastResult"
          },
          "actuals": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "month": {
                      "type": "string"
                    },
                    "complete": {
                      "type": "boolean"
                    },
                    "spend": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "paid": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "total": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "forecastPaid": {
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "month",
                    "complete",
                    "spend",
                    "paid",
                    "total",
                    "forecastPaid"
                  ],
                  "additionalProperties": false
                }
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "scenario",
          "result",
          "actuals"
        ],
        "additionalProperties": false
      },
      "ReportFreshness": {
        "type": "object",
        "properties": {
          "appId": {
            "$ref": "#/components/schemas/Id"
          },
          "processedUntil": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Timestamp"
              },
              {
                "type": "null"
              }
            ]
          },
          "lastEventReceivedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Timestamp"
              },
              {
                "type": "null"
              }
            ]
          },
          "upToDate": {
            "type": "boolean"
          },
          "pendingRollupDays": {
            "type": "integer"
          },
          "adsSyncedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Timestamp"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "appId",
          "processedUntil",
          "lastEventReceivedAt",
          "upToDate",
          "pendingRollupDays",
          "adsSyncedAt"
        ],
        "additionalProperties": false
      },
      "ReportMetricLabel": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "unit": {
            "type": "string",
            "enum": [
              "count",
              "duration_ms",
              "percent",
              "currency",
              "ratio",
              "number"
            ]
          },
          "goodDirection": {
            "type": "string",
            "enum": [
              "higher",
              "lower",
              "neutral"
            ]
          },
          "countingMode": {
            "type": "string",
            "enum": [
              "event_date",
              "cohort"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "metrics",
              "ad_platform",
              "ga4",
              "search_console",
              "social_platform",
              "messaging",
              "mixed"
            ]
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "metrics",
                "ad_platform",
                "ga4",
                "search_console",
                "social_platform",
                "messaging"
              ]
            }
          }
        },
        "required": [
          "key",
          "label",
          "description",
          "unit",
          "goodDirection",
          "countingMode"
        ],
        "additionalProperties": false
      },
      "ReportNoteBlock": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "paragraph"
              },
              "content": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ReportNoteSpan"
                }
              }
            },
            "required": [
              "type",
              "content"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "heading"
              },
              "level": {
                "anyOf": [
                  {
                    "type": "number",
                    "const": 2
                  },
                  {
                    "type": "number",
                    "const": 3
                  },
                  {
                    "type": "number",
                    "const": 4
                  }
                ]
              },
              "content": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ReportNoteSpan"
                }
              }
            },
            "required": [
              "type",
              "level",
              "content"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "list"
              },
              "style": {
                "type": "string",
                "enum": [
                  "bullet",
                  "ordered"
                ]
              },
              "items": {
                "type": "array",
                "items": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ReportNoteSpan"
                  }
                }
              }
            },
            "required": [
              "type",
              "style",
              "items"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "quote"
              },
              "content": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ReportNoteSpan"
                }
              }
            },
            "required": [
              "type",
              "content"
            ],
            "additionalProperties": false
          }
        ]
      },
      "ReportNoteSpan": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string"
          },
          "marks": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "bold",
                "italic"
              ]
            }
          },
          "href": {
            "type": "string"
          }
        },
        "required": [
          "text"
        ],
        "additionalProperties": false
      },
      "ReportPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Report"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "total": {
            "type": "integer"
          }
        },
        "required": [
          "items",
          "nextCursor",
          "total"
        ],
        "additionalProperties": false
      },
      "ReportPeriod": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "relative"
              },
              "preset": {
                "type": "string",
                "enum": [
                  "yesterday",
                  "last_7_days",
                  "last_14_days",
                  "last_28_days",
                  "last_30_days",
                  "last_90_days",
                  "this_week",
                  "previous_week",
                  "this_month",
                  "previous_month",
                  "this_quarter",
                  "previous_quarter",
                  "this_year",
                  "previous_year"
                ]
              }
            },
            "required": [
              "kind",
              "preset"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "fixed"
              },
              "from": {
                "type": "string"
              },
              "to": {
                "type": "string"
              }
            },
            "required": [
              "kind",
              "from",
              "to"
            ],
            "additionalProperties": false
          }
        ]
      },
      "ReportSection": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/KpiSection"
          },
          {
            "$ref": "#/components/schemas/TimeseriesSection"
          },
          {
            "$ref": "#/components/schemas/TableSection"
          },
          {
            "$ref": "#/components/schemas/FunnelSection"
          },
          {
            "$ref": "#/components/schemas/AttributionSection"
          },
          {
            "$ref": "#/components/schemas/AdsTableSection"
          },
          {
            "$ref": "#/components/schemas/AdFunnelSection"
          },
          {
            "$ref": "#/components/schemas/SummarySection"
          },
          {
            "$ref": "#/components/schemas/NoteSection"
          },
          {
            "$ref": "#/components/schemas/AdConversionsListSection"
          },
          {
            "$ref": "#/components/schemas/ContentCalendarSection"
          },
          {
            "$ref": "#/components/schemas/ForecastSection"
          }
        ]
      },
      "ReportSectionResult": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "kpi",
              "timeseries",
              "table",
              "funnel",
              "attribution",
              "ads_table",
              "ad_funnel",
              "summary",
              "note",
              "ad_conversions_list",
              "content_calendar",
              "forecast"
            ]
          },
          "title": {
            "type": "string"
          },
          "subtitle": {
            "type": [
              "string",
              "null"
            ]
          },
          "size": {
            "type": "string",
            "enum": [
              "kpi",
              "half",
              "full"
            ]
          },
          "definition": {
            "$ref": "#/components/schemas/ReportSection"
          },
          "metrics": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReportMetricLabel"
            }
          },
          "countingModes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "event_date",
                "cohort"
              ]
            }
          },
          "text": {
            "type": [
              "string",
              "null"
            ]
          },
          "blocks": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ReportNoteBlock"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "dataDelayHint": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SectionDataDelay"
              },
              {
                "type": "null"
              }
            ]
          },
          "apps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SectionAppResult"
            }
          }
        },
        "required": [
          "id",
          "type",
          "title",
          "subtitle",
          "size",
          "definition",
          "metrics",
          "countingModes",
          "text",
          "apps"
        ],
        "additionalProperties": false
      },
      "ReportSnapshot": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "reportId": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Id"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "type": "string"
          },
          "subtitle": {
            "type": [
              "string",
              "null"
            ]
          },
          "trigger": {
            "type": "string",
            "enum": [
              "manual",
              "schedule",
              "api",
              "preview"
            ]
          },
          "period": {
            "type": "object",
            "properties": {
              "from": {
                "$ref": "#/components/schemas/LocalDate"
              },
              "to": {
                "$ref": "#/components/schemas/LocalDate"
              },
              "preset": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "yesterday",
                      "last_7_days",
                      "last_14_days",
                      "last_28_days",
                      "last_30_days",
                      "last_90_days",
                      "this_week",
                      "previous_week",
                      "this_month",
                      "previous_month",
                      "this_quarter",
                      "previous_quarter",
                      "this_year",
                      "previous_year"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "from",
              "to",
              "preset"
            ],
            "additionalProperties": false
          },
          "comparison": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "mode": {
                    "type": "string",
                    "enum": [
                      "none",
                      "previous_period",
                      "previous_year"
                    ]
                  },
                  "from": {
                    "$ref": "#/components/schemas/LocalDate"
                  },
                  "to": {
                    "$ref": "#/components/schemas/LocalDate"
                  }
                },
                "required": [
                  "mode",
                  "from",
                  "to"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "timezone": {
            "type": "string"
          },
          "locale": {
            "type": "string",
            "enum": [
              "tr",
              "en"
            ]
          },
          "generatedAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "createdBy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Id"
              },
              {
                "type": "null"
              }
            ]
          },
          "scheduleId": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Id"
              },
              {
                "type": "null"
              }
            ]
          },
          "apps": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "$ref": "#/components/schemas/Id"
                },
                "slug": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "timezone": {
                  "type": "string"
                },
                "currency": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "slug",
                "name",
                "timezone",
                "currency"
              ],
              "additionalProperties": false
            }
          },
          "filters": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QueryFilterRecord"
            }
          },
          "include": {
            "type": "object",
            "properties": {
              "test": {
                "type": "boolean"
              },
              "internal": {
                "type": "boolean"
              },
              "bot": {
                "type": "boolean"
              }
            },
            "required": [
              "test",
              "internal",
              "bot"
            ],
            "additionalProperties": false
          },
          "attributionModel": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "first_touch",
                  "last_touch",
                  "last_non_direct",
                  "linear",
                  "position_based",
                  "time_decay",
                  "last_paid"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "freshness": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReportFreshness"
            }
          },
          "sections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReportSectionResult"
            }
          },
          "aiSummary": {
            "$ref": "#/components/schemas/AiSummary"
          }
        },
        "required": [
          "id",
          "reportId",
          "name",
          "subtitle",
          "trigger",
          "period",
          "comparison",
          "timezone",
          "locale",
          "generatedAt",
          "createdBy",
          "scheduleId",
          "apps",
          "filters",
          "include",
          "attributionModel",
          "freshness",
          "sections",
          "aiSummary"
        ],
        "additionalProperties": false
      },
      "ReportSnapshotPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReportSnapshotSummary"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "items",
          "nextCursor"
        ],
        "additionalProperties": false
      },
      "ReportSnapshotSummary": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "reportId": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Id"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "type": "string"
          },
          "subtitle": {
            "type": [
              "string",
              "null"
            ]
          },
          "trigger": {
            "type": "string",
            "enum": [
              "manual",
              "schedule",
              "api",
              "preview"
            ]
          },
          "period": {
            "type": "object",
            "properties": {
              "from": {
                "$ref": "#/components/schemas/LocalDate"
              },
              "to": {
                "$ref": "#/components/schemas/LocalDate"
              },
              "preset": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "yesterday",
                      "last_7_days",
                      "last_14_days",
                      "last_28_days",
                      "last_30_days",
                      "last_90_days",
                      "this_week",
                      "previous_week",
                      "this_month",
                      "previous_month",
                      "this_quarter",
                      "previous_quarter",
                      "this_year",
                      "previous_year"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "from",
              "to",
              "preset"
            ],
            "additionalProperties": false
          },
          "comparison": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "mode": {
                    "type": "string",
                    "enum": [
                      "none",
                      "previous_period",
                      "previous_year"
                    ]
                  },
                  "from": {
                    "$ref": "#/components/schemas/LocalDate"
                  },
                  "to": {
                    "$ref": "#/components/schemas/LocalDate"
                  }
                },
                "required": [
                  "mode",
                  "from",
                  "to"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "timezone": {
            "type": "string"
          },
          "locale": {
            "type": "string",
            "enum": [
              "tr",
              "en"
            ]
          },
          "generatedAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "createdBy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Id"
              },
              {
                "type": "null"
              }
            ]
          },
          "scheduleId": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Id"
              },
              {
                "type": "null"
              }
            ]
          },
          "aiSummaryStatus": {
            "type": "string",
            "enum": [
              "disabled",
              "not_configured",
              "pending",
              "ready",
              "failed"
            ]
          }
        },
        "required": [
          "id",
          "reportId",
          "name",
          "subtitle",
          "trigger",
          "period",
          "comparison",
          "timezone",
          "locale",
          "generatedAt",
          "createdBy",
          "scheduleId",
          "aiSummaryStatus"
        ],
        "additionalProperties": false
      },
      "RevokeSourceKeyRequest": {
        "type": "object",
        "properties": {
          "graceMinutes": {
            "default": 0,
            "type": "integer",
            "minimum": 0,
            "maximum": 10080
          }
        }
      },
      "Role": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "key": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "permissions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "builtIn": {
            "type": "boolean"
          },
          "createdAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/Timestamp"
          }
        },
        "required": [
          "id",
          "key",
          "name",
          "description",
          "permissions",
          "builtIn",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "RoleList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Role"
            }
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": false
      },
      "RoleSummary": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "key": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "builtIn": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "key",
          "name",
          "builtIn"
        ],
        "additionalProperties": false
      },
      "SchemaBundle": {
        "type": "object",
        "properties": {
          "formatVersion": {
            "type": "number",
            "const": 1
          },
          "app": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "slug": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "slug",
              "name"
            ],
            "additionalProperties": false
          },
          "schemaMode": {
            "type": "string",
            "enum": [
              "strict",
              "lenient",
              "discover"
            ]
          },
          "revision": {
            "type": "integer",
            "minimum": 0
          },
          "generatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EventDefinition"
            }
          },
          "traits": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PropertyDefinition"
            }
          },
          "groupTraits": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PropertyDefinition"
            }
          }
        },
        "required": [
          "formatVersion",
          "app",
          "schemaMode",
          "revision",
          "generatedAt",
          "events",
          "traits",
          "groupTraits"
        ],
        "additionalProperties": false
      },
      "SectionAppResult": {
        "type": "object",
        "properties": {
          "appId": {
            "$ref": "#/components/schemas/Id"
          },
          "status": {
            "type": "string",
            "enum": [
              "ok",
              "not_available",
              "not_connected",
              "failed"
            ]
          },
          "message": {
            "type": [
              "string",
              "null"
            ]
          },
          "results": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "$ref": "#/components/schemas/AnalyticsQueryResult"
            }
          },
          "funnel": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FunnelResult"
              },
              {
                "type": "null"
              }
            ]
          },
          "labels": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {
                "type": "string"
              }
            }
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "derived": {
            "$ref": "#/components/schemas/SectionDerived"
          },
          "conversions": {
            "type": "object",
            "properties": {
              "items": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/AdConversion"
                }
              },
              "total": {
                "type": "integer"
              },
              "sold": {
                "type": "integer"
              }
            },
            "required": [
              "items",
              "total",
              "sold"
            ],
            "additionalProperties": false
          },
          "calendar": {
            "$ref": "#/components/schemas/ReportCalendar"
          },
          "forecast": {
            "$ref": "#/components/schemas/ReportForecast"
          }
        },
        "required": [
          "appId",
          "status",
          "message",
          "results",
          "funnel",
          "labels",
          "lines",
          "derived"
        ],
        "additionalProperties": false
      },
      "SectionDataDelay": {
        "type": "object",
        "properties": {
          "days": {
            "type": "integer"
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "source": {
                  "type": "string",
                  "enum": [
                    "metrics",
                    "ad_platform",
                    "ga4",
                    "search_console",
                    "social_platform",
                    "messaging"
                  ]
                },
                "days": {
                  "type": "integer"
                }
              },
              "required": [
                "source",
                "days"
              ],
              "additionalProperties": false
            }
          },
          "affectsPeriod": {
            "type": "boolean"
          },
          "text": {
            "type": "string"
          }
        },
        "required": [
          "days",
          "sources",
          "affectsPeriod",
          "text"
        ],
        "additionalProperties": false
      },
      "SectionDerived": {
        "type": "object",
        "properties": {
          "share": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "metric": {
                    "type": "string"
                  },
                  "total": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "rows": {
                    "type": "array",
                    "items": {
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  }
                },
                "required": [
                  "metric",
                  "total",
                  "rows"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "steps": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "metric": {
                      "type": "string"
                    },
                    "value": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "fromPrevious": {
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "metric",
                    "value",
                    "fromPrevious"
                  ],
                  "additionalProperties": false
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "stack": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "metric": {
                    "type": "string"
                  },
                  "dimension": {
                    "type": "string"
                  },
                  "buckets": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "series": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "value": {
                          "type": "string"
                        },
                        "values": {
                          "type": "array",
                          "items": {
                            "type": "number"
                          }
                        }
                      },
                      "required": [
                        "value",
                        "values"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "others": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "number"
                        }
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "metric",
                  "dimension",
                  "buckets",
                  "series",
                  "others"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "share",
          "steps",
          "stack"
        ],
        "additionalProperties": false
      },
      "SendCampaignRequest": {
        "type": "object",
        "properties": {
          "contentReviewed": {
            "type": "boolean",
            "const": true
          },
          "confirm": {
            "type": "boolean",
            "const": true
          },
          "schedule": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MessagingLocalTime"
              },
              {
                "type": "null"
              }
            ]
          },
          "note": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "contentReviewed",
          "confirm"
        ]
      },
      "SessionSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "personId": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Id"
              },
              {
                "type": "null"
              }
            ]
          },
          "anonymousId": {
            "type": [
              "string",
              "null"
            ]
          },
          "userId": {
            "type": [
              "string",
              "null"
            ]
          },
          "startedAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "endedAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "durationMs": {
            "type": "integer"
          },
          "activeMs": {
            "type": "integer"
          },
          "pageviews": {
            "type": "integer"
          },
          "screenViews": {
            "type": "integer"
          },
          "events": {
            "type": "integer"
          },
          "interactions": {
            "type": "integer"
          },
          "rageClicks": {
            "type": "integer"
          },
          "deadClicks": {
            "type": "integer"
          },
          "errors": {
            "type": "integer"
          },
          "entryPath": {
            "type": [
              "string",
              "null"
            ]
          },
          "exitPath": {
            "type": [
              "string",
              "null"
            ]
          },
          "channel": {
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "type": [
              "string",
              "null"
            ]
          },
          "medium": {
            "type": [
              "string",
              "null"
            ]
          },
          "campaign": {
            "type": [
              "string",
              "null"
            ]
          },
          "referrerHost": {
            "type": [
              "string",
              "null"
            ]
          },
          "deviceType": {
            "type": [
              "string",
              "null"
            ]
          },
          "os": {
            "type": [
              "string",
              "null"
            ]
          },
          "browser": {
            "type": [
              "string",
              "null"
            ]
          },
          "country": {
            "type": [
              "string",
              "null"
            ]
          },
          "region": {
            "type": [
              "string",
              "null"
            ]
          },
          "city": {
            "type": [
              "string",
              "null"
            ]
          },
          "isEngaged": {
            "type": "boolean"
          },
          "isBounce": {
            "type": "boolean"
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "converted": {
            "type": "boolean"
          },
          "revenue": {
            "type": "number"
          },
          "isTest": {
            "type": "boolean"
          },
          "isInternal": {
            "type": "boolean"
          },
          "isBot": {
            "type": "boolean"
          },
          "quickBacks": {
            "type": "integer"
          },
          "errorClicks": {
            "type": "integer"
          },
          "excessiveScrolls": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "personId",
          "anonymousId",
          "userId",
          "startedAt",
          "endedAt",
          "durationMs",
          "activeMs",
          "pageviews",
          "screenViews",
          "events",
          "interactions",
          "rageClicks",
          "deadClicks",
          "errors",
          "entryPath",
          "exitPath",
          "channel",
          "source",
          "medium",
          "campaign",
          "referrerHost",
          "deviceType",
          "os",
          "browser",
          "country",
          "region",
          "city",
          "isEngaged",
          "isBounce",
          "roles",
          "converted",
          "revenue",
          "isTest",
          "isInternal",
          "isBot"
        ],
        "additionalProperties": false
      },
      "SmsSegments": {
        "type": "object",
        "properties": {
          "encoding": {
            "type": "string",
            "enum": [
              "gsm7",
              "gsm7_turkish",
              "ucs2"
            ]
          },
          "characters": {
            "type": "integer"
          },
          "units": {
            "type": "integer"
          },
          "parts": {
            "type": "integer"
          },
          "perPart": {
            "type": "integer"
          },
          "remaining": {
            "type": "integer"
          },
          "credits": {
            "type": "integer"
          },
          "unsupported": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "encoding",
          "characters",
          "units",
          "parts",
          "perPart",
          "remaining",
          "credits",
          "unsupported"
        ],
        "additionalProperties": false
      },
      "SocialAccount": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "platform": {
            "type": "string",
            "enum": [
              "instagram",
              "facebook",
              "linkedin"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "needs_reauth",
              "disconnected"
            ]
          },
          "connectionId": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Id"
              },
              {
                "type": "null"
              }
            ]
          },
          "externalId": {
            "type": "string"
          },
          "username": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "profile": {
            "type": "object",
            "properties": {
              "bio": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "website": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "avatarUrl": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "pageUrl": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "bio",
              "website",
              "avatarUrl",
              "pageUrl"
            ],
            "additionalProperties": false
          },
          "followers": {
            "type": [
              "integer",
              "null"
            ]
          },
          "mediaCount": {
            "type": [
              "integer",
              "null"
            ]
          },
          "autoPublish": {
            "type": "boolean"
          },
          "capabilities": {
            "type": "object",
            "properties": {
              "insights": {
                "type": "boolean"
              },
              "publish": {
                "type": "boolean"
              },
              "formats": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "post",
                    "reel",
                    "story",
                    "text"
                  ]
                }
              },
              "autoPublishFormats": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "post",
                    "reel",
                    "story",
                    "text"
                  ]
                }
              }
            },
            "required": [
              "insights",
              "publish",
              "formats",
              "autoPublishFormats"
            ],
            "additionalProperties": false
          },
          "freshness": {
            "type": "object",
            "properties": {
              "lastSyncedAt": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/Timestamp"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "nextSyncAt": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/Timestamp"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "lastError": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "code": {
                        "type": "string"
                      },
                      "message": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "code",
                      "message"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "lastSyncedAt",
              "nextSyncAt",
              "lastError"
            ],
            "additionalProperties": false
          },
          "createdAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/Timestamp"
          }
        },
        "required": [
          "id",
          "platform",
          "status",
          "connectionId",
          "externalId",
          "username",
          "name",
          "profile",
          "followers",
          "mediaCount",
          "autoPublish",
          "capabilities",
          "freshness",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "SocialAccountList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SocialAccount"
            }
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": false
      },
      "SocialAccountRef": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "platform": {
            "type": "string",
            "enum": [
              "instagram",
              "facebook",
              "linkedin"
            ]
          },
          "name": {
            "type": "string"
          },
          "username": {
            "type": [
              "string",
              "null"
            ]
          },
          "lastSyncedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Timestamp"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "platform",
          "name",
          "username",
          "lastSyncedAt"
        ],
        "additionalProperties": false
      },
      "SocialKpi": {
        "type": "object",
        "properties": {
          "metric": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "unit": {
            "type": "string",
            "enum": [
              "count",
              "duration_ms",
              "percent",
              "currency",
              "ratio",
              "number"
            ]
          },
          "goodDirection": {
            "type": "string",
            "enum": [
              "higher",
              "lower",
              "neutral"
            ]
          },
          "countingMode": {
            "type": "string",
            "enum": [
              "event_date",
              "cohort"
            ]
          },
          "value": {
            "type": [
              "number",
              "null"
            ]
          },
          "previous": {
            "type": [
              "number",
              "null"
            ]
          },
          "delta": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/QueryDelta"
              },
              {
                "type": "null"
              }
            ]
          },
          "unavailable": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SocialUnavailable"
              },
              {
                "type": "null"
              }
            ]
          },
          "notAdditive": {
            "type": "boolean"
          }
        },
        "required": [
          "metric",
          "label",
          "description",
          "unit",
          "goodDirection",
          "countingMode",
          "value",
          "previous",
          "delta",
          "unavailable",
          "notAdditive"
        ],
        "additionalProperties": false
      },
      "SocialOverview": {
        "type": "object",
        "properties": {
          "scope": {
            "type": "object",
            "properties": {
              "platform": {
                "type": "string",
                "enum": [
                  "all",
                  "instagram",
                  "facebook",
                  "linkedin"
                ]
              },
              "accountIds": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Id"
                }
              }
            },
            "required": [
              "platform",
              "accountIds"
            ],
            "additionalProperties": false
          },
          "accounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SocialAccountRef"
            }
          },
          "kpis": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SocialKpi"
            }
          },
          "series": {
            "$ref": "#/components/schemas/AnalyticsQueryResult"
          },
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QueryWarning"
            }
          },
          "posts": {
            "type": [
              "integer",
              "null"
            ]
          },
          "uniqueByAccount": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "accountId": {
                  "$ref": "#/components/schemas/Id"
                },
                "kpis": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "metric": {
                        "type": "string"
                      },
                      "value": {
                        "type": [
                          "number",
                          "null"
                        ]
                      },
                      "previous": {
                        "type": [
                          "number",
                          "null"
                        ]
                      },
                      "delta": {
                        "anyOf": [
                          {
                            "$ref": "#/components/schemas/QueryDelta"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "unavailable": {
                        "anyOf": [
                          {
                            "$ref": "#/components/schemas/SocialUnavailable"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "metric",
                      "value",
                      "previous",
                      "delta",
                      "unavailable"
                    ],
                    "additionalProperties": false
                  }
                }
              },
              "required": [
                "accountId",
                "kpis"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "scope",
          "accounts",
          "kpis",
          "series",
          "warnings",
          "posts",
          "uniqueByAccount"
        ],
        "additionalProperties": false
      },
      "SocialPostMetrics": {
        "type": "object",
        "properties": {
          "likes": {
            "type": [
              "number",
              "null"
            ]
          },
          "comments": {
            "type": [
              "number",
              "null"
            ]
          },
          "shares": {
            "type": [
              "number",
              "null"
            ]
          },
          "saves": {
            "type": [
              "number",
              "null"
            ]
          },
          "reach": {
            "type": [
              "number",
              "null"
            ]
          },
          "views": {
            "type": [
              "number",
              "null"
            ]
          },
          "clicks": {
            "type": [
              "number",
              "null"
            ]
          },
          "engagement": {
            "type": [
              "number",
              "null"
            ]
          },
          "engagementRate": {
            "type": [
              "number",
              "null"
            ]
          }
        },
        "required": [
          "likes",
          "comments",
          "shares",
          "saves",
          "reach",
          "views",
          "clicks",
          "engagement",
          "engagementRate"
        ],
        "additionalProperties": false
      },
      "SocialPostSnapshot": {
        "type": "object",
        "properties": {
          "capturedAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "likes": {
            "type": [
              "number",
              "null"
            ]
          },
          "comments": {
            "type": [
              "number",
              "null"
            ]
          },
          "shares": {
            "type": [
              "number",
              "null"
            ]
          },
          "saves": {
            "type": [
              "number",
              "null"
            ]
          },
          "reach": {
            "type": [
              "number",
              "null"
            ]
          },
          "views": {
            "type": [
              "number",
              "null"
            ]
          },
          "clicks": {
            "type": [
              "number",
              "null"
            ]
          }
        },
        "required": [
          "capturedAt",
          "likes",
          "comments",
          "shares",
          "saves",
          "reach",
          "views",
          "clicks"
        ],
        "additionalProperties": false
      },
      "SocialPublishedPost": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "accountId": {
            "$ref": "#/components/schemas/Id"
          },
          "platform": {
            "type": "string",
            "enum": [
              "instagram",
              "facebook",
              "linkedin"
            ]
          },
          "externalId": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "image",
              "carousel",
              "video",
              "reel",
              "story",
              "text",
              "link",
              "other"
            ]
          },
          "caption": {
            "type": [
              "string",
              "null"
            ]
          },
          "permalink": {
            "type": [
              "string",
              "null"
            ]
          },
          "publishedAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "publishedLocal": {
            "type": "object",
            "properties": {
              "date": {
                "$ref": "#/components/schemas/LocalDate"
              },
              "time": {
                "type": "string"
              }
            },
            "required": [
              "date",
              "time"
            ],
            "additionalProperties": false
          },
          "thumbnailUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "metrics": {
            "$ref": "#/components/schemas/SocialPostMetrics"
          },
          "unavailable": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "$ref": "#/components/schemas/SocialUnavailable"
            }
          },
          "plannedPostId": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Id"
              },
              {
                "type": "null"
              }
            ]
          },
          "campaignKey": {
            "type": [
              "string",
              "null"
            ]
          },
          "metricsUpdatedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Timestamp"
              },
              {
                "type": "null"
              }
            ]
          },
          "nextRefreshAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Timestamp"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "accountId",
          "platform",
          "externalId",
          "type",
          "caption",
          "permalink",
          "publishedAt",
          "publishedLocal",
          "thumbnailUrl",
          "metrics",
          "unavailable",
          "plannedPostId",
          "campaignKey",
          "metricsUpdatedAt",
          "nextRefreshAt"
        ],
        "additionalProperties": false
      },
      "SocialPublishedPostDetail": {
        "type": "object",
        "properties": {
          "post": {
            "$ref": "#/components/schemas/SocialPublishedPost"
          },
          "history": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SocialPostSnapshot"
            }
          }
        },
        "required": [
          "post",
          "history"
        ],
        "additionalProperties": false
      },
      "SocialPublishedPostPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SocialPublishedPost"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "countingMode": {
            "type": "string",
            "enum": [
              "event_date",
              "cohort"
            ]
          },
          "total": {
            "type": "integer"
          }
        },
        "required": [
          "items",
          "nextCursor",
          "countingMode",
          "total"
        ],
        "additionalProperties": false
      },
      "SocialUnavailable": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string",
            "enum": [
              "not_provided",
              "period_limited",
              "history_limited",
              "permission_missing",
              "not_connected",
              "no_data"
            ]
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "reason",
          "message"
        ],
        "additionalProperties": false
      },
      "Source": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "appId": {
            "$ref": "#/components/schemas/Id"
          },
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "web",
              "ios",
              "android",
              "server",
              "other"
            ]
          },
          "environment": {
            "type": "string",
            "enum": [
              "production",
              "staging",
              "development"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "disabled"
            ]
          },
          "requireSignature": {
            "type": "boolean"
          },
          "allowedOrigins": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "consentMode": {
            "type": "string",
            "enum": [
              "required",
              "implied",
              "none"
            ]
          },
          "excludedPaths": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "maskSelectors": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "ignoreSelectors": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "stripQueryParams": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sessionTimeoutMinutes": {
            "type": "integer"
          },
          "interactionSampleRate": {
            "type": "number"
          },
          "autocapture": {
            "$ref": "#/components/schemas/Autocapture"
          },
          "dataLayerEvents": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "createdAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/Timestamp"
          }
        },
        "required": [
          "id",
          "appId",
          "name",
          "kind",
          "environment",
          "status",
          "requireSignature",
          "allowedOrigins",
          "consentMode",
          "excludedPaths",
          "maskSelectors",
          "ignoreSelectors",
          "stripQueryParams",
          "sessionTimeoutMinutes",
          "interactionSampleRate",
          "autocapture",
          "dataLayerEvents",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "SourceHealth": {
        "type": "object",
        "properties": {
          "sourceId": {
            "$ref": "#/components/schemas/Id"
          },
          "state": {
            "type": "string",
            "enum": [
              "no_data",
              "receiving",
              "quiet"
            ]
          },
          "lastEventAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Timestamp"
              },
              {
                "type": "null"
              }
            ]
          },
          "lastRejectionAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Timestamp"
              },
              {
                "type": "null"
              }
            ]
          },
          "lastLibrary": {
            "type": [
              "string",
              "null"
            ]
          },
          "rejectionsLast24h": {
            "type": "integer",
            "minimum": 0
          },
          "eventsLast24h": {
            "type": "integer",
            "minimum": 0
          },
          "warningsLast24h": {
            "type": "integer",
            "minimum": 0
          },
          "rejectionRate": {
            "type": [
              "number",
              "null"
            ]
          }
        },
        "required": [
          "sourceId",
          "state",
          "lastEventAt",
          "lastRejectionAt",
          "lastLibrary",
          "rejectionsLast24h"
        ],
        "additionalProperties": false
      },
      "SourceKey": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "kind": {
            "type": "string",
            "enum": [
              "write",
              "signing"
            ]
          },
          "mode": {
            "type": "string",
            "enum": [
              "live",
              "test"
            ]
          },
          "maskedKey": {
            "type": "string"
          },
          "displayPrefix": {
            "type": "string"
          },
          "last4": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "active",
              "expiring",
              "revoked"
            ]
          },
          "revokedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Timestamp"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdBy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Id"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "$ref": "#/components/schemas/Timestamp"
          }
        },
        "required": [
          "id",
          "kind",
          "mode",
          "maskedKey",
          "displayPrefix",
          "last4",
          "state",
          "revokedAt",
          "createdBy",
          "createdAt"
        ],
        "additionalProperties": false
      },
      "SourceKeyList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SourceKey"
            }
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": false
      },
      "SourcePage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Source"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "items",
          "nextCursor"
        ],
        "additionalProperties": false
      },
      "SummarySection": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40,
            "pattern": "^[a-z0-9][a-z0-9_-]{0,39}$"
          },
          "title": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "size": {
            "type": "string",
            "enum": [
              "kpi",
              "half",
              "full"
            ]
          },
          "type": {
            "type": "string",
            "const": "summary"
          },
          "scope": {
            "default": "overall",
            "type": "string",
            "enum": [
              "overall",
              "ads"
            ]
          }
        },
        "required": [
          "type",
          "scope"
        ],
        "additionalProperties": false
      },
      "SuppressionResult": {
        "type": "object",
        "properties": {
          "suppressed": {
            "type": "boolean"
          },
          "channel": {
            "type": "string",
            "enum": [
              "email",
              "sms"
            ]
          },
          "changed": {
            "type": "boolean"
          }
        },
        "required": [
          "suppressed",
          "channel",
          "changed"
        ],
        "additionalProperties": false
      },
      "TableSection": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40,
            "pattern": "^[a-z0-9][a-z0-9_-]{0,39}$"
          },
          "title": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "size": {
            "type": "string",
            "enum": [
              "kpi",
              "half",
              "full"
            ]
          },
          "type": {
            "type": "string",
            "const": "table"
          },
          "dimensions": {
            "minItems": 1,
            "maxItems": 2,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120,
              "pattern": "^(?:[a-z][a-z_]{1,30}|property:[A-Za-z_][A-Za-z0-9_]{0,99})$"
            }
          },
          "metrics": {
            "minItems": 1,
            "maxItems": 8,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 101,
              "pattern": "^(?:[a-z][a-z0-9_]{0,49}(?::[a-z][a-z0-9_]{0,49})?|social\\.[a-z][a-z0-9_]{0,19}\\.[a-z][a-z0-9_]{0,49}|(?:email|sms)\\.[a-z][a-z0-9_]{0,49})$"
            }
          },
          "limit": {
            "default": 10,
            "type": "integer",
            "minimum": 1,
            "maximum": 50
          },
          "orderBy": {
            "type": "string",
            "minLength": 1,
            "maxLength": 101,
            "pattern": "^(?:[a-z][a-z0-9_]{0,49}(?::[a-z][a-z0-9_]{0,49})?|social\\.[a-z][a-z0-9_]{0,19}\\.[a-z][a-z0-9_]{0,49}|(?:email|sms)\\.[a-z][a-z0-9_]{0,49})$"
          },
          "direction": {
            "default": "desc",
            "type": "string",
            "enum": [
              "asc",
              "desc"
            ]
          },
          "share": {
            "default": false,
            "type": "boolean"
          },
          "filters": {
            "default": [],
            "maxItems": 10,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QueryFilter"
            }
          },
          "segmentId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "type",
          "dimensions",
          "metrics",
          "limit",
          "direction",
          "share",
          "filters"
        ],
        "additionalProperties": false
      },
      "TestSendRequest": {
        "type": "object",
        "properties": {
          "recipients": {
            "minItems": 1,
            "maxItems": 5,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 3,
              "maxLength": 320
            }
          },
          "contactId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          }
        },
        "required": [
          "recipients"
        ]
      },
      "TestSendResult": {
        "type": "object",
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "to": {
                  "type": "string"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "sent",
                    "failed"
                  ]
                },
                "errorCode": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "to",
                "status",
                "errorCode"
              ],
              "additionalProperties": false
            }
          },
          "sms": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SmsSegments"
              },
              {
                "type": "null"
              }
            ]
          },
          "campaign": {
            "$ref": "#/components/schemas/MessageCampaign"
          }
        },
        "required": [
          "results",
          "sms",
          "campaign"
        ],
        "additionalProperties": false
      },
      "TimeToConvert": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer"
          },
          "averageSeconds": {
            "type": [
              "number",
              "null"
            ]
          },
          "medianSeconds": {
            "type": [
              "number",
              "null"
            ]
          },
          "p75Seconds": {
            "type": [
              "number",
              "null"
            ]
          },
          "p90Seconds": {
            "type": [
              "number",
              "null"
            ]
          },
          "histogram": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "upToSeconds": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "count": {
                  "type": "integer"
                }
              },
              "required": [
                "upToSeconds",
                "count"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "count",
          "averageSeconds",
          "medianSeconds",
          "p75Seconds",
          "p90Seconds",
          "histogram"
        ],
        "additionalProperties": false
      },
      "TimeseriesSection": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40,
            "pattern": "^[a-z0-9][a-z0-9_-]{0,39}$"
          },
          "title": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "size": {
            "type": "string",
            "enum": [
              "kpi",
              "half",
              "full"
            ]
          },
          "type": {
            "type": "string",
            "const": "timeseries"
          },
          "metrics": {
            "minItems": 1,
            "maxItems": 4,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 101,
              "pattern": "^(?:[a-z][a-z0-9_]{0,49}(?::[a-z][a-z0-9_]{0,49})?|social\\.[a-z][a-z0-9_]{0,19}\\.[a-z][a-z0-9_]{0,49}|(?:email|sms)\\.[a-z][a-z0-9_]{0,49})$"
            }
          },
          "granularity": {
            "default": "day",
            "type": "string",
            "enum": [
              "day",
              "week",
              "month"
            ]
          },
          "breakdown": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "pattern": "^(?:[a-z][a-z_]{1,30}|property:[A-Za-z_][A-Za-z0-9_]{0,99})$"
          },
          "breakdownLimit": {
            "default": 6,
            "type": "integer",
            "minimum": 2,
            "maximum": 8
          },
          "chart": {
            "default": "line",
            "type": "string",
            "enum": [
              "line",
              "bar",
              "stacked_bar"
            ]
          },
          "filters": {
            "default": [],
            "maxItems": 10,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QueryFilter"
            }
          },
          "segmentId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "type",
          "metrics",
          "granularity",
          "breakdownLimit",
          "chart",
          "filters"
        ],
        "additionalProperties": false
      },
      "Timestamp": {
        "type": "string",
        "format": "date-time",
        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
      },
      "TrafficInclude": {
        "type": "object",
        "properties": {
          "test": {
            "default": false,
            "type": "boolean"
          },
          "internal": {
            "default": false,
            "type": "boolean"
          },
          "bot": {
            "default": false,
            "type": "boolean"
          }
        }
      },
      "TraitList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PropertyDefinitionRecord"
            }
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": false
      },
      "UpdateAppRequest": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string",
            "minLength": 1,
            "maxLength": 50,
            "pattern": "^[a-z0-9](?:[a-z0-9-]{0,48}[a-z0-9])?$"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ]
          },
          "websiteUrl": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ]
          },
          "iconUrl": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ]
          },
          "timezone": {
            "type": "string",
            "maxLength": 64
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "schemaMode": {
            "type": "string",
            "enum": [
              "strict",
              "lenient",
              "discover"
            ]
          },
          "attributionModel": {
            "type": "string",
            "enum": [
              "first_touch",
              "last_touch",
              "last_non_direct",
              "linear",
              "position_based",
              "time_decay",
              "last_paid"
            ]
          },
          "attributionWindowDays": {
            "type": "integer",
            "minimum": 1,
            "maximum": 365
          },
          "conversionRoles": {
            "minItems": 1,
            "maxItems": 16,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "signup",
                "login",
                "trial_start",
                "trial_end",
                "activation",
                "core_action",
                "lead",
                "demo_request",
                "contact_click",
                "checkout_start",
                "payment_failed",
                "purchase",
                "subscription_renewal",
                "refund",
                "churn",
                "referral"
              ]
            }
          },
          "leadContactClicks": {
            "type": "boolean"
          },
          "retention": {
            "type": "object",
            "properties": {
              "eventsMonths": {
                "type": "integer",
                "minimum": 1,
                "maximum": 120
              },
              "interactionsMonths": {
                "type": "integer",
                "minimum": 1,
                "maximum": 60
              },
              "sessionsMonths": {
                "type": "integer",
                "minimum": 1,
                "maximum": 120
              }
            },
            "required": [
              "eventsMonths",
              "interactionsMonths",
              "sessionsMonths"
            ]
          },
          "internalIpRanges": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 43,
              "pattern": "^(?:(?:\\d{1,3}\\.){3}\\d{1,3}(?:\\/\\d{1,2})?|[0-9A-Fa-f:]{2,39}(?:\\/\\d{1,3})?)$"
            }
          },
          "internalCookie": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ]
          },
          "revenueBasis": {
            "type": "string",
            "enum": [
              "gross",
              "net"
            ]
          },
          "pricesIncludeTax": {
            "type": "boolean"
          },
          "overviewTiles": {
            "maxItems": 12,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OverviewTileRequest"
            }
          },
          "adsKpis": {
            "maxItems": 12,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 101,
              "pattern": "^(?:[a-z][a-z0-9_]{0,49}(?::[a-z][a-z0-9_]{0,49})?|social\\.[a-z][a-z0-9_]{0,19}\\.[a-z][a-z0-9_]{0,49}|(?:email|sms)\\.[a-z][a-z0-9_]{0,49})$"
            }
          },
          "modules": {
            "maxItems": 6,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "ads",
                "social",
                "messaging",
                "content",
                "leads",
                "behavior"
              ]
            }
          },
          "defaultAlertRecipients": {
            "$ref": "#/components/schemas/AlertRecipients"
          },
          "searchBrandTerms": {
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 2,
              "maxLength": 100
            }
          }
        }
      },
      "UpdateEventDefinitionRequest": {
        "type": "object",
        "properties": {
          "displayName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ]
          },
          "category": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ]
          },
          "roles": {
            "maxItems": 16,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "signup",
                "login",
                "trial_start",
                "trial_end",
                "activation",
                "core_action",
                "lead",
                "demo_request",
                "contact_click",
                "checkout_start",
                "payment_failed",
                "purchase",
                "subscription_renewal",
                "refund",
                "churn",
                "referral"
              ]
            }
          },
          "aliases": {
            "maxItems": 20,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          "properties": {
            "maxItems": 200,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PropertyDefinitionInput"
            }
          },
          "displayNames": {
            "$ref": "#/components/schemas/LocalizedNames"
          }
        }
      },
      "UpdateMessageCampaignRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "subject": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "preheader": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "body": {
            "type": "string",
            "maxLength": 20000
          },
          "senderId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              {
                "type": "null"
              }
            ]
          },
          "audience": {
            "type": "object",
            "properties": {
              "listIds": {
                "default": [],
                "maxItems": 20,
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                }
              },
              "segmentId": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          },
          "locale": {
            "type": "string",
            "enum": [
              "tr",
              "en"
            ]
          },
          "throttlePerMinute": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 100000
              },
              {
                "type": "null"
              }
            ]
          },
          "utmSource": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          }
        }
      },
      "UpdateSourceRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "environment": {
            "type": "string",
            "enum": [
              "production",
              "staging",
              "development"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "disabled"
            ]
          },
          "requireSignature": {
            "type": "boolean"
          },
          "allowedOrigins": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 300,
              "pattern": "^https?:\\/\\/(?:\\*\\.)?[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)*(?::\\d{1,5})?$"
            }
          },
          "consentMode": {
            "type": "string",
            "enum": [
              "required",
              "implied",
              "none"
            ]
          },
          "excludedPaths": {
            "maxItems": 200,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 300,
              "pattern": "^\\/[^\\s?#]{0,299}$"
            }
          },
          "maskSelectors": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 300
            }
          },
          "ignoreSelectors": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 300
            }
          },
          "stripQueryParams": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100,
              "pattern": "^[A-Za-z0-9_.\\-[\\]]{1,100}$"
            }
          },
          "sessionTimeoutMinutes": {
            "type": "integer",
            "minimum": 5,
            "maximum": 240
          },
          "interactionSampleRate": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "autocapture": {
            "type": "object",
            "properties": {
              "pageviews": {
                "type": "boolean"
              },
              "pageleave": {
                "type": "boolean"
              },
              "clicks": {
                "type": "boolean"
              },
              "rageClicks": {
                "type": "boolean"
              },
              "deadClicks": {
                "type": "boolean"
              },
              "scroll": {
                "type": "boolean"
              },
              "errors": {
                "type": "boolean"
              },
              "forms": {
                "type": "boolean"
              },
              "layout": {
                "type": "boolean"
              },
              "outboundLinks": {
                "type": "boolean"
              },
              "downloads": {
                "type": "boolean"
              },
              "webVitals": {
                "type": "boolean"
              }
            }
          },
          "dataLayerEvents": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        }
      },
      "UpdateTraitRequest": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "string",
              "number",
              "integer",
              "boolean",
              "datetime",
              "money",
              "currency",
              "enum",
              "object",
              "array"
            ]
          },
          "itemType": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "string",
                  "number",
                  "integer",
                  "boolean",
                  "datetime",
                  "money",
                  "currency",
                  "enum",
                  "object",
                  "array"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "required": {
            "type": "boolean"
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1000
              },
              {
                "type": "null"
              }
            ]
          },
          "piiClass": {
            "type": "string",
            "enum": [
              "none",
              "pseudonymous",
              "personal",
              "sensitive"
            ]
          },
          "piiAction": {
            "type": "string",
            "enum": [
              "allow",
              "hash",
              "drop",
              "reject"
            ]
          },
          "enumValues": {
            "anyOf": [
              {
                "maxItems": 500,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "maxLength": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 10000
              },
              {
                "type": "null"
              }
            ]
          },
          "minimum": {
            "type": [
              "number",
              "null"
            ]
          },
          "maximum": {
            "type": [
              "number",
              "null"
            ]
          },
          "example": {},
          "displayNames": {
            "$ref": "#/components/schemas/LocalizedNames"
          }
        }
      },
      "UpsertContactRequest": {
        "type": "object",
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 320
              },
              {
                "type": "null"
              }
            ]
          },
          "phone": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 40
              },
              {
                "type": "null"
              }
            ]
          },
          "mobile": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 40
              },
              {
                "type": "null"
              }
            ]
          },
          "landline": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 40
              },
              {
                "type": "null"
              }
            ]
          },
          "company": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "title": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 120
              },
              {
                "type": "null"
              }
            ]
          },
          "city": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 80
              },
              {
                "type": "null"
              }
            ]
          },
          "district": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 80
              },
              {
                "type": "null"
              }
            ]
          },
          "userId": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "locale": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "tr",
                  "en"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "tags": {
            "maxItems": 30,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 40
            }
          },
          "consents": {
            "type": "object",
            "properties": {
              "email": {
                "$ref": "#/components/schemas/ConsentChange"
              },
              "sms": {
                "$ref": "#/components/schemas/ConsentChange"
              }
            }
          },
          "listIds": {
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          }
        }
      },
      "UpsertContactResult": {
        "type": "object",
        "properties": {
          "contactId": {
            "$ref": "#/components/schemas/Id"
          },
          "created": {
            "type": "boolean"
          },
          "consents": {
            "type": "object",
            "properties": {
              "email": {
                "type": "string",
                "enum": [
                  "none",
                  "merchant",
                  "opt_in",
                  "opt_out"
                ]
              },
              "sms": {
                "type": "string",
                "enum": [
                  "none",
                  "merchant",
                  "opt_in",
                  "opt_out"
                ]
              }
            },
            "required": [
              "email",
              "sms"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "contactId",
          "created",
          "consents"
        ],
        "additionalProperties": false
      }
    },
    "responses": {
      "ValidationFailed": {
        "description": "İstek doğrulanamadı (`VALIDATION_FAILED`). `error.fields` her hatalı alan için isteğin dilinde mesajları taşır; alan yolu noktayla yazılır (`properties.2.enumValues`), gövdenin bütünü için `_`. Okunamayan JSON `INVALID_REQUEST`, bozuk imleç `CURSOR_INVALID` döner.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "error": {
                "code": "VALIDATION_FAILED",
                "message": "Girilen bilgileri kontrol edin.",
                "fields": {
                  "name": [
                    "Ad gerekli."
                  ]
                },
                "traceId": "9b1c4f2e-6a1d-4c55-8f0e-2b7a3d9e5c10"
              }
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Kimlik yok ya da geçersiz: panelde oturum çerezi (`SESSION_REQUIRED`, ikinci adım bekleyen oturumda `TWO_FACTOR_REQUIRED`), Management API'de `Authorization: Bearer mk_…` (`API_KEY_INVALID`: yok, bilinmiyor, iptal edilmiş ya da süresi dolmuş). Giriş uçlarında hatalı bilgiler de 401 döner (`INVALID_CREDENTIALS`, `TOTP_CODE_INVALID`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "error": {
                "code": "API_KEY_INVALID",
                "message": "API anahtarı geçersiz, iptal edilmiş ya da süresi dolmuş.",
                "traceId": "9b1c4f2e-6a1d-4c55-8f0e-2b7a3d9e5c10"
              }
            }
          }
        }
      },
      "Forbidden": {
        "description": "Yetki yok: rol gereken izni vermiyor (`PERMISSION_REQUIRED`, `error.details.permissions`), API anahtarının kapsamı eksik (`API_KEY_SCOPE_MISSING`, `error.details.scopes`) ya da organizasyon askıda (`ORGANIZATION_SUSPENDED`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "error": {
                "code": "API_KEY_SCOPE_MISSING",
                "message": "API anahtarının bu işlem için gereken kapsamı yok.",
                "details": {
                  "scopes": [
                    "management:write"
                  ]
                },
                "traceId": "9b1c4f2e-6a1d-4c55-8f0e-2b7a3d9e5c10"
              }
            }
          }
        }
      },
      "NotFound": {
        "description": "Kayıt bulunamadı ya da çağıranın kapsamında değil; ikisi bilerek ayırt edilmez (ör. `APP_NOT_FOUND`, `EVENT_DEFINITION_NOT_FOUND`). Biçimi geçersiz kimlikler de 404 döner.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "error": {
                "code": "APP_NOT_FOUND",
                "message": "Uygulama bulunamadı veya erişim yetkiniz yok.",
                "traceId": "9b1c4f2e-6a1d-4c55-8f0e-2b7a3d9e5c10"
              }
            }
          }
        }
      },
      "Conflict": {
        "description": "Kaydın güncel durumu bu işleme izin vermiyor ya da aynı kayıt zaten var (ör. `APP_SLUG_TAKEN`, `EVENT_NAME_TAKEN`, `LAST_OWNER`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "error": {
                "code": "EVENT_NAME_TAKEN",
                "message": "\"purchase_completed\" adlı olay zaten tanımlı.",
                "traceId": "9b1c4f2e-6a1d-4c55-8f0e-2b7a3d9e5c10"
              }
            }
          }
        }
      },
      "Gone": {
        "description": "E-postayla gelen bağlantı geçersiz, kullanılmış ya da süresi dolmuş (`LINK_INVALID`, `INVITATION_INVALID`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "error": {
                "code": "LINK_INVALID",
                "message": "Bağlantı geçersiz ya da süresi dolmuş.",
                "traceId": "9b1c4f2e-6a1d-4c55-8f0e-2b7a3d9e5c10"
              }
            }
          }
        }
      },
      "RuleViolation": {
        "description": "İş kuralı ihlali. `error.message` kullanıcıya olduğu gibi gösterilebilir.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "error": {
                "code": "CHECK_VIOLATION",
                "message": "Kayıt kurallara uymuyor.",
                "traceId": "9b1c4f2e-6a1d-4c55-8f0e-2b7a3d9e5c10"
              }
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "Çok fazla istek (`TOO_MANY_REQUESTS`, `Retry-After` başlığıyla) ya da hesap geçici olarak kilitli (`ACCOUNT_LOCKED`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "error": {
                "code": "TOO_MANY_REQUESTS",
                "message": "Çok fazla istek gönderildi. Lütfen 30 saniye sonra tekrar deneyin.",
                "retryAfterSeconds": 30,
                "traceId": "9b1c4f2e-6a1d-4c55-8f0e-2b7a3d9e5c10"
              }
            }
          }
        }
      },
      "InternalError": {
        "description": "Beklenmeyen hata (`INTERNAL_ERROR`). Destek talebinde `error.traceId` iletilir.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "error": {
                "code": "INTERNAL_ERROR",
                "message": "Beklenmeyen bir hata oluştu. Sorun sürerse destek ekibine iz numarasını iletin.",
                "traceId": "9b1c4f2e-6a1d-4c55-8f0e-2b7a3d9e5c10"
              }
            }
          }
        }
      }
    },
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "mk_…",
        "description": "Organizasyonun Management API anahtarı (`mk_` + 40 karakter)."
      }
    }
  }
}
