---
title: "Execute CRM Query"
method: POST
path: "/crm/query"
tags: ["CRM"]
---

# Execute CRM Query

`POST /crm/query`

Executes a query against the connected CRM platform (e.g., Salesforce SOQL). The query is validated for security before execution.

## Request body

- ExecuteCRMQueryRequest
  - `query` string, required — The query to execute (e.g., SOQL for Salesforce)

## Response `200`

Query executed successfully

- ExecuteCRMQueryResponse
  - `records` object[] — Query result records
  - `totalSize` integer — Total number of records matching the query
  - `done` boolean — Whether all records have been returned
  - `nextRecordsUrl` string — URL to fetch the next batch of records (if paginated)

## Other responses

- `400` — Invalid query or request parameters
- `401` — Valid API key required
- `404` — No CRM account configured for this organization
- `429` — Rate limit exceeded
- `default` — Unexpected error

---

[API](https://skmtc.net/attention/apis/attention-service-v2.md) · [All operations](https://skmtc.net/attention/apis/attention-service-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/attention/attention-service-v2/revisions/5de55d3804cf/schema)
