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

# Update a company

> Updates an existing company. Only provided fields will be updated. Custom field values use `cf_*` keys — see the [Custom fields](/api-v2/custom-fields) guide.



## OpenAPI

````yaml /openapi.v2.json patch /companies/{id}
openapi: 3.1.1
info:
  title: Heffl API v2 (Beta)
  version: 2.0.0
  description: >-
    Heffl REST API v2 (beta) — resource-oriented endpoints with consistent
    response envelopes. Endpoints, schemas, and behavior may change until GA.
    See Agent workflows and ID prefixes guides for automation.
  contact:
    name: Heffl Support
    url: https://heffl.com/support
    email: support@heffl.com
servers:
  - url: https://api.heffl.com/api/v2
    description: Production API Server
security:
  - ApiKeyAuth: []
paths:
  /companies/{id}:
    patch:
      tags:
        - Objects
      summary: Update a company
      description: >-
        Updates an existing company. Only provided fields will be updated.
        Custom field values use `cf_*` keys — see the [Custom
        fields](/api-v2/custom-fields) guide.
      operationId: objects.companies.update
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: Company ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CompanyUpdateInput'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Company'
        '400':
          description: Validation error or bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2ApiError'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2ApiError'
        '403':
          description: Insufficient permission
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2ApiError'
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2ApiError'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2ApiError'
components:
  schemas:
    CompanyUpdateInput:
      type: object
      properties:
        name:
          type: string
          description: Company name
        email:
          anyOf:
            - type: string
              format: email
            - type: 'null'
          description: Email address
        phone:
          type: string
          description: Phone number with country code
        taxNumber:
          type: string
          description: Tax number
        website:
          anyOf:
            - type: string
              format: uri
            - type: 'null'
          description: Website URL
        description:
          type: string
          description: Description
        linkedin:
          anyOf:
            - type: string
              format: uri
            - type: 'null'
          description: LinkedIn URL
        currency:
          anyOf:
            - type: string
            - type: 'null'
          description: 3-letter ISO currency code
        openingBalance:
          type: number
          minimum: 0
          description: Opening balance
        showJobAmountToWorker:
          type: boolean
          description: Whether job amounts are visible to field workers
        isClientPortalEnabled:
          type: boolean
          description: Whether the client portal is enabled
        internalNotes:
          type: string
          description: Internal notes
        stageId:
          type: string
          description: Client stage ID
        ownerUserId:
          type: string
          description: Owner user ID
        vendorId:
          type: string
          description: Vendor ID
        sourceId:
          type: string
          description: CRM source ID
        billingAddress:
          $ref: '#/components/schemas/BillingAddressInput'
        primaryContact:
          type: object
          description: Optional primary contact fields to create or update
      additionalProperties:
        description: >-
          Custom field values using cf_* keys (for example cf_industry). Only
          documented fields and cf_* keys are accepted.
    Company:
      type: object
      properties:
        id:
          type: string
          description: Company ID
        name:
          type: string
          description: Company name
        number:
          type: string
          description: Auto-generated company number
        type:
          anyOf:
            - type: string
              enum:
                - contact
                - company
            - type: 'null'
          description: Record type (always company for this endpoint)
        email:
          anyOf:
            - type: string
            - type: 'null'
          description: Email address
        phone:
          anyOf:
            - type: string
            - type: 'null'
          description: Phone number
        taxNumber:
          anyOf:
            - type: string
            - type: 'null'
          description: Tax number
        website:
          anyOf:
            - type: string
            - type: 'null'
          description: Website URL
        description:
          anyOf:
            - type: string
            - type: 'null'
          description: Description
        stageId:
          anyOf:
            - type: string
            - type: 'null'
          description: Client stage ID
        stageName:
          anyOf:
            - type: string
            - type: 'null'
          description: Client stage label
        ownerUserId:
          anyOf:
            - type: string
            - type: 'null'
          description: Owner user ID
        crmSourceId:
          anyOf:
            - type: string
            - type: 'null'
          description: CRM source ID
        sourceName:
          anyOf:
            - type: string
            - type: 'null'
          description: CRM source name
        currency:
          anyOf:
            - type: string
            - type: 'null'
          description: Currency code
        openingBalance:
          type: number
          description: Opening balance
        showJobAmountToWorker:
          type: boolean
          description: Whether job amounts are visible to field workers
        isClientPortalEnabled:
          type: boolean
          description: Whether the client portal is enabled
        internalNotes:
          anyOf:
            - type: string
            - type: 'null'
          description: Internal notes
        linkedin:
          anyOf:
            - type: string
            - type: 'null'
          description: LinkedIn URL
        createdAt:
          type: string
          format: date-time
          description: When the company was created
        updatedAt:
          type: string
          format: date-time
          description: When the company was last updated
      required:
        - id
        - name
        - number
        - openingBalance
        - showJobAmountToWorker
        - isClientPortalEnabled
      additionalProperties:
        description: >-
          Custom field values as top-level cf_* keys (for example cf_industry).
          There is no customFields wrapper.
    V2ApiError:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
            details:
              type: object
    BillingAddressInput:
      type: object
      properties:
        city:
          anyOf:
            - type: string
            - type: 'null'
          description: City
        address:
          anyOf:
            - type: string
            - type: 'null'
          description: Street address
        landmark:
          anyOf:
            - type: string
            - type: 'null'
          description: Nearby landmark
        state:
          anyOf:
            - type: string
            - type: 'null'
          description: State or province
        country:
          anyOf:
            - type: string
            - type: 'null'
          description: Country code, ISO3 code, or country name
        postalCode:
          anyOf:
            - type: string
            - type: 'null'
          description: Postal code or ZIP code
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key for authentication. Get yours at
        app.heffl.com/settings/developers

````