Tasks API
Create, update, and manage tasks across your products with the Tasks API.
Archiving Tasks
Archiving and restoring tasks must be done through the dashboard. The API supports creating, reading, updating, and deleting tasks.
Endpoints
Task Object
The task object represents a single task in MyOpcs.
| Attribute | Type | Description |
|---|---|---|
id | string | Unique identifier for the task (e.g., task_abc123) |
displayId | number | Display sequence number for the task |
title | string | The task title (1-200 characters) |
description | string | null | Detailed task description (max 2000 characters) |
priority | string | One of: high, medium, low |
status | string | One of: todo, in_progress, done |
dueDate | string | null | Due date in YYYY-MM-DD format |
productId | string | null | ID of the associated product |
productName | string | null | Name of the associated product |
versionId | string | null | ID of the associated version |
versionName | string | null | Name of the associated version (e.g., v1.0.0) |
isArchived | boolean | Whether the task is archived |
createdAt | string | ISO 8601 timestamp of creation |
completedAt | string | null | ISO 8601 timestamp when marked as done |
GET
List Tasks
Returns a list of tasks for the authenticated user. Results are ordered by creation date (newest first).
Request
Bash
curl https://api.myopcs.com/api/v1/tasks \
-H "Authorization: Bearer YOUR_API_KEY"Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
status | string | No | Filter by status: todo, in_progress, done |
productId | string | No | Filter by product ID |
isArchived | boolean | No | Filter by archived status (default: false) |
Response
{}JSON
{
"data": [
{
"id": "task_abc123",
"displayId": 42,
"title": "Implement user authentication",
"description": "Add OAuth2 login flow with Google and GitHub",
"priority": "high",
"status": "in_progress",
"dueDate": "2024-02-15",
"productId": "prod_xyz789",
"productName": "My SaaS App",
"versionId": "ver_def456",
"versionName": "v1.2.0",
"isArchived": false,
"createdAt": "2024-01-15T10:30:00Z",
"completedAt": null
}
]
}POST
Create Task
Creates a new task. The task will be associated with the authenticated user.
Request
Bash
curl -X POST https://api.myopcs.com/api/v1/tasks \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Fix login bug",
"description": "Users report intermittent login failures on mobile",
"productId": "prod_xyz789",
"versionId": "ver_def456",
"priority": "high",
"status": "todo",
"dueDate": "2024-02-20"
}'Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
title | string | Yes | The task title (1-200 characters) |
description | string | No | Detailed task description (max 2000 characters) |
productId | string | No | ID of the product to associate |
versionId | string | No | ID of the version to associate (requires productId) |
priority | string | No | One of: high, medium (default), low |
status | string | No | One of: todo (default), in_progress, done |
dueDate | string | No | Due date in YYYY-MM-DD format |
Response
{}JSON
{
"data": {
"id": "task_new123",
"displayId": 43,
"title": "Fix login bug",
"description": "Users report intermittent login failures on mobile",
"priority": "high",
"status": "todo",
"dueDate": "2024-02-20",
"productId": "prod_xyz789",
"productName": "My SaaS App",
"versionId": "ver_def456",
"versionName": "v1.2.0",
"isArchived": false,
"createdAt": "2024-01-21T14:00:00Z",
"completedAt": null
}
}GET
Retrieve a Task
Retrieves the details of an existing task by its ID.
Request
Bash
curl https://api.myopcs.com/api/v1/tasks/task_abc123 \
-H "Authorization: Bearer YOUR_API_KEY"Response
{}JSON
{
"data": {
"id": "task_abc123",
"displayId": 42,
"title": "Implement user authentication",
"description": "Add OAuth2 login flow with Google and GitHub",
"priority": "high",
"status": "in_progress",
"dueDate": "2024-02-15",
"productId": "prod_xyz789",
"productName": "My SaaS App",
"versionId": "ver_def456",
"versionName": "v1.2.0",
"isArchived": false,
"createdAt": "2024-01-15T10:30:00Z",
"completedAt": null
}
}PATCH
Update Task
Updates an existing task. Only include the fields you want to change.
Request
Bash
curl -X PATCH https://api.myopcs.com/api/v1/tasks/task_abc123 \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"status": "done",
"priority": "medium"
}'Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
title | string | No | The task title (1-200 characters) |
description | string | No | Detailed task description. Set to null to clear. |
productId | string | null | No | ID of the product to associate. Set to null to remove. |
versionId | string | null | No | ID of the version to associate. Set to null to remove. |
priority | string | No | One of: high, medium, low |
status | string | No | One of: todo, in_progress, done |
dueDate | string | null | No | Due date in YYYY-MM-DD format. Set to null to clear. |
Response
{}JSON
{
"data": {
"id": "task_abc123",
"displayId": 42,
"title": "Implement user authentication",
"description": "Add OAuth2 login flow with Google and GitHub",
"priority": "medium",
"status": "done",
"dueDate": "2024-02-15",
"productId": "prod_xyz789",
"productName": "My SaaS App",
"versionId": "ver_def456",
"versionName": "v1.2.0",
"isArchived": false,
"createdAt": "2024-01-15T10:30:00Z",
"completedAt": "2024-01-22T16:30:00Z"
}
}DELETE
Delete Task
Deletes a task. This is a soft delete - the task is marked as deleted but not permanently removed.
Request
Bash
curl -X DELETE https://api.myopcs.com/api/v1/tasks/task_abc123 \
-H "Authorization: Bearer YOUR_API_KEY"Response
{}JSON
{
"success": true
}