> ## 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.

# Bulk-Promote Contacts by Domain

Creates one new account from a domain and links a batch of existing contacts to it in one call — e.g. promoting a cluster of same-company targets/leads once you know the company. Account creation is attempted first; if it fails, the request raises before any contact is touched, so contacts are never left linked to a dangling account. Contact-linking itself is not transactional — see the response shape below for how partial failure surfaces.

### 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

| Field             | Type                       | Description                                                                                                                                                                            |
| ----------------- | -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `account_id`      | `string` (uuid)            | The newly created account.                                                                                                                                                             |
| `linked_contacts` | `array` of contact objects | The contacts successfully patched with the new `account_id`, in the order given. If linking a particular contact fails partway through, the loop aborts and nothing further is linked. |

### Errors

| Status | Cause                                                                                                                                                                                                                                                                                      |
| ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `400`  | `contact_ids` is empty, or no active organization.                                                                                                                                                                                                                                         |
| `500`  | Account creation, or a contact-linking PATCH, failed upstream. Unlike most other endpoints in this router, this route does not catch `httpx` errors itself, so the failure surfaces as a generic unhandled-exception response rather than this API's usual `{"detail": "..."}` JSON shape. |


## OpenAPI

````yaml POST /contacts/promote
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:
  /contacts/promote:
    post:
      tags:
        - Contacts
      summary: Promote Contact
      operationId: promote_contact_route_contacts_promote_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContactPromoteBody'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Promote Contact Route Contacts Promote Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    ContactPromoteBody:
      properties:
        domain:
          type: string
          minLength: 1
          title: Domain
          description: Email domain used to create the new account.
        contact_ids:
          items:
            type: string
          type: array
          title: Contact Ids
          description: IDs of existing contacts to link to the newly created account.
        account_name:
          type: string
          minLength: 1
          title: Account Name
          description: Name for the new account created from this domain.
      type: object
      required:
        - domain
        - contact_ids
        - account_name
      title: ContactPromoteBody
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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

````