Skip to content

OQL · Entities

Companies

OQL field reference for companies. Organization records that contacts can be linked to.

Maintained by the OnePageCRM engineering team · Last updated Oct 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.

FieldTypeFSAGDescription
idIDYY——Company ID
web_urlstring————Link to this company in the web app (select only)
namestringYY——Company name
descriptionstring————Description. Select only, plus contains search.
phonestringY———Phone number
urlstring————Website URL (select only)
addressstringY———Street address
citystringYY—YCity
statestringYY—YState or province
zip_codestringY———ZIP or postal code
country_codestringYY—YISO 3166-1 alpha-2 country code
sync_statusbooleanY——YWhen true, updating status_id on any contact in this company applies that status to every other contact in the company
sync_tagsbooleanY——YWhen true, updating tags on any contact in this company replaces tags on every other contact in the company
created_attimeYY—YRecord creation timestamp
modified_attimeYY—YLast modification timestamp

Notes

  • Companies are linked to contacts through the company_id field on the contact, not through any field on the company itself. To find a company’s contacts, query contacts with where: { "company_id": "..." }.
  • sync_status and sync_tags change how contact writes behave. When either is true on a company, updating that field on one of its contacts writes it to all of them. Tags are replaced wholesale rather than merged, so a sync’d update overwrites the other contacts’ tags entirely. Both flags are read-only through the API. Absent or null behaves as false.
  • Custom fields are queryable by name as custom_fields.<name> in select, where, and order_by; select custom_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>"] }), and min/max work on date custom fields. group_by works on custom fields whose type supports it (check describe); distinct does not — group by the field instead. Use describe to 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" }
}