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

# Import companies

> Create or update many companies at once, matched by `companyId` (the dashboard's CSV importer). Body:
`{ companies: [{ companyId, name, plan, domain, value, sla, tags, address, customData, ownerEmail }] }`,
at most 1000 rows per call. Each row is written like PUT /companies/{companyId}; rows sharing a
`companyId` are collapsed (the last one wins) and `lastSeenAt` is not touched. Answers how many were
imported, the positions of rows without a `companyId`, and the companies that failed. Re-sending rows
is safe.



## OpenAPI

````yaml https://api.gleap.io/api-docs.json post /companies/importer
openapi: 3.0.0
info:
  title: gleap-server
  version: 14.0.0
  contact: {}
servers:
  - url: https://api.gleap.io/v3
security: []
paths:
  /companies/importer:
    post:
      tags:
        - Company
      summary: Import companies
      description: >-
        Create or update many companies at once, matched by `companyId` (the
        dashboard's CSV importer). Body:

        `{ companies: [{ companyId, name, plan, domain, value, sla, tags,
        address, customData, ownerEmail }] }`,

        at most 1000 rows per call. Each row is written like PUT
        /companies/{companyId}; rows sharing a

        `companyId` are collapsed (the last one wins) and `lastSeenAt` is not
        touched. Answers how many were

        imported, the positions of rows without a `companyId`, and the companies
        that failed. Re-sending rows

        is safe.
      operationId: Importer
      parameters:
        - in: header
          name: project
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema: {}
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompanyImportResult'
      security:
        - jwt: []
components:
  schemas:
    CompanyImportResult:
      properties:
        failed:
          items:
            properties:
              message:
                type: string
              companyId:
                type: string
            required:
              - message
              - companyId
            type: object
          type: array
          description: Companies whose write failed; re-sending them is safe.
        invalidRows:
          items:
            type: number
            format: double
          type: array
          description: >-
            Positions (0-based) of rows without a usable `companyId`; nothing
            was written for them.
        imported:
          type: number
          format: double
          description: Companies created or updated.
      required:
        - failed
        - invalidRows
        - imported
      type: object
  securitySchemes:
    jwt:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.