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

# Assert a CRM Company

> Create or update a CRM company in the Zeeg CRM API, matched by domain. Upserts companies for bulk imports and sync jobs without pre-checking.

Creates or updates a CRM company record using a unique attribute to find an existing match.

* If a company with the same `domain` is found → it is **updated** and `200` is returned.
* If no match is found → a new company is **created** and `201` is returned.

## Matching attribute

The `matchingAttribute` query parameter specifies which field to use for the lookup. Currently only `domain` is supported, as it is the only unique attribute on companies.

```
PUT /v2/crm/companies?matchingAttribute=domain
```

## Use case

Assert is the recommended endpoint for bulk imports and sync jobs. Send your full company payload and let the API decide whether to create or update — no need to pre-check for duplicates.

```json theme={null}
{
  "name": "Acme Corp",
  "domain": "acme.com",
  "websiteUrl": "https://acme.com",
  "primaryLocation": "Berlin, Germany",
  "socials": {
    "linkedin": "https://linkedin.com/company/acme"
  }
}
```


## OpenAPI

````yaml PUT /crm/companies
openapi: 3.0.0
info:
  title: Zeeg Public API
  description: >-
    Zeeg public API documentation.


    ## Authentication

    All endpoints require a Bearer token. You can generate an API token from
    [your Zeeg dashboard](https://app.zeeg.me/account/settings/api-access).


    Each token is scoped to specific permissions (e.g. `events:read`,
    `webhooks:write`). Make sure your token has the required scopes for the
    endpoints you want to use.


    ## Recommended Headers

    We recommend including the `Accept: application/json` header in all API
    requests to ensure you receive JSON responses.
  version: 2.0.0
  x-logo:
    url: https://app.zeeg.me/img/logo-dark.2ca83593.svg
    backgroundColor: '#f7f7f9'
    altText: zeeg
  contact:
    name: Zeeg Support
    email: support@zeeg.me
    url: https://zeeg.me/en/contact
  license:
    name: Proprietary
    url: https://zeeg.me/en/legal/terms
  termsOfService: https://zeeg.me/en/legal/terms
servers:
  - url: https://api.zeeg.me/v2
    description: Production
security:
  - bearer: []
tags:
  - name: Scheduled Events
    description: Management of events scheduled via Zeeg
  - name: Scheduling Pages
    description: Scheduling pages information and management
  - name: Availability Schedule
    description: Read and change availability for users
  - name: Webhooks
    description: Webhooks management
  - name: Notes
    description: Notes for scheduled events
  - name: Workspaces & Teams
    description: Workspace users and team member management
  - name: AI Agent
    description: AI Agent integration endpoints
  - name: Payloads
    description: Webhook payload schemas
  - name: CRM - Objects
    description: >-
      Discover the schema of CRM objects (standard and custom) including all
      attribute definitions
  - name: CRM - Companies
    description: Create, read, update, and delete CRM company records
  - name: CRM - People
    description: Create, read, update, and delete CRM person records
paths:
  /crm/companies:
    put:
      tags:
        - CRM - Companies
      summary: Assert a CRM company (upsert)
      description: >-
        Creates or updates a CRM company using a unique attribute to find an
        existing match.


        - **Match found** → the company is updated and `200` is returned.

        - **No match** → a new company is created and `201` is returned.


        This is the recommended endpoint for bulk imports and sync jobs — send
        your full company payload and let the API decide whether to create or
        update.


        **Required scope:** `crm:write`
      operationId: put-crm-companies
      parameters:
        - name: matchingAttribute
          in: query
          required: true
          schema:
            type: string
            enum:
              - domain
          description: >-
            Attribute to use when searching for an existing company. Only
            `domain` is supported.
          example: domain
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
              properties:
                name:
                  type: string
                  example: Acme Corp
                domain:
                  type: string
                  nullable: true
                  example: acme.com
                description:
                  type: string
                  nullable: true
                websiteUrl:
                  type: string
                  nullable: true
                primaryLocation:
                  type: string
                  nullable: true
                socials:
                  type: object
                  properties:
                    linkedin:
                      type: string
                      nullable: true
                    twitter:
                      type: string
                      nullable: true
                    facebook:
                      type: string
                      nullable: true
                    instagram:
                      type: string
                      nullable: true
      responses:
        '200':
          description: Updated — a company with the matching domain was found and updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  status:
                    type: integer
                    example: 200
                  company:
                    $ref: '#/components/schemas/CrmCompany'
        '201':
          description: >-
            Created — no company with the matching domain was found; a new one
            was created
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  status:
                    type: integer
                    example: 201
                  company:
                    $ref: '#/components/schemas/CrmCompany'
        '401':
          $ref: '#/components/responses/401'
        '403':
          description: Forbidden — missing scope or CRM not enabled
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                  status:
                    type: integer
        '422':
          $ref: '#/components/responses/422'
      security:
        - bearer: []
components:
  schemas:
    CrmCompany:
      type: object
      description: A CRM company record.
      required:
        - id
        - name
        - domain
        - description
        - websiteUrl
        - primaryLocation
        - industries
        - socials
        - customAttributes
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the company record.
          example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
        name:
          type: string
          description: Display name of the company.
          example: Acme Corp
        domain:
          type: string
          nullable: true
          description: >-
            Primary domain. Unique within the workspace. Used as the matching
            attribute for upsert.
          example: acme.com
        description:
          type: string
          nullable: true
          description: Free-text description of the company.
          example: A global provider of anvils and gadgets.
        websiteUrl:
          type: string
          nullable: true
          description: Company website URL.
          example: https://acme.com
        primaryLocation:
          type: string
          nullable: true
          description: Primary location or address.
          example: Phoenix, AZ
        industries:
          type: array
          description: List of industry IDs assigned to the company.
          items:
            type: string
          example:
            - technology
        socials:
          type: object
          description: Social profile links.
          properties:
            linkedin:
              type: string
              nullable: true
              example: https://linkedin.com/company/acme
            twitter:
              type: string
              nullable: true
              example: null
            facebook:
              type: string
              nullable: true
              example: null
            instagram:
              type: string
              nullable: true
              example: null
        customAttributes:
          type: object
          description: >-
            Key/value pairs for custom attributes defined on the companies
            object.
          additionalProperties: true
          example: {}
        createdAt:
          type: string
          format: date-time
          description: ISO 8601 timestamp when the record was created.
          example: '2025-01-15T09:00:00+00:00'
        updatedAt:
          type: string
          format: date-time
          description: ISO 8601 timestamp when the record was last updated.
          example: '2025-06-01T12:00:00+00:00'
  responses:
    '401':
      description: Unauthorized
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                example: Unauthenticated.
          examples:
            Unauthenticated:
              value:
                message: Unauthenticated.
    '422':
      description: Unprocessable Entity
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                example: The given data was invalid.
              errors:
                type: object
                additionalProperties:
                  type: array
                  items:
                    type: string
                example:
                  field_name:
                    - The field_name field is required.
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: ''

````