# Tracker

## Get Agent Task Tracker

`client.tracker.retrieve(stringtrackerID, RequestOptionsoptions?): AgentTaskTracker`

**get** `/tracker/{tracker_id}`

Get agent task tracker by tracker ID

### Parameters

- `trackerID: string`

### Returns

- `AgentTaskTracker`

  - `id: string`

    The UUID of the agent task tracker

  - `agent_id: string`

    The UUID of the agent

  - `created_at: string`

    When the agent task tracker was created

  - `task_id: string`

    The UUID of the task

  - `last_processed_event_id?: string | null`

    The last processed event ID

  - `status?: string | null`

    Processing status

  - `status_reason?: string | null`

    Optional status reason

  - `updated_at?: string | null`

    When the agent task tracker was last updated

### Example

```typescript
import Agentex from 'agentex';

const client = new Agentex({
  apiKey: process.env['AGENTEX_SDK_API_KEY'], // This is the default and can be omitted
});

const agentTaskTracker = await client.tracker.retrieve('tracker_id');

console.log(agentTaskTracker.id);
```

#### Response

```json
{
  "id": "id",
  "agent_id": "agent_id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "task_id": "task_id",
  "last_processed_event_id": "last_processed_event_id",
  "status": "status",
  "status_reason": "status_reason",
  "updated_at": "2019-12-27T18:11:19.117Z"
}
```

## Update Agent Task Tracker

`client.tracker.update(stringtrackerID, TrackerUpdateParamsbody, RequestOptionsoptions?): AgentTaskTracker`

**put** `/tracker/{tracker_id}`

Update agent task tracker by tracker ID

### Parameters

- `trackerID: string`

- `body: TrackerUpdateParams`

  - `last_processed_event_id?: string | null`

    The most recent processed event ID (omit to leave unchanged)

  - `status?: string | null`

    Processing status

  - `status_reason?: string | null`

    Optional status reason

### Returns

- `AgentTaskTracker`

  - `id: string`

    The UUID of the agent task tracker

  - `agent_id: string`

    The UUID of the agent

  - `created_at: string`

    When the agent task tracker was created

  - `task_id: string`

    The UUID of the task

  - `last_processed_event_id?: string | null`

    The last processed event ID

  - `status?: string | null`

    Processing status

  - `status_reason?: string | null`

    Optional status reason

  - `updated_at?: string | null`

    When the agent task tracker was last updated

### Example

```typescript
import Agentex from 'agentex';

const client = new Agentex({
  apiKey: process.env['AGENTEX_SDK_API_KEY'], // This is the default and can be omitted
});

const agentTaskTracker = await client.tracker.update('tracker_id');

console.log(agentTaskTracker.id);
```

#### Response

```json
{
  "id": "id",
  "agent_id": "agent_id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "task_id": "task_id",
  "last_processed_event_id": "last_processed_event_id",
  "status": "status",
  "status_reason": "status_reason",
  "updated_at": "2019-12-27T18:11:19.117Z"
}
```

## List Agent Task Trackers

`client.tracker.list(TrackerListParamsquery?, RequestOptionsoptions?): TrackerListResponse`

**get** `/tracker`

List all agent task trackers, optionally filtered by query parameters.

### Parameters

- `query: TrackerListParams`

  - `agent_id?: string | null`

    Agent ID

  - `limit?: number`

    Limit

  - `order_by?: string | null`

    Field to order by

  - `order_direction?: string`

    Order direction (asc or desc)

  - `page_number?: number`

    Page number

  - `task_id?: string | null`

    Task ID

### Returns

- `TrackerListResponse = Array<AgentTaskTracker>`

  - `id: string`

    The UUID of the agent task tracker

  - `agent_id: string`

    The UUID of the agent

  - `created_at: string`

    When the agent task tracker was created

  - `task_id: string`

    The UUID of the task

  - `last_processed_event_id?: string | null`

    The last processed event ID

  - `status?: string | null`

    Processing status

  - `status_reason?: string | null`

    Optional status reason

  - `updated_at?: string | null`

    When the agent task tracker was last updated

### Example

```typescript
import Agentex from 'agentex';

const client = new Agentex({
  apiKey: process.env['AGENTEX_SDK_API_KEY'], // This is the default and can be omitted
});

const agentTaskTrackers = await client.tracker.list();

console.log(agentTaskTrackers);
```

#### Response

```json
[
  {
    "id": "id",
    "agent_id": "agent_id",
    "created_at": "2019-12-27T18:11:19.117Z",
    "task_id": "task_id",
    "last_processed_event_id": "last_processed_event_id",
    "status": "status",
    "status_reason": "status_reason",
    "updated_at": "2019-12-27T18:11:19.117Z"
  }
]
```

## Domain Types

### Agent Task Tracker

- `AgentTaskTracker`

  - `id: string`

    The UUID of the agent task tracker

  - `agent_id: string`

    The UUID of the agent

  - `created_at: string`

    When the agent task tracker was created

  - `task_id: string`

    The UUID of the task

  - `last_processed_event_id?: string | null`

    The last processed event ID

  - `status?: string | null`

    Processing status

  - `status_reason?: string | null`

    Optional status reason

  - `updated_at?: string | null`

    When the agent task tracker was last updated

### Tracker List Response

- `TrackerListResponse = Array<AgentTaskTracker>`

  - `id: string`

    The UUID of the agent task tracker

  - `agent_id: string`

    The UUID of the agent

  - `created_at: string`

    When the agent task tracker was created

  - `task_id: string`

    The UUID of the task

  - `last_processed_event_id?: string | null`

    The last processed event ID

  - `status?: string | null`

    Processing status

  - `status_reason?: string | null`

    Optional status reason

  - `updated_at?: string | null`

    When the agent task tracker was last updated
