> ## Documentation Index
> Fetch the complete documentation index at: https://modem.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# List companies

> List companies with aggregated statistics across all associated persons



## OpenAPI

````yaml /api-reference/openapi.json get /companies
openapi: 3.1.1
info:
  description: >-
    The public Modem API. Authenticate with an organization API key:
    `Authorization: Bearer modem_…`.
  title: Modem API
  version: 1.0.0
servers:
  - description: Production
    url: https://api.modem.dev/v1
security:
  - bearerAuth: []
paths:
  /companies:
    get:
      tags:
        - Companies
      summary: List companies
      description: List companies with aggregated statistics across all associated persons
      operationId: companies.list
      parameters:
        - allowEmptyValue: true
          allowReserved: true
          in: query
          name: page
          required: false
          schema:
            default: 1
            exclusiveMinimum: 0
            type: integer
        - allowEmptyValue: true
          allowReserved: true
          in: query
          name: limit
          required: false
          schema:
            default: 50
            exclusiveMinimum: 0
            maximum: 100
            type: integer
        - allowEmptyValue: true
          allowReserved: true
          in: query
          name: search
          required: false
          schema:
            minLength: 1
            type: string
        - allowEmptyValue: true
          allowReserved: true
          in: query
          name: sortBy
          required: false
          schema:
            default: lastSeen
            enum:
              - lastSeen
              - messageCount
              - personCount
            type: string
        - allowEmptyValue: true
          allowReserved: true
          in: query
          name: sortOrder
          required: false
          schema:
            default: desc
            enum:
              - asc
              - desc
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data:
                    items:
                      properties:
                        id:
                          pattern: ^\d+$
                          type: string
                        isOrgCompany:
                          type: boolean
                        isVip:
                          type: boolean
                        lastSeenAt:
                          anyOf:
                            - format: date-time
                              type: string
                            - type: 'null'
                        logoUrl:
                          anyOf:
                            - format: uri
                              type: string
                            - type: 'null'
                          description: Company logo image URL.
                          title: Logo URL
                        messageCount:
                          type: integer
                        name:
                          description: Company name.
                          title: Name
                          type: string
                        personCount:
                          type: integer
                        primaryDomain:
                          anyOf:
                            - type: string
                            - type: 'null'
                      required:
                        - id
                        - isOrgCompany
                        - isVip
                        - logoUrl
                        - messageCount
                        - name
                        - personCount
                        - primaryDomain
                      type: object
                    type: array
                  limit:
                    description: The page size used for this response.
                    exclusiveMinimum: 0
                    type: integer
                  page:
                    description: The 1-based page number returned.
                    exclusiveMinimum: 0
                    type: integer
                  totalCount:
                    description: >-
                      Total number of items matching the query, across all
                      pages.
                    minimum: 0
                    type: integer
                required:
                  - data
                  - limit
                  - page
                  - totalCount
                type: object
          description: OK
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Invalid request (validation failed).
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Missing or invalid API key.
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: The API key does not have access to this resource.
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: The requested resource was not found.
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Rate limit exceeded.
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Internal server error.
components:
  schemas:
    Error:
      properties:
        code:
          description: Machine-readable error code, e.g. `NOT_FOUND`.
          examples:
            - NOT_FOUND
          type: string
        data:
          description: Optional structured error details.
        defined:
          description: True if the error was declared in the procedure contract.
          type: boolean
        message:
          description: Human-readable error message.
          type: string
        status:
          description: HTTP status code.
          examples:
            - 404
          type: integer
      required:
        - code
        - defined
        - message
        - status
      type: object
  securitySchemes:
    bearerAuth:
      description: Organization API key (`modem_…`).
      scheme: bearer
      type: http

````