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

# Operations

> The queries an API key can call.

## apiKeyContext

What the key is and can read. Takes no arguments.

```graphql theme={null}
query {
  apiKeyContext {
    keyName
    orgId
    orgName
    agents { id name }
    scopes
    expiresAt
    retentionDays
    requestsPerMinute
    now
  }
}
```

## searchConversations

Conversations where any phrase appears in a message, newest first.

| Argument | Type | Notes |
| - | - | - |
| `agentId` | `String!` | |
| `phrases` | `[String!]!` | 1 to 10 phrases, each 2 to 200 characters |
| `startDate` | `DateTime!` | By when the conversation started |
| `endDate` | `DateTime!` | |
| `speaker` | `ResponseRole` | `USER` or `ASSISTANT`. Leave out for both. |
| `limit` | `Int` | 1 to 50, default 20 |

```graphql theme={null}
query ($agentId: String!, $phrases: [String!]!, $startDate: DateTime!, $endDate: DateTime!) {
  searchConversations(agentId: $agentId, phrases: $phrases, startDate: $startDate, endDate: $endDate) {
    totalCount
    truncated
    items {
      conversationId
      startedAt
      turnCount
      matchCount
      excerpts { role text createdAt responseId }
    }
  }
}
```

Matching is by the words as written, ignoring case. `%` and `_` are ordinary characters. Only message text is searched, not tool calls. Each conversation carries up to five excerpts. `truncated` is true when more conversations matched than were returned.

## conversationsPaginated

A page of an agent's conversations, newest first.

| Argument | Type | Notes |
| - | - | - |
| `agentId` | `String!` | |
| `startDate` | `DateTime!` | |
| `endDate` | `DateTime!` | |
| `page` | `Int` | Default 0 |
| `pageSize` | `Int` | Default 20, at most 100 |
| `includeMessages` | `Boolean` | Load `responses` too, oldest first. A page then holds at most 25. |

```graphql theme={null}
query ($agentId: String!, $startDate: DateTime!, $endDate: DateTime!) {
  conversationsPaginated(agentId: $agentId, startDate: $startDate, endDate: $endDate, includeMessages: true) {
    totalCount
    page
    totalPages
    items {
      id
      status
      createdAt
      turnCount
      totalToolsCalled
      totalLinkClicks
      initialMessageSource
      responses { role parts createdAt }
    }
  }
}
```

Ask for `responses` only with `includeMessages: true`. Without it the query fails.

A conversation with `status: ARCHIVED` is older than 60 days. Its messages are gone and `responses` is empty.

## conversation

One conversation with its messages, oldest first. Answers `null` for a conversation the key cannot read.

```graphql theme={null}
query ($id: String!) {
  conversation(id: $id) {
    id
    agentId
    status
    createdAt
    turnCount
    responses { id role parts createdAt responseTimeMs }
  }
}
```

### Message parts

`parts` is a JSON array. The parts that matter:

| `type` | Holds |
| - | - |
| `text` | `text`: what was said |
| `tool-<name>` | `toolName`, `input`, `output`, `state`, and `errorText` on failure |

Other types, such as `step-start` and `reasoning`, can be ignored.

## toolCalls

The calls an agent made to its tools, newest first.

| Argument | Type | Notes |
| - | - | - |
| `agentId` | `String!` | |
| `startDate` | `DateTime!` | By when the conversation started |
| `endDate` | `DateTime!` | |
| `toolName` | `String` | Only this tool, by its exact name |
| `page` | `Int` | Default 0 |
| `pageSize` | `Int` | Default 20, at most 100 |

```graphql theme={null}
query ($agentId: String!, $startDate: DateTime!, $endDate: DateTime!, $toolName: String) {
  toolCalls(agentId: $agentId, startDate: $startDate, endDate: $endDate, toolName: $toolName) {
    totalCount
    page
    totalPages
    items {
      conversationId
      conversationStartedAt
      responseId
      toolName
      state
      input
      output
      errorText
      calledAt
    }
  }
}
```

## conversationStats

Totals and daily counts for an agent. These are kept after messages are deleted.

| Argument | Type | Notes |
| - | - | - |
| `agentId` | `String!` | |
| `startDate` | `DateTime!` | |
| `endDate` | `DateTime!` | |
| `timezone` | `String` | IANA time zone for days and hours. Default UTC. |

```graphql theme={null}
query ($agentId: String!, $startDate: DateTime!, $endDate: DateTime!, $timezone: String) {
  conversationStats(agentId: $agentId, startDate: $startDate, endDate: $endDate, timezone: $timezone) {
    totalConversations
    totalMessages
    avgTurnsPerConversation
    totalToolsCalled
    totalLinkClicks
    totalTimeSavedMinutes
    toolUsageBreakdown { toolName count }
    peakHours { hour conversationCount }
    deviceTypeBreakdown { desktop mobile tablet }
    dailyStats { date conversationCount messageCount linkClicks }
  }
}
```

## linkClicks

Links visitors clicked in the agent's answers, newest first.

| Argument | Type | Notes |
| - | - | - |
| `agentId` | `String!` | |
| `startDate` | `DateTime!` | |
| `endDate` | `DateTime!` | |
| `page` | `Int` | Default 0 |
| `pageSize` | `Int` | Default 20, at most 100 |
| `urlFilter` | `String` | Only links whose address contains this text |

```graphql theme={null}
query ($agentId: String!, $startDate: DateTime!, $endDate: DateTime!, $urlFilter: String) {
  linkClicks(agentId: $agentId, startDate: $startDate, endDate: $endDate, urlFilter: $urlFilter) {
    totalCount
    page
    totalPages
    items { clickedAt conversationId responseId linkText url source }
  }
}
```

## Linking to a conversation

`https://www.taskadmin.ai/c/<conversationId>` opens a conversation in the dashboard for anyone in your organization who is signed in.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.