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

# Mercury Connector

> Query your Mercury bank accounts, transactions, and cash flow directly in Ana.

### **1. Overview**

The Ana x Mercury integration connects your Mercury banking account to Ana, giving you natural language access to your company's financial data — accounts, balances, transactions, cards, and recipients. Once configured, Ana can summarize cash position across accounts, break down spending by counterparty, track burn rate, and surface unusual transactions without leaving your workflow.

<Note>
  Connect Mercury to Ana to query and analyze your company's banking activity using natural language.
</Note>

### **2. Prerequisites**

You'll need:

* A Mercury account with permission to create API tokens
* A TextQL account with permission to add API connectors

<Warning>
  Mercury enforces an **IP allowlist** on API tokens. The token will be rejected with a 401 until the calling IP is allowlisted — even if the token itself is valid. When creating the token in Mercury, add TextQL's egress IP to its allowed IPs:

  * **TextQL Cloud:** `54.69.138.147`
  * **Self-hosted (VPC):** your deployment's egress IP
</Warning>

### **3. Capabilities**

Once configured, Ana can:

* Report current balances across all your Mercury accounts.
* Break down transactions by counterparty, amount, or time period.
* Track inflows vs outflows to estimate burn rate and runway.
* Surface large, unusual, or pending transactions.
* Query cards and recipients configured on the account.

### **4. Setup Instructions**

***

### Step 1: Create your Mercury API token

1. Go to [app.mercury.com](https://app.mercury.com) and sign in.
2. Navigate to **Settings → API Tokens**.
3. Generate a new token and choose its permission level:
   * **Read-Only** (recommended): can fetch all available data on your Mercury account — everything Ana needs, with no ability to move money.
   * **Custom**: restrict to specific scopes if you want even narrower access.
   * **Read-Write**: not needed for Ana — it can initiate transactions. Avoid unless you have a separate reason.
4. Add the appropriate IP to the token's **allowed IPs** (see the allowlist note in Prerequisites) — Mercury requires this on every token, read-only included.
5. Copy the token immediately — Mercury cannot show it again after the dialog closes.

<Warning>
  Use a **Read-Only** token. Ana only queries data; a Read-Write token would grant transaction-initiation ability the integration never uses.
</Warning>

### **Step 2: Add Mercury as an API connector in TextQL**

1. Go to app.textql.com and sign in.
2. In the bottom left sidebar, click **Connectors > APIs** and select Mercury.
3. In the configuration panel, fill in the fields:
   * Name (e.g. `Mercury`)
   * API Token: paste the token copied from Step 1
4. Click **Test** to verify the token, then click **Save**.

### **Step 3: Verify the connection**

1. Click on the Mercury connector and select Test Connection at the bottom of the panel.

* A successful setup will return Connection successful (200).
* If the test fails, refer to the [Troubleshooting](#6-troubleshooting) section for next steps.

***

### **5. Usage Examples**

Once configured, you can ask Ana:

* "What's our total cash position across all Mercury accounts?"
* "Show me all transactions over \$10,000 this quarter."
* "Break down outflows by counterparty for the last 90 days."
* "What was our net burn last month compared to the month before?"
* "List pending transactions across all accounts."

### **6. Troubleshooting**

| **Symptom**                                         | **Likely Cause**                                                                                                           | **Fix**                                                                                                           |
| --------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| Test fails with 401 despite a freshly created token | The token's **IP allowlist** doesn't include TextQL's egress IP (Mercury requires this on every token, read-only included) | In Mercury, add `54.69.138.147` (TextQL Cloud) — or your VPC deployment's egress IP — to the token's allowed IPs. |
| Test fails with 401                                 | Invalid, revoked, or incorrectly copied API token                                                                          | Generate a new token under **Settings → API Tokens** and update the connector in TextQL.                          |
| 403 on specific queries                             | Custom token scopes exclude the queried resource                                                                           | Recreate the token with the needed scopes, or use a Read-Only token.                                              |
| Ana returns no results                              | Empty result set for the queried period or account                                                                         | Widen the time range or confirm the account has activity.                                                         |

### **7. Security Notes**

* This connector accesses **bank data**. Use a Read-Only token — never Read-Write — and treat it like a password.
* Tokens are shown only once at creation and remain valid until revoked. Store securely; never share in email, chat, or tickets.
* Revoke and regenerate immediately if you suspect exposure.
* If you no longer need the integration, revoke the token in Mercury and remove the connector from TextQL.
* For more details, refer to [Mercury's API documentation](https://docs.mercury.com/reference/getting-started-with-your-api).

***

### **Need Help?**

For further assistance, please contact [support@textql.com](mailto:support@textql.com).

### **Privacy Policy**

For information about how we handle your data and protect your privacy, please review our [Privacy Policy](https://textql.com/privacy).
