Companies

A company within the account (some care provider are structured as multiple companies).

The company object

Attributes

  • _id
    string

    A unique Id for the company.

  • created
    string

    The date/time the company was created.

  • legal_entity_code
    string

    A unique legal entity code for the company.

  • modified
    string

    The date/time the company was modified.

  • name
    string

    The name of the company.

The company object
{
    "_id": "6931813005ceb967bdd0fdc1",
    "created": "2025-12-04 12:40:16",
    "legal_entity_code": "100",
    "modified": "2025-12-04 12:40:16",
    "name": "Marshall Care Limited"
}

List all companies

Return a list of companies setup for your account on CareHQ.

Parameters

  • attributes
    optional
    default ['_id']

    A list of attributes to include for fetched objects.

  • filters-ids
    optional

    A filter that accepts a list of Ids and filters the items returned to those with an Id in the list.

  • filters-modified_after
    optional

    A filter that accepts a date/time and filters the items returned to those modified after the date/time.

  • filters-modified_before
    optional

    A filter that accepts a date/time and filters the items returned to those modified before the date/time.

  • filters-q
    optional

    A case insensitive keyword filter applied to the following fields; legal_entity_code, name.

  • page
    optional
    default 1

    The page number to fetch.

  • per_page
    optional
    default 10

    The number of items to return per page.

  • sort_by
    optional
    default _id

    A list of fields the returned items can be sorted by. Fields prefixed with minus (-) sign are sorted in descending order.

    • _id
    • created
    • legal_entity_code
    • modified
    • name

Response

Returns a page of companies.

GET
/v1/companies
var companies = apiClient.Request(
    HttpMethod.Get,
    "companies",
    new MultiValueDict()
        .Add("attributes", "name", "legal_entity_code")
);
<?php

$companies = $api_client->request(
    'GET',
    'companies',
    [
        'attributes'=>['name', 'legal_entity_code']
    ]
);
companies = api_client(
    'GET',
    'companies',
    params={
        'attributes': ['name', 'legal_entity_code']
    }
)
companies = api_client.request(
    'GET',
    'companies',
    params: {
        'attributes' => ['name', 'legal_entity_code']
    }
)
Response
{
    "item_count": 1,
    "items": [
        {
            "_id": "6931813005ceb967bdd0fdc1",
            "legal_entity_code": "100",
            "name": "Marshall Care Limited"
        }
    ],
    "page": 1,
    "page_count": 1,
    "per_page": 10
}

Retrieve a company

Retrieve a company object.

Response

Returns a company object.

GET
/v1/companies/<company_id>
var company = apiClient.Request(
    HttpMethod.Get, 
    $"companies/{companyId}"
);
<?php

$company = $api_client->request(
    'GET',
    'companies/' . $company_id
);
company = api_client('GET', f'companies/{company_id}')
company = api_client.request('GET', "companies/#{company_id}")
Response
{
    "_id": "6931813005ceb967bdd0fdc1",
    "created": "2025-12-04 12:40:16",
    "legal_entity_code": "100",
    "modified": "2025-12-04 12:40:16",
    "name": "Marshall Care Limited"
}