# Companies Everything about your Companies ## Create or Update a company - [POST /companies](https://developers.intercom.com/docs/references/2.10/rest-api/api.intercom.io/companies/createorupdatecompany.md): You can create or update a company. Companies will be only visible in Intercom when there is at least one associated user. Companies are looked up via in a request, if not found via , the new company will be created, if found, that company will be updated. {% admonition type="warning" name="Using " %} You can set a unique value when creating a company. However, it is not possible to update . Be sure to set a unique value once upon creation of the company. {% /admonition %} ## Retrieve companies - [GET /companies](https://developers.intercom.com/docs/references/2.10/rest-api/api.intercom.io/companies/retrievecompany.md): You can fetch a single company by passing in or . You can fetch all companies and filter by or as a query parameter. ## Retrieve a company by ID - [GET /companies/{id}](https://developers.intercom.com/docs/references/2.10/rest-api/api.intercom.io/companies/retrieveacompanybyid.md): You can fetch a single company. ## Update a company - [PUT /companies/{id}](https://developers.intercom.com/docs/references/2.10/rest-api/api.intercom.io/companies/updatecompany.md): You can update a single company using the Intercom provisioned . {% admonition type="warning" name="Using " %} When updating a company it is not possible to update . This can only be set once upon creation of the company. {% /admonition %} ## Delete a company - [DELETE /companies/{id}](https://developers.intercom.com/docs/references/2.10/rest-api/api.intercom.io/companies/deletecompany.md): You can delete a single company. ## List attached contacts - [GET /companies/{id}/contacts](https://developers.intercom.com/docs/references/2.10/rest-api/api.intercom.io/companies/listattachedcontacts.md): You can fetch a list of all contacts that belong to a company. ## List attached segments for companies - [GET /companies/{id}/segments](https://developers.intercom.com/docs/references/2.10/rest-api/api.intercom.io/companies/listattachedsegmentsforcompanies.md): You can fetch a list of all segments that belong to a company. ## List all companies - [POST /companies/list](https://developers.intercom.com/docs/references/2.10/rest-api/api.intercom.io/companies/listallcompanies.md): You can list companies. The company list is sorted by the field and by default is ordered descending, most recently requested first. Note that the API does not include companies who have no associated users in list responses. When using the Companies endpoint and the pages object to iterate through the returned companies, there is a limit of 10,000 Companies that can be returned. If you need to list or iterate on more than 10,000 Companies, please use the Scroll API. {% admonition type="warning" name="Pagination" %} You can use pagination to limit the number of results returned. The default is results per page. See the pagination section for more details on how to use the param. {% /admonition %} ## Scroll over all companies - [GET /companies/scroll](https://developers.intercom.com/docs/references/2.10/rest-api/api.intercom.io/companies/scrolloverallcompanies.md): The functionality does not work well for huge datasets, and can result in errors and performance problems when paging deeply. The Scroll API provides an efficient mechanism for iterating over all companies in a dataset. - Each app can only have 1 scroll open at a time. You'll get an error message if you try to have more than one open per app. - If the scroll isn't used for 1 minute, it expires and calls with that scroll param will fail - If the end of the scroll is reached, "companies" will be empty and the scroll parameter will expire {% admonition type="info" name="Scroll Parameter" %} You can get the first page of companies by simply sending a GET request to the scroll endpoint. For subsequent requests you will need to use the scroll parameter from the response. {% /admonition %} {% admonition type="danger" name="Scroll network timeouts" %} Since scroll is often used on large datasets network errors such as timeouts can be encountered. When this occurs you will see a HTTP 500 error with the following message: "Request failed due to an internal network error. Please restart the scroll operation." If this happens, you will need to restart your scroll query: It is not possible to continue from a specific point when using scroll. {% /admonition %} ## Attach a Contact to a Company - [POST /contacts/{id}/companies](https://developers.intercom.com/docs/references/2.10/rest-api/api.intercom.io/companies/attachcontacttoacompany.md): You can attach a company to a single contact. ## List attached companies for contact - [GET /contacts/{id}/companies](https://developers.intercom.com/docs/references/2.10/rest-api/api.intercom.io/companies/listcompaniesforacontact.md): You can fetch a list of companies that are associated to a contact. ## Detach a contact from a company - [DELETE /contacts/{contact_id}/companies/{id}](https://developers.intercom.com/docs/references/2.10/rest-api/api.intercom.io/companies/detachcontactfromacompany.md): You can detach a company from a single contact. ## List attached contacts - [GET /companies/{id}/contacts](https://developers.intercom.com/docs/references/2.10/rest-api/api.intercom.io/contacts/listattachedcontacts.md): You can fetch a list of all contacts that belong to a company. ## Attach a Contact to a Company - [POST /contacts/{id}/companies](https://developers.intercom.com/docs/references/2.10/rest-api/api.intercom.io/contacts/attachcontacttoacompany.md): You can attach a company to a single contact. ## List attached companies for contact - [GET /contacts/{id}/companies](https://developers.intercom.com/docs/references/2.10/rest-api/api.intercom.io/contacts/listcompaniesforacontact.md): You can fetch a list of companies that are associated to a contact. ## Detach a contact from a company - [DELETE /contacts/{contact_id}/companies/{id}](https://developers.intercom.com/docs/references/2.10/rest-api/api.intercom.io/contacts/detachcontactfromacompany.md): You can detach a company from a single contact.