Lydira API
TR

API reference

Tasks

6 endpoints

The advisor to-do list. Tasks may hang off a Trip, a Lead, a Customer or any other linkable record through taskable_type + taskable_id; taskable_label resolves that pair to something readable so a client need not fetch the target to render a row.

Completion is its own verb (complete / reopen) and stamps who closed it.

List tasks

GET/api/v1/tasks

Needs a key with the full scope.

Soonest due first. With no scope the list is the pending set, which is usually what a worklist wants; ask for completed explicitly.

Parameters

Query

  • qstring

    Matches subject or body.

  • scopeenum

    Defaults to pending when omitted.

    one ofmineoverduedue_todayupcomingcompleted

  • prioritystring
  • assigned_to_iduuid
  • limitintegerdefault 25

    Rows per page.

  • cursorstring

    Opaque; take it from the previous response's page.next_cursor.

Response · 200

  • dataobject[]required
    Show fields
    • iduuid
    • subjectstring
    • prioritystringnullable
    • due_atdate-timenullable
    • completed_atdate-timenullable
    • overdueboolean
    • taskable_typestringnullable
    • taskable_iduuidnullable
    • taskable_labelstringnullable

      The linked record rendered as text, so a row needs no second fetch.

    • assigned_toobjectnullable

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

      Show fields
      • iduuid
      • namestringnullable
      • emailstringnullable
  • pageobjectrequired

    The cursor for the list beside it. Re-send the same request with ?cursor=<next_cursor> while has_more is true. next_cursor is null on the last page.

    Show fields
    • next_cursorstringrequirednullable
    • has_morebooleanrequired
    • limitintegerrequired

Responses

  • 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/tasks' \
  -H 'Authorization: Bearer sek_YOUR_API_KEY'
Response
200
{
  "data": [
    {
      "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
      "subject": "Confirm the hotel allocation",
      "priority": "high",
      "due_at": "2026-03-14T09:30:00Z",
      "completed_at": "2026-03-14T09:30:00Z",
      "overdue": true,
      "taskable_type": "Trip",
      "taskable_id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
      "taskable_label": "string",
      "assigned_to": {
        "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
        "name": "Ayşe Yılmaz",
        "email": "ayse@example.com"
      }
    }
  ],
  "page": {
    "next_cursor": "MjAyNi0wMy0xNFQwOTozMDowMC4wMDAwMDBafDk0MQ",
    "has_more": true,
    "limit": 25
  }
}

Create a task

POST/api/v1/tasks

Needs a key with the full scope.

taskable_type + taskable_id attach the task to a record. Pass them together or not at all.

reminder_offsets is a list of minutes before due_at. Reminders only fire on a task that has both a due_at and an assignee.

Parameters

Headers

  • Idempotency-Keystring

    Your own unique string for this write (a UUID is the obvious choice), max 255 characters. Optional: omit it and nothing changes. Send it and a repeat of the same request returns this call's response verbatim, with Idempotent-Replay: true, instead of writing again.

Body

  • taskobjectrequired
    Show fields
    • subjectstring
    • bodystring
    • prioritystring
    • due_atdate-time
    • assigned_to_iduuid
    • taskable_typestring
    • taskable_iduuid
    • reminder_offsetsinteger[]

Response · 201

  • dataobject
    Show fields
    • iduuid
    • subjectstring
    • prioritystringnullable
    • due_atdate-timenullable
    • completed_atdate-timenullable
    • overdueboolean
    • taskable_typestringnullable
    • taskable_iduuidnullable
    • taskable_labelstringnullable

      The linked record rendered as text, so a row needs no second fetch.

    • assigned_toobjectnullable

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

      Show fields
      • iduuid
      • namestringnullable
      • emailstringnullable
    • bodystringnullable
    • reminder_offsetsinteger[]

      Minutes before due_at.

    • ownerobjectnullable

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

      Show fields
      • iduuid
      • namestringnullable
      • emailstringnullable
    • completed_byobjectnullable

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

      Show fields
      • iduuid
      • namestringnullable
      • emailstringnullable
    • created_atdate-time
    • updated_atdate-time

