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

# List companies

## Overview

Retrieve a list of the companies associated with the authenticated user.


## OpenAPI

````yaml GET /companies
openapi: 3.0.1
info:
  title: Public API
  description: >-
    Public API definition where you can check the documentation for the
    different available operations to integrate with the platform.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://pre-public-api.cobee.io/api/v3
  - url: https://public-api.cobee.io/api/v3
security:
  - bearerAuth: []
paths:
  /companies:
    get:
      summary: Get all companies associated with the authenticated user
      parameters:
        - name: legalId
          in: query
          required: false
          description: >-
            Company CIF(s) to filter by. Can be a single CIF or multiple CIFs
            separated by commas
          schema:
            oneOf:
              - type: string
              - type: array
                items:
                  type: string
          example: B12345678,B87654321
        - name: state
          in: query
          required: false
          description: Company state to filter by
          schema:
            type: string
            enum:
              - active
          example: active
      responses:
        '200':
          description: New response
          content:
            application/json:
              schema:
                type: object
                properties:
                  companies:
                    type: array
                    items:
                      $ref: '#/components/schemas/Company'
        '401':
          description: Unauthorised - Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                message: Unauthorized
components:
  schemas:
    Company:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: The unique identifier of the company
        name:
          type: string
          description: The name of the company
        legalId:
          type: string
          description: The legal identification number of the company
        legalName:
          type: string
          description: The legal name of the company
        state:
          type: string
          enum:
            - active
          description: The state of the company
        contactEmail:
          type: string
          format: email
          description: The contact email of the company
        corporationId:
          type: string
          nullable: true
          description: The corporation ID if applicable, otherwise null
        countryISO2Code:
          type: string
          description: The two-letter ISO code of the company's country
        deliveryAddress:
          $ref: '#/components/schemas/Address'
        legalAddress:
          $ref: '#/components/schemas/Address'
      required:
        - id
        - name
        - legalId
        - legalName
        - state
        - contactEmail
        - countryISO2Code
        - deliveryAddress
        - legalAddress
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
      example:
        message: 'Bad request: Invalid field value'
    Address:
      type: object
      properties:
        streetName:
          type: string
          description: The name of the street
        streetNumber:
          type: string
          description: The number of the building
        details:
          type: string
          nullable: true
          description: Additional address details, if any
        street:
          type: string
          description: Full formatted street address
        postalCode:
          type: string
          description: The postal code of the address
        province:
          type: string
          description: The province or state of the address
        locality:
          type: string
          description: The city or town of the address
        district:
          type: string
          nullable: true
          description: The district of the address, if applicable
      required:
        - streetName
        - streetNumber
        - street
        - postalCode
        - province
        - locality
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````