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

# Update an Account

Every field is optional — send only what you want to change. `tags`, `address`, and `custom_fields` are wholesale replacements of the column, not merges.

<Note>**`PATCH` only ever sets fields you explicitly include with a non-null value.** The patch body is built by dropping every `null`/omitted field before sending it to the database — so `{"domain": null}` does **not** clear the domain, it's indistinguishable from not sending `domain` at all. There's currently no way to null out a previously-set field through this endpoint.</Note>

`industry` is a closed enum, not free text — it accepts exactly one of the `AccountIndustry` values, and anything else fails validation with `422`. An empty string (`""`) is treated as unset (i.e. a no-op, per the note above), not a validation error.

`lifecycle_stage` is checked in application code, not just the DB. Valid values are `prospect`, `customer`, `churned`, `inactive` — anything else is rejected with `400` before the write happens (the same values are also enforced by a `CHECK` constraint on the table).

### Auth

Requires a CRM manage [scope](/authentication#scopes) and an active organization on the token. Any `*:manage` scope qualifies — in practice `contacts:manage`, `deals:manage`, `companies:manage`, or `activities:manage`.

### Response

The full updated account row — every column on `accounts` (`id`, `org_id`, `name`, `domain`, `industry`, `size_range`, `annual_revenue`, `health_score`, `website`, `linkedin_url`, `address`, `tags`, `custom_fields`, `created_by`, `created_at`, `updated_at`, `owner_id`, `lifecycle_stage`, `notes`).

### Errors

| Status            | Cause                                                                                                                                                |
| ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `400 Bad Request` | No fields in the body (after dropping nulls), an empty/whitespace-only `name`, an invalid `lifecycle_stage`, or no active organization on the token. |
| `404 Not Found`   | No account with this id in the caller's organization.                                                                                                |


## OpenAPI

````yaml PATCH /accounts/{account_id}
openapi: 3.1.0
info:
  title: anycrm-api
  version: 0.0.1
servers: []
security: []
tags:
  - name: Customer Intelligence
    description: >-
      Company research and ICP-fit scoring — create a research run, track its
      progress, and read back scored companies as leads.
  - name: Outreach
    description: >-
      The cold-email management console — domains, mailboxes, and campaigns — as
      a thin control plane over the SalesForge stack.
  - name: AnyCard
    description: >-
      Authenticated CRUD for AnyCard, the org's digital business-card /
      lead-capture product.
  - name: AnyCard Events
    description: >-
      Event-attribution analytics for AnyCard — which captured leads converted,
      broken down by source, owner, and deal.
  - name: AnyCard Share Links
    description: >-
      Unauthenticated endpoints reached by anyone who scans a QR code or opens a
      shared AnyCard link.
  - name: AI
    description: >-
      A streaming (SSE) AI chat endpoint with account-commit actions it can take
      on the caller's behalf.
  - name: Analytics Assistant
    description: >-
      The natural-language analytics assistant — a guarded text-to-SQL loop
      (SSE) that answers ad-hoc questions over the org's CRM data as a
      least-privilege, read-only database role.
  - name: Account Readiness
    description: >-
      Account Readiness Profiles — AI-scored signals on whether an account is
      ready for outreach or expansion, computed via a Temporal workflow.
  - name: Integrations
    description: >-
      Pipedream Connect — issuing connect tokens and managing the org's
      connected third-party accounts.
  - name: Feedback
    description: >-
      User-submitted platform feedback (bug reports, feature requests) — global,
      not scoped to one organization.
  - name: Public Media
    description: >-
      Unauthenticated image reads for publicly-embeddable assets (card photos,
      inline email images) — allowlisted by key shape; everything else in the
      storage bucket stays private.
  - name: Service Health
    description: Service liveness.
paths:
  /accounts/{account_id}:
    patch:
      tags:
        - Accounts
      summary: Update Account
      operationId: update_account_accounts__account_id__patch
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
            description: The account's id.
            title: Account Id
          description: The account's id.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccountPatchBody'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    AccountPatchBody:
      properties:
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: New name; empty/whitespace-only is rejected.
        domain:
          anyOf:
            - type: string
            - type: 'null'
          title: Domain
          description: New primary domain.
        industry:
          anyOf:
            - $ref: '#/components/schemas/AccountIndustry'
            - type: 'null'
          description: One AccountIndustry enum value; blank/omitted means unset.
        website:
          anyOf:
            - type: string
            - type: 'null'
          title: Website
          description: New company website URL.
        size_range:
          anyOf:
            - type: string
            - type: 'null'
          title: Size Range
          description: Freeform employee-count bucket, e.g. '11-50'.
        annual_revenue:
          anyOf:
            - type: number
            - type: 'null'
          title: Annual Revenue
          description: Annual revenue.
        linkedin_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Linkedin Url
          description: Company LinkedIn profile URL.
        address:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Address
          description: Freeform postal address JSON, stored as-is.
        tags:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Tags
          description: Full replacement list of tag name strings.
        custom_fields:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Custom Fields
          description: Full replacement JSON object of custom field values.
        lifecycle_stage:
          anyOf:
            - type: string
            - type: 'null'
          title: Lifecycle Stage
          description: One of prospect, customer, churned, inactive.
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
          description: Free-text notes.
      type: object
      title: AccountPatchBody
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AccountIndustry:
      type: string
      enum:
        - Food & Beverage
        - Technology
        - Healthcare
        - Financial Services
        - Retail
        - Manufacturing
        - Professional Services
        - Real Estate
        - Education
        - Media & Entertainment
        - Transportation & Logistics
        - Energy
        - Agriculture
        - Construction
        - Hospitality & Travel
        - Other
      title: AccountIndustry
      description: >-
        Account industry taxonomy — keep in sync with frontend
        industry-options.ts.


        Pydantic renders this as a JSON-schema enum, so it is at once the API

        validation, the constraint handed to the AI, and the account form's
        option

        list. StrEnum so members serialize as their labels.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````