> ## 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 Time Entry ID

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

## What is a Time Entry ID?

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

### Step-by-Step Instructions

<Steps>
  <Step title="Make the API request">
    Send a `GET` request to the [List time entries](/api-reference/time-entry/list) API endpoint, including your API key in the request header. You'll need to provide the `client_id` and `project_id` as query parameters.
  </Step>

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

    Example:

    ```json theme={"system"}
    {
      "time_entries": [
        {
          "id": "128c1dfc-b29f-4fda-9a05-8a90e197b81b",
          "user_id": "5a2de667-243b-4da3-b090-b698a03d98da",
          "user_name": "John Doe",
          "user_email": "john@example.com",
          "task_id": "4d0d7ad1-91ce-44d0-abfe-6718422716dd",
          "task_name": "UI Design",
          "project_id": "e34204233797f4b637c5",
          "project_name": "Website Redesign",
          "client_id": "d3e77fe4b9cae1e82d8a",
          "client_name": "Acme Corp",
          "hours": 2.5,
          "recorded_on": "2025-01-15",
          "notes": "Completed working on adding tests.",
          "status": "unbilled",
          "created_at": "2025-01-15T10:30:00Z",
          "updated_at": "2025-01-15T10:30:00Z"
        },
        {
          "id": "6be815a8-9a10-455c-95d9-b0b548664420",
          "user_id": "5a2de667-243b-4da3-b090-b698a03d98da",
          "user_name": "John Doe",
          "user_email": "john@example.com",
          "task_id": "f23a9c19-1153-4ef9-b488-1789f047b245",
          "task_name": "Frontend Development",
          "project_id": "e34204233797f4b637c5",
          "project_name": "Website Redesign",
          "client_id": "d3e77fe4b9cae1e82d8a",
          "client_name": "Acme Corp",
          "hours": 4.0,
          "recorded_on": "2025-01-16",
          "notes": "Implemented user authentication",
          "status": "unbilled",
          "created_at": "2025-01-16T09:15:00Z",
          "updated_at": "2025-01-16T09:15:00Z"
        }
      ],

      // ... rest of the details
    }
    ```
  </Step>

  <Step title="Extract the time entry ID">
    Here the time entry ID for the first entry is: **128c1dfc-b29f-4fda-9a05-8a90e197b81b**.

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

    <CodeGroup>
      ```javascript JavaScript theme={"system"}
      // Get the first time entry's ID
      const timeEntryId = response.time_entries[0].id;

      // Or iterate through all time entries to find a specific one
      const uiDesignEntry = response.time_entries.find(entry => entry.task_name === "UI Design");
      const uiDesignEntryId = uiDesignEntry.id;
      ```

      ```python Python theme={"system"}
      # Get the first time entry's ID
      time_entry_id = response['time_entries'][0]['id']

      # Or iterate through all time entries to find a specific one
      ui_design_entry = next(entry for entry in response['time_entries'] if entry['task_name'] == "UI Design")
      ui_design_entry_id = ui_design_entry['id']
      ```

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

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