Skip to main content

Overview

The Tasks API allows you to create, assign, and manage tasks associated with mentions. Tasks are useful for tracking follow-ups, assignments, and collaboration workflows.

Methods

Get Tasks

Fetch all tasks for an alert.
client.get_tasks(
    account_id: str,
    alert_id: str
) -> TasksResponse
account_id
string
required
The account ID
alert_id
string
required
The alert ID
Returns: TasksResponse containing list of tasks Example:
from mention import MentionClient

client = MentionClient(access_token="your-token")
tasks_response = client.get_tasks("acc_123456", "alert_123")

for task in tasks_response.tasks:
    print(f"{task.title} - Status: {task.status}")
    if task.assigned_to:
        print(f"  Assigned to: {task.assigned_to}")
Response:
{
  "tasks": [
    {
      "id": "task_456",
      "title": "Respond to customer feedback",
      "description": "Customer mentioned issues with the new feature",
      "status": "pending",
      "assigned_to": "user_789",
      "due_at": "2024-01-25T17:00:00Z",
      "completed_at": null,
      "created_at": "2024-01-20T10:00:00Z",
      "updated_at": "2024-01-20T10:00:00Z",
      "mention_id": "mention_123",
      "alert_id": "alert_123",
      "account_id": "acc_123456"
    }
  ]
}

Get Mention Tasks

Fetch all tasks for a specific mention.
client.get_mention_tasks(
    account_id: str,
    alert_id: str,
    mention_id: str
) -> TasksResponse
account_id
string
required
The account ID
alert_id
string
required
The alert ID
mention_id
string
required
The mention ID
Returns: TasksResponse containing list of tasks Example:
tasks = client.get_mention_tasks(
    "acc_123456",
    "alert_123",
    "mention_789"
)

print(f"Found {len(tasks.tasks)} tasks for this mention")

Get Task

Fetch a single task by ID.
client.get_task(
    account_id: str,
    alert_id: str,
    mention_id: str,
    task_id: str
) -> Task
account_id
string
required
The account ID
alert_id
string
required
The alert ID
mention_id
string
required
The mention ID
task_id
string
required
The task ID
Returns: Task object Example:
task = client.get_task(
    "acc_123456",
    "alert_123",
    "mention_789",
    "task_456"
)

print(f"Task: {task.title}")
print(f"Status: {task.status}")
if task.due_at:
    print(f"Due: {task.due_at}")

Create Task

Create a new task for a mention.
from mention import CreateTaskRequest, TaskStatus

client.create_task(
    account_id: str,
    alert_id: str,
    mention_id: str,
    request: CreateTaskRequest
) -> Task
account_id
string
required
The account ID
alert_id
string
required
The alert ID
mention_id
string
required
The mention ID to associate the task with
request
CreateTaskRequest
required
Task creation request
Request Fields:
request.title
string
required
Task title
request.description
string
Task description (optional)
request.status
TaskStatus
default:"pending"
Task status (pending, in_progress, completed, cancelled)
request.assigned_to
string
User ID to assign task to
request.due_at
datetime | string
Due date/time (ISO 8601 format)
Returns: Created Task object Example:
from mention import MentionClient, CreateTaskRequest, TaskStatus
from datetime import datetime, timedelta

client = MentionClient(access_token="your-token")

request = CreateTaskRequest(
    title="Follow up with customer",
    description="Customer reported an issue with the API integration",
    status=TaskStatus.PENDING,
    assigned_to="user_789",
    due_at=datetime.now() + timedelta(days=2)
)

task = client.create_task(
    "acc_123456",
    "alert_123",
    "mention_789",
    request
)

print(f"Created task: {task.id}")
print(f"Assigned to: {task.assigned_to}")

Update Task

Update an existing task.
from mention import UpdateTaskRequest

client.update_task(
    account_id: str,
    alert_id: str,
    mention_id: str,
    task_id: str,
    request: UpdateTaskRequest
) -> Task
account_id
string
required
The account ID
alert_id
string
required
The alert ID
mention_id
string
required
The mention ID
task_id
string
required
The task ID
request
UpdateTaskRequest
required
Task update request (all fields optional)
Returns: Updated Task object Example:
from mention import UpdateTaskRequest, TaskStatus

# Mark task as completed
request = UpdateTaskRequest(
    status=TaskStatus.COMPLETED,
    description="Updated: Issue resolved with customer"
)

task = client.update_task(
    "acc_123456",
    "alert_123",
    "mention_789",
    "task_456",
    request
)

print(f"Task updated: {task.status}")
if task.completed_at:
    print(f"Completed at: {task.completed_at}")

Delete Task

Delete a task permanently.
client.delete_task(
    account_id: str,
    alert_id: str,
    mention_id: str,
    task_id: str
) -> bool
account_id
string
required
The account ID
alert_id
string
required
The alert ID
mention_id
string
required
The mention ID
task_id
string
required
The task ID
Returns: True if deletion was successful Example:
success = client.delete_task(
    "acc_123456",
    "alert_123",
    "mention_789",
    "task_456"
)

if success:
    print("Task deleted successfully")

Models

Task

Represents a task associated with a mention.
FieldTypeDescription
idstringTask ID
titlestringTask title
descriptionstringTask description
statusTaskStatusTask status
assigned_tostringUser ID of assignee
due_atdatetimeDue date/time
completed_atdatetimeCompletion timestamp
created_atdatetimeCreation timestamp
updated_atdatetimeLast update timestamp
mention_idstringAssociated mention ID
alert_idstringAssociated alert ID
account_idstringAssociated account ID

TaskStatus

Task status enumeration:
  • PENDING: Task is pending
  • IN_PROGRESS: Task is in progress
  • COMPLETED: Task is completed
  • CANCELLED: Task was cancelled

CreateTaskRequest

Request for creating a new task.
FieldTypeRequiredDefaultDescription
titlestringYes-Task title
descriptionstringNo-Task description
statusTaskStatusNopendingInitial status
assigned_tostringNo-User ID to assign to
due_atdatetime|stringNo-Due date/time

UpdateTaskRequest

Request for updating an existing task.
FieldTypeDescription
titlestringNew task title
descriptionstringNew description
statusTaskStatusNew status
assigned_tostringNew assignee
due_atdatetime|stringNew due date

Build docs developers (and LLMs) love