Skip to content

Latest commit

 

History

History
584 lines (519 loc) · 16.2 KB

File metadata and controls

584 lines (519 loc) · 16.2 KB
title Action Items
icon list-check
description Create and retrieve action items (tasks/to-dos) via the Developer API

Endpoints

Retrieve action items Create action item Update action item Delete action item Create up to 50

Get Action Items

Retrieve your action items with optional filtering | Parameter | Type | Default | Description | |-----------|------|---------|-------------| | `limit` | integer | 100 | Maximum number of items to return | | `offset` | integer | 0 | Number of items to skip | | `completed` | boolean | - | Filter by completion status | | `conversation_id` | string | - | Filter by conversation ID | | `start_date` | datetime | - | Filter by creation start date (inclusive) | | `end_date` | datetime | - | Filter by creation end date (inclusive) | ```bash curl -H "Authorization: Bearer $API_KEY" \ "https://api.omi.me/v1/dev/user/action-items?completed=false&limit=50" ``` ```python import requests
response = requests.get(
    "https://api.omi.me/v1/dev/user/action-items",
    headers={"Authorization": f"Bearer {API_KEY}"},
    params={"completed": False, "limit": 50}
)
action_items = response.json()
```
```javascript const response = await fetch( "https://api.omi.me/v1/dev/user/action-items?completed=false&limit=50", { headers: { Authorization: `Bearer ${API_KEY}` } } ); const actionItems = await response.json(); ``` ```json [ { "id": "action_101", "description": "Review budget proposal", "completed": false, "created_at": "2025-01-20T10:15:00Z", "updated_at": "2025-01-20T10:15:00Z", "due_at": null, "completed_at": null, "conversation_id": "conv_202" }, { "id": "action_102", "description": "Call dentist for appointment", "completed": true, "created_at": "2025-01-19T14:00:00Z", "updated_at": "2025-01-20T09:00:00Z", "due_at": "2025-01-25T00:00:00Z", "completed_at": "2025-01-20T09:00:00Z", "conversation_id": null } ] ``` | Field | Type | Description | |-------|------|-------------| | `id` | string | Unique identifier | | `description` | string | The action item text | | `completed` | boolean | Whether the item is completed | | `created_at` | datetime | When the item was created | | `updated_at` | datetime | When the item was last updated | | `due_at` | datetime | Due date (null if not set) | | `completed_at` | datetime | When completed (null if not completed) | | `conversation_id` | string | Associated conversation ID (null for standalone items) |

Create Action Item

Create a new action item (task/to-do) | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `description` | string | **Yes** | The action item description (1-500 characters) | | `completed` | boolean | No | Whether completed (default: `false`) | | `due_at` | datetime | No | Due date in ISO 8601 format with timezone | ```bash curl -X POST "https://api.omi.me/v1/dev/user/action-items" \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "description": "Review pull request #123", "completed": false, "due_at": "2025-12-08T15:00:00+00:00" }' ``` ```python import requests
response = requests.post(
    "https://api.omi.me/v1/dev/user/action-items",
    headers={
        "Authorization": f"Bearer {API_KEY}",
        "Content-Type": "application/json"
    },
    json={
        "description": "Review pull request #123",
        "completed": False,
        "due_at": "2025-12-08T15:00:00+00:00"
    }
)
action_item = response.json()
```
```javascript const response = await fetch( "https://api.omi.me/v1/dev/user/action-items", { method: "POST", headers: { Authorization: `Bearer ${API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ description: "Review pull request #123", completed: false, due_at: "2025-12-08T15:00:00+00:00" }) } ); const actionItem = await response.json(); ``` ```json { "id": "action_abc123", "description": "Review pull request #123", "completed": false, "created_at": "2025-12-06T10:30:00Z", "updated_at": "2025-12-06T10:30:00Z", "due_at": "2025-12-08T15:00:00+00:00", "completed_at": null, "conversation_id": null } ``` Push notifications are automatically sent to the Omi app if a `due_at` date is provided.

Create Action Items (Batch)

Create multiple action items in a single request (max 50) | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `action_items` | array | **Yes** | List of action item objects (max 50) |
Each action item object accepts the same fields as the single create endpoint.
```bash curl -X POST "https://api.omi.me/v1/dev/user/action-items/batch" \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "action_items": [ {"description": "Review Q1 report", "due_at": "2025-12-10T17:00:00Z"}, {"description": "Schedule team meeting"} ] }' ``` ```python import requests
response = requests.post(
    "https://api.omi.me/v1/dev/user/action-items/batch",
    headers={
        "Authorization": f"Bearer {API_KEY}",
        "Content-Type": "application/json"
    },
    json={
        "action_items": [
            {"description": "Review Q1 report", "due_at": "2025-12-10T17:00:00Z"},
            {"description": "Schedule team meeting"}
        ]
    }
)
result = response.json()
print(f"Created {result['created_count']} action items")
```
```javascript const response = await fetch( "https://api.omi.me/v1/dev/user/action-items/batch", { method: "POST", headers: { Authorization: `Bearer ${API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ action_items: [ { description: "Review Q1 report", due_at: "2025-12-10T17:00:00Z" }, { description: "Schedule team meeting" } ] }) } ); const result = await response.json(); console.log(`Created ${result.created_count} action items`); ``` ```json { "action_items": [ { "id": "action_001", "description": "Review Q1 report", ... }, { "id": "action_002", "description": "Schedule team meeting", ... } ], "created_count": 2 } ```

Update Action Item

Update an action item's description, completion status, or due date | Parameter | Type | Description | |-----------|------|-------------| | `action_item_id` | string | The ID of the action item to update | | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `description` | string | No | New description (1-500 characters) | | `completed` | boolean | No | New completion status | | `due_at` | datetime | No | New due date (ISO 8601 format) |
At least one field must be provided. Setting `completed: true` automatically sets `completed_at`.
```bash curl -X PATCH "https://api.omi.me/v1/dev/user/action-items/action_abc123" \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "completed": true }' ``` ```python import requests
# Mark action item as completed
response = requests.patch(
    "https://api.omi.me/v1/dev/user/action-items/action_abc123",
    headers={
        "Authorization": f"Bearer {API_KEY}",
        "Content-Type": "application/json"
    },
    json={"completed": True}
)
action_item = response.json()
print(f"Completed at: {action_item['completed_at']}")
```
```javascript // Mark action item as completed const response = await fetch( "https://api.omi.me/v1/dev/user/action-items/action_abc123", { method: "PATCH", headers: { Authorization: `Bearer ${API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ completed: true }) } ); const actionItem = await response.json(); console.log(`Completed at: ${actionItem.completed_at}`); ``` ```json { "id": "action_abc123", "description": "Review pull request #123", "completed": true, "created_at": "2025-12-06T10:30:00Z", "updated_at": "2025-12-25T14:00:00Z", "due_at": "2025-12-08T15:00:00+00:00", "completed_at": "2025-12-25T14:00:00Z", "conversation_id": null } ``` When updating `due_at`, a push notification is sent to the Omi app to remind the user.

Delete Action Item

Delete an action item permanently | Parameter | Type | Description | |-----------|------|-------------| | `action_item_id` | string | The ID of the action item to delete | ```bash curl -X DELETE "https://api.omi.me/v1/dev/user/action-items/action_abc123" \ -H "Authorization: Bearer $API_KEY" ``` ```python import requests
response = requests.delete(
    "https://api.omi.me/v1/dev/user/action-items/action_abc123",
    headers={"Authorization": f"Bearer {API_KEY}"}
)
result = response.json()
if result["success"]:
    print("Action item deleted successfully")
