> For the complete documentation index, see [llms.txt](https://docs.cashramp.co/cashramp/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cashramp.co/cashramp/cashramp-bot-api/queries.md).

# Queries

The Cashramp Bot API provides read-only queries to fetch agent profile data and account information.

**Endpoint:** `POST /cashramp/bot/graphql`\
**Auth:** `Authorization: Bearer {api_key}` (agent API key)

***

### Profile

```graphql
query {
  profile {
    # AgentProfile fields
  }
}
```

Returns the authenticated agent's profile — includes balances, rates, settings, deposit/withdrawal stats, TOTP info, etc.

***

### Order History

```graphql
query {
  orderHistory(
    page: 1
    perPage: 10
    filter: {
      orderId: "order_id"
      status: completed
      dateFrom: "2024-01-01"
      dateTo: "2024-12-31"
      paymentMethod: "bank_transfer"
    }
  ) {
    data {
      # P2PPayment fields
    }
    pagination {
      # Pagination fields
    }
  }
}
```

<table><thead><tr><th width="160">Argument</th><th width="192.1640625">Type</th><th width="94">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>page</code></td><td><code>Int!</code></td><td><strong>Yes</strong></td><td>The page number to fetch.</td></tr><tr><td><code>perPage</code></td><td><code>Int</code></td><td>No</td><td>Number of results per page. Defaults to <code>10</code>.</td></tr><tr><td><code>filter</code></td><td><code>OrderHistoryFilter</code></td><td>No</td><td>Optional filters to narrow results.</td></tr></tbody></table>

#### OrderHistoryFilter Fields

<table><thead><tr><th width="163.5390625">Field</th><th width="201.95703125">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>orderId</code></td><td><code>String</code></td><td>Filter by a specific order ID</td></tr><tr><td><code>status</code></td><td><code>P2PPaymentStatus</code></td><td>Filter by payment status</td></tr><tr><td><code>dateFrom</code></td><td><code>ISO8601Date</code></td><td>Start of date range</td></tr><tr><td><code>dateTo</code></td><td><code>ISO8601Date</code></td><td>End of date range</td></tr><tr><td><code>paymentMethod</code></td><td><code>String</code></td><td>Filter by payment method</td></tr></tbody></table>

Returns a `PaginatedP2PPayments` object containing a `data` array of `P2PPayment` records and a `pagination` object.

***

### Withdrawal Info

```graphql
query {
  withdrawalInfo(symbol: "USDC") {
    symbol
    name
    icon
    networks
  }
}
```

<table><thead><tr><th width="160">Argument</th><th width="104">Type</th><th width="94">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>symbol</code></td><td><code>String!</code></td><td><strong>Yes</strong></td><td>The asset symbol to fetch withdrawal info for (e.g. <code>"USDC"</code>, <code>"ETH"</code>).</td></tr></tbody></table>

Returns a `WithdrawalInfo` object — includes the asset `symbol`, `name`, `icon`, and supported `networks`.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.cashramp.co/cashramp/cashramp-bot-api/queries.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
