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

# companies merge

> Moves every domain and user of the absorbed company onto the kept company, keeps the kept company's revenue and tier (filling blanks from the absorbed one), and removes the absorbed company from the list. Refuses when both companies carry different revenue or tiers. Safe to repeat: a pair that is already merged returns alreadyMerged. Requires workspace admin.



## OpenAPI

````yaml https://api.interfere.com/openapi.json post /v3/workspaces/{workspaceSlug}/tenants/merge
openapi: 3.0.4
info:
  title: Interfere API
  termsOfService: https://interfere.com/legal/terms-of-service
  contact:
    email: support@interfere.com
    name: Interfere Support
    url: https://interfere.com/~/*/settings/support
  license:
    name: All Rights Reserved
    url: https://interfere.com/legal/terms-of-service
  description: >-
    Register builds, ingest telemetry, and inspect application issues. Build
    operations authenticate with a secret surface key; SDK ingestion uses a
    publishable surface key. Dashboard operations require a Clerk session, and
    investigation endpoints require workload identity. Authentication
    alternatives are listed on each operation. Retry only when the operation
    contract permits it, preserving the original idempotency key.
  version: 3.0.0
servers:
  - url: https://api.interfere.com
    description: This environment
security: []
tags:
  - name: Releases
    description: Build registration and source-map uploads
  - name: Sessions
    description: Session identity, activity, and events
  - name: tenants
    x-displayName: Companies
externalDocs:
  url: https://interfere.com/docs
  description: Interfere Documentation
paths:
  /v3/workspaces/{workspaceSlug}/tenants/merge:
    post:
      tags:
        - tenants
      summary: companies merge
      description: >-
        Moves every domain and user of the absorbed company onto the kept
        company, keeps the kept company's revenue and tier (filling blanks from
        the absorbed one), and removes the absorbed company from the list.
        Refuses when both companies carry different revenue or tiers. Safe to
        repeat: a pair that is already merged returns alreadyMerged. Requires
        workspace admin.
      operationId: tenants_merge
      parameters:
        - name: workspaceSlug
          in: path
          required: true
          schema:
            minLength: 1
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              properties:
                keepId:
                  format: uuid
                  type: string
                absorbId:
                  format: uuid
                  type: string
              required:
                - keepId
                - absorbId
              type: object
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MergeTenantsResponse'
        '400':
          $ref: '#/components/responses/RpcValidationError'
        '401':
          description: Missing or invalid credentials
          content:
            application/json:
              schema:
                oneOf:
                  - properties:
                      defined:
                        enum:
                          - true
                      code:
                        enum:
                          - AUTH_MISSING
                      status:
                        enum:
                          - 401
                      message:
                        default: Request is missing session credentials.
                        type: string
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
                    type: object
                  - properties:
                      defined:
                        enum:
                          - true
                      code:
                        enum:
                          - AUTH_SESSION_INVALID
                      status:
                        enum:
                          - 401
                      message:
                        default: Session token is missing, expired, or not valid here.
                        type: string
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
                    type: object
                  - properties:
                      defined:
                        enum:
                          - true
                      code:
                        enum:
                          - AUTH_ORG_REQUIRED
                      status:
                        enum:
                          - 401
                      message:
                        default: An active workspace session is required.
                        type: string
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
                    type: object
                  - $ref: '#/components/schemas/RpcUnexpectedError'
        '403':
          description: Access denied
          content:
            application/json:
              schema:
                oneOf:
                  - properties:
                      defined:
                        enum:
                          - true
                      code:
                        enum:
                          - NETWORK_ACCESS_DENIED
                      status:
                        enum:
                          - 403
                      message:
                        default: >-
                          This network is not allowed to access the workspace.
                          Connect to an allowed network and try again.
                        type: string
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
                    type: object
                  - properties:
                      defined:
                        enum:
                          - true
                      code:
                        enum:
                          - WORKSPACE_ACCESS_DENIED
                      status:
                        enum:
                          - 403
                      message:
                        default: Workspace access is unavailable for this session.
                        type: string
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
                    type: object
                  - $ref: '#/components/schemas/RpcUnexpectedError'
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                oneOf:
                  - properties:
                      defined:
                        enum:
                          - true
                      code:
                        enum:
                          - COMPANY_NOT_FOUND
                      status:
                        enum:
                          - 404
                      message:
                        default: Company not found.
                        type: string
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
                    type: object
                  - properties:
                      defined:
                        enum:
                          - true
                      code:
                        enum:
                          - WORKSPACE_NOT_FOUND
                      status:
                        enum:
                          - 404
                      message:
                        default: Workspace not found.
                        type: string
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
                    type: object
                  - $ref: '#/components/schemas/RpcUnexpectedError'
        '409':
          description: Request conflicts with current state
          content:
            application/json:
              schema:
                oneOf:
                  - properties:
                      defined:
                        enum:
                          - true
                      code:
                        enum:
                          - COMPANY_MERGE_CONFLICT
                      status:
                        enum:
                          - 409
                      message:
                        default: >-
                          These companies have different revenue or tiers. Edit
                          one of them so the values agree, then merge again.
                        type: string
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
                    type: object
                  - $ref: '#/components/schemas/RpcUnexpectedError'
        '503':
          description: Service temporarily unavailable; retry after the indicated delay
          content:
            application/json:
              schema:
                oneOf:
                  - properties:
                      defined:
                        enum:
                          - true
                      code:
                        enum:
                          - NETWORK_ACCESS_UNAVAILABLE
                      status:
                        enum:
                          - 503
                      message:
                        default: >-
                          Network access could not be checked. Try again
                          shortly.
                        type: string
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
                    type: object
                  - properties:
                      defined:
                        enum:
                          - true
                      code:
                        enum:
                          - OPERATION_UNAVAILABLE
                      status:
                        enum:
                          - 503
                      message:
                        default: Operation is temporarily unavailable.
                        type: string
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
                    type: object
                  - $ref: '#/components/schemas/RpcUnexpectedError'
          headers:
            Retry-After:
              $ref: '#/components/headers/RetryAfter'
      security:
        - clerkSession: []
components:
  schemas:
    MergeTenantsResponse:
      properties:
        keep:
          properties:
            endUserOrgId:
              format: uuid
              type: string
          required:
            - endUserOrgId
          type: object
        absorb:
          properties:
            endUserOrgId:
              format: uuid
              type: string
          required:
            - endUserOrgId
          type: object
        alreadyMerged:
          type: boolean
        moved:
          properties:
            domains:
              minimum: 0
              maximum: 9007199254740991
              type: integer
            users:
              minimum: 0
              maximum: 9007199254740991
              type: integer
          required:
            - domains
            - users
          type: object
      required:
        - keep
        - absorb
        - alreadyMerged
        - moved
      type: object
    RpcUnexpectedError:
      properties:
        defined:
          enum:
            - false
        code:
          type: string
        status:
          type: number
        message:
          type: string
        data: {}
      required:
        - defined
        - code
        - status
        - message
      type: object
  responses:
    RpcValidationError:
      description: Request parameters or body failed validation
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RpcUnexpectedError'
  headers:
    RetryAfter:
      description: Seconds to wait before retrying this request
      schema:
        pattern: ^[0-9]+$
        example: '30'
        type: string
  securitySchemes:
    clerkSession:
      description: >-
        Clerk session or delegated OAuth access token of an Interfere user.
        Workspace routes also accept API keys with explicit permission scopes.
      scheme: bearer
      type: http

````

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