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

# Create Company

> Creates a new company in the system with the provided details.



## OpenAPI

````yaml POST /public/v2/companies
openapi: 3.0.3
info:
  title: RevyOps API
  version: 1.0.0
servers: []
security: []
paths:
  /public/v2/companies:
    post:
      tags:
        - public
      description: Creates a new company in the system with the provided details.
      operationId: Add company (v2)
      parameters:
        - in: query
          name: structure
          schema:
            type: string
            enum:
              - FLAT
              - NESTED
            default: NESTED
          description: >-
            Format of custom fields in response. NESTED returns array of objects
            with id, field_name, field_value. FLAT returns object with field
            names as keys.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Company'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Company'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Company'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Company'
          description: Created. The company was successfully created.
        '400':
          description: Bad Request. Invalid data has been provided.
        '403':
          description: Forbidden. Missing authentication credentials or invalid API key.
        '409':
          description: Conflict. A company with this domain already exists for this client.
        '500':
          description: Internal Server Error. An unexpected error occurred on the server.
components:
  schemas:
    Company:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        updated_time:
          type: string
          format: date-time
          readOnly: true
        domain:
          type: string
        name:
          type: string
        company_status:
          type: string
        company_custom_fields:
          type: array
          items:
            $ref: '#/components/schemas/CompanyCustomFields'
        previous_status:
          type: string
          readOnly: true
          nullable: true
        status_changed_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
      required:
        - domain
        - id
        - previous_status
        - status_changed_at
        - updated_time
    CompanyCustomFields:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        updated_time:
          type: string
          format: date-time
          readOnly: true
        field_name:
          type: string
        field_value:
          type: string
          maxLength: 2500
      required:
        - field_name
        - field_value
        - id
        - updated_time

````