> ## Documentation Index
> Fetch the complete documentation index at: https://apidocs.neetoinvoice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Getting the Task ID

> Understand how to retrieve task IDs for use in your API calls.

## What is a Task ID?

A task ID is a unique identifier assigned to each task within a project. It's required for making API requests that interact with specific tasks, such as creating time entries or generating invoices.

### Step-by-Step Instructions

<Steps>
  <Step title="Make the API request">
    Send a `GET` request to the [Get project details](/api-reference/projects/get) API endpoint, including your API key in the request header.
  </Step>

  <Step title="Parse the response">
    The response will contain a `tasks` array with task objects, each containing an `id` field.

    Example:

    ```json theme={"system"}
    {
      "project": { ... },
      "tasks": [
        {
          "id": "4d0d7ad1-91ce-44d0-abfe-6718422716dd",
          "name": "UI Design",
          "hourly_rate": 75.0,
          "deleted": false,
          "hourly_rate_with_currency": "$75.00",
          "is_billable": true
        },
        {
          "id": "f23a9c19-1153-4ef9-b488-1789f047b245",
          "name": "Frontend Development",
          "hourly_rate": 85.0,
          "deleted": false,
          "hourly_rate_with_currency": "$85.00",
          "is_billable": true
        }
      ],
      "checklists": [ ... ]
    }
    ```
  </Step>

  <Step title="Extract the task ID">
    Here the task ID for `UI Design` is: **4d0d7ad1-91ce-44d0-abfe-6718422716dd**.

    You can access the task ID in your code from the response using:

    <CodeGroup>
      ```javascript JavaScript theme={"system"}
      // Get the first task's ID
      const taskId = response.tasks[0].id;

      // Or iterate through all tasks to find a specific one
      const uiDesignTask = response.tasks.find(task => task.name === "UI Design");
      const uiDesignTaskId = uiDesignTask.id;
      ```

      ```python Python theme={"system"}
      # Get the first task's ID
      task_id = response['tasks'][0]['id']

      # Or iterate through all tasks to find a specific one
      ui_design_task = next(task for task in response['tasks'] if task['name'] == "UI Design")
      ui_design_task_id = ui_design_task['id']
      ```

      ```bash Bash theme={"system"}
      # Extract task ID using jq
      task_id=$(echo "$response" | jq -r '.tasks[0].id')

      # Or find a specific task by name
      ui_design_task_id=$(echo "$response" | jq -r '.tasks[] | select(.name == "UI Design") | .id')
      ```
    </CodeGroup>
  </Step>
</Steps>
