OQL Β· Entities
Companies
OQL field reference for companies. Organization records that contacts can be linked to.
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" }
}