Responses

  • 401Missing or invalid Bearer token
  • 403Policy denied or account has no owner
  • 422The request was understood but the record could not be written. details maps each rejected attribute to its reasons, so a client can put the message next to the field that caused it.
  • 429Rate limit exceeded
curl -X POST 'https://YOUR-CELL.lydira.com/api/v1/tasks' \
  -H 'Authorization: Bearer sek_YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: 8f14e45f-ea2c-4f33-9a3b-6d0c1b7e5a90' \
  -d '{
  "task": {
    "subject": "Confirm the hotel allocation",
    "body": "Guest asked for a late checkout.",
    "priority": "high",
    "due_at": "2026-03-14T09:30:00Z",
    "assigned_to_id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
    "taskable_type": "Trip"
  }
}'
Response
201
{
  "data": {
    "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
    "subject": "Confirm the hotel allocation",
    "priority": "high",
    "due_at": "2026-03-14T09:30:00Z",
    "completed_at": "2026-03-14T09:30:00Z",
    "overdue": true,
    "taskable_type": "Trip",
    "taskable_id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
    "taskable_label": "string",
    "assigned_to": {
      "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
      "name": "Ayşe Yılmaz",
      "email": "ayse@example.com"
    },
    "body": "Guest asked for a late checkout.",
    "reminder_offsets": [
      1
    ],
    "owner": {
      "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
      "name": "Ayşe Yılmaz",
      "email": "ayse@example.com"
    },
    "completed_by": {
      "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
      "name": "Ayşe Yılmaz",
      "email": "ayse@example.com"
    },
    "created_at": "2026-03-14T09:30:00Z",
    "updated_at": "2026-03-14T09:30:00Z"
  }
}

Read a task

GET/api/v1/tasks/{id}

Needs a key with the full scope.

Parameters

Path

  • iduuidrequired

Response · 200

  • dataobject
    Show fields
    • iduuid
    • subjectstring
    • prioritystringnullable
    • due_atdate-timenullable
    • completed_atdate-timenullable
    • overdueboolean
    • taskable_typestringnullable
    • taskable_iduuidnullable
    • taskable_labelstringnullable

      The linked record rendered as text, so a row needs no second fetch.

    • assigned_toobjectnullable

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

      Show fields
      • iduuid
      • namestringnullable
      • emailstringnullable
    • bodystringnullable
    • reminder_offsetsinteger[]

      Minutes before due_at.

    • ownerobjectnullable

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

      Show fields
      • iduuid
      • namestringnullable
      • emailstringnullable
    • completed_byobjectnullable

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

      Show fields
      • iduuid
      • namestringnullable
      • emailstringnullable
    • created_atdate-time
    • updated_atdate-time

Responses

  • 401Missing or invalid Bearer token
  • 403Policy denied or account has no owner
  • 404Resource not found
  • 429Rate limit exceeded
curl -X GET 'https://YOUR-CELL.lydira.com/api/v1/tasks/9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18' \
  -H 'Authorization: Bearer sek_YOUR_API_KEY'
Response
200
{
  "data": {
    "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
    "subject": "Confirm the hotel allocation",
    "priority": "high",
    "due_at": "2026-03-14T09:30:00Z",
    "completed_at": "2026-03-14T09:30:00Z",
    "overdue": true,
    "taskable_type": "Trip",
    "taskable_id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
    "taskable_label": "string",
    "assigned_to": {
      "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
      "name": "Ayşe Yılmaz",
      "email": "ayse@example.com"
    },
    "body": "Guest asked for a late checkout.",
    "reminder_offsets": [
      1
    ],
    "owner": {
      "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
      "name": "Ayşe Yılmaz",
      "email": "ayse@example.com"
    },
    "completed_by": {
      "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
      "name": "Ayşe Yılmaz",
      "email": "ayse@example.com"
    },
    "created_at": "2026-03-14T09:30:00Z",
    "updated_at": "2026-03-14T09:30:00Z"
  }
}

Update a task

PATCH/api/v1/tasks/{id}

Needs a key with the full scope.

Partial; PUT is routed to the same action. Completion has its own endpoints.

Parameters

Path

  • iduuidrequired

Headers

  • Idempotency-Keystring

    Your own unique string for this write (a UUID is the obvious choice), max 255 characters. Optional: omit it and nothing changes. Send it and a repeat of the same request returns this call's response verbatim, with Idempotent-Replay: true, instead of writing again.