```
```javascript const response = await fetch( "https://api.omi.me/v1/dev/user/action-items/action_abc123", { method: "DELETE", headers: { Authorization: `Bearer ${API_KEY}` } } ); const result = await response.json(); if (result.success) { console.log("Action item deleted successfully"); } ``` ```json { "success": true } ``` This action is permanent. Deleted action items cannot be recovered.

Use Case: Import Tasks

Import tasks from an external task management system into Omi:

```python import requests
API_KEY = "omi_dev_your_api_key"

# Your tasks from another app
external_tasks = [
    {"title": "Complete project proposal", "due": "2025-12-15T10:00:00Z", "done": False},
    {"title": "Send weekly report", "due": "2025-12-12T17:00:00Z", "done": False},
    {"title": "Review team feedback", "due": None, "done": True}
]

# Convert to Omi action items format
action_items = [
    {
        "description": task["title"],
        "due_at": task["due"],
        "completed": task["done"]
    }
    for task in external_tasks
]

# Create batch
response = requests.post(
    "https://api.omi.me/v1/dev/user/action-items/batch",
    headers={"Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json"},
    json={"action_items": action_items}
)

print(f"Imported {response.json()['created_count']} action items")
```
```javascript const API_KEY = process.env.OMI_API_KEY;
// Your tasks from another app
const externalTasks = [
  { title: "Complete project proposal", due: "2025-12-15T10:00:00Z", done: false },
  { title: "Send weekly report", due: "2025-12-12T17:00:00Z", done: false },
  { title: "Review team feedback", due: null, done: true }
];

// Convert to Omi action items format
const actionItems = externalTasks.map(task => ({
  description: task.title,
  due_at: task.due,
  completed: task.done
}));

// Create batch
const response = await fetch(
  "https://api.omi.me/v1/dev/user/action-items/batch",
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${API_KEY}`,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({ action_items: actionItems })
  }
);

const result = await response.json();
console.log(`Imported ${result.created_count} action items`);
```

Use Case: Get Pending Tasks

```bash # Get all incomplete action items curl -H "Authorization: Bearer $API_KEY" \ "https://api.omi.me/v1/dev/user/action-items?completed=false" ``` ```python import requests
API_KEY = "omi_dev_your_api_key"

# Get pending tasks
response = requests.get(
    "https://api.omi.me/v1/dev/user/action-items",
    headers={"Authorization": f"Bearer {API_KEY}"},
    params={"completed": False, "limit": 100}
)

pending_tasks = response.json()
print(f"You have {len(pending_tasks)} pending tasks")

for task in pending_tasks:
    due = task.get("due_at", "No due date")
    print(f"- {task['description']} (Due: {due})")
```
```javascript const API_KEY = process.env.OMI_API_KEY;
const response = await fetch(
  "https://api.omi.me/v1/dev/user/action-items?completed=false&limit=100",
  { headers: { Authorization: `Bearer ${API_KEY}` } }
);

const pendingTasks = await response.json();
console.log(`You have ${pendingTasks.length} pending tasks`);

pendingTasks.forEach(task => {
  const due = task.due_at || "No due date";
  console.log(`- ${task.description} (Due: ${due})`);
});
```