OQL · Entities
Companies
OQL field reference for companies. Organization records that contacts can be linked to.
Maintained by the OnePageCRM engineering team · Last updated Jul 16, 2026
A company groups its contacts. Companies aren’t standalone: one is
created automatically from a contact’s company name, and a contact
references its company via company_id.
Fields
Legend: F filterable, S sortable, A aggregatable, G groupable.
| Field | Type | F | S | A | G | Description |
|---|---|---|---|---|---|---|
id | ID | Y | — | — | — | Company ID |
name | string | Y | Y | — | — | Company name |
description | string | — | — | — | — | Description (select only) |
phone | string | Y | — | — | — | Phone number |
url | string | — | — | — | — | Website URL (select only) |
address | string | Y | — | — | — | Street address |
city | string | Y | Y | — | Y | City |
state | string | Y | Y | — | Y | State or province |
zip_code | string | Y | — | — | — | ZIP or postal code |
country_code | string | Y | Y | — | Y | ISO 3166-1 alpha-2 country code |
created_at | time | Y | Y | — | Y | Record creation timestamp |
modified_at | time | Y | Y | — | Y | Last modification timestamp |
Notes
- Companies are linked to contacts through the
company_idfield on the contact, not through any field on the company itself. To find a company’s contacts, querycontactswithwhere: { "company_id": "..." }. - Custom fields are queryable by name as
custom_fields.<name>inselect,where, andorder_by; selectcustom_fields.*(or*) to return all of them. Filterability and sortability depend on the field’s type. Numeric custom fields can also be aggregated ({ "sum": ["custom_fields.<name>"] }), andmin/maxwork on date custom fields.group_byanddistincton custom fields are not supported: group by a top-level field and filter on the custom field inwhereinstead. Usedescribeto discover an account’s custom-field names and types.
Example queries
Companies in the US, alphabetically:
{
"from": "companies",
"where": { "country_code": "US" },
"order_by": ["name"]
}
Companies in each country:
{
"from": "companies",
"select": ["country_code", "count()"],
"group_by": ["country_code"]
}
All contacts at a specific company:
{
"from": "contacts",
"where": { "company_id": "507f1f77bcf86cd799439011" }
}