Body

  • taskobjectrequired
    Show fields
    • subjectstring
    • bodystring
    • prioritystring
    • due_atdate-time
    • assigned_to_iduuid
    • taskable_typestring
    • taskable_iduuid
    • reminder_offsetsinteger[]

Response · 200

  • dataobject
    Show fields
    • iduuid
    • subjectstring
    • prioritystringnullable
    • due_atdate-timenullable
    • completed_atdate-timenullable
    • overdueboolean
    • taskable_typestringnullable
    • taskable_iduuidnullable
    • taskable_labelstringnullable

      The linked record rendered as text, so a row needs no second fetch.

    • assigned_toobjectnullable

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

      Show fields
      • iduuid
      • namestringnullable
      • emailstringnullable
    • bodystringnullable
    • reminder_offsetsinteger[]

      Minutes before due_at.

    • ownerobjectnullable

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

      Show fields
      • iduuid
      • namestringnullable
      • emailstringnullable
    • completed_byobjectnullable

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

      Show fields
      • iduuid
      • namestringnullable
      • emailstringnullable
    • created_atdate-time
    • updated_atdate-time

Responses

  • 401Missing or invalid Bearer token
  • 403Policy denied or account has no owner
  • 404Resource not found
  • 422The request was understood but the record could not be written. details maps each rejected attribute to its reasons, so a client can put the message next to the field that caused it.
  • 429Rate limit exceeded
curl -X PATCH 'https://YOUR-CELL.lydira.com/api/v1/tasks/9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18' \
  -H 'Authorization: Bearer sek_YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: 8f14e45f-ea2c-4f33-9a3b-6d0c1b7e5a90' \
  -d '{
  "task": {
    "subject": "Confirm the hotel allocation",
    "body": "Guest asked for a late checkout.",
    "priority": "high",
    "due_at": "2026-03-14T09:30:00Z",
    "assigned_to_id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
    "taskable_type": "Trip"
  }
}'
Response
200
{
  "data": {
    "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
    "subject": "Confirm the hotel allocation",
    "priority": "high",
    "due_at": "2026-03-14T09:30:00Z",
    "completed_at": "2026-03-14T09:30:00Z",
    "overdue": true,
    "taskable_type": "Trip",
    "taskable_id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
    "taskable_label": "string",
    "assigned_to": {
      "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
      "name": "Ayşe Yılmaz",
      "email": "ayse@example.com"
    },
    "body": "Guest asked for a late checkout.",
    "reminder_offsets": [
      1
    ],
    "owner": {
      "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
      "name": "Ayşe Yılmaz",
      "email": "ayse@example.com"
    },
    "completed_by": {
      "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
      "name": "Ayşe Yılmaz",
      "email": "ayse@example.com"
    },
    "created_at": "2026-03-14T09:30:00Z",
    "updated_at": "2026-03-14T09:30:00Z"
  }
}

Complete a task

PATCH/api/v1/tasks/{id}/complete

Needs a key with the full scope.

Stamps completed_at and completed_by. Completing a completed task is harmless.

Parameters

Path

  • iduuidrequired

Headers

  • Idempotency-Keystring

    Your own unique string for this write (a UUID is the obvious choice), max 255 characters. Optional: omit it and nothing changes. Send it and a repeat of the same request returns this call's response verbatim, with Idempotent-Replay: true, instead of writing again.

Response · 200

  • dataobject
    Show fields
    • iduuid
    • subjectstring
    • prioritystringnullable
    • due_atdate-timenullable
    • completed_atdate-timenullable
    • overdueboolean
    • taskable_typestringnullable
    • taskable_iduuidnullable
    • taskable_labelstringnullable

      The linked record rendered as text, so a row needs no second fetch.

    • assigned_toobjectnullable

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

      Show fields
      • iduuid
      • namestringnullable
      • emailstringnullable
    • bodystringnullable
    • reminder_offsetsinteger[]

      Minutes before due_at.

    • ownerobjectnullable

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

      Show fields
      • iduuid
      • namestringnullable
      • emailstringnullable
    • completed_byobjectnullable

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

      Show fields
      • iduuid
      • namestringnullable
      • emailstringnullable
    • created_atdate-time
    • updated_atdate-time

