Lydira API
EN

API referansı

Insights

2 uç nokta

Two computed dashboards, each a single call with no pagination. GET /api/v1/performance is post-trip quality: NPS, survey response rate, per-advisor breakdown, top suppliers and recent detractors over a window. GET /api/v1/retention is the forward view: anniversaries coming up, trips due a rebooking nudge, recent outreach and the referral codes that actually convert.

Both are computed fresh on every call rather than served from a cache, so treat them as a periodic pull, not a per-request lookup.

Post-trip quality snapshot

GET/api/v1/performance

full kapsamlı bir anahtar ister.

Survey outcomes over a trailing window: how many invitations went out, how many were answered, the NPS that came back, the average segment rating, a per-advisor breakdown, the suppliers that scored best and the detractors worth calling.

Computed fresh on each call. Leave advisor_id off for the whole account.

Parametreler

Sorgu

  • window_daysenumvarsayılan 90

    Anything outside the allowed set falls back to 90.

    şunlardan biri306090180365

  • advisor_iduuid

Yanıt · 200

  • dataobject
    Alanları göster
    • window_daysinteger

      The window actually used, after the allowlist.

    • advisorobjectnull olabilir

      Null when the snapshot covers the whole account.

      Alanları göster
      • iduuid
      • namestringnull olabilir
      • emailstringnull olabilir
    • invitedinteger

      Survey invitations sent in the window.

    • startedinteger
    • completedinteger
    • response_ratenumbernull olabilir

      Completed over invited, 0 to 1.

    • npsnumbernull olabilir

      Net promoter score, -100 to 100.

    • avg_segment_ratingnumbernull olabilir
    • per_advisorobject[]

      The same figures broken out per advisor.

    • top_suppliersobject[]
    • detractorsobject[]

      Recent low scorers, worth a call.

    • complimentaryobjectnull olabilir

      Goodwill and complimentary service figures for the window.

Yanıtlar

  • 401Missing or invalid Bearer token
  • 403Policy denied or account has no owner
  • 429Rate limit exceeded
curl -X GET 'https://YOUR-CELL.lydira.com/api/v1/performance' \
  -H 'Authorization: Bearer sek_YOUR_API_KEY'
Yanıt
200
{
  "data": {
    "window_days": 90,
    "advisor": {
      "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
      "name": "Ayşe Yılmaz",
      "email": "ayse@example.com"
    },
    "invited": 1,
    "started": 1,
    "completed": 1,
    "response_rate": 1,
    "nps": 1,
    "avg_segment_rating": 1,
    "per_advisor": [
      {}
    ],
    "top_suppliers": [
      {}
    ],
    "detractors": [
      {}
    ],
    "complimentary": {}
  }
}

Rebooking opportunities

GET/api/v1/retention

full kapsamlı bir anahtar ister.

The forward view on past customers: trips hitting their one-year anniversary inside the window, trips that ended about six months ago and are due a nudge, the outreach already sent, and the referral codes pulling their weight.

Each list is capped (50 anniversaries, 50 rebooks, 20 touches, 10 referral codes) and there is no cursor: widen or narrow with window_days.

Parametreler

Sorgu

  • window_daysintegervarsayılan 60

    Clamped to 7-365.

Yanıt · 200

  • dataobject
    Alanları göster
    • window_daysinteger
    • upcomingobject[]

      Completed trips reaching their one-year anniversary inside the window. Capped at 50.

      Alanları göster
      • trip_iduuid
      • trip_titlestring
      • anniversarydate
      • customerobjectnull olabilir
        Alanları göster
        • iduuid
        • namestringnull olabilir
      • advisorobjectnull olabilir

        A seat on the account, as referenced from other records.

        Alanları göster
        • iduuid
        • namestringnull olabilir
        • emailstringnull olabilir
    • overdue_rebooksobject[]

      Trips that ended about six months ago. Capped at 50.

      Alanları göster
      • trip_iduuid
      • trip_titlestring
      • end_datedatenull olabilir
      • customerobjectnull olabilir
        Alanları göster
        • iduuid
        • namestringnull olabilir
      • advisorobjectnull olabilir

        A seat on the account, as referenced from other records.

        Alanları göster
        • iduuid
        • namestringnull olabilir
        • emailstringnull olabilir
    • recent_touchesobject[]

      Outreach already sent, newest first. Capped at 20.

      Alanları göster
      • iduuid
      • kindstring
      • statusstring
      • sent_atdate-timenull olabilir
      • customerobjectnull olabilir
        Alanları göster
        • iduuid
        • namestringnull olabilir
      • tripobjectnull olabilir
        Alanları göster
        • iduuid
        • titlestring
    • top_referralsobject[]

      Active referral codes by conversions. Capped at 10.

      Alanları göster
      • iduuid
      • tokenstring
      • labelstringnull olabilir
      • visitsinteger
      • conversionsinteger
      • customerobjectnull olabilir
        Alanları göster
        • iduuid
        • namestringnull olabilir
      • tripobjectnull olabilir
        Alanları göster
        • iduuid
        • titlestring

Yanıtlar

  • 401Missing or invalid Bearer token
  • 403Policy denied or account has no owner
  • 429Rate limit exceeded
curl -X GET 'https://YOUR-CELL.lydira.com/api/v1/retention' \
  -H 'Authorization: Bearer sek_YOUR_API_KEY'
Yanıt
200
{
  "data": {
    "window_days": 90,
    "upcoming": [
      {
        "trip_id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
        "trip_title": "string",
        "anniversary": "2026-03-14",
        "customer": {
          "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
          "name": "Ayşe Yılmaz"
        },
        "advisor": {
          "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
          "name": "Ayşe Yılmaz",
          "email": "ayse@example.com"
        }
      }
    ],
    "overdue_rebooks": [
      {
        "trip_id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
        "trip_title": "string",
        "end_date": "2026-03-14",
        "customer": {
          "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
          "name": "Ayşe Yılmaz"
        },
        "advisor": {
          "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
          "name": "Ayşe Yılmaz",
          "email": "ayse@example.com"
        }
      }
    ],
    "recent_touches": [
      {
        "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
        "kind": "anniversary",
        "status": "confirmed",
        "sent_at": "2026-03-14T09:30:00Z",
        "customer": {
          "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
          "name": "Ayşe Yılmaz"
        },
        "trip": {
          "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
          "title": "Cappadocia, 4 nights"
        }
      }
    ],
    "top_referrals": [
      {
        "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
        "token": "0b9a4d182c0f6b9a",
        "label": "Spring campaign",
        "visits": 1,
        "conversions": 1,
        "customer": {
          "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
          "name": "Ayşe Yılmaz"
        },
        "trip": {
          "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
          "title": "Cappadocia, 4 nights"
        }
      }
    ]
  }
}