> ## Documentation Index
> Fetch the complete documentation index at: https://docs.olira.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Engagement

> Product and care engagement signals: check-ins, sessions, and interactions. 7 log types with payload schemas and examples.

Product and care engagement signals: check-ins, sessions, and interactions. Submit these via `POST /v1/logs/batch` or the [Python SDK](/reference/sdk); see [How logs work](/send-data/how-logs-work) for submission fields and the difference between **lifecycle-tracked** and point-in-time log types.

## User login

**Type:** `user_login` · **Source:** Python SDK / REST · **Extensible**

Reserved for login events: app login; optional metadata.

**Payload**

<ResponseField name="extensions" type="object">
  Open key/value bag for client/source-specific fields that lack a typed slot; merged into the entry's extensions (leaf-level, last-writer-wins by event timestamp).
</ResponseField>

**Example**

<CodeGroup>
  ```python Python theme={null}
  import olira
  from olira import OliraLogType

  olira.log(
      log_type=OliraLogType.USER_LOGIN,
      patient_id="your-patient-id",
      payload={},
  )
  ```

  ```http HTTP theme={null}
  POST /v1/logs/batch
  Authorization: Bearer YOUR_API_KEY
  Content-Type: application/json

  {
    "logs": [
      {
        "log_type": "user_login",
        "patient_id": "8a4fde23-0f1b-4c2a-9d7e-b36c1a5f0e82",
        "timestamp": "2026-03-18T09:00:00Z",
        "payload": {}
      }
    ]
  }
  ```
</CodeGroup>