Responses

  • 401Missing or invalid Bearer token
  • 403Policy denied or account has no owner
  • 404Resource not found
  • 429Rate limit exceeded
curl -X PATCH 'https://YOUR-CELL.lydira.com/api/v1/tasks/9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18/complete' \
  -H 'Authorization: Bearer sek_YOUR_API_KEY' \
  -H 'Idempotency-Key: 8f14e45f-ea2c-4f33-9a3b-6d0c1b7e5a90'
Response
200
{
  "data": {
    "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
    "subject": "Confirm the hotel allocation",
    "priority": "high",
    "due_at": "2026-03-14T09:30:00Z",
    "completed_at": "2026-03-14T09:30:00Z",
    "overdue": true,
    "taskable_type": "Trip",
    "taskable_id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
    "taskable_label": "string",
    "assigned_to": {
      "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
      "name": "Ayşe Yılmaz",
      "email": "ayse@example.com"
    },
    "body": "Guest asked for a late checkout.",
    "reminder_offsets": [
      1
    ],
    "owner": {
      "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
      "name": "Ayşe Yılmaz",
      "email": "ayse@example.com"
    },
    "completed_by": {
      "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
      "name": "Ayşe Yılmaz",
      "email": "ayse@example.com"
    },
    "created_at": "2026-03-14T09:30:00Z",
    "updated_at": "2026-03-14T09:30:00Z"
  }
}

Reopen a task

PATCH/api/v1/tasks/{id}/reopen

Needs a key with the full scope.

Clears the completion stamp and puts the task back in the pending set.

Parameters

Path

  • iduuidrequired

Headers

  • Idempotency-Keystring

    Your own unique string for this write (a UUID is the obvious choice), max 255 characters. Optional: omit it and nothing changes. Send it and a repeat of the same request returns this call's response verbatim, with Idempotent-Replay: true, instead of writing again.

Response · 200

  • dataobject
    Show fields
    • iduuid
    • subjectstring
    • prioritystringnullable
    • due_atdate-timenullable
    • completed_atdate-timenullable
    • overdueboolean
    • taskable_typestringnullable
    • taskable_iduuidnullable
    • taskable_labelstringnullable

      The linked record rendered as text, so a row needs no second fetch.

    • assigned_toobjectnullable

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

      Show fields
      • iduuid
      • namestringnullable
      • emailstringnullable
    • bodystringnullable
    • reminder_offsetsinteger[]

      Minutes before due_at.

    • ownerobjectnullable

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

      Show fields
      • iduuid
      • namestringnullable
      • emailstringnullable
    • completed_byobjectnullable

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

      Show fields
      • iduuid
      • namestringnullable
      • emailstringnullable
    • created_atdate-time
    • updated_atdate-time

Responses

  • 401Missing or invalid Bearer token
  • 403Policy denied or account has no owner
  • 404Resource not found
  • 429Rate limit exceeded
curl -X PATCH 'https://YOUR-CELL.lydira.com/api/v1/tasks/9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18/reopen' \
  -H 'Authorization: Bearer sek_YOUR_API_KEY' \
  -H 'Idempotency-Key: 8f14e45f-ea2c-4f33-9a3b-6d0c1b7e5a90'
Response
200
{
  "data": {
    "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
    "subject": "Confirm the hotel allocation",
    "priority": "high",
    "due_at": "2026-03-14T09:30:00Z",
    "completed_at": "2026-03-14T09:30:00Z",
    "overdue": true,
    "taskable_type": "Trip",
    "taskable_id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
    "taskable_label": "string",
    "assigned_to": {
      "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
      "name": "Ayşe Yılmaz",
      "email": "ayse@example.com"
    },
    "body": "Guest asked for a late checkout.",
    "reminder_offsets": [
      1
    ],
    "owner": {
      "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
      "name": "Ayşe Yılmaz",
      "email": "ayse@example.com"
    },
    "completed_by": {
      "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
      "name": "Ayşe Yılmaz",
      "email": "ayse@example.com"
    },
    "created_at": "2026-03-14T09:30:00Z",
    "updated_at": "2026-03-14T09:30:00Z"
  }
}