Skip to main content
Using TypeScript? Check out our GraphQL SDK for a fully typed client.
We provide a number of methods for fetching companies:
  1. Get companies (To fetch more than one company at a time)
  2. Get company by ID
  3. Search for companies
All of these endpoints require the following permissions:
  • company:read

Get companies

You can get all companies you’ve interacted with in your workspace using the companies query. This endpoint supports Pagination.
Query
query getCompanies($cursor: String!) {
  companies(after: $cursor, first: 50) {
    edges {
      node {
        id
        name
        logoUrl
        domainName
      }
    }
    pageInfo {
      hasPreviousPage
      hasNextPage
      startCursor
      endCursor
    }
  }
}
Variables
{
  "cursor": "eyJjb21wYW5pZXMubmFtZSI6IuyYpOuIhOydtCIsImNvbXBhbmllcy5pZCI6ImNvXzAxSFJSTVJQRVJaQ0s0MkhUUEQ0SlE1N05CIn0"
}

Get company by ID

If you already have the ID of a company you can fetch it directly using the company query.
Query
query getCompany($companyId: ID!) {
  company(companyId: $companyId) {
    id
    name
    domainName
    logoUrl
  }
}
Variables
{
  "companyId": "co_01HRRMRPERZCK42HTPD4JQ57NB"
}

Search for companies

The searchCompanies query performs a case-insensitive partial match across a company’s name and domain. The search term must be at least 2 characters long.
Query
query searchCompanies($term: String!, $first: Int = 25, $after: String) {
  searchCompanies(searchQuery: { term: $term }, first: $first, after: $after) {
    edges {
      node {
        company {
          id
          name
          domainName
          logoUrl
        }
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}
Variables
{
  "term": "plain",
  "first": 25
}