Sub-Tasks

Manage sub-tasks within a parent task. Sub-tasks help break down work into smaller, trackable items.

Endpoints

MethodEndpointDescription
GET/tasks/v1/taskboards/{taskBoardId}/tasks/{taskId}/sub-tasksGet sub-tasks
POST/tasks/v1/taskboards/{taskBoardId}/tasks/{taskId}/sub-tasksCreate sub-task
PUT/tasks/v1/taskboards/{taskBoardId}/tasks/{taskId}/sub-tasks/{subTaskId}Update sub-task
DELETE/tasks/v1/taskboards/{taskBoardId}/tasks/{taskId}/sub-tasks/{subTaskId}Delete sub-task

Get Sub-Tasks

Retrieve sub-tasks for a parent task.

Query Parameters

ParameterTypeRequiredDefaultDescription
subtaskIdsarrayNo-Filter by specific sub-task IDs
limitintegerNo10Results per page (1-100)
offsetintegerNo0Pagination offset

Example Request

curl --request GET \
  --url 'https://api.connecteam.com/tasks/v1/taskboards/12345/tasks/task-abc123/sub-tasks' \
  --header 'X-API-KEY: YOUR_API_KEY'

Response

{
  "requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "data": {
    "subTasks": [
      {
        "id": "subtask-001",
        "title": "Check fire extinguishers",
        "isCompleted": true
      },
      {
        "id": "subtask-002",
        "title": "Inspect emergency exits",
        "isCompleted": false
      }
    ]
  },
  "paging": {
    "offset": 2
  }
}

Create Sub-Task

Add a new sub-task to an existing task.

Request Body

FieldTypeRequiredDescription
titlestringYesSub-task title
isCompletedbooleanNoCompletion status (default: false)

Example

curl --request POST \
  --url https://api.connecteam.com/tasks/v1/taskboards/12345/tasks/task-abc123/sub-tasks \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: YOUR_API_KEY' \
  --data '{
    "title": "Test smoke detectors",
    "isCompleted": false
  }'

Response

{
  "requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "data": {
    "id": "subtask-003",
    "title": "Test smoke detectors",
    "isCompleted": false
  }
}

Update Sub-Task

Modify a sub-task's title or completion status.

Request Body

FieldTypeRequiredDescription
titlestringNoNew title
isCompletedbooleanNoNew completion status

Example: Mark as Complete

curl --request PUT \
  --url https://api.connecteam.com/tasks/v1/taskboards/12345/tasks/task-abc123/sub-tasks/subtask-002 \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: YOUR_API_KEY' \
  --data '{
    "isCompleted": true
  }'

Example: Update Title

curl --request PUT \
  --url https://api.connecteam.com/tasks/v1/taskboards/12345/tasks/task-abc123/sub-tasks/subtask-002 \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: YOUR_API_KEY' \
  --data '{
    "title": "Inspect all emergency exits and document findings"
  }'

Response

{
  "requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "data": {
    "id": "subtask-002",
    "title": "Inspect all emergency exits and document findings",
    "isCompleted": true
  }
}

Delete Sub-Task

Remove a sub-task from a task.

Example

curl --request DELETE \
  --url https://api.connecteam.com/tasks/v1/taskboards/12345/tasks/task-abc123/sub-tasks/subtask-003 \
  --header 'X-API-KEY: YOUR_API_KEY'

Response

{
  "requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "data": {}
}

Integration Example

class SubTaskManager {
  constructor(apiKey, taskBoardId, taskId) {
    this.apiKey = apiKey;
    this.baseUrl = `https://api.connecteam.com/tasks/v1/taskboards/${taskBoardId}/tasks/${taskId}/sub-tasks`;
  }

  async getAll() {
    const response = await fetch(this.baseUrl, {
      headers: { 'X-API-KEY': this.apiKey }
    });
    return response.json();
  }

  async create(title, isCompleted = false) {
    const response = await fetch(this.baseUrl, {
      method: 'POST',
      headers: {
        'X-API-KEY': this.apiKey,
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({ title, isCompleted })
    });
    return response.json();
  }

  async complete(subTaskId) {
    const response = await fetch(`${this.baseUrl}/${subTaskId}`, {
      method: 'PUT',
      headers: {
        'X-API-KEY': this.apiKey,
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({ isCompleted: true })
    });
    return response.json();
  }

  async completeAll() {
    const { data } = await this.getAll();
    for (const subTask of data.subTasks) {
      if (!subTask.isCompleted) {
        await this.complete(subTask.id);
      }
    }
  }
}

// Usage
const subTasks = new SubTaskManager('YOUR_API_KEY', 12345, 'task-abc123');

// Add new sub-tasks
await subTasks.create('Review documentation');
await subTasks.create('Update test cases');

// Complete a specific sub-task
await subTasks.complete('subtask-001');

// Complete all sub-tasks
await subTasks.completeAll();

API Reference