Lydira API
EN

API referansı

Account

2 uç nokta

Who the key is, and the ids every other call needs. GET /api/v1/me resolves the account, the companies and branches the key can reach, and the plan features that decide which endpoints answer at all; a key runs as the account owner unless the agency bound it to a role, in which case that role's permission set applies and masked fields come back null.

GET /api/v1/users is the seat directory, which is where an assigned_to_id comes from.

Who this key is

GET/api/v1/me

full kapsamlı bir anahtar ister.

The call to make first. It resolves the account behind the key, the companies and branches it can file against, the permissions it acts with and the plan features that decide which other endpoints answer.

One of the few responses with no data envelope: the object is the payload.

Yanıt · 200

  • userobject
    Alanları göster
    • iduuid
    • namestringnull olabilir
    • emailstring
    • rolestring
    • localestring
    • ai_response_localestringnull olabilir
    • verifiedboolean
  • accountobject
    Alanları göster
    • iduuid
    • external_account_idinteger

      The number that appears in browser URLs for this account.

    • namestring
  • current_branchobjectnull olabilir

    Always null for an API key: a key belongs to the account, not to a desk. Name a branch per call instead.

    Alanları göster
    • iduuid
    • namestring
    • codestringnull olabilir
    • is_headquartersboolean
    • company_iduuid
    • company_namestringnull olabilir
  • companiesobject[]

    Every company the principal can reach, default first, each with its branches.

    Alanları göster
    • iduuid
    • namestring
    • company_typestringnull olabilir
    • is_defaultboolean
    • activeboolean
    • branchesobject[]
      Alanları göster
      • iduuid
      • namestring
      • codestringnull olabilir
      • is_headquartersboolean
      • activeboolean
  • policiesobject

    What the principal may do, as booleans.

  • featuresobject

    Plan features, as booleans. api_access is the one that decides whether a key works at all: false here means every authenticated call answers 403 plan_upgrade_required.

  • billingobjectnull olabilir
    Alanları göster
    • statusstring
    • plan_slugstringnull olabilir
    • plan_namestringnull olabilir
    • trialingboolean
    • activeboolean
    • trial_ends_atdate-timenull olabilir
    • cancel_at_period_endboolean
  • server_timedate-time

    Useful for checking clock drift before you sign or schedule anything.

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/me' \
  -H 'Authorization: Bearer sek_YOUR_API_KEY'
Yanıt
200
{
  "user": {
    "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
    "name": "Ayşe Yılmaz",
    "email": "ayse@example.com",
    "role": "owner",
    "locale": "tr",
    "ai_response_locale": "string",
    "verified": true
  },
  "account": {
    "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
    "external_account_id": 1000001,
    "name": "Ayşe Yılmaz"
  },
  "current_branch": {
    "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
    "name": "Ayşe Yılmaz",
    "code": "CUST-0042",
    "is_headquarters": true,
    "company_id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
    "company_name": "Ayşe Yılmaz"
  },
  "companies": [
    {
      "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
      "name": "Ayşe Yılmaz",
      "company_type": "agency",
      "is_default": true,
      "active": true,
      "branches": [
        {
          "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
          "name": "Ayşe Yılmaz",
          "code": "CUST-0042",
          "is_headquarters": true,
          "active": true
        }
      ]
    }
  ],
  "policies": {},
  "features": {},
  "billing": {
    "status": "active",
    "plan_slug": "studio",
    "plan_name": "Studio",
    "trialing": true,
    "active": true,
    "trial_ends_at": "2026-03-14T09:30:00Z",
    "cancel_at_period_end": true
  },
  "server_time": "2026-03-14T09:30:00Z"
}

Seat directory

GET/api/v1/users

full kapsamlı bir anahtar ister.

Everyone who can be assigned work on this account, ordered by name. Bounded at 50 rows and not cursored: this is a picker source, so narrow it with ?q= rather than paging it.

Parametreler

Sorgu

  • qstring

    Case-insensitive match on name or email.

Yanıt · 200

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

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/users' \
  -H 'Authorization: Bearer sek_YOUR_API_KEY'
Yanıt
200
{
  "data": [
    {
      "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
      "name": "Ayşe Yılmaz",
      "email": "ayse@example.com"
    }
  ]
}