[POST] tasks

POST /api/v1/tasks

Creates or updates tasks. If the task already exists (based on task_app_id), it will be updated; otherwise, it will be created. The project must exist beforehand.

Required Body Parameters:

  • tasks (array): list of task objects containing:
    • project_app_id (string): ID of the associated project
    • task_app_id (string): unique identifier for the task in the external tool
    • task_name (string): name/title of the task
    • created_at (string): UTC timestamp of task creation

Optional Parameters:

  • task_url (string): direct URL to the task in the external tool
  • owner_id (string): external ID of the task owner
  • owner_name (string): name of the task owner
  • parent_task_id (string): ID of the parent task (must exist if provided)
{
  "tasks": [
    {
      "project_app_id": "PROJ-001",
      "task_app_id": "TASK-001",
      "task_name": "Implement OAuth2 Authentication",
      "task_url": "https://client.com/tasks/TASK-001",
      "owner_id": "user-123",
      "owner_name": "John Doe",
      "parent_task_id": "TASK-PARENT-001",
      "created_at": "2024-01-20 09:00:00"
    }
  ]
}

Example Response:

{
  "status": "success",
  "message": "Tasks processed successfully",
  "data": {
    "processed_tasks": [
      {
        "task_app_id": "TASK-001",
        "action": "created",
        "task_id": 101
      }
    ]
  }
}

Validations:

  • ✅ The project must exist
  • ✅ The project must belong to an organization within the token scope
  • ✅ If provided, parent_task_id must correspond to an existing task
  • ✅ The date format must be valid UTC
  • ✅ All required fields must be present

Error Codes:

  • 400: Invalid input data
  • 401: Invalid or missing token
  • 403: Organization out of token scope
  • 404: Project or parent task not found
  • 500: Internal server error