OQL
OQL
OnePageCRM Query Language. A JSON query language over CRM data.
Last updated Jul 16, 2026
OQL (OnePageCRM Query Language) is a JSON query language over the CRM. Where a REST API exposes one endpoint per shape of question, OQL exposes one query language that handles them all: contacts, companies, deals, actions, notes, calls, and meetings.
{
"from": "deals",
"where": { "status": "won", "close_date": "LAST_QUARTER()" },
"select": ["name", "amount", "owner_id"],
"order_by": [{ "amount": "desc" }],
"limit": 25
}
OQL is available through the OnePageCRM MCP server. There is no REST endpoint for OQL.
Whatβs in this section
- Concepts. The query shape, how the schema acts as
an allowlist, AND-only filters, sorting, limits, lookups across
related records, and how aggregates and
group_bywork. - Entities. Field references for every queryable record type: contacts, companies, deals, actions, notes, calls, and meetings.
- Operators.
=,!=,<,>,in,between,like, null checks, with the type compatibility matrix. - Functions.
ME(),TODAY(),LAST_QUARTER(),DAYS_AGO, and the date bucketing functions used ingroup_by. - Limits and errors. The timeout, row cap, and the error categories you can expect.
- Recipes. Copy-paste examples for the most common CRM questions.
New here? Start with the OQL tutorial for a hands-on walkthrough.