# Retrieve companies

You can fetch a single company by passing in `company_id` or `name`.
`https://api.intercom.io/companies?name={name}`
`https://api.intercom.io/companies?company_id={company_id}`
You can fetch all companies and filter by `segment_id` or `tag_id` as a query parameter.
`https://api.intercom.io/companies?tag_id={tag_id}`
`https://api.intercom.io/companies?segment_id={segment_id}`

Endpoint: GET /companies
Version: 2.11
Security: bearerAuth

## Query parameters:

  - `name` (string)
    The `name` of the company to filter by.

  - `company_id` (string)
    The `company_id` of the company to filter by.

  - `tag_id` (string)
    The `tag_id` of the company to filter by.

  - `segment_id` (string)
    The `segment_id` of the company to filter by.

  - `page` (integer)
    The page of results to fetch. Defaults to first page

  - `per_page` (integer)
    How many results to display per page. Defaults to 15

## Header parameters:

  - `Intercom-Version` (string)

## Response 200 fields (application/json):

  - `type` (string, required)
    The type of object - `list`.
    Enum: "list"

  - `pages` (object)
    Cursor-based pagination is a technique used in the Intercom API to navigate through large amounts of data.
A "cursor" or pointer is used to keep track of the current position in the result set, allowing the API to return the data in small chunks or "pages" as needed.

  - `pages.type` (string, required)
    the type of object `pages`.
    Enum: "pages"

  - `pages.page` (integer)
    The current page
    Example: 1

  - `pages.next` (object)

  - `pages.next.per_page` (integer, required)
    The number of results to fetch per page.
    Example: 2

  - `pages.next.starting_after` (string)
    The cursor to use in the next request to get the next page of results.
    Example: your-cursor-from-response

  - `pages.per_page` (integer)
    Number of results per page
    Example: 2

  - `pages.total_pages` (integer)
    Total number of pages
    Example: 13

  - `total_count` (integer, required)
    The total number of companies.
    Example: 100

  - `data` (array, required)
    An array containing Company Objects.

  - `data.type` (string)
    Value is `company`
    Enum: "company"

  - `data.id` (string, required)
    The Intercom defined id representing the company.
    Example: 531ee472cce572a6ec000006

  - `data.name` (string, required)
    The name of the company.
    Example: Blue Sun

  - `data.app_id` (string, required)
    The Intercom defined code of the workspace the company is associated to.
    Example: ecahpwf5

  - `data.plan` (object)

  - `data.plan.type` (string)
    Value is always "plan"
    Enum: "plan"

  - `data.plan.id` (string)
    The id of the plan
    Example: 269315

  - `data.plan.name` (string)
    The name of the plan
    Example: Pro

  - `data.company_id` (string, required)
    The company id you have defined for the company.
    Example: 6

  - `data.remote_created_at` (integer, required)
    The time the company was created by you.
    Example: 1663597223

  - `data.created_at` (integer, required)
    The time the company was added in Intercom.
    Example: 1663597223

  - `data.updated_at` (integer, required)
    The last time the company was updated.
    Example: 1663597223

  - `data.last_request_at` (integer, required)
    The time the company last recorded making a request.
    Example: 1663597223

  - `data.size` (integer, required)
    The number of employees in the company.
    Example: 100

  - `data.website` (string, required)
    The URL for the company website.
    Example: https://www.intercom.com

  - `data.industry` (string, required)
    The industry that the company operates in.
    Example: Software

  - `data.monthly_spend` (integer, required)
    How much revenue the company generates for your business.
    Example: 100

  - `data.session_count` (integer, required)
    How many sessions the company has recorded.
    Example: 100

  - `data.user_count` (integer, required)
    The number of users in the company.
    Example: 100

  - `data.tags` (object)
    The list of tags associated with the company

  - `data.tags.type` (string)
    The type of the object
    Enum: "tag.list"

  - `data.tags.tags` (array)

  - `data.tags.tags.type` (string)
    value is "tag"
    Example: tag

  - `data.tags.tags.id` (string)
    The id of the tag
    Example: 123456

  - `data.tags.tags.name` (string)
    The name of the tag
    Example: Test tag

  - `data.segments` (object)
    The list of segments associated with the company

  - `data.segments.type` (string)
    The type of the object
    Enum: "segment.list"

  - `data.segments.segments` (array)

  - `data.segments.segments.type` (string, required)
    The type of object.
    Enum: "segment"

  - `data.segments.segments.id` (string, required)
    The unique identifier representing the segment.
    Example: 56203d253cba154d39010062

  - `data.segments.segments.name` (string, required)
    The name of the segment.
    Example: Active

  - `data.segments.segments.created_at` (integer, required)
    The time the segment was created.
    Example: 1394621988

  - `data.segments.segments.updated_at` (integer)
    The time the segment was updated.
    Example: 1394622004

  - `data.segments.segments.person_type` (string, required)
    Type of the contact: contact (lead) or user.
    Enum: "contact", "user"

  - `data.segments.segments.count` (integer)
    The number of items in the user segment. It's returned when `include_count=true` is included in the request.
    Example: 3

## Response 401 fields (application/json):

  - `type` (string, required)
    The type is error.list
    Example: error.list

  - `request_id` (string)
    Example: f93ecfa8-d08a-4325-8694-89aeb89c8f85

  - `errors` (array, required)
    An array of one or more error objects

  - `errors.code` (string, required)
    A string indicating the kind of error, used to further qualify the HTTP response code
    Example: unauthorized

  - `errors.message` (string)
    Optional. Human readable description of the error.
    Example: Access Token Invalid

  - `errors.field` (string)
    Optional. Used to identify a particular field or query parameter that was in error.
    Example: email

## Response 404 fields (application/json):

  - `type` (string, required)
    The type is error.list
    Example: error.list

  - `request_id` (string)
    Example: f93ecfa8-d08a-4325-8694-89aeb89c8f85

  - `errors` (array, required)
    An array of one or more error objects

  - `errors.code` (string, required)
    A string indicating the kind of error, used to further qualify the HTTP response code
    Example: unauthorized

  - `errors.message` (string)
    Optional. Human readable description of the error.
    Example: Access Token Invalid

  - `errors.field` (string)
    Optional. Used to identify a particular field or query parameter that was in error.
    Example: email

