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.

FieldTypeFSAGDescription
idIDYβ€”β€”β€”Company ID
namestringYYβ€”β€”Company name
descriptionstringβ€”β€”β€”β€”Description (select only)
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
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": "..." }.
  • 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 and distinct on custom fields are not supported: group by a top-level field and filter on the custom field in where 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" }
}