---
title: "OQL"
description: "OnePageCRM Query Language. A JSON query language over CRM data."
canonical_url: https://developer.onepagecrm.com/oql/overview/
source: Markdown mirror of https://developer.onepagecrm.com/oql/overview/
---

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.

```json
{
  "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](/mcp/overview/). There is no REST endpoint for OQL.

## What's in this section

- [Concepts](/oql/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_by` work.
- Entities. Field references for every queryable record type:
  [contacts](/oql/entities/contacts/),
  [companies](/oql/entities/companies/),
  [deals](/oql/entities/deals/),
  [actions](/oql/entities/actions/),
  [notes](/oql/entities/notes/),
  [calls](/oql/entities/calls/), and
  [meetings](/oql/entities/meetings/).
- [Operators](/oql/operators/). `=`, `!=`, `<`, `>`, `in`, `between`,
  `like`, null checks, with the type compatibility matrix.
- [Functions](/oql/functions/). `ME()`, `TODAY()`, `LAST_QUARTER()`,
  `DAYS_AGO`, and the date bucketing functions used in `group_by`.
- [Limits and errors](/oql/limits-and-errors/). The timeout, row cap,
  and the error categories you can expect.
- [Recipes](/oql/recipes/). Copy-paste examples for the most common
  CRM questions.

New here? Start with the [OQL tutorial](/tutorials/oql/) for a
hands-on walkthrough.
