Skip to main content
POST
/
crm
/
query
Execute CRM Query
curl --request POST \
  --url https://api.attention.tech/v2/crm/query \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data @- <<EOF
{
  "query": "SELECT Id, Name, Amount FROM Opportunity WHERE StageName = 'Closed Won' LIMIT 10"
}
EOF
{
  "records": [
    {
      "Id": "006ABC123",
      "Name": "Enterprise Deal",
      "Amount": 50000
    }
  ],
  "totalSize": 1,
  "done": true
}

Authorizations

Authorization
string
header
required

Body

application/json

Query request payload

query
string
required

The query to execute (e.g., SOQL for Salesforce)

Maximum string length: 10000
Example:

"SELECT Id, Name, Email FROM Contact WHERE CreatedDate = LAST_N_DAYS:30 LIMIT 100"

Response

Query executed successfully

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)