<Note>
  **Related types:** Use [`user_logout`](/reference/log-types/engagement#user-logout) for logout, [`content_interaction`](/reference/log-types/engagement#content-interaction) or [`feature_usage`](/reference/log-types/engagement#feature-usage) for content or feature interaction, [`task_outcome`](/reference/log-types/engagement#task-outcome) for task completion.
</Note>

## User logout

**Type:** `user_logout` · **Source:** Python SDK / REST · **Extensible**

Reserved for logout events: app logout; optional metadata.

**Payload**

<ResponseField name="extensions" type="object">
  Open key/value bag for client/source-specific fields that lack a typed slot; merged into the entry's extensions (leaf-level, last-writer-wins by event timestamp).
</ResponseField>

**Example**

<CodeGroup>
  ```python Python theme={null}
  import olira
  from olira import OliraLogType

  olira.log(
      log_type=OliraLogType.USER_LOGOUT,
      patient_id="your-patient-id",
      payload={},
  )
  ```

  ```http HTTP theme={null}
  POST /v1/logs/batch
  Authorization: Bearer YOUR_API_KEY
  Content-Type: application/json

  {
    "logs": [
      {
        "log_type": "user_logout",
        "patient_id": "8a4fde23-0f1b-4c2a-9d7e-b36c1a5f0e82",
        "timestamp": "2026-03-18T09:00:00Z",
        "payload": {}
      }
    ]
  }
  ```
</CodeGroup>

<Note>
  **Related types:** Use [`user_login`](/reference/log-types/engagement#user-login) for login. Not intended for other engagement (content\_interaction, task\_outcome, etc.).
</Note>

## Content interaction

**Type:** `content_interaction` · **Source:** Python SDK / REST · **Extensible**

Reserved for user actions on content (view, bookmark, dismiss, etc.): content\_type + action (viewed, bookmarked, dismissed, completed, shared, clicked); content\_id, dwell\_time\_seconds optional.

**Payload**

<ResponseField name="content_type" type="string" required>
  Client-defined (e.g. card, article, video, recipe).. Example: `card`, `article`, `video`
</ResponseField>

<ResponseField name="action" type="string" required>
  User action on the content item.. One of: `viewed`, `bookmarked`, `dismissed`, `completed`, `shared`, `clicked`
</ResponseField>

<ResponseField name="content_id" type="string">
  Identifier of the content item.
</ResponseField>

<ResponseField name="title" type="string">
  Display title of the content item.
</ResponseField>

<ResponseField name="preview" type="string">
  Short preview or excerpt shown to the user.
</ResponseField>

<ResponseField name="dwell_time_seconds" type="integer">
  Time spent viewing. Populated for viewed actions.
</ResponseField>

<ResponseField name="reason" type="string">
  Reason for the action. Relevant for dismissed actions.
</ResponseField>

<ResponseField name="extensions" type="object">
  Open key/value bag for client/source-specific fields that lack a typed slot; merged into the entry's extensions (leaf-level, last-writer-wins by event timestamp).
</ResponseField>

**Example**

<CodeGroup>
  ```python Python theme={null}
  import olira
  from olira import OliraLogType

  olira.log(
      log_type=OliraLogType.CONTENT_INTERACTION,
      patient_id="your-patient-id",
      payload={
          "content_type": "card",
          "action": "viewed"
      },
  )
  ```

  ```http HTTP theme={null}
  POST /v1/logs/batch
  Authorization: Bearer YOUR_API_KEY
  Content-Type: application/json

  {
    "logs": [
      {
        "log_type": "content_interaction",
        "patient_id": "8a4fde23-0f1b-4c2a-9d7e-b36c1a5f0e82",
        "timestamp": "2026-03-18T09:00:00Z",
        "payload": {
          "content_type": "card",
          "action": "viewed"
      }
      }
    ]
  }
  ```
</CodeGroup>

<Note>
  **Related types:** Use [`notification_interaction`](/reference/log-types/engagement#notification-interaction) for notification interaction, [`task_outcome`](/reference/log-types/engagement#task-outcome) for task completion, [`feature_usage`](/reference/log-types/engagement#feature-usage) for feature use.
</Note>

## Notification interaction

**Type:** `notification_interaction` · **Source:** Python SDK / REST · **Extensible**

Reserved for push notification interactions: notification\_type + action (opened, dismissed, snoozed); delivered\_at, time\_to\_open\_seconds optional.

**Payload**

<ResponseField name="notification_type" type="string" required>
  Client-defined (e.g. medication\_reminder, symptom\_checkin, lab\_result).. Example: `medication_reminder`, `symptom_checkin`, `lab_result`
</ResponseField>

<ResponseField name="action" type="string" required>
  How the user interacted with the notification.. One of: `opened`, `dismissed`, `snoozed`
</ResponseField>

<ResponseField name="delivered_at" type="string">
  ISO 8601 UTC datetime when the notification was delivered.
</ResponseField>

<ResponseField name="time_to_open_seconds" type="integer">
  Seconds between delivery and opening. Populated for opened actions.
</ResponseField>

<ResponseField name="extensions" type="object">
  Open key/value bag for client/source-specific fields that lack a typed slot; merged into the entry's extensions (leaf-level, last-writer-wins by event timestamp).
</ResponseField>

**Example**

<CodeGroup>
  ```python Python theme={null}
  import olira
  from olira import OliraLogType

  olira.log(
      log_type=OliraLogType.NOTIFICATION_INTERACTION,
      patient_id="your-patient-id",
      payload={
          "notification_type": "medication_reminder",
          "action": "opened"
      },
  )
  ```

  ```http HTTP theme={null}
  POST /v1/logs/batch
  Authorization: Bearer YOUR_API_KEY
  Content-Type: application/json

  {
    "logs": [
      {
        "log_type": "notification_interaction",
        "patient_id": "8a4fde23-0f1b-4c2a-9d7e-b36c1a5f0e82",
        "timestamp": "2026-03-18T09:00:00Z",
        "payload": {
          "notification_type": "medication_reminder",
          "action": "opened"
      }
      }
    ]
  }
  ```
</CodeGroup>

<Note>
  **Related types:** Use [`content_interaction`](/reference/log-types/engagement#content-interaction) for content interaction, [`task_outcome`](/reference/log-types/engagement#task-outcome) for task, [`interaction_feedback`](/reference/log-types/engagement#interaction-feedback) for in-app message feedback.
</Note>

## Task outcome

**Type:** `task_outcome` · **Source:** Python SDK / REST · **Extensible**

Reserved for completion or skip of a discrete task or flow: task\_type + action (completed/skipped); task\_id, task\_description, completion\_time\_seconds optional.

**Payload**

<ResponseField name="task_type" type="string" required>
  Client-defined (e.g. checkin, questionnaire, onboarding\_step, medication\_log).. Example: `checkin`, `questionnaire`, `onboarding_step`
</ResponseField>

<ResponseField name="action" type="string" required>
  Whether the task was completed or skipped.. One of: `completed`, `skipped`
</ResponseField>

<ResponseField name="task_id" type="string">
  Reference to the specific task instance.
</ResponseField>

<ResponseField name="task_description" type="string">
  Human-readable description of the task.
</ResponseField>

<ResponseField name="completion_time_seconds" type="integer">
  Time taken to complete the task in seconds.
</ResponseField>

<ResponseField name="extensions" type="object">
  Open key/value bag for client/source-specific fields that lack a typed slot; merged into the entry's extensions (leaf-level, last-writer-wins by event timestamp).
</ResponseField>

**Example**

<CodeGroup>
  ```python Python theme={null}
  import olira
  from olira import OliraLogType

  olira.log(
      log_type=OliraLogType.TASK_OUTCOME,
      patient_id="your-patient-id",
      payload={
          "task_type": "checkin",
          "action": "completed"
      },
  )
  ```

  ```http HTTP theme={null}
  POST /v1/logs/batch
  Authorization: Bearer YOUR_API_KEY
  Content-Type: application/json

  {
    "logs": [
      {
        "log_type": "task_outcome",
        "patient_id": "8a4fde23-0f1b-4c2a-9d7e-b36c1a5f0e82",
        "timestamp": "2026-03-18T09:00:00Z",
        "payload": {
          "task_type": "checkin",
          "action": "completed"
      }
      }
    ]
  }
  ```
</CodeGroup>

<Note>
  **Related types:** Use [`questionnaire_response`](/reference/log-types/questionnaires#questionnaire-response) for questionnaire response content, [`content_interaction`](/reference/log-types/engagement#content-interaction) for content view, [`feature_usage`](/reference/log-types/engagement#feature-usage) for feature use.
</Note>

## Interaction feedback

**Type:** `interaction_feedback` · **Source:** Python SDK / REST · **Extensible**

Reserved for explicit user feedback on a system-generated item: target\_type (e.g. message, content) + feedback\_type (e.g. thumbs\_up, flagged); target\_id optional.

**Payload**

<ResponseField name="target_type" type="string" required>
  e.g. message, content or client-defined.. Example: `message`, `content`
</ResponseField>

<ResponseField name="target_id" type="string">
  Identifier of the item that received feedback.
</ResponseField>

<ResponseField name="feedback_type" type="string" required>
  e.g. thumbs\_up, thumbs\_down, bookmarked, flagged.. Example: `thumbs_up`, `thumbs_down`, `flagged`
</ResponseField>

<ResponseField name="extensions" type="object">
  Open key/value bag for client/source-specific fields that lack a typed slot; merged into the entry's extensions (leaf-level, last-writer-wins by event timestamp).
</ResponseField>

**Example**

<CodeGroup>
  ```python Python theme={null}
  import olira
  from olira import OliraLogType

  olira.log(
      log_type=OliraLogType.INTERACTION_FEEDBACK,
      patient_id="your-patient-id",
      payload={
          "target_type": "message",
          "feedback_type": "thumbs_up"
      },
  )
  ```

  ```http HTTP theme={null}
  POST /v1/logs/batch
  Authorization: Bearer YOUR_API_KEY
  Content-Type: application/json

  {
    "logs": [
      {
        "log_type": "interaction_feedback",
        "patient_id": "8a4fde23-0f1b-4c2a-9d7e-b36c1a5f0e82",
        "timestamp": "2026-03-18T09:00:00Z",
        "payload": {
          "target_type": "message",
          "feedback_type": "thumbs_up"
      }
      }
    ]
  }
  ```
</CodeGroup>

<Note>
  **Related types:** Use [`content_interaction`](/reference/log-types/engagement#content-interaction) for content action like bookmark, [`task_outcome`](/reference/log-types/engagement#task-outcome) for task skip, [`notification_interaction`](/reference/log-types/engagement#notification-interaction) for notification.
</Note>

## Feature usage

**Type:** `feature_usage` · **Source:** Python SDK / REST · **Extensible**

Reserved for interaction with a named app feature: feature\_name; session\_id, dwell\_time\_seconds optional.

**Payload**

<ResponseField name="feature_name" type="string" required>
  Name of the app feature used. Client-defined string.
</ResponseField>

<ResponseField name="session_id" type="string">
  Session identifier linking multiple feature\_usage events in one app session.
</ResponseField>

<ResponseField name="dwell_time_seconds" type="integer">
  Time spent in the feature in seconds.
</ResponseField>

<ResponseField name="extensions" type="object">
  Open key/value bag for client/source-specific fields that lack a typed slot; merged into the entry's extensions (leaf-level, last-writer-wins by event timestamp).
</ResponseField>

**Example**

<CodeGroup>
  ```python Python theme={null}
  import olira
  from olira import OliraLogType

  olira.log(
      log_type=OliraLogType.FEATURE_USAGE,
      patient_id="your-patient-id",
      payload={
          "feature_name": "..."
      },
  )
  ```

  ```http HTTP theme={null}
  POST /v1/logs/batch
  Authorization: Bearer YOUR_API_KEY
  Content-Type: application/json

  {
    "logs": [
      {
        "log_type": "feature_usage",
        "patient_id": "8a4fde23-0f1b-4c2a-9d7e-b36c1a5f0e82",
        "timestamp": "2026-03-18T09:00:00Z",
        "payload": {
          "feature_name": "..."
      }
      }
    ]
  }
  ```
</CodeGroup>

<Note>
  **Related types:** Use [`content_interaction`](/reference/log-types/engagement#content-interaction) for content item action, [`task_outcome`](/reference/log-types/engagement#task-outcome) for task, [`user_login`](/reference/log-types/engagement#user-login) or [`user_logout`](/reference/log-types/engagement#user-logout) for login/logout.
</Note>
