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

# Get a company by id.

> # Access control rules

- Company users get list the company they are associated with.
- Admins can list all companies. Requires `read_all_companies` permissions.



## OpenAPI

````yaml GET /api/v0/companies/{company_id}
openapi: 3.1.0
info:
  title: Cantina Client API
  description: >-
    Endpoints available to client organizations. For an overview and
    authentication, see
    https://docs.cantina.xyz/for-organizations/getting-started/api-access.
  license:
    name: Cantina
    identifier: Cantina
  version: 0.1.0
servers: []
security: []
paths:
  /api/v0/companies/{company_id}:
    get:
      tags:
        - companies
      summary: Get a company by id.
      description: >-
        # Access control rules


        - Company users get list the company they are associated with.

        - Admins can list all companies. Requires `read_all_companies`
        permissions.
      operationId: get_company_by_id
      parameters:
        - name: company_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Company details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Company'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CantinaError'
        '401':
          description: Access not authorised
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CantinaError'
        '403':
          description: Access forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CantinaError'
        '404':
          description: Not found. This can also be due to requester not having permission
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CantinaError'
        '500':
          description: Error retrieving company
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CantinaError'
components:
  schemas:
    Company:
      type: object
      required:
        - id
        - name
        - handle
        - logo
        - isGeneratedLogo
        - showAuditLog
        - createdBy
        - createdAt
        - users
        - sessionSettings
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        handle:
          type: string
        about:
          type:
            - string
            - 'null'
        legalName:
          type:
            - string
            - 'null'
        legalAddress:
          type:
            - string
            - 'null'
        legalCountry:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/Country'
        logo:
          type: string
        isGeneratedLogo:
          type: boolean
        website:
          type:
            - string
            - 'null'
        github:
          type:
            - string
            - 'null'
        twitter:
          type:
            - string
            - 'null'
        domain:
          type:
            - string
            - 'null'
        autoJoinAllowed:
          type:
            - boolean
            - 'null'
          description: Note, this is only set if `domain` field is also set.
        adminData: {}
        showAuditLog:
          type: boolean
        createdBy:
          type: string
          format: uuid
        createdAt:
          type: string
          format: date-time
        users:
          type: array
          items:
            $ref: '#/components/schemas/CompanyUser'
        sessionSettings:
          $ref: '#/components/schemas/SessionSettings'
    CantinaError:
      type: object
      description: Error returned by the Cantina API.
      required:
        - type
        - msg
      properties:
        type:
          $ref: '#/components/schemas/ErrorType'
        msg:
          type: string
          description: Error message for the user.
    Country:
      type: object
      required:
        - name
        - code
      properties:
        name:
          type: string
        code:
          type: string
    CompanyUser:
      type: object
      description: User within a company.
      required:
        - userId
        - name
        - username
        - email
        - isActivated
        - createdAt
        - isBot
        - role
        - companyId
      properties:
        userId:
          type: string
          format: uuid
        name:
          type: string
        username:
          type: string
        email:
          type: string
        avatar:
          type:
            - string
            - 'null'
        isGeneratedAvatar:
          type:
            - boolean
            - 'null'
        isActivated:
          type: boolean
        discord:
          type:
            - string
            - 'null'
        telegram:
          type:
            - string
            - 'null'
        timezone:
          type:
            - string
            - 'null'
        createdAt:
          type: string
          format: date-time
        isBot:
          type: boolean
        role:
          $ref: '#/components/schemas/CompanyRole'
        companyId:
          type: string
          format: uuid
        disabledAt:
          type:
            - string
            - 'null'
          format: date-time
          description: Set when a company user has been disabled.
    SessionSettings:
      type: object
      description: |-
        Session expiration settings

        They are expressed in i64 seconds to be database-friendly.
      required:
        - maxTime
        - refreshTime
      properties:
        maxTime:
          type: integer
          format: int64
          description: Max session duration in seconds
        refreshTime:
          type: integer
          format: int64
          description: Time between refresh requests in seconds
    ErrorType:
      type: string
      description: Type of error.
      enum:
        - email_not_verified
        - auth_invalid
        - auth_expired
        - auth_token_missing
        - auth_id_missing
        - invalid_password
        - disabled_user
        - tc_not_accepted
        - evicted
        - unauthorized
        - bad_request
        - not_found
        - forbidden
        - gone
        - payload_too_large
        - service_unavailable
        - internal_error
    CompanyRole:
      type: string
      enum:
        - manager
        - member
        - unverified_member

````